diff --git a/.codegen/_openapi_sha b/.codegen/_openapi_sha index 3fbd74142..347bf5ee5 100644 --- a/.codegen/_openapi_sha +++ b/.codegen/_openapi_sha @@ -1 +1 @@ -033bcb9242b006001e2cf3956896711681de1a8c \ No newline at end of file +universe:/home/parth.bansal/universetwo \ No newline at end of file diff --git a/.gitattributes b/.gitattributes index 41750e4f0..594111705 100644 --- a/.gitattributes +++ b/.gitattributes @@ -19,7 +19,9 @@ experimental/mocks/service/catalog/mock_artifact_allowlists_interface.go linguis experimental/mocks/service/catalog/mock_catalogs_interface.go linguist-generated=true experimental/mocks/service/catalog/mock_connections_interface.go linguist-generated=true experimental/mocks/service/catalog/mock_credentials_interface.go linguist-generated=true +experimental/mocks/service/catalog/mock_external_lineage_interface.go linguist-generated=true experimental/mocks/service/catalog/mock_external_locations_interface.go linguist-generated=true +experimental/mocks/service/catalog/mock_external_metadata_interface.go linguist-generated=true experimental/mocks/service/catalog/mock_functions_interface.go linguist-generated=true experimental/mocks/service/catalog/mock_grants_interface.go linguist-generated=true experimental/mocks/service/catalog/mock_metastores_interface.go linguist-generated=true @@ -51,6 +53,7 @@ experimental/mocks/service/compute/mock_policy_families_interface.go linguist-ge experimental/mocks/service/dashboards/mock_genie_interface.go linguist-generated=true experimental/mocks/service/dashboards/mock_lakeview_embedded_interface.go linguist-generated=true experimental/mocks/service/dashboards/mock_lakeview_interface.go linguist-generated=true +experimental/mocks/service/dashboards/mock_query_execution_interface.go linguist-generated=true experimental/mocks/service/database/mock_database_interface.go linguist-generated=true experimental/mocks/service/files/mock_dbfs_interface.go linguist-generated=true experimental/mocks/service/files/mock_files_interface.go linguist-generated=true @@ -84,6 +87,7 @@ experimental/mocks/service/marketplace/mock_provider_providers_interface.go ling experimental/mocks/service/ml/mock_experiments_interface.go linguist-generated=true experimental/mocks/service/ml/mock_feature_store_interface.go linguist-generated=true experimental/mocks/service/ml/mock_forecasting_interface.go linguist-generated=true +experimental/mocks/service/ml/mock_materialized_features_interface.go linguist-generated=true experimental/mocks/service/ml/mock_model_registry_interface.go linguist-generated=true experimental/mocks/service/oauth2/mock_account_federation_policy_interface.go linguist-generated=true experimental/mocks/service/oauth2/mock_custom_app_integration_interface.go linguist-generated=true diff --git a/experimental/mocks/mock_workspace_client.go b/experimental/mocks/mock_workspace_client.go index 822b7ac3f..38cf4f21b 100755 --- a/experimental/mocks/mock_workspace_client.go +++ b/experimental/mocks/mock_workspace_client.go @@ -75,7 +75,9 @@ func NewMockWorkspaceClient(t interface { Dbfs: files.NewMockDbfsInterface(t), DbsqlPermissions: sql.NewMockDbsqlPermissionsInterface(t), Experiments: ml.NewMockExperimentsInterface(t), + ExternalLineage: catalog.NewMockExternalLineageInterface(t), ExternalLocations: catalog.NewMockExternalLocationsInterface(t), + ExternalMetadata: catalog.NewMockExternalMetadataInterface(t), FeatureStore: ml.NewMockFeatureStoreInterface(t), Files: files.NewMockFilesInterface(t), Functions: catalog.NewMockFunctionsInterface(t), @@ -91,6 +93,7 @@ func NewMockWorkspaceClient(t interface { Lakeview: dashboards.NewMockLakeviewInterface(t), LakeviewEmbedded: dashboards.NewMockLakeviewEmbeddedInterface(t), Libraries: compute.NewMockLibrariesInterface(t), + MaterializedFeatures: ml.NewMockMaterializedFeaturesInterface(t), Metastores: catalog.NewMockMetastoresInterface(t), ModelRegistry: ml.NewMockModelRegistryInterface(t), ModelVersions: catalog.NewMockModelVersionsInterface(t), @@ -114,6 +117,7 @@ func NewMockWorkspaceClient(t interface { QualityMonitors: catalog.NewMockQualityMonitorsInterface(t), Queries: sql.NewMockQueriesInterface(t), QueriesLegacy: sql.NewMockQueriesLegacyInterface(t), + QueryExecution: dashboards.NewMockQueryExecutionInterface(t), QueryHistory: sql.NewMockQueryHistoryInterface(t), QueryVisualizations: sql.NewMockQueryVisualizationsInterface(t), QueryVisualizationsLegacy: sql.NewMockQueryVisualizationsLegacyInterface(t), @@ -569,6 +573,14 @@ func (m *MockWorkspaceClient) GetMockExperimentsAPI() *ml.MockExperimentsInterfa return api } +func (m *MockWorkspaceClient) GetMockExternalLineageAPI() *catalog.MockExternalLineageInterface { + api, ok := m.WorkspaceClient.ExternalLineage.(*catalog.MockExternalLineageInterface) + if !ok { + panic(fmt.Sprintf("expected ExternalLineage to be *catalog.MockExternalLineageInterface, actual was %T", m.WorkspaceClient.ExternalLineage)) + } + return api +} + func (m *MockWorkspaceClient) GetMockExternalLocationsAPI() *catalog.MockExternalLocationsInterface { api, ok := m.WorkspaceClient.ExternalLocations.(*catalog.MockExternalLocationsInterface) if !ok { @@ -577,6 +589,14 @@ func (m *MockWorkspaceClient) GetMockExternalLocationsAPI() *catalog.MockExterna return api } +func (m *MockWorkspaceClient) GetMockExternalMetadataAPI() *catalog.MockExternalMetadataInterface { + api, ok := m.WorkspaceClient.ExternalMetadata.(*catalog.MockExternalMetadataInterface) + if !ok { + panic(fmt.Sprintf("expected ExternalMetadata to be *catalog.MockExternalMetadataInterface, actual was %T", m.WorkspaceClient.ExternalMetadata)) + } + return api +} + func (m *MockWorkspaceClient) GetMockFeatureStoreAPI() *ml.MockFeatureStoreInterface { api, ok := m.WorkspaceClient.FeatureStore.(*ml.MockFeatureStoreInterface) if !ok { @@ -697,6 +717,14 @@ func (m *MockWorkspaceClient) GetMockLibrariesAPI() *compute.MockLibrariesInterf return api } +func (m *MockWorkspaceClient) GetMockMaterializedFeaturesAPI() *ml.MockMaterializedFeaturesInterface { + api, ok := m.WorkspaceClient.MaterializedFeatures.(*ml.MockMaterializedFeaturesInterface) + if !ok { + panic(fmt.Sprintf("expected MaterializedFeatures to be *ml.MockMaterializedFeaturesInterface, actual was %T", m.WorkspaceClient.MaterializedFeatures)) + } + return api +} + func (m *MockWorkspaceClient) GetMockMetastoresAPI() *catalog.MockMetastoresInterface { api, ok := m.WorkspaceClient.Metastores.(*catalog.MockMetastoresInterface) if !ok { @@ -881,6 +909,14 @@ func (m *MockWorkspaceClient) GetMockQueriesLegacyAPI() *sql.MockQueriesLegacyIn return api } +func (m *MockWorkspaceClient) GetMockQueryExecutionAPI() *dashboards.MockQueryExecutionInterface { + api, ok := m.WorkspaceClient.QueryExecution.(*dashboards.MockQueryExecutionInterface) + if !ok { + panic(fmt.Sprintf("expected QueryExecution to be *dashboards.MockQueryExecutionInterface, actual was %T", m.WorkspaceClient.QueryExecution)) + } + return api +} + func (m *MockWorkspaceClient) GetMockQueryHistoryAPI() *sql.MockQueryHistoryInterface { api, ok := m.WorkspaceClient.QueryHistory.(*sql.MockQueryHistoryInterface) if !ok { diff --git a/experimental/mocks/service/catalog/mock_external_lineage_interface.go b/experimental/mocks/service/catalog/mock_external_lineage_interface.go new file mode 100644 index 000000000..0ff8368cf --- /dev/null +++ b/experimental/mocks/service/catalog/mock_external_lineage_interface.go @@ -0,0 +1,313 @@ +// Code generated by mockery v2.53.2. DO NOT EDIT. + +package catalog + +import ( + context "context" + + catalog "github.com/databricks/databricks-sdk-go/service/catalog" + + listing "github.com/databricks/databricks-sdk-go/listing" + + mock "github.com/stretchr/testify/mock" +) + +// MockExternalLineageInterface is an autogenerated mock type for the ExternalLineageInterface type +type MockExternalLineageInterface struct { + mock.Mock +} + +type MockExternalLineageInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *MockExternalLineageInterface) EXPECT() *MockExternalLineageInterface_Expecter { + return &MockExternalLineageInterface_Expecter{mock: &_m.Mock} +} + +// CreateExternalLineageRelationship provides a mock function with given fields: ctx, request +func (_m *MockExternalLineageInterface) CreateExternalLineageRelationship(ctx context.Context, request catalog.CreateExternalLineageRelationshipRequest) (*catalog.ExternalLineageRelationship, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for CreateExternalLineageRelationship") + } + + var r0 *catalog.ExternalLineageRelationship + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, catalog.CreateExternalLineageRelationshipRequest) (*catalog.ExternalLineageRelationship, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, catalog.CreateExternalLineageRelationshipRequest) *catalog.ExternalLineageRelationship); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*catalog.ExternalLineageRelationship) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, catalog.CreateExternalLineageRelationshipRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockExternalLineageInterface_CreateExternalLineageRelationship_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateExternalLineageRelationship' +type MockExternalLineageInterface_CreateExternalLineageRelationship_Call struct { + *mock.Call +} + +// CreateExternalLineageRelationship is a helper method to define mock.On call +// - ctx context.Context +// - request catalog.CreateExternalLineageRelationshipRequest +func (_e *MockExternalLineageInterface_Expecter) CreateExternalLineageRelationship(ctx interface{}, request interface{}) *MockExternalLineageInterface_CreateExternalLineageRelationship_Call { + return &MockExternalLineageInterface_CreateExternalLineageRelationship_Call{Call: _e.mock.On("CreateExternalLineageRelationship", ctx, request)} +} + +func (_c *MockExternalLineageInterface_CreateExternalLineageRelationship_Call) Run(run func(ctx context.Context, request catalog.CreateExternalLineageRelationshipRequest)) *MockExternalLineageInterface_CreateExternalLineageRelationship_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(catalog.CreateExternalLineageRelationshipRequest)) + }) + return _c +} + +func (_c *MockExternalLineageInterface_CreateExternalLineageRelationship_Call) Return(_a0 *catalog.ExternalLineageRelationship, _a1 error) *MockExternalLineageInterface_CreateExternalLineageRelationship_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockExternalLineageInterface_CreateExternalLineageRelationship_Call) RunAndReturn(run func(context.Context, catalog.CreateExternalLineageRelationshipRequest) (*catalog.ExternalLineageRelationship, error)) *MockExternalLineageInterface_CreateExternalLineageRelationship_Call { + _c.Call.Return(run) + return _c +} + +// DeleteExternalLineageRelationship provides a mock function with given fields: ctx, request +func (_m *MockExternalLineageInterface) DeleteExternalLineageRelationship(ctx context.Context, request catalog.DeleteExternalLineageRelationshipRequest) error { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for DeleteExternalLineageRelationship") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, catalog.DeleteExternalLineageRelationshipRequest) error); ok { + r0 = rf(ctx, request) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockExternalLineageInterface_DeleteExternalLineageRelationship_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteExternalLineageRelationship' +type MockExternalLineageInterface_DeleteExternalLineageRelationship_Call struct { + *mock.Call +} + +// DeleteExternalLineageRelationship is a helper method to define mock.On call +// - ctx context.Context +// - request catalog.DeleteExternalLineageRelationshipRequest +func (_e *MockExternalLineageInterface_Expecter) DeleteExternalLineageRelationship(ctx interface{}, request interface{}) *MockExternalLineageInterface_DeleteExternalLineageRelationship_Call { + return &MockExternalLineageInterface_DeleteExternalLineageRelationship_Call{Call: _e.mock.On("DeleteExternalLineageRelationship", ctx, request)} +} + +func (_c *MockExternalLineageInterface_DeleteExternalLineageRelationship_Call) Run(run func(ctx context.Context, request catalog.DeleteExternalLineageRelationshipRequest)) *MockExternalLineageInterface_DeleteExternalLineageRelationship_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(catalog.DeleteExternalLineageRelationshipRequest)) + }) + return _c +} + +func (_c *MockExternalLineageInterface_DeleteExternalLineageRelationship_Call) Return(_a0 error) *MockExternalLineageInterface_DeleteExternalLineageRelationship_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockExternalLineageInterface_DeleteExternalLineageRelationship_Call) RunAndReturn(run func(context.Context, catalog.DeleteExternalLineageRelationshipRequest) error) *MockExternalLineageInterface_DeleteExternalLineageRelationship_Call { + _c.Call.Return(run) + return _c +} + +// ListExternalLineageRelationships provides a mock function with given fields: ctx, request +func (_m *MockExternalLineageInterface) ListExternalLineageRelationships(ctx context.Context, request catalog.ListExternalLineageRelationshipsRequest) listing.Iterator[catalog.ExternalLineageInfo] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListExternalLineageRelationships") + } + + var r0 listing.Iterator[catalog.ExternalLineageInfo] + if rf, ok := ret.Get(0).(func(context.Context, catalog.ListExternalLineageRelationshipsRequest) listing.Iterator[catalog.ExternalLineageInfo]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[catalog.ExternalLineageInfo]) + } + } + + return r0 +} + +// MockExternalLineageInterface_ListExternalLineageRelationships_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListExternalLineageRelationships' +type MockExternalLineageInterface_ListExternalLineageRelationships_Call struct { + *mock.Call +} + +// ListExternalLineageRelationships is a helper method to define mock.On call +// - ctx context.Context +// - request catalog.ListExternalLineageRelationshipsRequest +func (_e *MockExternalLineageInterface_Expecter) ListExternalLineageRelationships(ctx interface{}, request interface{}) *MockExternalLineageInterface_ListExternalLineageRelationships_Call { + return &MockExternalLineageInterface_ListExternalLineageRelationships_Call{Call: _e.mock.On("ListExternalLineageRelationships", ctx, request)} +} + +func (_c *MockExternalLineageInterface_ListExternalLineageRelationships_Call) Run(run func(ctx context.Context, request catalog.ListExternalLineageRelationshipsRequest)) *MockExternalLineageInterface_ListExternalLineageRelationships_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(catalog.ListExternalLineageRelationshipsRequest)) + }) + return _c +} + +func (_c *MockExternalLineageInterface_ListExternalLineageRelationships_Call) Return(_a0 listing.Iterator[catalog.ExternalLineageInfo]) *MockExternalLineageInterface_ListExternalLineageRelationships_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockExternalLineageInterface_ListExternalLineageRelationships_Call) RunAndReturn(run func(context.Context, catalog.ListExternalLineageRelationshipsRequest) listing.Iterator[catalog.ExternalLineageInfo]) *MockExternalLineageInterface_ListExternalLineageRelationships_Call { + _c.Call.Return(run) + return _c +} + +// ListExternalLineageRelationshipsAll provides a mock function with given fields: ctx, request +func (_m *MockExternalLineageInterface) ListExternalLineageRelationshipsAll(ctx context.Context, request catalog.ListExternalLineageRelationshipsRequest) ([]catalog.ExternalLineageInfo, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListExternalLineageRelationshipsAll") + } + + var r0 []catalog.ExternalLineageInfo + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, catalog.ListExternalLineageRelationshipsRequest) ([]catalog.ExternalLineageInfo, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, catalog.ListExternalLineageRelationshipsRequest) []catalog.ExternalLineageInfo); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]catalog.ExternalLineageInfo) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, catalog.ListExternalLineageRelationshipsRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockExternalLineageInterface_ListExternalLineageRelationshipsAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListExternalLineageRelationshipsAll' +type MockExternalLineageInterface_ListExternalLineageRelationshipsAll_Call struct { + *mock.Call +} + +// ListExternalLineageRelationshipsAll is a helper method to define mock.On call +// - ctx context.Context +// - request catalog.ListExternalLineageRelationshipsRequest +func (_e *MockExternalLineageInterface_Expecter) ListExternalLineageRelationshipsAll(ctx interface{}, request interface{}) *MockExternalLineageInterface_ListExternalLineageRelationshipsAll_Call { + return &MockExternalLineageInterface_ListExternalLineageRelationshipsAll_Call{Call: _e.mock.On("ListExternalLineageRelationshipsAll", ctx, request)} +} + +func (_c *MockExternalLineageInterface_ListExternalLineageRelationshipsAll_Call) Run(run func(ctx context.Context, request catalog.ListExternalLineageRelationshipsRequest)) *MockExternalLineageInterface_ListExternalLineageRelationshipsAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(catalog.ListExternalLineageRelationshipsRequest)) + }) + return _c +} + +func (_c *MockExternalLineageInterface_ListExternalLineageRelationshipsAll_Call) Return(_a0 []catalog.ExternalLineageInfo, _a1 error) *MockExternalLineageInterface_ListExternalLineageRelationshipsAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockExternalLineageInterface_ListExternalLineageRelationshipsAll_Call) RunAndReturn(run func(context.Context, catalog.ListExternalLineageRelationshipsRequest) ([]catalog.ExternalLineageInfo, error)) *MockExternalLineageInterface_ListExternalLineageRelationshipsAll_Call { + _c.Call.Return(run) + return _c +} + +// UpdateExternalLineageRelationship provides a mock function with given fields: ctx, request +func (_m *MockExternalLineageInterface) UpdateExternalLineageRelationship(ctx context.Context, request catalog.UpdateExternalLineageRelationshipRequest) (*catalog.ExternalLineageRelationship, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for UpdateExternalLineageRelationship") + } + + var r0 *catalog.ExternalLineageRelationship + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, catalog.UpdateExternalLineageRelationshipRequest) (*catalog.ExternalLineageRelationship, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, catalog.UpdateExternalLineageRelationshipRequest) *catalog.ExternalLineageRelationship); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*catalog.ExternalLineageRelationship) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, catalog.UpdateExternalLineageRelationshipRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockExternalLineageInterface_UpdateExternalLineageRelationship_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateExternalLineageRelationship' +type MockExternalLineageInterface_UpdateExternalLineageRelationship_Call struct { + *mock.Call +} + +// UpdateExternalLineageRelationship is a helper method to define mock.On call +// - ctx context.Context +// - request catalog.UpdateExternalLineageRelationshipRequest +func (_e *MockExternalLineageInterface_Expecter) UpdateExternalLineageRelationship(ctx interface{}, request interface{}) *MockExternalLineageInterface_UpdateExternalLineageRelationship_Call { + return &MockExternalLineageInterface_UpdateExternalLineageRelationship_Call{Call: _e.mock.On("UpdateExternalLineageRelationship", ctx, request)} +} + +func (_c *MockExternalLineageInterface_UpdateExternalLineageRelationship_Call) Run(run func(ctx context.Context, request catalog.UpdateExternalLineageRelationshipRequest)) *MockExternalLineageInterface_UpdateExternalLineageRelationship_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(catalog.UpdateExternalLineageRelationshipRequest)) + }) + return _c +} + +func (_c *MockExternalLineageInterface_UpdateExternalLineageRelationship_Call) Return(_a0 *catalog.ExternalLineageRelationship, _a1 error) *MockExternalLineageInterface_UpdateExternalLineageRelationship_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockExternalLineageInterface_UpdateExternalLineageRelationship_Call) RunAndReturn(run func(context.Context, catalog.UpdateExternalLineageRelationshipRequest) (*catalog.ExternalLineageRelationship, error)) *MockExternalLineageInterface_UpdateExternalLineageRelationship_Call { + _c.Call.Return(run) + return _c +} + +// NewMockExternalLineageInterface creates a new instance of MockExternalLineageInterface. 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 NewMockExternalLineageInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *MockExternalLineageInterface { + mock := &MockExternalLineageInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/experimental/mocks/service/catalog/mock_external_metadata_interface.go b/experimental/mocks/service/catalog/mock_external_metadata_interface.go new file mode 100644 index 000000000..48a25b100 --- /dev/null +++ b/experimental/mocks/service/catalog/mock_external_metadata_interface.go @@ -0,0 +1,478 @@ +// Code generated by mockery v2.53.2. DO NOT EDIT. + +package catalog + +import ( + context "context" + + catalog "github.com/databricks/databricks-sdk-go/service/catalog" + + listing "github.com/databricks/databricks-sdk-go/listing" + + mock "github.com/stretchr/testify/mock" +) + +// MockExternalMetadataInterface is an autogenerated mock type for the ExternalMetadataInterface type +type MockExternalMetadataInterface struct { + mock.Mock +} + +type MockExternalMetadataInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *MockExternalMetadataInterface) EXPECT() *MockExternalMetadataInterface_Expecter { + return &MockExternalMetadataInterface_Expecter{mock: &_m.Mock} +} + +// CreateExternalMetadata provides a mock function with given fields: ctx, request +func (_m *MockExternalMetadataInterface) CreateExternalMetadata(ctx context.Context, request catalog.CreateExternalMetadataRequest) (*catalog.ExternalMetadata, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for CreateExternalMetadata") + } + + var r0 *catalog.ExternalMetadata + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, catalog.CreateExternalMetadataRequest) (*catalog.ExternalMetadata, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, catalog.CreateExternalMetadataRequest) *catalog.ExternalMetadata); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*catalog.ExternalMetadata) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, catalog.CreateExternalMetadataRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockExternalMetadataInterface_CreateExternalMetadata_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateExternalMetadata' +type MockExternalMetadataInterface_CreateExternalMetadata_Call struct { + *mock.Call +} + +// CreateExternalMetadata is a helper method to define mock.On call +// - ctx context.Context +// - request catalog.CreateExternalMetadataRequest +func (_e *MockExternalMetadataInterface_Expecter) CreateExternalMetadata(ctx interface{}, request interface{}) *MockExternalMetadataInterface_CreateExternalMetadata_Call { + return &MockExternalMetadataInterface_CreateExternalMetadata_Call{Call: _e.mock.On("CreateExternalMetadata", ctx, request)} +} + +func (_c *MockExternalMetadataInterface_CreateExternalMetadata_Call) Run(run func(ctx context.Context, request catalog.CreateExternalMetadataRequest)) *MockExternalMetadataInterface_CreateExternalMetadata_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(catalog.CreateExternalMetadataRequest)) + }) + return _c +} + +func (_c *MockExternalMetadataInterface_CreateExternalMetadata_Call) Return(_a0 *catalog.ExternalMetadata, _a1 error) *MockExternalMetadataInterface_CreateExternalMetadata_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockExternalMetadataInterface_CreateExternalMetadata_Call) RunAndReturn(run func(context.Context, catalog.CreateExternalMetadataRequest) (*catalog.ExternalMetadata, error)) *MockExternalMetadataInterface_CreateExternalMetadata_Call { + _c.Call.Return(run) + return _c +} + +// DeleteExternalMetadata provides a mock function with given fields: ctx, request +func (_m *MockExternalMetadataInterface) DeleteExternalMetadata(ctx context.Context, request catalog.DeleteExternalMetadataRequest) error { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for DeleteExternalMetadata") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, catalog.DeleteExternalMetadataRequest) error); ok { + r0 = rf(ctx, request) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockExternalMetadataInterface_DeleteExternalMetadata_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteExternalMetadata' +type MockExternalMetadataInterface_DeleteExternalMetadata_Call struct { + *mock.Call +} + +// DeleteExternalMetadata is a helper method to define mock.On call +// - ctx context.Context +// - request catalog.DeleteExternalMetadataRequest +func (_e *MockExternalMetadataInterface_Expecter) DeleteExternalMetadata(ctx interface{}, request interface{}) *MockExternalMetadataInterface_DeleteExternalMetadata_Call { + return &MockExternalMetadataInterface_DeleteExternalMetadata_Call{Call: _e.mock.On("DeleteExternalMetadata", ctx, request)} +} + +func (_c *MockExternalMetadataInterface_DeleteExternalMetadata_Call) Run(run func(ctx context.Context, request catalog.DeleteExternalMetadataRequest)) *MockExternalMetadataInterface_DeleteExternalMetadata_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(catalog.DeleteExternalMetadataRequest)) + }) + return _c +} + +func (_c *MockExternalMetadataInterface_DeleteExternalMetadata_Call) Return(_a0 error) *MockExternalMetadataInterface_DeleteExternalMetadata_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockExternalMetadataInterface_DeleteExternalMetadata_Call) RunAndReturn(run func(context.Context, catalog.DeleteExternalMetadataRequest) error) *MockExternalMetadataInterface_DeleteExternalMetadata_Call { + _c.Call.Return(run) + return _c +} + +// DeleteExternalMetadataByName provides a mock function with given fields: ctx, name +func (_m *MockExternalMetadataInterface) DeleteExternalMetadataByName(ctx context.Context, name string) error { + ret := _m.Called(ctx, name) + + if len(ret) == 0 { + panic("no return value specified for DeleteExternalMetadataByName") + } + + 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 +} + +// MockExternalMetadataInterface_DeleteExternalMetadataByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteExternalMetadataByName' +type MockExternalMetadataInterface_DeleteExternalMetadataByName_Call struct { + *mock.Call +} + +// DeleteExternalMetadataByName is a helper method to define mock.On call +// - ctx context.Context +// - name string +func (_e *MockExternalMetadataInterface_Expecter) DeleteExternalMetadataByName(ctx interface{}, name interface{}) *MockExternalMetadataInterface_DeleteExternalMetadataByName_Call { + return &MockExternalMetadataInterface_DeleteExternalMetadataByName_Call{Call: _e.mock.On("DeleteExternalMetadataByName", ctx, name)} +} + +func (_c *MockExternalMetadataInterface_DeleteExternalMetadataByName_Call) Run(run func(ctx context.Context, name string)) *MockExternalMetadataInterface_DeleteExternalMetadataByName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockExternalMetadataInterface_DeleteExternalMetadataByName_Call) Return(_a0 error) *MockExternalMetadataInterface_DeleteExternalMetadataByName_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockExternalMetadataInterface_DeleteExternalMetadataByName_Call) RunAndReturn(run func(context.Context, string) error) *MockExternalMetadataInterface_DeleteExternalMetadataByName_Call { + _c.Call.Return(run) + return _c +} + +// GetExternalMetadata provides a mock function with given fields: ctx, request +func (_m *MockExternalMetadataInterface) GetExternalMetadata(ctx context.Context, request catalog.GetExternalMetadataRequest) (*catalog.ExternalMetadata, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for GetExternalMetadata") + } + + var r0 *catalog.ExternalMetadata + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, catalog.GetExternalMetadataRequest) (*catalog.ExternalMetadata, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, catalog.GetExternalMetadataRequest) *catalog.ExternalMetadata); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*catalog.ExternalMetadata) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, catalog.GetExternalMetadataRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockExternalMetadataInterface_GetExternalMetadata_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetExternalMetadata' +type MockExternalMetadataInterface_GetExternalMetadata_Call struct { + *mock.Call +} + +// GetExternalMetadata is a helper method to define mock.On call +// - ctx context.Context +// - request catalog.GetExternalMetadataRequest +func (_e *MockExternalMetadataInterface_Expecter) GetExternalMetadata(ctx interface{}, request interface{}) *MockExternalMetadataInterface_GetExternalMetadata_Call { + return &MockExternalMetadataInterface_GetExternalMetadata_Call{Call: _e.mock.On("GetExternalMetadata", ctx, request)} +} + +func (_c *MockExternalMetadataInterface_GetExternalMetadata_Call) Run(run func(ctx context.Context, request catalog.GetExternalMetadataRequest)) *MockExternalMetadataInterface_GetExternalMetadata_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(catalog.GetExternalMetadataRequest)) + }) + return _c +} + +func (_c *MockExternalMetadataInterface_GetExternalMetadata_Call) Return(_a0 *catalog.ExternalMetadata, _a1 error) *MockExternalMetadataInterface_GetExternalMetadata_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockExternalMetadataInterface_GetExternalMetadata_Call) RunAndReturn(run func(context.Context, catalog.GetExternalMetadataRequest) (*catalog.ExternalMetadata, error)) *MockExternalMetadataInterface_GetExternalMetadata_Call { + _c.Call.Return(run) + return _c +} + +// GetExternalMetadataByName provides a mock function with given fields: ctx, name +func (_m *MockExternalMetadataInterface) GetExternalMetadataByName(ctx context.Context, name string) (*catalog.ExternalMetadata, error) { + ret := _m.Called(ctx, name) + + if len(ret) == 0 { + panic("no return value specified for GetExternalMetadataByName") + } + + var r0 *catalog.ExternalMetadata + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*catalog.ExternalMetadata, error)); ok { + return rf(ctx, name) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *catalog.ExternalMetadata); ok { + r0 = rf(ctx, name) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*catalog.ExternalMetadata) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, name) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockExternalMetadataInterface_GetExternalMetadataByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetExternalMetadataByName' +type MockExternalMetadataInterface_GetExternalMetadataByName_Call struct { + *mock.Call +} + +// GetExternalMetadataByName is a helper method to define mock.On call +// - ctx context.Context +// - name string +func (_e *MockExternalMetadataInterface_Expecter) GetExternalMetadataByName(ctx interface{}, name interface{}) *MockExternalMetadataInterface_GetExternalMetadataByName_Call { + return &MockExternalMetadataInterface_GetExternalMetadataByName_Call{Call: _e.mock.On("GetExternalMetadataByName", ctx, name)} +} + +func (_c *MockExternalMetadataInterface_GetExternalMetadataByName_Call) Run(run func(ctx context.Context, name string)) *MockExternalMetadataInterface_GetExternalMetadataByName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockExternalMetadataInterface_GetExternalMetadataByName_Call) Return(_a0 *catalog.ExternalMetadata, _a1 error) *MockExternalMetadataInterface_GetExternalMetadataByName_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockExternalMetadataInterface_GetExternalMetadataByName_Call) RunAndReturn(run func(context.Context, string) (*catalog.ExternalMetadata, error)) *MockExternalMetadataInterface_GetExternalMetadataByName_Call { + _c.Call.Return(run) + return _c +} + +// ListExternalMetadata provides a mock function with given fields: ctx, request +func (_m *MockExternalMetadataInterface) ListExternalMetadata(ctx context.Context, request catalog.ListExternalMetadataRequest) listing.Iterator[catalog.ExternalMetadata] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListExternalMetadata") + } + + var r0 listing.Iterator[catalog.ExternalMetadata] + if rf, ok := ret.Get(0).(func(context.Context, catalog.ListExternalMetadataRequest) listing.Iterator[catalog.ExternalMetadata]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[catalog.ExternalMetadata]) + } + } + + return r0 +} + +// MockExternalMetadataInterface_ListExternalMetadata_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListExternalMetadata' +type MockExternalMetadataInterface_ListExternalMetadata_Call struct { + *mock.Call +} + +// ListExternalMetadata is a helper method to define mock.On call +// - ctx context.Context +// - request catalog.ListExternalMetadataRequest +func (_e *MockExternalMetadataInterface_Expecter) ListExternalMetadata(ctx interface{}, request interface{}) *MockExternalMetadataInterface_ListExternalMetadata_Call { + return &MockExternalMetadataInterface_ListExternalMetadata_Call{Call: _e.mock.On("ListExternalMetadata", ctx, request)} +} + +func (_c *MockExternalMetadataInterface_ListExternalMetadata_Call) Run(run func(ctx context.Context, request catalog.ListExternalMetadataRequest)) *MockExternalMetadataInterface_ListExternalMetadata_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(catalog.ListExternalMetadataRequest)) + }) + return _c +} + +func (_c *MockExternalMetadataInterface_ListExternalMetadata_Call) Return(_a0 listing.Iterator[catalog.ExternalMetadata]) *MockExternalMetadataInterface_ListExternalMetadata_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockExternalMetadataInterface_ListExternalMetadata_Call) RunAndReturn(run func(context.Context, catalog.ListExternalMetadataRequest) listing.Iterator[catalog.ExternalMetadata]) *MockExternalMetadataInterface_ListExternalMetadata_Call { + _c.Call.Return(run) + return _c +} + +// ListExternalMetadataAll provides a mock function with given fields: ctx, request +func (_m *MockExternalMetadataInterface) ListExternalMetadataAll(ctx context.Context, request catalog.ListExternalMetadataRequest) ([]catalog.ExternalMetadata, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListExternalMetadataAll") + } + + var r0 []catalog.ExternalMetadata + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, catalog.ListExternalMetadataRequest) ([]catalog.ExternalMetadata, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, catalog.ListExternalMetadataRequest) []catalog.ExternalMetadata); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]catalog.ExternalMetadata) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, catalog.ListExternalMetadataRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockExternalMetadataInterface_ListExternalMetadataAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListExternalMetadataAll' +type MockExternalMetadataInterface_ListExternalMetadataAll_Call struct { + *mock.Call +} + +// ListExternalMetadataAll is a helper method to define mock.On call +// - ctx context.Context +// - request catalog.ListExternalMetadataRequest +func (_e *MockExternalMetadataInterface_Expecter) ListExternalMetadataAll(ctx interface{}, request interface{}) *MockExternalMetadataInterface_ListExternalMetadataAll_Call { + return &MockExternalMetadataInterface_ListExternalMetadataAll_Call{Call: _e.mock.On("ListExternalMetadataAll", ctx, request)} +} + +func (_c *MockExternalMetadataInterface_ListExternalMetadataAll_Call) Run(run func(ctx context.Context, request catalog.ListExternalMetadataRequest)) *MockExternalMetadataInterface_ListExternalMetadataAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(catalog.ListExternalMetadataRequest)) + }) + return _c +} + +func (_c *MockExternalMetadataInterface_ListExternalMetadataAll_Call) Return(_a0 []catalog.ExternalMetadata, _a1 error) *MockExternalMetadataInterface_ListExternalMetadataAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockExternalMetadataInterface_ListExternalMetadataAll_Call) RunAndReturn(run func(context.Context, catalog.ListExternalMetadataRequest) ([]catalog.ExternalMetadata, error)) *MockExternalMetadataInterface_ListExternalMetadataAll_Call { + _c.Call.Return(run) + return _c +} + +// UpdateExternalMetadata provides a mock function with given fields: ctx, request +func (_m *MockExternalMetadataInterface) UpdateExternalMetadata(ctx context.Context, request catalog.UpdateExternalMetadataRequest) (*catalog.ExternalMetadata, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for UpdateExternalMetadata") + } + + var r0 *catalog.ExternalMetadata + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, catalog.UpdateExternalMetadataRequest) (*catalog.ExternalMetadata, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, catalog.UpdateExternalMetadataRequest) *catalog.ExternalMetadata); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*catalog.ExternalMetadata) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, catalog.UpdateExternalMetadataRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockExternalMetadataInterface_UpdateExternalMetadata_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateExternalMetadata' +type MockExternalMetadataInterface_UpdateExternalMetadata_Call struct { + *mock.Call +} + +// UpdateExternalMetadata is a helper method to define mock.On call +// - ctx context.Context +// - request catalog.UpdateExternalMetadataRequest +func (_e *MockExternalMetadataInterface_Expecter) UpdateExternalMetadata(ctx interface{}, request interface{}) *MockExternalMetadataInterface_UpdateExternalMetadata_Call { + return &MockExternalMetadataInterface_UpdateExternalMetadata_Call{Call: _e.mock.On("UpdateExternalMetadata", ctx, request)} +} + +func (_c *MockExternalMetadataInterface_UpdateExternalMetadata_Call) Run(run func(ctx context.Context, request catalog.UpdateExternalMetadataRequest)) *MockExternalMetadataInterface_UpdateExternalMetadata_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(catalog.UpdateExternalMetadataRequest)) + }) + return _c +} + +func (_c *MockExternalMetadataInterface_UpdateExternalMetadata_Call) Return(_a0 *catalog.ExternalMetadata, _a1 error) *MockExternalMetadataInterface_UpdateExternalMetadata_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockExternalMetadataInterface_UpdateExternalMetadata_Call) RunAndReturn(run func(context.Context, catalog.UpdateExternalMetadataRequest) (*catalog.ExternalMetadata, error)) *MockExternalMetadataInterface_UpdateExternalMetadata_Call { + _c.Call.Return(run) + return _c +} + +// NewMockExternalMetadataInterface creates a new instance of MockExternalMetadataInterface. 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 NewMockExternalMetadataInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *MockExternalMetadataInterface { + mock := &MockExternalMetadataInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/experimental/mocks/service/catalog/mock_tables_interface.go b/experimental/mocks/service/catalog/mock_tables_interface.go index 0f921c171..311fb0931 100644 --- a/experimental/mocks/service/catalog/mock_tables_interface.go +++ b/experimental/mocks/service/catalog/mock_tables_interface.go @@ -355,65 +355,6 @@ func (_c *MockTablesInterface_GetByFullName_Call) RunAndReturn(run func(context. return _c } -// GetByName provides a mock function with given fields: ctx, name -func (_m *MockTablesInterface) GetByName(ctx context.Context, name string) (*catalog.TableInfo, error) { - ret := _m.Called(ctx, name) - - if len(ret) == 0 { - panic("no return value specified for GetByName") - } - - var r0 *catalog.TableInfo - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*catalog.TableInfo, error)); ok { - return rf(ctx, name) - } - if rf, ok := ret.Get(0).(func(context.Context, string) *catalog.TableInfo); ok { - r0 = rf(ctx, name) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*catalog.TableInfo) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, name) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockTablesInterface_GetByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetByName' -type MockTablesInterface_GetByName_Call struct { - *mock.Call -} - -// GetByName is a helper method to define mock.On call -// - ctx context.Context -// - name string -func (_e *MockTablesInterface_Expecter) GetByName(ctx interface{}, name interface{}) *MockTablesInterface_GetByName_Call { - return &MockTablesInterface_GetByName_Call{Call: _e.mock.On("GetByName", ctx, name)} -} - -func (_c *MockTablesInterface_GetByName_Call) Run(run func(ctx context.Context, name string)) *MockTablesInterface_GetByName_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) - }) - return _c -} - -func (_c *MockTablesInterface_GetByName_Call) Return(_a0 *catalog.TableInfo, _a1 error) *MockTablesInterface_GetByName_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockTablesInterface_GetByName_Call) RunAndReturn(run func(context.Context, string) (*catalog.TableInfo, error)) *MockTablesInterface_GetByName_Call { - _c.Call.Return(run) - return _c -} - // List provides a mock function with given fields: ctx, request func (_m *MockTablesInterface) List(ctx context.Context, request catalog.ListTablesRequest) listing.Iterator[catalog.TableInfo] { ret := _m.Called(ctx, request) @@ -630,65 +571,6 @@ func (_c *MockTablesInterface_ListSummariesAll_Call) RunAndReturn(run func(conte return _c } -// TableInfoNameToTableIdMap provides a mock function with given fields: ctx, request -func (_m *MockTablesInterface) TableInfoNameToTableIdMap(ctx context.Context, request catalog.ListTablesRequest) (map[string]string, error) { - ret := _m.Called(ctx, request) - - if len(ret) == 0 { - panic("no return value specified for TableInfoNameToTableIdMap") - } - - var r0 map[string]string - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, catalog.ListTablesRequest) (map[string]string, error)); ok { - return rf(ctx, request) - } - if rf, ok := ret.Get(0).(func(context.Context, catalog.ListTablesRequest) map[string]string); ok { - r0 = rf(ctx, request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(map[string]string) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, catalog.ListTablesRequest) error); ok { - r1 = rf(ctx, request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockTablesInterface_TableInfoNameToTableIdMap_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TableInfoNameToTableIdMap' -type MockTablesInterface_TableInfoNameToTableIdMap_Call struct { - *mock.Call -} - -// TableInfoNameToTableIdMap is a helper method to define mock.On call -// - ctx context.Context -// - request catalog.ListTablesRequest -func (_e *MockTablesInterface_Expecter) TableInfoNameToTableIdMap(ctx interface{}, request interface{}) *MockTablesInterface_TableInfoNameToTableIdMap_Call { - return &MockTablesInterface_TableInfoNameToTableIdMap_Call{Call: _e.mock.On("TableInfoNameToTableIdMap", ctx, request)} -} - -func (_c *MockTablesInterface_TableInfoNameToTableIdMap_Call) Run(run func(ctx context.Context, request catalog.ListTablesRequest)) *MockTablesInterface_TableInfoNameToTableIdMap_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(catalog.ListTablesRequest)) - }) - return _c -} - -func (_c *MockTablesInterface_TableInfoNameToTableIdMap_Call) Return(_a0 map[string]string, _a1 error) *MockTablesInterface_TableInfoNameToTableIdMap_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockTablesInterface_TableInfoNameToTableIdMap_Call) RunAndReturn(run func(context.Context, catalog.ListTablesRequest) (map[string]string, error)) *MockTablesInterface_TableInfoNameToTableIdMap_Call { - _c.Call.Return(run) - return _c -} - // Update provides a mock function with given fields: ctx, request func (_m *MockTablesInterface) Update(ctx context.Context, request catalog.UpdateTableRequest) error { ret := _m.Called(ctx, request) diff --git a/experimental/mocks/service/compute/mock_libraries_interface.go b/experimental/mocks/service/compute/mock_libraries_interface.go index 23304e2d5..c7a5d55ca 100644 --- a/experimental/mocks/service/compute/mock_libraries_interface.go +++ b/experimental/mocks/service/compute/mock_libraries_interface.go @@ -300,6 +300,159 @@ func (_c *MockLibrariesInterface_ClusterStatusByClusterId_Call) RunAndReturn(run return _c } +// CreateDefaultBaseEnvironment provides a mock function with given fields: ctx, request +func (_m *MockLibrariesInterface) CreateDefaultBaseEnvironment(ctx context.Context, request compute.CreateDefaultBaseEnvironmentRequest) (*compute.DefaultBaseEnvironment, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for CreateDefaultBaseEnvironment") + } + + var r0 *compute.DefaultBaseEnvironment + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, compute.CreateDefaultBaseEnvironmentRequest) (*compute.DefaultBaseEnvironment, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, compute.CreateDefaultBaseEnvironmentRequest) *compute.DefaultBaseEnvironment); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*compute.DefaultBaseEnvironment) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, compute.CreateDefaultBaseEnvironmentRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockLibrariesInterface_CreateDefaultBaseEnvironment_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateDefaultBaseEnvironment' +type MockLibrariesInterface_CreateDefaultBaseEnvironment_Call struct { + *mock.Call +} + +// CreateDefaultBaseEnvironment is a helper method to define mock.On call +// - ctx context.Context +// - request compute.CreateDefaultBaseEnvironmentRequest +func (_e *MockLibrariesInterface_Expecter) CreateDefaultBaseEnvironment(ctx interface{}, request interface{}) *MockLibrariesInterface_CreateDefaultBaseEnvironment_Call { + return &MockLibrariesInterface_CreateDefaultBaseEnvironment_Call{Call: _e.mock.On("CreateDefaultBaseEnvironment", ctx, request)} +} + +func (_c *MockLibrariesInterface_CreateDefaultBaseEnvironment_Call) Run(run func(ctx context.Context, request compute.CreateDefaultBaseEnvironmentRequest)) *MockLibrariesInterface_CreateDefaultBaseEnvironment_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(compute.CreateDefaultBaseEnvironmentRequest)) + }) + return _c +} + +func (_c *MockLibrariesInterface_CreateDefaultBaseEnvironment_Call) Return(_a0 *compute.DefaultBaseEnvironment, _a1 error) *MockLibrariesInterface_CreateDefaultBaseEnvironment_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockLibrariesInterface_CreateDefaultBaseEnvironment_Call) RunAndReturn(run func(context.Context, compute.CreateDefaultBaseEnvironmentRequest) (*compute.DefaultBaseEnvironment, error)) *MockLibrariesInterface_CreateDefaultBaseEnvironment_Call { + _c.Call.Return(run) + return _c +} + +// DeleteDefaultBaseEnvironment provides a mock function with given fields: ctx, request +func (_m *MockLibrariesInterface) DeleteDefaultBaseEnvironment(ctx context.Context, request compute.DeleteDefaultBaseEnvironmentRequest) error { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for DeleteDefaultBaseEnvironment") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, compute.DeleteDefaultBaseEnvironmentRequest) error); ok { + r0 = rf(ctx, request) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockLibrariesInterface_DeleteDefaultBaseEnvironment_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteDefaultBaseEnvironment' +type MockLibrariesInterface_DeleteDefaultBaseEnvironment_Call struct { + *mock.Call +} + +// DeleteDefaultBaseEnvironment is a helper method to define mock.On call +// - ctx context.Context +// - request compute.DeleteDefaultBaseEnvironmentRequest +func (_e *MockLibrariesInterface_Expecter) DeleteDefaultBaseEnvironment(ctx interface{}, request interface{}) *MockLibrariesInterface_DeleteDefaultBaseEnvironment_Call { + return &MockLibrariesInterface_DeleteDefaultBaseEnvironment_Call{Call: _e.mock.On("DeleteDefaultBaseEnvironment", ctx, request)} +} + +func (_c *MockLibrariesInterface_DeleteDefaultBaseEnvironment_Call) Run(run func(ctx context.Context, request compute.DeleteDefaultBaseEnvironmentRequest)) *MockLibrariesInterface_DeleteDefaultBaseEnvironment_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(compute.DeleteDefaultBaseEnvironmentRequest)) + }) + return _c +} + +func (_c *MockLibrariesInterface_DeleteDefaultBaseEnvironment_Call) Return(_a0 error) *MockLibrariesInterface_DeleteDefaultBaseEnvironment_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockLibrariesInterface_DeleteDefaultBaseEnvironment_Call) RunAndReturn(run func(context.Context, compute.DeleteDefaultBaseEnvironmentRequest) error) *MockLibrariesInterface_DeleteDefaultBaseEnvironment_Call { + _c.Call.Return(run) + return _c +} + +// DeleteDefaultBaseEnvironmentById provides a mock function with given fields: ctx, id +func (_m *MockLibrariesInterface) DeleteDefaultBaseEnvironmentById(ctx context.Context, id string) error { + ret := _m.Called(ctx, id) + + if len(ret) == 0 { + panic("no return value specified for DeleteDefaultBaseEnvironmentById") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = rf(ctx, id) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockLibrariesInterface_DeleteDefaultBaseEnvironmentById_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteDefaultBaseEnvironmentById' +type MockLibrariesInterface_DeleteDefaultBaseEnvironmentById_Call struct { + *mock.Call +} + +// DeleteDefaultBaseEnvironmentById is a helper method to define mock.On call +// - ctx context.Context +// - id string +func (_e *MockLibrariesInterface_Expecter) DeleteDefaultBaseEnvironmentById(ctx interface{}, id interface{}) *MockLibrariesInterface_DeleteDefaultBaseEnvironmentById_Call { + return &MockLibrariesInterface_DeleteDefaultBaseEnvironmentById_Call{Call: _e.mock.On("DeleteDefaultBaseEnvironmentById", ctx, id)} +} + +func (_c *MockLibrariesInterface_DeleteDefaultBaseEnvironmentById_Call) Run(run func(ctx context.Context, id string)) *MockLibrariesInterface_DeleteDefaultBaseEnvironmentById_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockLibrariesInterface_DeleteDefaultBaseEnvironmentById_Call) Return(_a0 error) *MockLibrariesInterface_DeleteDefaultBaseEnvironmentById_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockLibrariesInterface_DeleteDefaultBaseEnvironmentById_Call) RunAndReturn(run func(context.Context, string) error) *MockLibrariesInterface_DeleteDefaultBaseEnvironmentById_Call { + _c.Call.Return(run) + return _c +} + // Install provides a mock function with given fields: ctx, request func (_m *MockLibrariesInterface) Install(ctx context.Context, request compute.InstallLibraries) error { ret := _m.Called(ctx, request) @@ -347,6 +500,208 @@ func (_c *MockLibrariesInterface_Install_Call) RunAndReturn(run func(context.Con return _c } +// ListDefaultBaseEnvironments provides a mock function with given fields: ctx, request +func (_m *MockLibrariesInterface) ListDefaultBaseEnvironments(ctx context.Context, request compute.ListDefaultBaseEnvironmentsRequest) listing.Iterator[compute.DefaultBaseEnvironment] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListDefaultBaseEnvironments") + } + + var r0 listing.Iterator[compute.DefaultBaseEnvironment] + if rf, ok := ret.Get(0).(func(context.Context, compute.ListDefaultBaseEnvironmentsRequest) listing.Iterator[compute.DefaultBaseEnvironment]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[compute.DefaultBaseEnvironment]) + } + } + + return r0 +} + +// MockLibrariesInterface_ListDefaultBaseEnvironments_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListDefaultBaseEnvironments' +type MockLibrariesInterface_ListDefaultBaseEnvironments_Call struct { + *mock.Call +} + +// ListDefaultBaseEnvironments is a helper method to define mock.On call +// - ctx context.Context +// - request compute.ListDefaultBaseEnvironmentsRequest +func (_e *MockLibrariesInterface_Expecter) ListDefaultBaseEnvironments(ctx interface{}, request interface{}) *MockLibrariesInterface_ListDefaultBaseEnvironments_Call { + return &MockLibrariesInterface_ListDefaultBaseEnvironments_Call{Call: _e.mock.On("ListDefaultBaseEnvironments", ctx, request)} +} + +func (_c *MockLibrariesInterface_ListDefaultBaseEnvironments_Call) Run(run func(ctx context.Context, request compute.ListDefaultBaseEnvironmentsRequest)) *MockLibrariesInterface_ListDefaultBaseEnvironments_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(compute.ListDefaultBaseEnvironmentsRequest)) + }) + return _c +} + +func (_c *MockLibrariesInterface_ListDefaultBaseEnvironments_Call) Return(_a0 listing.Iterator[compute.DefaultBaseEnvironment]) *MockLibrariesInterface_ListDefaultBaseEnvironments_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockLibrariesInterface_ListDefaultBaseEnvironments_Call) RunAndReturn(run func(context.Context, compute.ListDefaultBaseEnvironmentsRequest) listing.Iterator[compute.DefaultBaseEnvironment]) *MockLibrariesInterface_ListDefaultBaseEnvironments_Call { + _c.Call.Return(run) + return _c +} + +// ListDefaultBaseEnvironmentsAll provides a mock function with given fields: ctx, request +func (_m *MockLibrariesInterface) ListDefaultBaseEnvironmentsAll(ctx context.Context, request compute.ListDefaultBaseEnvironmentsRequest) ([]compute.DefaultBaseEnvironment, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListDefaultBaseEnvironmentsAll") + } + + var r0 []compute.DefaultBaseEnvironment + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, compute.ListDefaultBaseEnvironmentsRequest) ([]compute.DefaultBaseEnvironment, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, compute.ListDefaultBaseEnvironmentsRequest) []compute.DefaultBaseEnvironment); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]compute.DefaultBaseEnvironment) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, compute.ListDefaultBaseEnvironmentsRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockLibrariesInterface_ListDefaultBaseEnvironmentsAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListDefaultBaseEnvironmentsAll' +type MockLibrariesInterface_ListDefaultBaseEnvironmentsAll_Call struct { + *mock.Call +} + +// ListDefaultBaseEnvironmentsAll is a helper method to define mock.On call +// - ctx context.Context +// - request compute.ListDefaultBaseEnvironmentsRequest +func (_e *MockLibrariesInterface_Expecter) ListDefaultBaseEnvironmentsAll(ctx interface{}, request interface{}) *MockLibrariesInterface_ListDefaultBaseEnvironmentsAll_Call { + return &MockLibrariesInterface_ListDefaultBaseEnvironmentsAll_Call{Call: _e.mock.On("ListDefaultBaseEnvironmentsAll", ctx, request)} +} + +func (_c *MockLibrariesInterface_ListDefaultBaseEnvironmentsAll_Call) Run(run func(ctx context.Context, request compute.ListDefaultBaseEnvironmentsRequest)) *MockLibrariesInterface_ListDefaultBaseEnvironmentsAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(compute.ListDefaultBaseEnvironmentsRequest)) + }) + return _c +} + +func (_c *MockLibrariesInterface_ListDefaultBaseEnvironmentsAll_Call) Return(_a0 []compute.DefaultBaseEnvironment, _a1 error) *MockLibrariesInterface_ListDefaultBaseEnvironmentsAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockLibrariesInterface_ListDefaultBaseEnvironmentsAll_Call) RunAndReturn(run func(context.Context, compute.ListDefaultBaseEnvironmentsRequest) ([]compute.DefaultBaseEnvironment, error)) *MockLibrariesInterface_ListDefaultBaseEnvironmentsAll_Call { + _c.Call.Return(run) + return _c +} + +// RefreshDefaultBaseEnvironments provides a mock function with given fields: ctx, request +func (_m *MockLibrariesInterface) RefreshDefaultBaseEnvironments(ctx context.Context, request compute.RefreshDefaultBaseEnvironmentsRequest) error { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for RefreshDefaultBaseEnvironments") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, compute.RefreshDefaultBaseEnvironmentsRequest) error); ok { + r0 = rf(ctx, request) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockLibrariesInterface_RefreshDefaultBaseEnvironments_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RefreshDefaultBaseEnvironments' +type MockLibrariesInterface_RefreshDefaultBaseEnvironments_Call struct { + *mock.Call +} + +// RefreshDefaultBaseEnvironments is a helper method to define mock.On call +// - ctx context.Context +// - request compute.RefreshDefaultBaseEnvironmentsRequest +func (_e *MockLibrariesInterface_Expecter) RefreshDefaultBaseEnvironments(ctx interface{}, request interface{}) *MockLibrariesInterface_RefreshDefaultBaseEnvironments_Call { + return &MockLibrariesInterface_RefreshDefaultBaseEnvironments_Call{Call: _e.mock.On("RefreshDefaultBaseEnvironments", ctx, request)} +} + +func (_c *MockLibrariesInterface_RefreshDefaultBaseEnvironments_Call) Run(run func(ctx context.Context, request compute.RefreshDefaultBaseEnvironmentsRequest)) *MockLibrariesInterface_RefreshDefaultBaseEnvironments_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(compute.RefreshDefaultBaseEnvironmentsRequest)) + }) + return _c +} + +func (_c *MockLibrariesInterface_RefreshDefaultBaseEnvironments_Call) Return(_a0 error) *MockLibrariesInterface_RefreshDefaultBaseEnvironments_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockLibrariesInterface_RefreshDefaultBaseEnvironments_Call) RunAndReturn(run func(context.Context, compute.RefreshDefaultBaseEnvironmentsRequest) error) *MockLibrariesInterface_RefreshDefaultBaseEnvironments_Call { + _c.Call.Return(run) + return _c +} + +// RefreshDefaultBaseEnvironmentsByIds provides a mock function with given fields: ctx, ids +func (_m *MockLibrariesInterface) RefreshDefaultBaseEnvironmentsByIds(ctx context.Context, ids []string) error { + ret := _m.Called(ctx, ids) + + if len(ret) == 0 { + panic("no return value specified for RefreshDefaultBaseEnvironmentsByIds") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, []string) error); ok { + r0 = rf(ctx, ids) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockLibrariesInterface_RefreshDefaultBaseEnvironmentsByIds_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RefreshDefaultBaseEnvironmentsByIds' +type MockLibrariesInterface_RefreshDefaultBaseEnvironmentsByIds_Call struct { + *mock.Call +} + +// RefreshDefaultBaseEnvironmentsByIds is a helper method to define mock.On call +// - ctx context.Context +// - ids []string +func (_e *MockLibrariesInterface_Expecter) RefreshDefaultBaseEnvironmentsByIds(ctx interface{}, ids interface{}) *MockLibrariesInterface_RefreshDefaultBaseEnvironmentsByIds_Call { + return &MockLibrariesInterface_RefreshDefaultBaseEnvironmentsByIds_Call{Call: _e.mock.On("RefreshDefaultBaseEnvironmentsByIds", ctx, ids)} +} + +func (_c *MockLibrariesInterface_RefreshDefaultBaseEnvironmentsByIds_Call) Run(run func(ctx context.Context, ids []string)) *MockLibrariesInterface_RefreshDefaultBaseEnvironmentsByIds_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]string)) + }) + return _c +} + +func (_c *MockLibrariesInterface_RefreshDefaultBaseEnvironmentsByIds_Call) Return(_a0 error) *MockLibrariesInterface_RefreshDefaultBaseEnvironmentsByIds_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockLibrariesInterface_RefreshDefaultBaseEnvironmentsByIds_Call) RunAndReturn(run func(context.Context, []string) error) *MockLibrariesInterface_RefreshDefaultBaseEnvironmentsByIds_Call { + _c.Call.Return(run) + return _c +} + // Uninstall provides a mock function with given fields: ctx, request func (_m *MockLibrariesInterface) Uninstall(ctx context.Context, request compute.UninstallLibraries) error { ret := _m.Called(ctx, request) @@ -456,6 +811,65 @@ func (_c *MockLibrariesInterface_UpdateAndWait_Call) RunAndReturn(run func(conte return _c } +// UpdateDefaultBaseEnvironment provides a mock function with given fields: ctx, request +func (_m *MockLibrariesInterface) UpdateDefaultBaseEnvironment(ctx context.Context, request compute.UpdateDefaultBaseEnvironmentRequest) (*compute.DefaultBaseEnvironment, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for UpdateDefaultBaseEnvironment") + } + + var r0 *compute.DefaultBaseEnvironment + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, compute.UpdateDefaultBaseEnvironmentRequest) (*compute.DefaultBaseEnvironment, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, compute.UpdateDefaultBaseEnvironmentRequest) *compute.DefaultBaseEnvironment); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*compute.DefaultBaseEnvironment) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, compute.UpdateDefaultBaseEnvironmentRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockLibrariesInterface_UpdateDefaultBaseEnvironment_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateDefaultBaseEnvironment' +type MockLibrariesInterface_UpdateDefaultBaseEnvironment_Call struct { + *mock.Call +} + +// UpdateDefaultBaseEnvironment is a helper method to define mock.On call +// - ctx context.Context +// - request compute.UpdateDefaultBaseEnvironmentRequest +func (_e *MockLibrariesInterface_Expecter) UpdateDefaultBaseEnvironment(ctx interface{}, request interface{}) *MockLibrariesInterface_UpdateDefaultBaseEnvironment_Call { + return &MockLibrariesInterface_UpdateDefaultBaseEnvironment_Call{Call: _e.mock.On("UpdateDefaultBaseEnvironment", ctx, request)} +} + +func (_c *MockLibrariesInterface_UpdateDefaultBaseEnvironment_Call) Run(run func(ctx context.Context, request compute.UpdateDefaultBaseEnvironmentRequest)) *MockLibrariesInterface_UpdateDefaultBaseEnvironment_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(compute.UpdateDefaultBaseEnvironmentRequest)) + }) + return _c +} + +func (_c *MockLibrariesInterface_UpdateDefaultBaseEnvironment_Call) Return(_a0 *compute.DefaultBaseEnvironment, _a1 error) *MockLibrariesInterface_UpdateDefaultBaseEnvironment_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockLibrariesInterface_UpdateDefaultBaseEnvironment_Call) RunAndReturn(run func(context.Context, compute.UpdateDefaultBaseEnvironmentRequest) (*compute.DefaultBaseEnvironment, error)) *MockLibrariesInterface_UpdateDefaultBaseEnvironment_Call { + _c.Call.Return(run) + return _c +} + // NewMockLibrariesInterface creates a new instance of MockLibrariesInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockLibrariesInterface(t interface { diff --git a/experimental/mocks/service/dashboards/mock_genie_interface.go b/experimental/mocks/service/dashboards/mock_genie_interface.go index dc61f28e1..cb76b0adf 100644 --- a/experimental/mocks/service/dashboards/mock_genie_interface.go +++ b/experimental/mocks/service/dashboards/mock_genie_interface.go @@ -159,6 +159,101 @@ func (_c *MockGenieInterface_CreateMessageAndWait_Call) RunAndReturn(run func(co return _c } +// DeleteConversation provides a mock function with given fields: ctx, request +func (_m *MockGenieInterface) DeleteConversation(ctx context.Context, request dashboards.GenieDeleteConversationRequest) error { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for DeleteConversation") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, dashboards.GenieDeleteConversationRequest) error); ok { + r0 = rf(ctx, request) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockGenieInterface_DeleteConversation_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteConversation' +type MockGenieInterface_DeleteConversation_Call struct { + *mock.Call +} + +// DeleteConversation is a helper method to define mock.On call +// - ctx context.Context +// - request dashboards.GenieDeleteConversationRequest +func (_e *MockGenieInterface_Expecter) DeleteConversation(ctx interface{}, request interface{}) *MockGenieInterface_DeleteConversation_Call { + return &MockGenieInterface_DeleteConversation_Call{Call: _e.mock.On("DeleteConversation", ctx, request)} +} + +func (_c *MockGenieInterface_DeleteConversation_Call) Run(run func(ctx context.Context, request dashboards.GenieDeleteConversationRequest)) *MockGenieInterface_DeleteConversation_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(dashboards.GenieDeleteConversationRequest)) + }) + return _c +} + +func (_c *MockGenieInterface_DeleteConversation_Call) Return(_a0 error) *MockGenieInterface_DeleteConversation_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockGenieInterface_DeleteConversation_Call) RunAndReturn(run func(context.Context, dashboards.GenieDeleteConversationRequest) error) *MockGenieInterface_DeleteConversation_Call { + _c.Call.Return(run) + return _c +} + +// DeleteConversationBySpaceIdAndConversationId provides a mock function with given fields: ctx, spaceId, conversationId +func (_m *MockGenieInterface) DeleteConversationBySpaceIdAndConversationId(ctx context.Context, spaceId string, conversationId string) error { + ret := _m.Called(ctx, spaceId, conversationId) + + if len(ret) == 0 { + panic("no return value specified for DeleteConversationBySpaceIdAndConversationId") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { + r0 = rf(ctx, spaceId, conversationId) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockGenieInterface_DeleteConversationBySpaceIdAndConversationId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteConversationBySpaceIdAndConversationId' +type MockGenieInterface_DeleteConversationBySpaceIdAndConversationId_Call struct { + *mock.Call +} + +// DeleteConversationBySpaceIdAndConversationId is a helper method to define mock.On call +// - ctx context.Context +// - spaceId string +// - conversationId string +func (_e *MockGenieInterface_Expecter) DeleteConversationBySpaceIdAndConversationId(ctx interface{}, spaceId interface{}, conversationId interface{}) *MockGenieInterface_DeleteConversationBySpaceIdAndConversationId_Call { + return &MockGenieInterface_DeleteConversationBySpaceIdAndConversationId_Call{Call: _e.mock.On("DeleteConversationBySpaceIdAndConversationId", ctx, spaceId, conversationId)} +} + +func (_c *MockGenieInterface_DeleteConversationBySpaceIdAndConversationId_Call) Run(run func(ctx context.Context, spaceId string, conversationId string)) *MockGenieInterface_DeleteConversationBySpaceIdAndConversationId_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *MockGenieInterface_DeleteConversationBySpaceIdAndConversationId_Call) Return(_a0 error) *MockGenieInterface_DeleteConversationBySpaceIdAndConversationId_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockGenieInterface_DeleteConversationBySpaceIdAndConversationId_Call) RunAndReturn(run func(context.Context, string, string) error) *MockGenieInterface_DeleteConversationBySpaceIdAndConversationId_Call { + _c.Call.Return(run) + return _c +} + // ExecuteMessageAttachmentQuery provides a mock function with given fields: ctx, request func (_m *MockGenieInterface) ExecuteMessageAttachmentQuery(ctx context.Context, request dashboards.GenieExecuteMessageAttachmentQueryRequest) (*dashboards.GenieGetMessageQueryResultResponse, error) { ret := _m.Called(ctx, request) @@ -1058,6 +1153,124 @@ func (_c *MockGenieInterface_GetSpaceBySpaceId_Call) RunAndReturn(run func(conte return _c } +// ListConversations provides a mock function with given fields: ctx, request +func (_m *MockGenieInterface) ListConversations(ctx context.Context, request dashboards.GenieListConversationsRequest) (*dashboards.GenieListConversationsResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListConversations") + } + + var r0 *dashboards.GenieListConversationsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, dashboards.GenieListConversationsRequest) (*dashboards.GenieListConversationsResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, dashboards.GenieListConversationsRequest) *dashboards.GenieListConversationsResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*dashboards.GenieListConversationsResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, dashboards.GenieListConversationsRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGenieInterface_ListConversations_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListConversations' +type MockGenieInterface_ListConversations_Call struct { + *mock.Call +} + +// ListConversations is a helper method to define mock.On call +// - ctx context.Context +// - request dashboards.GenieListConversationsRequest +func (_e *MockGenieInterface_Expecter) ListConversations(ctx interface{}, request interface{}) *MockGenieInterface_ListConversations_Call { + return &MockGenieInterface_ListConversations_Call{Call: _e.mock.On("ListConversations", ctx, request)} +} + +func (_c *MockGenieInterface_ListConversations_Call) Run(run func(ctx context.Context, request dashboards.GenieListConversationsRequest)) *MockGenieInterface_ListConversations_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(dashboards.GenieListConversationsRequest)) + }) + return _c +} + +func (_c *MockGenieInterface_ListConversations_Call) Return(_a0 *dashboards.GenieListConversationsResponse, _a1 error) *MockGenieInterface_ListConversations_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGenieInterface_ListConversations_Call) RunAndReturn(run func(context.Context, dashboards.GenieListConversationsRequest) (*dashboards.GenieListConversationsResponse, error)) *MockGenieInterface_ListConversations_Call { + _c.Call.Return(run) + return _c +} + +// ListConversationsBySpaceId provides a mock function with given fields: ctx, spaceId +func (_m *MockGenieInterface) ListConversationsBySpaceId(ctx context.Context, spaceId string) (*dashboards.GenieListConversationsResponse, error) { + ret := _m.Called(ctx, spaceId) + + if len(ret) == 0 { + panic("no return value specified for ListConversationsBySpaceId") + } + + var r0 *dashboards.GenieListConversationsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*dashboards.GenieListConversationsResponse, error)); ok { + return rf(ctx, spaceId) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *dashboards.GenieListConversationsResponse); ok { + r0 = rf(ctx, spaceId) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*dashboards.GenieListConversationsResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, spaceId) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGenieInterface_ListConversationsBySpaceId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListConversationsBySpaceId' +type MockGenieInterface_ListConversationsBySpaceId_Call struct { + *mock.Call +} + +// ListConversationsBySpaceId is a helper method to define mock.On call +// - ctx context.Context +// - spaceId string +func (_e *MockGenieInterface_Expecter) ListConversationsBySpaceId(ctx interface{}, spaceId interface{}) *MockGenieInterface_ListConversationsBySpaceId_Call { + return &MockGenieInterface_ListConversationsBySpaceId_Call{Call: _e.mock.On("ListConversationsBySpaceId", ctx, spaceId)} +} + +func (_c *MockGenieInterface_ListConversationsBySpaceId_Call) Run(run func(ctx context.Context, spaceId string)) *MockGenieInterface_ListConversationsBySpaceId_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockGenieInterface_ListConversationsBySpaceId_Call) Return(_a0 *dashboards.GenieListConversationsResponse, _a1 error) *MockGenieInterface_ListConversationsBySpaceId_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGenieInterface_ListConversationsBySpaceId_Call) RunAndReturn(run func(context.Context, string) (*dashboards.GenieListConversationsResponse, error)) *MockGenieInterface_ListConversationsBySpaceId_Call { + _c.Call.Return(run) + return _c +} + // ListSpaces provides a mock function with given fields: ctx, request func (_m *MockGenieInterface) ListSpaces(ctx context.Context, request dashboards.GenieListSpacesRequest) (*dashboards.GenieListSpacesResponse, error) { ret := _m.Called(ctx, request) @@ -1250,6 +1463,100 @@ func (_c *MockGenieInterface_StartConversationAndWait_Call) RunAndReturn(run fun return _c } +// TrashSpace provides a mock function with given fields: ctx, request +func (_m *MockGenieInterface) TrashSpace(ctx context.Context, request dashboards.GenieTrashSpaceRequest) error { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for TrashSpace") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, dashboards.GenieTrashSpaceRequest) error); ok { + r0 = rf(ctx, request) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockGenieInterface_TrashSpace_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TrashSpace' +type MockGenieInterface_TrashSpace_Call struct { + *mock.Call +} + +// TrashSpace is a helper method to define mock.On call +// - ctx context.Context +// - request dashboards.GenieTrashSpaceRequest +func (_e *MockGenieInterface_Expecter) TrashSpace(ctx interface{}, request interface{}) *MockGenieInterface_TrashSpace_Call { + return &MockGenieInterface_TrashSpace_Call{Call: _e.mock.On("TrashSpace", ctx, request)} +} + +func (_c *MockGenieInterface_TrashSpace_Call) Run(run func(ctx context.Context, request dashboards.GenieTrashSpaceRequest)) *MockGenieInterface_TrashSpace_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(dashboards.GenieTrashSpaceRequest)) + }) + return _c +} + +func (_c *MockGenieInterface_TrashSpace_Call) Return(_a0 error) *MockGenieInterface_TrashSpace_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockGenieInterface_TrashSpace_Call) RunAndReturn(run func(context.Context, dashboards.GenieTrashSpaceRequest) error) *MockGenieInterface_TrashSpace_Call { + _c.Call.Return(run) + return _c +} + +// TrashSpaceBySpaceId provides a mock function with given fields: ctx, spaceId +func (_m *MockGenieInterface) TrashSpaceBySpaceId(ctx context.Context, spaceId string) error { + ret := _m.Called(ctx, spaceId) + + if len(ret) == 0 { + panic("no return value specified for TrashSpaceBySpaceId") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = rf(ctx, spaceId) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockGenieInterface_TrashSpaceBySpaceId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TrashSpaceBySpaceId' +type MockGenieInterface_TrashSpaceBySpaceId_Call struct { + *mock.Call +} + +// TrashSpaceBySpaceId is a helper method to define mock.On call +// - ctx context.Context +// - spaceId string +func (_e *MockGenieInterface_Expecter) TrashSpaceBySpaceId(ctx interface{}, spaceId interface{}) *MockGenieInterface_TrashSpaceBySpaceId_Call { + return &MockGenieInterface_TrashSpaceBySpaceId_Call{Call: _e.mock.On("TrashSpaceBySpaceId", ctx, spaceId)} +} + +func (_c *MockGenieInterface_TrashSpaceBySpaceId_Call) Run(run func(ctx context.Context, spaceId string)) *MockGenieInterface_TrashSpaceBySpaceId_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockGenieInterface_TrashSpaceBySpaceId_Call) Return(_a0 error) *MockGenieInterface_TrashSpaceBySpaceId_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockGenieInterface_TrashSpaceBySpaceId_Call) RunAndReturn(run func(context.Context, string) error) *MockGenieInterface_TrashSpaceBySpaceId_Call { + _c.Call.Return(run) + return _c +} + // WaitGetMessageGenieCompleted provides a mock function with given fields: ctx, conversationId, messageId, spaceId, timeout, callback func (_m *MockGenieInterface) WaitGetMessageGenieCompleted(ctx context.Context, conversationId string, messageId string, spaceId string, timeout time.Duration, callback func(*dashboards.GenieMessage)) (*dashboards.GenieMessage, error) { ret := _m.Called(ctx, conversationId, messageId, spaceId, timeout, callback) diff --git a/experimental/mocks/service/dashboards/mock_lakeview_embedded_interface.go b/experimental/mocks/service/dashboards/mock_lakeview_embedded_interface.go index eea99e9b6..51479c6ef 100644 --- a/experimental/mocks/service/dashboards/mock_lakeview_embedded_interface.go +++ b/experimental/mocks/service/dashboards/mock_lakeview_embedded_interface.go @@ -22,6 +22,100 @@ func (_m *MockLakeviewEmbeddedInterface) EXPECT() *MockLakeviewEmbeddedInterface return &MockLakeviewEmbeddedInterface_Expecter{mock: &_m.Mock} } +// GetPublishedDashboardEmbedded provides a mock function with given fields: ctx, request +func (_m *MockLakeviewEmbeddedInterface) GetPublishedDashboardEmbedded(ctx context.Context, request dashboards.GetPublishedDashboardEmbeddedRequest) error { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for GetPublishedDashboardEmbedded") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, dashboards.GetPublishedDashboardEmbeddedRequest) error); ok { + r0 = rf(ctx, request) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockLakeviewEmbeddedInterface_GetPublishedDashboardEmbedded_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPublishedDashboardEmbedded' +type MockLakeviewEmbeddedInterface_GetPublishedDashboardEmbedded_Call struct { + *mock.Call +} + +// GetPublishedDashboardEmbedded is a helper method to define mock.On call +// - ctx context.Context +// - request dashboards.GetPublishedDashboardEmbeddedRequest +func (_e *MockLakeviewEmbeddedInterface_Expecter) GetPublishedDashboardEmbedded(ctx interface{}, request interface{}) *MockLakeviewEmbeddedInterface_GetPublishedDashboardEmbedded_Call { + return &MockLakeviewEmbeddedInterface_GetPublishedDashboardEmbedded_Call{Call: _e.mock.On("GetPublishedDashboardEmbedded", ctx, request)} +} + +func (_c *MockLakeviewEmbeddedInterface_GetPublishedDashboardEmbedded_Call) Run(run func(ctx context.Context, request dashboards.GetPublishedDashboardEmbeddedRequest)) *MockLakeviewEmbeddedInterface_GetPublishedDashboardEmbedded_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(dashboards.GetPublishedDashboardEmbeddedRequest)) + }) + return _c +} + +func (_c *MockLakeviewEmbeddedInterface_GetPublishedDashboardEmbedded_Call) Return(_a0 error) *MockLakeviewEmbeddedInterface_GetPublishedDashboardEmbedded_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockLakeviewEmbeddedInterface_GetPublishedDashboardEmbedded_Call) RunAndReturn(run func(context.Context, dashboards.GetPublishedDashboardEmbeddedRequest) error) *MockLakeviewEmbeddedInterface_GetPublishedDashboardEmbedded_Call { + _c.Call.Return(run) + return _c +} + +// GetPublishedDashboardEmbeddedByDashboardId provides a mock function with given fields: ctx, dashboardId +func (_m *MockLakeviewEmbeddedInterface) GetPublishedDashboardEmbeddedByDashboardId(ctx context.Context, dashboardId string) error { + ret := _m.Called(ctx, dashboardId) + + if len(ret) == 0 { + panic("no return value specified for GetPublishedDashboardEmbeddedByDashboardId") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = rf(ctx, dashboardId) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockLakeviewEmbeddedInterface_GetPublishedDashboardEmbeddedByDashboardId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPublishedDashboardEmbeddedByDashboardId' +type MockLakeviewEmbeddedInterface_GetPublishedDashboardEmbeddedByDashboardId_Call struct { + *mock.Call +} + +// GetPublishedDashboardEmbeddedByDashboardId is a helper method to define mock.On call +// - ctx context.Context +// - dashboardId string +func (_e *MockLakeviewEmbeddedInterface_Expecter) GetPublishedDashboardEmbeddedByDashboardId(ctx interface{}, dashboardId interface{}) *MockLakeviewEmbeddedInterface_GetPublishedDashboardEmbeddedByDashboardId_Call { + return &MockLakeviewEmbeddedInterface_GetPublishedDashboardEmbeddedByDashboardId_Call{Call: _e.mock.On("GetPublishedDashboardEmbeddedByDashboardId", ctx, dashboardId)} +} + +func (_c *MockLakeviewEmbeddedInterface_GetPublishedDashboardEmbeddedByDashboardId_Call) Run(run func(ctx context.Context, dashboardId string)) *MockLakeviewEmbeddedInterface_GetPublishedDashboardEmbeddedByDashboardId_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockLakeviewEmbeddedInterface_GetPublishedDashboardEmbeddedByDashboardId_Call) Return(_a0 error) *MockLakeviewEmbeddedInterface_GetPublishedDashboardEmbeddedByDashboardId_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockLakeviewEmbeddedInterface_GetPublishedDashboardEmbeddedByDashboardId_Call) RunAndReturn(run func(context.Context, string) error) *MockLakeviewEmbeddedInterface_GetPublishedDashboardEmbeddedByDashboardId_Call { + _c.Call.Return(run) + return _c +} + // GetPublishedDashboardTokenInfo provides a mock function with given fields: ctx, request func (_m *MockLakeviewEmbeddedInterface) GetPublishedDashboardTokenInfo(ctx context.Context, request dashboards.GetPublishedDashboardTokenInfoRequest) (*dashboards.GetPublishedDashboardTokenInfoResponse, error) { ret := _m.Called(ctx, request) diff --git a/experimental/mocks/service/dashboards/mock_query_execution_interface.go b/experimental/mocks/service/dashboards/mock_query_execution_interface.go new file mode 100644 index 000000000..ead40a712 --- /dev/null +++ b/experimental/mocks/service/dashboards/mock_query_execution_interface.go @@ -0,0 +1,202 @@ +// Code generated by mockery v2.53.2. DO NOT EDIT. + +package dashboards + +import ( + context "context" + + dashboards "github.com/databricks/databricks-sdk-go/service/dashboards" + mock "github.com/stretchr/testify/mock" +) + +// MockQueryExecutionInterface is an autogenerated mock type for the QueryExecutionInterface type +type MockQueryExecutionInterface struct { + mock.Mock +} + +type MockQueryExecutionInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *MockQueryExecutionInterface) EXPECT() *MockQueryExecutionInterface_Expecter { + return &MockQueryExecutionInterface_Expecter{mock: &_m.Mock} +} + +// CancelPublishedQueryExecution provides a mock function with given fields: ctx, request +func (_m *MockQueryExecutionInterface) CancelPublishedQueryExecution(ctx context.Context, request dashboards.CancelPublishedQueryExecutionRequest) (*dashboards.CancelQueryExecutionResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for CancelPublishedQueryExecution") + } + + var r0 *dashboards.CancelQueryExecutionResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, dashboards.CancelPublishedQueryExecutionRequest) (*dashboards.CancelQueryExecutionResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, dashboards.CancelPublishedQueryExecutionRequest) *dashboards.CancelQueryExecutionResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*dashboards.CancelQueryExecutionResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, dashboards.CancelPublishedQueryExecutionRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockQueryExecutionInterface_CancelPublishedQueryExecution_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CancelPublishedQueryExecution' +type MockQueryExecutionInterface_CancelPublishedQueryExecution_Call struct { + *mock.Call +} + +// CancelPublishedQueryExecution is a helper method to define mock.On call +// - ctx context.Context +// - request dashboards.CancelPublishedQueryExecutionRequest +func (_e *MockQueryExecutionInterface_Expecter) CancelPublishedQueryExecution(ctx interface{}, request interface{}) *MockQueryExecutionInterface_CancelPublishedQueryExecution_Call { + return &MockQueryExecutionInterface_CancelPublishedQueryExecution_Call{Call: _e.mock.On("CancelPublishedQueryExecution", ctx, request)} +} + +func (_c *MockQueryExecutionInterface_CancelPublishedQueryExecution_Call) Run(run func(ctx context.Context, request dashboards.CancelPublishedQueryExecutionRequest)) *MockQueryExecutionInterface_CancelPublishedQueryExecution_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(dashboards.CancelPublishedQueryExecutionRequest)) + }) + return _c +} + +func (_c *MockQueryExecutionInterface_CancelPublishedQueryExecution_Call) Return(_a0 *dashboards.CancelQueryExecutionResponse, _a1 error) *MockQueryExecutionInterface_CancelPublishedQueryExecution_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockQueryExecutionInterface_CancelPublishedQueryExecution_Call) RunAndReturn(run func(context.Context, dashboards.CancelPublishedQueryExecutionRequest) (*dashboards.CancelQueryExecutionResponse, error)) *MockQueryExecutionInterface_CancelPublishedQueryExecution_Call { + _c.Call.Return(run) + return _c +} + +// ExecutePublishedDashboardQuery provides a mock function with given fields: ctx, request +func (_m *MockQueryExecutionInterface) ExecutePublishedDashboardQuery(ctx context.Context, request dashboards.ExecutePublishedDashboardQueryRequest) error { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ExecutePublishedDashboardQuery") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, dashboards.ExecutePublishedDashboardQueryRequest) error); ok { + r0 = rf(ctx, request) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockQueryExecutionInterface_ExecutePublishedDashboardQuery_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExecutePublishedDashboardQuery' +type MockQueryExecutionInterface_ExecutePublishedDashboardQuery_Call struct { + *mock.Call +} + +// ExecutePublishedDashboardQuery is a helper method to define mock.On call +// - ctx context.Context +// - request dashboards.ExecutePublishedDashboardQueryRequest +func (_e *MockQueryExecutionInterface_Expecter) ExecutePublishedDashboardQuery(ctx interface{}, request interface{}) *MockQueryExecutionInterface_ExecutePublishedDashboardQuery_Call { + return &MockQueryExecutionInterface_ExecutePublishedDashboardQuery_Call{Call: _e.mock.On("ExecutePublishedDashboardQuery", ctx, request)} +} + +func (_c *MockQueryExecutionInterface_ExecutePublishedDashboardQuery_Call) Run(run func(ctx context.Context, request dashboards.ExecutePublishedDashboardQueryRequest)) *MockQueryExecutionInterface_ExecutePublishedDashboardQuery_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(dashboards.ExecutePublishedDashboardQueryRequest)) + }) + return _c +} + +func (_c *MockQueryExecutionInterface_ExecutePublishedDashboardQuery_Call) Return(_a0 error) *MockQueryExecutionInterface_ExecutePublishedDashboardQuery_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockQueryExecutionInterface_ExecutePublishedDashboardQuery_Call) RunAndReturn(run func(context.Context, dashboards.ExecutePublishedDashboardQueryRequest) error) *MockQueryExecutionInterface_ExecutePublishedDashboardQuery_Call { + _c.Call.Return(run) + return _c +} + +// PollPublishedQueryStatus provides a mock function with given fields: ctx, request +func (_m *MockQueryExecutionInterface) PollPublishedQueryStatus(ctx context.Context, request dashboards.PollPublishedQueryStatusRequest) (*dashboards.PollQueryStatusResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for PollPublishedQueryStatus") + } + + var r0 *dashboards.PollQueryStatusResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, dashboards.PollPublishedQueryStatusRequest) (*dashboards.PollQueryStatusResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, dashboards.PollPublishedQueryStatusRequest) *dashboards.PollQueryStatusResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*dashboards.PollQueryStatusResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, dashboards.PollPublishedQueryStatusRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockQueryExecutionInterface_PollPublishedQueryStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PollPublishedQueryStatus' +type MockQueryExecutionInterface_PollPublishedQueryStatus_Call struct { + *mock.Call +} + +// PollPublishedQueryStatus is a helper method to define mock.On call +// - ctx context.Context +// - request dashboards.PollPublishedQueryStatusRequest +func (_e *MockQueryExecutionInterface_Expecter) PollPublishedQueryStatus(ctx interface{}, request interface{}) *MockQueryExecutionInterface_PollPublishedQueryStatus_Call { + return &MockQueryExecutionInterface_PollPublishedQueryStatus_Call{Call: _e.mock.On("PollPublishedQueryStatus", ctx, request)} +} + +func (_c *MockQueryExecutionInterface_PollPublishedQueryStatus_Call) Run(run func(ctx context.Context, request dashboards.PollPublishedQueryStatusRequest)) *MockQueryExecutionInterface_PollPublishedQueryStatus_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(dashboards.PollPublishedQueryStatusRequest)) + }) + return _c +} + +func (_c *MockQueryExecutionInterface_PollPublishedQueryStatus_Call) Return(_a0 *dashboards.PollQueryStatusResponse, _a1 error) *MockQueryExecutionInterface_PollPublishedQueryStatus_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockQueryExecutionInterface_PollPublishedQueryStatus_Call) RunAndReturn(run func(context.Context, dashboards.PollPublishedQueryStatusRequest) (*dashboards.PollQueryStatusResponse, error)) *MockQueryExecutionInterface_PollPublishedQueryStatus_Call { + _c.Call.Return(run) + return _c +} + +// NewMockQueryExecutionInterface creates a new instance of MockQueryExecutionInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockQueryExecutionInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *MockQueryExecutionInterface { + mock := &MockQueryExecutionInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/experimental/mocks/service/database/mock_database_interface.go b/experimental/mocks/service/database/mock_database_interface.go index f9c35d348..7c602ce22 100644 --- a/experimental/mocks/service/database/mock_database_interface.go +++ b/experimental/mocks/service/database/mock_database_interface.go @@ -142,6 +142,65 @@ func (_c *MockDatabaseInterface_CreateDatabaseInstance_Call) RunAndReturn(run fu return _c } +// CreateDatabaseInstanceRole provides a mock function with given fields: ctx, request +func (_m *MockDatabaseInterface) CreateDatabaseInstanceRole(ctx context.Context, request database.CreateDatabaseInstanceRoleRequest) (*database.DatabaseInstanceRole, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for CreateDatabaseInstanceRole") + } + + var r0 *database.DatabaseInstanceRole + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, database.CreateDatabaseInstanceRoleRequest) (*database.DatabaseInstanceRole, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, database.CreateDatabaseInstanceRoleRequest) *database.DatabaseInstanceRole); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*database.DatabaseInstanceRole) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, database.CreateDatabaseInstanceRoleRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockDatabaseInterface_CreateDatabaseInstanceRole_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateDatabaseInstanceRole' +type MockDatabaseInterface_CreateDatabaseInstanceRole_Call struct { + *mock.Call +} + +// CreateDatabaseInstanceRole is a helper method to define mock.On call +// - ctx context.Context +// - request database.CreateDatabaseInstanceRoleRequest +func (_e *MockDatabaseInterface_Expecter) CreateDatabaseInstanceRole(ctx interface{}, request interface{}) *MockDatabaseInterface_CreateDatabaseInstanceRole_Call { + return &MockDatabaseInterface_CreateDatabaseInstanceRole_Call{Call: _e.mock.On("CreateDatabaseInstanceRole", ctx, request)} +} + +func (_c *MockDatabaseInterface_CreateDatabaseInstanceRole_Call) Run(run func(ctx context.Context, request database.CreateDatabaseInstanceRoleRequest)) *MockDatabaseInterface_CreateDatabaseInstanceRole_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(database.CreateDatabaseInstanceRoleRequest)) + }) + return _c +} + +func (_c *MockDatabaseInterface_CreateDatabaseInstanceRole_Call) Return(_a0 *database.DatabaseInstanceRole, _a1 error) *MockDatabaseInterface_CreateDatabaseInstanceRole_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockDatabaseInterface_CreateDatabaseInstanceRole_Call) RunAndReturn(run func(context.Context, database.CreateDatabaseInstanceRoleRequest) (*database.DatabaseInstanceRole, error)) *MockDatabaseInterface_CreateDatabaseInstanceRole_Call { + _c.Call.Return(run) + return _c +} + // CreateDatabaseTable provides a mock function with given fields: ctx, request func (_m *MockDatabaseInterface) CreateDatabaseTable(ctx context.Context, request database.CreateDatabaseTableRequest) (*database.DatabaseTable, error) { ret := _m.Called(ctx, request) @@ -448,6 +507,101 @@ func (_c *MockDatabaseInterface_DeleteDatabaseInstanceByName_Call) RunAndReturn( return _c } +// DeleteDatabaseInstanceRole provides a mock function with given fields: ctx, request +func (_m *MockDatabaseInterface) DeleteDatabaseInstanceRole(ctx context.Context, request database.DeleteDatabaseInstanceRoleRequest) error { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for DeleteDatabaseInstanceRole") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, database.DeleteDatabaseInstanceRoleRequest) error); ok { + r0 = rf(ctx, request) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockDatabaseInterface_DeleteDatabaseInstanceRole_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteDatabaseInstanceRole' +type MockDatabaseInterface_DeleteDatabaseInstanceRole_Call struct { + *mock.Call +} + +// DeleteDatabaseInstanceRole is a helper method to define mock.On call +// - ctx context.Context +// - request database.DeleteDatabaseInstanceRoleRequest +func (_e *MockDatabaseInterface_Expecter) DeleteDatabaseInstanceRole(ctx interface{}, request interface{}) *MockDatabaseInterface_DeleteDatabaseInstanceRole_Call { + return &MockDatabaseInterface_DeleteDatabaseInstanceRole_Call{Call: _e.mock.On("DeleteDatabaseInstanceRole", ctx, request)} +} + +func (_c *MockDatabaseInterface_DeleteDatabaseInstanceRole_Call) Run(run func(ctx context.Context, request database.DeleteDatabaseInstanceRoleRequest)) *MockDatabaseInterface_DeleteDatabaseInstanceRole_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(database.DeleteDatabaseInstanceRoleRequest)) + }) + return _c +} + +func (_c *MockDatabaseInterface_DeleteDatabaseInstanceRole_Call) Return(_a0 error) *MockDatabaseInterface_DeleteDatabaseInstanceRole_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockDatabaseInterface_DeleteDatabaseInstanceRole_Call) RunAndReturn(run func(context.Context, database.DeleteDatabaseInstanceRoleRequest) error) *MockDatabaseInterface_DeleteDatabaseInstanceRole_Call { + _c.Call.Return(run) + return _c +} + +// DeleteDatabaseInstanceRoleByInstanceNameAndName provides a mock function with given fields: ctx, instanceName, name +func (_m *MockDatabaseInterface) DeleteDatabaseInstanceRoleByInstanceNameAndName(ctx context.Context, instanceName string, name string) error { + ret := _m.Called(ctx, instanceName, name) + + if len(ret) == 0 { + panic("no return value specified for DeleteDatabaseInstanceRoleByInstanceNameAndName") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { + r0 = rf(ctx, instanceName, name) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockDatabaseInterface_DeleteDatabaseInstanceRoleByInstanceNameAndName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteDatabaseInstanceRoleByInstanceNameAndName' +type MockDatabaseInterface_DeleteDatabaseInstanceRoleByInstanceNameAndName_Call struct { + *mock.Call +} + +// DeleteDatabaseInstanceRoleByInstanceNameAndName is a helper method to define mock.On call +// - ctx context.Context +// - instanceName string +// - name string +func (_e *MockDatabaseInterface_Expecter) DeleteDatabaseInstanceRoleByInstanceNameAndName(ctx interface{}, instanceName interface{}, name interface{}) *MockDatabaseInterface_DeleteDatabaseInstanceRoleByInstanceNameAndName_Call { + return &MockDatabaseInterface_DeleteDatabaseInstanceRoleByInstanceNameAndName_Call{Call: _e.mock.On("DeleteDatabaseInstanceRoleByInstanceNameAndName", ctx, instanceName, name)} +} + +func (_c *MockDatabaseInterface_DeleteDatabaseInstanceRoleByInstanceNameAndName_Call) Run(run func(ctx context.Context, instanceName string, name string)) *MockDatabaseInterface_DeleteDatabaseInstanceRoleByInstanceNameAndName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *MockDatabaseInterface_DeleteDatabaseInstanceRoleByInstanceNameAndName_Call) Return(_a0 error) *MockDatabaseInterface_DeleteDatabaseInstanceRoleByInstanceNameAndName_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockDatabaseInterface_DeleteDatabaseInstanceRoleByInstanceNameAndName_Call) RunAndReturn(run func(context.Context, string, string) error) *MockDatabaseInterface_DeleteDatabaseInstanceRoleByInstanceNameAndName_Call { + _c.Call.Return(run) + return _c +} + // DeleteDatabaseTable provides a mock function with given fields: ctx, request func (_m *MockDatabaseInterface) DeleteDatabaseTable(ctx context.Context, request database.DeleteDatabaseTableRequest) error { ret := _m.Called(ctx, request) @@ -636,6 +790,65 @@ func (_c *MockDatabaseInterface_DeleteSyncedDatabaseTableByName_Call) RunAndRetu return _c } +// FailoverDatabaseInstance provides a mock function with given fields: ctx, request +func (_m *MockDatabaseInterface) FailoverDatabaseInstance(ctx context.Context, request database.FailoverDatabaseInstanceRequest) (*database.DatabaseInstance, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for FailoverDatabaseInstance") + } + + var r0 *database.DatabaseInstance + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, database.FailoverDatabaseInstanceRequest) (*database.DatabaseInstance, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, database.FailoverDatabaseInstanceRequest) *database.DatabaseInstance); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*database.DatabaseInstance) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, database.FailoverDatabaseInstanceRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockDatabaseInterface_FailoverDatabaseInstance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FailoverDatabaseInstance' +type MockDatabaseInterface_FailoverDatabaseInstance_Call struct { + *mock.Call +} + +// FailoverDatabaseInstance is a helper method to define mock.On call +// - ctx context.Context +// - request database.FailoverDatabaseInstanceRequest +func (_e *MockDatabaseInterface_Expecter) FailoverDatabaseInstance(ctx interface{}, request interface{}) *MockDatabaseInterface_FailoverDatabaseInstance_Call { + return &MockDatabaseInterface_FailoverDatabaseInstance_Call{Call: _e.mock.On("FailoverDatabaseInstance", ctx, request)} +} + +func (_c *MockDatabaseInterface_FailoverDatabaseInstance_Call) Run(run func(ctx context.Context, request database.FailoverDatabaseInstanceRequest)) *MockDatabaseInterface_FailoverDatabaseInstance_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(database.FailoverDatabaseInstanceRequest)) + }) + return _c +} + +func (_c *MockDatabaseInterface_FailoverDatabaseInstance_Call) Return(_a0 *database.DatabaseInstance, _a1 error) *MockDatabaseInterface_FailoverDatabaseInstance_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockDatabaseInterface_FailoverDatabaseInstance_Call) RunAndReturn(run func(context.Context, database.FailoverDatabaseInstanceRequest) (*database.DatabaseInstance, error)) *MockDatabaseInterface_FailoverDatabaseInstance_Call { + _c.Call.Return(run) + return _c +} + // FindDatabaseInstanceByUid provides a mock function with given fields: ctx, request func (_m *MockDatabaseInterface) FindDatabaseInstanceByUid(ctx context.Context, request database.FindDatabaseInstanceByUidRequest) (*database.DatabaseInstance, error) { ret := _m.Called(ctx, request) @@ -990,6 +1203,125 @@ func (_c *MockDatabaseInterface_GetDatabaseInstanceByName_Call) RunAndReturn(run return _c } +// GetDatabaseInstanceRole provides a mock function with given fields: ctx, request +func (_m *MockDatabaseInterface) GetDatabaseInstanceRole(ctx context.Context, request database.GetDatabaseInstanceRoleRequest) (*database.DatabaseInstanceRole, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for GetDatabaseInstanceRole") + } + + var r0 *database.DatabaseInstanceRole + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, database.GetDatabaseInstanceRoleRequest) (*database.DatabaseInstanceRole, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, database.GetDatabaseInstanceRoleRequest) *database.DatabaseInstanceRole); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*database.DatabaseInstanceRole) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, database.GetDatabaseInstanceRoleRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockDatabaseInterface_GetDatabaseInstanceRole_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDatabaseInstanceRole' +type MockDatabaseInterface_GetDatabaseInstanceRole_Call struct { + *mock.Call +} + +// GetDatabaseInstanceRole is a helper method to define mock.On call +// - ctx context.Context +// - request database.GetDatabaseInstanceRoleRequest +func (_e *MockDatabaseInterface_Expecter) GetDatabaseInstanceRole(ctx interface{}, request interface{}) *MockDatabaseInterface_GetDatabaseInstanceRole_Call { + return &MockDatabaseInterface_GetDatabaseInstanceRole_Call{Call: _e.mock.On("GetDatabaseInstanceRole", ctx, request)} +} + +func (_c *MockDatabaseInterface_GetDatabaseInstanceRole_Call) Run(run func(ctx context.Context, request database.GetDatabaseInstanceRoleRequest)) *MockDatabaseInterface_GetDatabaseInstanceRole_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(database.GetDatabaseInstanceRoleRequest)) + }) + return _c +} + +func (_c *MockDatabaseInterface_GetDatabaseInstanceRole_Call) Return(_a0 *database.DatabaseInstanceRole, _a1 error) *MockDatabaseInterface_GetDatabaseInstanceRole_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockDatabaseInterface_GetDatabaseInstanceRole_Call) RunAndReturn(run func(context.Context, database.GetDatabaseInstanceRoleRequest) (*database.DatabaseInstanceRole, error)) *MockDatabaseInterface_GetDatabaseInstanceRole_Call { + _c.Call.Return(run) + return _c +} + +// GetDatabaseInstanceRoleByInstanceNameAndName provides a mock function with given fields: ctx, instanceName, name +func (_m *MockDatabaseInterface) GetDatabaseInstanceRoleByInstanceNameAndName(ctx context.Context, instanceName string, name string) (*database.DatabaseInstanceRole, error) { + ret := _m.Called(ctx, instanceName, name) + + if len(ret) == 0 { + panic("no return value specified for GetDatabaseInstanceRoleByInstanceNameAndName") + } + + var r0 *database.DatabaseInstanceRole + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) (*database.DatabaseInstanceRole, error)); ok { + return rf(ctx, instanceName, name) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string) *database.DatabaseInstanceRole); ok { + r0 = rf(ctx, instanceName, name) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*database.DatabaseInstanceRole) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = rf(ctx, instanceName, name) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockDatabaseInterface_GetDatabaseInstanceRoleByInstanceNameAndName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDatabaseInstanceRoleByInstanceNameAndName' +type MockDatabaseInterface_GetDatabaseInstanceRoleByInstanceNameAndName_Call struct { + *mock.Call +} + +// GetDatabaseInstanceRoleByInstanceNameAndName is a helper method to define mock.On call +// - ctx context.Context +// - instanceName string +// - name string +func (_e *MockDatabaseInterface_Expecter) GetDatabaseInstanceRoleByInstanceNameAndName(ctx interface{}, instanceName interface{}, name interface{}) *MockDatabaseInterface_GetDatabaseInstanceRoleByInstanceNameAndName_Call { + return &MockDatabaseInterface_GetDatabaseInstanceRoleByInstanceNameAndName_Call{Call: _e.mock.On("GetDatabaseInstanceRoleByInstanceNameAndName", ctx, instanceName, name)} +} + +func (_c *MockDatabaseInterface_GetDatabaseInstanceRoleByInstanceNameAndName_Call) Run(run func(ctx context.Context, instanceName string, name string)) *MockDatabaseInterface_GetDatabaseInstanceRoleByInstanceNameAndName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *MockDatabaseInterface_GetDatabaseInstanceRoleByInstanceNameAndName_Call) Return(_a0 *database.DatabaseInstanceRole, _a1 error) *MockDatabaseInterface_GetDatabaseInstanceRoleByInstanceNameAndName_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockDatabaseInterface_GetDatabaseInstanceRoleByInstanceNameAndName_Call) RunAndReturn(run func(context.Context, string, string) (*database.DatabaseInstanceRole, error)) *MockDatabaseInterface_GetDatabaseInstanceRoleByInstanceNameAndName_Call { + _c.Call.Return(run) + return _c +} + // GetDatabaseTable provides a mock function with given fields: ctx, request func (_m *MockDatabaseInterface) GetDatabaseTable(ctx context.Context, request database.GetDatabaseTableRequest) (*database.DatabaseTable, error) { ret := _m.Called(ctx, request) @@ -1226,77 +1558,77 @@ func (_c *MockDatabaseInterface_GetSyncedDatabaseTableByName_Call) RunAndReturn( return _c } -// ListDatabaseInstances provides a mock function with given fields: ctx, request -func (_m *MockDatabaseInterface) ListDatabaseInstances(ctx context.Context, request database.ListDatabaseInstancesRequest) listing.Iterator[database.DatabaseInstance] { +// ListDatabaseCatalogs provides a mock function with given fields: ctx, request +func (_m *MockDatabaseInterface) ListDatabaseCatalogs(ctx context.Context, request database.ListDatabaseCatalogsRequest) listing.Iterator[database.DatabaseCatalog] { ret := _m.Called(ctx, request) if len(ret) == 0 { - panic("no return value specified for ListDatabaseInstances") + panic("no return value specified for ListDatabaseCatalogs") } - var r0 listing.Iterator[database.DatabaseInstance] - if rf, ok := ret.Get(0).(func(context.Context, database.ListDatabaseInstancesRequest) listing.Iterator[database.DatabaseInstance]); ok { + var r0 listing.Iterator[database.DatabaseCatalog] + if rf, ok := ret.Get(0).(func(context.Context, database.ListDatabaseCatalogsRequest) listing.Iterator[database.DatabaseCatalog]); ok { r0 = rf(ctx, request) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(listing.Iterator[database.DatabaseInstance]) + r0 = ret.Get(0).(listing.Iterator[database.DatabaseCatalog]) } } return r0 } -// MockDatabaseInterface_ListDatabaseInstances_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListDatabaseInstances' -type MockDatabaseInterface_ListDatabaseInstances_Call struct { +// MockDatabaseInterface_ListDatabaseCatalogs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListDatabaseCatalogs' +type MockDatabaseInterface_ListDatabaseCatalogs_Call struct { *mock.Call } -// ListDatabaseInstances is a helper method to define mock.On call +// ListDatabaseCatalogs is a helper method to define mock.On call // - ctx context.Context -// - request database.ListDatabaseInstancesRequest -func (_e *MockDatabaseInterface_Expecter) ListDatabaseInstances(ctx interface{}, request interface{}) *MockDatabaseInterface_ListDatabaseInstances_Call { - return &MockDatabaseInterface_ListDatabaseInstances_Call{Call: _e.mock.On("ListDatabaseInstances", ctx, request)} +// - request database.ListDatabaseCatalogsRequest +func (_e *MockDatabaseInterface_Expecter) ListDatabaseCatalogs(ctx interface{}, request interface{}) *MockDatabaseInterface_ListDatabaseCatalogs_Call { + return &MockDatabaseInterface_ListDatabaseCatalogs_Call{Call: _e.mock.On("ListDatabaseCatalogs", ctx, request)} } -func (_c *MockDatabaseInterface_ListDatabaseInstances_Call) Run(run func(ctx context.Context, request database.ListDatabaseInstancesRequest)) *MockDatabaseInterface_ListDatabaseInstances_Call { +func (_c *MockDatabaseInterface_ListDatabaseCatalogs_Call) Run(run func(ctx context.Context, request database.ListDatabaseCatalogsRequest)) *MockDatabaseInterface_ListDatabaseCatalogs_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(database.ListDatabaseInstancesRequest)) + run(args[0].(context.Context), args[1].(database.ListDatabaseCatalogsRequest)) }) return _c } -func (_c *MockDatabaseInterface_ListDatabaseInstances_Call) Return(_a0 listing.Iterator[database.DatabaseInstance]) *MockDatabaseInterface_ListDatabaseInstances_Call { +func (_c *MockDatabaseInterface_ListDatabaseCatalogs_Call) Return(_a0 listing.Iterator[database.DatabaseCatalog]) *MockDatabaseInterface_ListDatabaseCatalogs_Call { _c.Call.Return(_a0) return _c } -func (_c *MockDatabaseInterface_ListDatabaseInstances_Call) RunAndReturn(run func(context.Context, database.ListDatabaseInstancesRequest) listing.Iterator[database.DatabaseInstance]) *MockDatabaseInterface_ListDatabaseInstances_Call { +func (_c *MockDatabaseInterface_ListDatabaseCatalogs_Call) RunAndReturn(run func(context.Context, database.ListDatabaseCatalogsRequest) listing.Iterator[database.DatabaseCatalog]) *MockDatabaseInterface_ListDatabaseCatalogs_Call { _c.Call.Return(run) return _c } -// ListDatabaseInstancesAll provides a mock function with given fields: ctx, request -func (_m *MockDatabaseInterface) ListDatabaseInstancesAll(ctx context.Context, request database.ListDatabaseInstancesRequest) ([]database.DatabaseInstance, error) { +// ListDatabaseCatalogsAll provides a mock function with given fields: ctx, request +func (_m *MockDatabaseInterface) ListDatabaseCatalogsAll(ctx context.Context, request database.ListDatabaseCatalogsRequest) ([]database.DatabaseCatalog, error) { ret := _m.Called(ctx, request) if len(ret) == 0 { - panic("no return value specified for ListDatabaseInstancesAll") + panic("no return value specified for ListDatabaseCatalogsAll") } - var r0 []database.DatabaseInstance + var r0 []database.DatabaseCatalog var r1 error - if rf, ok := ret.Get(0).(func(context.Context, database.ListDatabaseInstancesRequest) ([]database.DatabaseInstance, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, database.ListDatabaseCatalogsRequest) ([]database.DatabaseCatalog, error)); ok { return rf(ctx, request) } - if rf, ok := ret.Get(0).(func(context.Context, database.ListDatabaseInstancesRequest) []database.DatabaseInstance); ok { + if rf, ok := ret.Get(0).(func(context.Context, database.ListDatabaseCatalogsRequest) []database.DatabaseCatalog); ok { r0 = rf(ctx, request) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]database.DatabaseInstance) + r0 = ret.Get(0).([]database.DatabaseCatalog) } } - if rf, ok := ret.Get(1).(func(context.Context, database.ListDatabaseInstancesRequest) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, database.ListDatabaseCatalogsRequest) error); ok { r1 = rf(ctx, request) } else { r1 = ret.Error(1) @@ -1305,14 +1637,348 @@ func (_m *MockDatabaseInterface) ListDatabaseInstancesAll(ctx context.Context, r return r0, r1 } -// MockDatabaseInterface_ListDatabaseInstancesAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListDatabaseInstancesAll' -type MockDatabaseInterface_ListDatabaseInstancesAll_Call struct { +// MockDatabaseInterface_ListDatabaseCatalogsAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListDatabaseCatalogsAll' +type MockDatabaseInterface_ListDatabaseCatalogsAll_Call struct { *mock.Call } -// ListDatabaseInstancesAll is a helper method to define mock.On call +// ListDatabaseCatalogsAll is a helper method to define mock.On call // - ctx context.Context -// - request database.ListDatabaseInstancesRequest +// - request database.ListDatabaseCatalogsRequest +func (_e *MockDatabaseInterface_Expecter) ListDatabaseCatalogsAll(ctx interface{}, request interface{}) *MockDatabaseInterface_ListDatabaseCatalogsAll_Call { + return &MockDatabaseInterface_ListDatabaseCatalogsAll_Call{Call: _e.mock.On("ListDatabaseCatalogsAll", ctx, request)} +} + +func (_c *MockDatabaseInterface_ListDatabaseCatalogsAll_Call) Run(run func(ctx context.Context, request database.ListDatabaseCatalogsRequest)) *MockDatabaseInterface_ListDatabaseCatalogsAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(database.ListDatabaseCatalogsRequest)) + }) + return _c +} + +func (_c *MockDatabaseInterface_ListDatabaseCatalogsAll_Call) Return(_a0 []database.DatabaseCatalog, _a1 error) *MockDatabaseInterface_ListDatabaseCatalogsAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockDatabaseInterface_ListDatabaseCatalogsAll_Call) RunAndReturn(run func(context.Context, database.ListDatabaseCatalogsRequest) ([]database.DatabaseCatalog, error)) *MockDatabaseInterface_ListDatabaseCatalogsAll_Call { + _c.Call.Return(run) + return _c +} + +// ListDatabaseCatalogsByInstanceName provides a mock function with given fields: ctx, instanceName +func (_m *MockDatabaseInterface) ListDatabaseCatalogsByInstanceName(ctx context.Context, instanceName string) (*database.ListDatabaseCatalogsResponse, error) { + ret := _m.Called(ctx, instanceName) + + if len(ret) == 0 { + panic("no return value specified for ListDatabaseCatalogsByInstanceName") + } + + var r0 *database.ListDatabaseCatalogsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*database.ListDatabaseCatalogsResponse, error)); ok { + return rf(ctx, instanceName) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *database.ListDatabaseCatalogsResponse); ok { + r0 = rf(ctx, instanceName) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*database.ListDatabaseCatalogsResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, instanceName) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockDatabaseInterface_ListDatabaseCatalogsByInstanceName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListDatabaseCatalogsByInstanceName' +type MockDatabaseInterface_ListDatabaseCatalogsByInstanceName_Call struct { + *mock.Call +} + +// ListDatabaseCatalogsByInstanceName is a helper method to define mock.On call +// - ctx context.Context +// - instanceName string +func (_e *MockDatabaseInterface_Expecter) ListDatabaseCatalogsByInstanceName(ctx interface{}, instanceName interface{}) *MockDatabaseInterface_ListDatabaseCatalogsByInstanceName_Call { + return &MockDatabaseInterface_ListDatabaseCatalogsByInstanceName_Call{Call: _e.mock.On("ListDatabaseCatalogsByInstanceName", ctx, instanceName)} +} + +func (_c *MockDatabaseInterface_ListDatabaseCatalogsByInstanceName_Call) Run(run func(ctx context.Context, instanceName string)) *MockDatabaseInterface_ListDatabaseCatalogsByInstanceName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockDatabaseInterface_ListDatabaseCatalogsByInstanceName_Call) Return(_a0 *database.ListDatabaseCatalogsResponse, _a1 error) *MockDatabaseInterface_ListDatabaseCatalogsByInstanceName_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockDatabaseInterface_ListDatabaseCatalogsByInstanceName_Call) RunAndReturn(run func(context.Context, string) (*database.ListDatabaseCatalogsResponse, error)) *MockDatabaseInterface_ListDatabaseCatalogsByInstanceName_Call { + _c.Call.Return(run) + return _c +} + +// ListDatabaseInstanceRoles provides a mock function with given fields: ctx, request +func (_m *MockDatabaseInterface) ListDatabaseInstanceRoles(ctx context.Context, request database.ListDatabaseInstanceRolesRequest) listing.Iterator[database.DatabaseInstanceRole] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListDatabaseInstanceRoles") + } + + var r0 listing.Iterator[database.DatabaseInstanceRole] + if rf, ok := ret.Get(0).(func(context.Context, database.ListDatabaseInstanceRolesRequest) listing.Iterator[database.DatabaseInstanceRole]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[database.DatabaseInstanceRole]) + } + } + + return r0 +} + +// MockDatabaseInterface_ListDatabaseInstanceRoles_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListDatabaseInstanceRoles' +type MockDatabaseInterface_ListDatabaseInstanceRoles_Call struct { + *mock.Call +} + +// ListDatabaseInstanceRoles is a helper method to define mock.On call +// - ctx context.Context +// - request database.ListDatabaseInstanceRolesRequest +func (_e *MockDatabaseInterface_Expecter) ListDatabaseInstanceRoles(ctx interface{}, request interface{}) *MockDatabaseInterface_ListDatabaseInstanceRoles_Call { + return &MockDatabaseInterface_ListDatabaseInstanceRoles_Call{Call: _e.mock.On("ListDatabaseInstanceRoles", ctx, request)} +} + +func (_c *MockDatabaseInterface_ListDatabaseInstanceRoles_Call) Run(run func(ctx context.Context, request database.ListDatabaseInstanceRolesRequest)) *MockDatabaseInterface_ListDatabaseInstanceRoles_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(database.ListDatabaseInstanceRolesRequest)) + }) + return _c +} + +func (_c *MockDatabaseInterface_ListDatabaseInstanceRoles_Call) Return(_a0 listing.Iterator[database.DatabaseInstanceRole]) *MockDatabaseInterface_ListDatabaseInstanceRoles_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockDatabaseInterface_ListDatabaseInstanceRoles_Call) RunAndReturn(run func(context.Context, database.ListDatabaseInstanceRolesRequest) listing.Iterator[database.DatabaseInstanceRole]) *MockDatabaseInterface_ListDatabaseInstanceRoles_Call { + _c.Call.Return(run) + return _c +} + +// ListDatabaseInstanceRolesAll provides a mock function with given fields: ctx, request +func (_m *MockDatabaseInterface) ListDatabaseInstanceRolesAll(ctx context.Context, request database.ListDatabaseInstanceRolesRequest) ([]database.DatabaseInstanceRole, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListDatabaseInstanceRolesAll") + } + + var r0 []database.DatabaseInstanceRole + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, database.ListDatabaseInstanceRolesRequest) ([]database.DatabaseInstanceRole, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, database.ListDatabaseInstanceRolesRequest) []database.DatabaseInstanceRole); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]database.DatabaseInstanceRole) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, database.ListDatabaseInstanceRolesRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockDatabaseInterface_ListDatabaseInstanceRolesAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListDatabaseInstanceRolesAll' +type MockDatabaseInterface_ListDatabaseInstanceRolesAll_Call struct { + *mock.Call +} + +// ListDatabaseInstanceRolesAll is a helper method to define mock.On call +// - ctx context.Context +// - request database.ListDatabaseInstanceRolesRequest +func (_e *MockDatabaseInterface_Expecter) ListDatabaseInstanceRolesAll(ctx interface{}, request interface{}) *MockDatabaseInterface_ListDatabaseInstanceRolesAll_Call { + return &MockDatabaseInterface_ListDatabaseInstanceRolesAll_Call{Call: _e.mock.On("ListDatabaseInstanceRolesAll", ctx, request)} +} + +func (_c *MockDatabaseInterface_ListDatabaseInstanceRolesAll_Call) Run(run func(ctx context.Context, request database.ListDatabaseInstanceRolesRequest)) *MockDatabaseInterface_ListDatabaseInstanceRolesAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(database.ListDatabaseInstanceRolesRequest)) + }) + return _c +} + +func (_c *MockDatabaseInterface_ListDatabaseInstanceRolesAll_Call) Return(_a0 []database.DatabaseInstanceRole, _a1 error) *MockDatabaseInterface_ListDatabaseInstanceRolesAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockDatabaseInterface_ListDatabaseInstanceRolesAll_Call) RunAndReturn(run func(context.Context, database.ListDatabaseInstanceRolesRequest) ([]database.DatabaseInstanceRole, error)) *MockDatabaseInterface_ListDatabaseInstanceRolesAll_Call { + _c.Call.Return(run) + return _c +} + +// ListDatabaseInstanceRolesByInstanceName provides a mock function with given fields: ctx, instanceName +func (_m *MockDatabaseInterface) ListDatabaseInstanceRolesByInstanceName(ctx context.Context, instanceName string) (*database.ListDatabaseInstanceRolesResponse, error) { + ret := _m.Called(ctx, instanceName) + + if len(ret) == 0 { + panic("no return value specified for ListDatabaseInstanceRolesByInstanceName") + } + + var r0 *database.ListDatabaseInstanceRolesResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*database.ListDatabaseInstanceRolesResponse, error)); ok { + return rf(ctx, instanceName) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *database.ListDatabaseInstanceRolesResponse); ok { + r0 = rf(ctx, instanceName) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*database.ListDatabaseInstanceRolesResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, instanceName) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockDatabaseInterface_ListDatabaseInstanceRolesByInstanceName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListDatabaseInstanceRolesByInstanceName' +type MockDatabaseInterface_ListDatabaseInstanceRolesByInstanceName_Call struct { + *mock.Call +} + +// ListDatabaseInstanceRolesByInstanceName is a helper method to define mock.On call +// - ctx context.Context +// - instanceName string +func (_e *MockDatabaseInterface_Expecter) ListDatabaseInstanceRolesByInstanceName(ctx interface{}, instanceName interface{}) *MockDatabaseInterface_ListDatabaseInstanceRolesByInstanceName_Call { + return &MockDatabaseInterface_ListDatabaseInstanceRolesByInstanceName_Call{Call: _e.mock.On("ListDatabaseInstanceRolesByInstanceName", ctx, instanceName)} +} + +func (_c *MockDatabaseInterface_ListDatabaseInstanceRolesByInstanceName_Call) Run(run func(ctx context.Context, instanceName string)) *MockDatabaseInterface_ListDatabaseInstanceRolesByInstanceName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockDatabaseInterface_ListDatabaseInstanceRolesByInstanceName_Call) Return(_a0 *database.ListDatabaseInstanceRolesResponse, _a1 error) *MockDatabaseInterface_ListDatabaseInstanceRolesByInstanceName_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockDatabaseInterface_ListDatabaseInstanceRolesByInstanceName_Call) RunAndReturn(run func(context.Context, string) (*database.ListDatabaseInstanceRolesResponse, error)) *MockDatabaseInterface_ListDatabaseInstanceRolesByInstanceName_Call { + _c.Call.Return(run) + return _c +} + +// ListDatabaseInstances provides a mock function with given fields: ctx, request +func (_m *MockDatabaseInterface) ListDatabaseInstances(ctx context.Context, request database.ListDatabaseInstancesRequest) listing.Iterator[database.DatabaseInstance] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListDatabaseInstances") + } + + var r0 listing.Iterator[database.DatabaseInstance] + if rf, ok := ret.Get(0).(func(context.Context, database.ListDatabaseInstancesRequest) listing.Iterator[database.DatabaseInstance]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[database.DatabaseInstance]) + } + } + + return r0 +} + +// MockDatabaseInterface_ListDatabaseInstances_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListDatabaseInstances' +type MockDatabaseInterface_ListDatabaseInstances_Call struct { + *mock.Call +} + +// ListDatabaseInstances is a helper method to define mock.On call +// - ctx context.Context +// - request database.ListDatabaseInstancesRequest +func (_e *MockDatabaseInterface_Expecter) ListDatabaseInstances(ctx interface{}, request interface{}) *MockDatabaseInterface_ListDatabaseInstances_Call { + return &MockDatabaseInterface_ListDatabaseInstances_Call{Call: _e.mock.On("ListDatabaseInstances", ctx, request)} +} + +func (_c *MockDatabaseInterface_ListDatabaseInstances_Call) Run(run func(ctx context.Context, request database.ListDatabaseInstancesRequest)) *MockDatabaseInterface_ListDatabaseInstances_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(database.ListDatabaseInstancesRequest)) + }) + return _c +} + +func (_c *MockDatabaseInterface_ListDatabaseInstances_Call) Return(_a0 listing.Iterator[database.DatabaseInstance]) *MockDatabaseInterface_ListDatabaseInstances_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockDatabaseInterface_ListDatabaseInstances_Call) RunAndReturn(run func(context.Context, database.ListDatabaseInstancesRequest) listing.Iterator[database.DatabaseInstance]) *MockDatabaseInterface_ListDatabaseInstances_Call { + _c.Call.Return(run) + return _c +} + +// ListDatabaseInstancesAll provides a mock function with given fields: ctx, request +func (_m *MockDatabaseInterface) ListDatabaseInstancesAll(ctx context.Context, request database.ListDatabaseInstancesRequest) ([]database.DatabaseInstance, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListDatabaseInstancesAll") + } + + var r0 []database.DatabaseInstance + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, database.ListDatabaseInstancesRequest) ([]database.DatabaseInstance, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, database.ListDatabaseInstancesRequest) []database.DatabaseInstance); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]database.DatabaseInstance) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, database.ListDatabaseInstancesRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockDatabaseInterface_ListDatabaseInstancesAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListDatabaseInstancesAll' +type MockDatabaseInterface_ListDatabaseInstancesAll_Call struct { + *mock.Call +} + +// ListDatabaseInstancesAll is a helper method to define mock.On call +// - ctx context.Context +// - request database.ListDatabaseInstancesRequest func (_e *MockDatabaseInterface_Expecter) ListDatabaseInstancesAll(ctx interface{}, request interface{}) *MockDatabaseInterface_ListDatabaseInstancesAll_Call { return &MockDatabaseInterface_ListDatabaseInstancesAll_Call{Call: _e.mock.On("ListDatabaseInstancesAll", ctx, request)} } @@ -1334,6 +2000,232 @@ func (_c *MockDatabaseInterface_ListDatabaseInstancesAll_Call) RunAndReturn(run return _c } +// ListSyncedDatabaseTables provides a mock function with given fields: ctx, request +func (_m *MockDatabaseInterface) ListSyncedDatabaseTables(ctx context.Context, request database.ListSyncedDatabaseTablesRequest) listing.Iterator[database.SyncedDatabaseTable] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListSyncedDatabaseTables") + } + + var r0 listing.Iterator[database.SyncedDatabaseTable] + if rf, ok := ret.Get(0).(func(context.Context, database.ListSyncedDatabaseTablesRequest) listing.Iterator[database.SyncedDatabaseTable]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[database.SyncedDatabaseTable]) + } + } + + return r0 +} + +// MockDatabaseInterface_ListSyncedDatabaseTables_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListSyncedDatabaseTables' +type MockDatabaseInterface_ListSyncedDatabaseTables_Call struct { + *mock.Call +} + +// ListSyncedDatabaseTables is a helper method to define mock.On call +// - ctx context.Context +// - request database.ListSyncedDatabaseTablesRequest +func (_e *MockDatabaseInterface_Expecter) ListSyncedDatabaseTables(ctx interface{}, request interface{}) *MockDatabaseInterface_ListSyncedDatabaseTables_Call { + return &MockDatabaseInterface_ListSyncedDatabaseTables_Call{Call: _e.mock.On("ListSyncedDatabaseTables", ctx, request)} +} + +func (_c *MockDatabaseInterface_ListSyncedDatabaseTables_Call) Run(run func(ctx context.Context, request database.ListSyncedDatabaseTablesRequest)) *MockDatabaseInterface_ListSyncedDatabaseTables_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(database.ListSyncedDatabaseTablesRequest)) + }) + return _c +} + +func (_c *MockDatabaseInterface_ListSyncedDatabaseTables_Call) Return(_a0 listing.Iterator[database.SyncedDatabaseTable]) *MockDatabaseInterface_ListSyncedDatabaseTables_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockDatabaseInterface_ListSyncedDatabaseTables_Call) RunAndReturn(run func(context.Context, database.ListSyncedDatabaseTablesRequest) listing.Iterator[database.SyncedDatabaseTable]) *MockDatabaseInterface_ListSyncedDatabaseTables_Call { + _c.Call.Return(run) + return _c +} + +// ListSyncedDatabaseTablesAll provides a mock function with given fields: ctx, request +func (_m *MockDatabaseInterface) ListSyncedDatabaseTablesAll(ctx context.Context, request database.ListSyncedDatabaseTablesRequest) ([]database.SyncedDatabaseTable, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListSyncedDatabaseTablesAll") + } + + var r0 []database.SyncedDatabaseTable + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, database.ListSyncedDatabaseTablesRequest) ([]database.SyncedDatabaseTable, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, database.ListSyncedDatabaseTablesRequest) []database.SyncedDatabaseTable); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]database.SyncedDatabaseTable) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, database.ListSyncedDatabaseTablesRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockDatabaseInterface_ListSyncedDatabaseTablesAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListSyncedDatabaseTablesAll' +type MockDatabaseInterface_ListSyncedDatabaseTablesAll_Call struct { + *mock.Call +} + +// ListSyncedDatabaseTablesAll is a helper method to define mock.On call +// - ctx context.Context +// - request database.ListSyncedDatabaseTablesRequest +func (_e *MockDatabaseInterface_Expecter) ListSyncedDatabaseTablesAll(ctx interface{}, request interface{}) *MockDatabaseInterface_ListSyncedDatabaseTablesAll_Call { + return &MockDatabaseInterface_ListSyncedDatabaseTablesAll_Call{Call: _e.mock.On("ListSyncedDatabaseTablesAll", ctx, request)} +} + +func (_c *MockDatabaseInterface_ListSyncedDatabaseTablesAll_Call) Run(run func(ctx context.Context, request database.ListSyncedDatabaseTablesRequest)) *MockDatabaseInterface_ListSyncedDatabaseTablesAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(database.ListSyncedDatabaseTablesRequest)) + }) + return _c +} + +func (_c *MockDatabaseInterface_ListSyncedDatabaseTablesAll_Call) Return(_a0 []database.SyncedDatabaseTable, _a1 error) *MockDatabaseInterface_ListSyncedDatabaseTablesAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockDatabaseInterface_ListSyncedDatabaseTablesAll_Call) RunAndReturn(run func(context.Context, database.ListSyncedDatabaseTablesRequest) ([]database.SyncedDatabaseTable, error)) *MockDatabaseInterface_ListSyncedDatabaseTablesAll_Call { + _c.Call.Return(run) + return _c +} + +// ListSyncedDatabaseTablesByInstanceName provides a mock function with given fields: ctx, instanceName +func (_m *MockDatabaseInterface) ListSyncedDatabaseTablesByInstanceName(ctx context.Context, instanceName string) (*database.ListSyncedDatabaseTablesResponse, error) { + ret := _m.Called(ctx, instanceName) + + if len(ret) == 0 { + panic("no return value specified for ListSyncedDatabaseTablesByInstanceName") + } + + var r0 *database.ListSyncedDatabaseTablesResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*database.ListSyncedDatabaseTablesResponse, error)); ok { + return rf(ctx, instanceName) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *database.ListSyncedDatabaseTablesResponse); ok { + r0 = rf(ctx, instanceName) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*database.ListSyncedDatabaseTablesResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, instanceName) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockDatabaseInterface_ListSyncedDatabaseTablesByInstanceName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListSyncedDatabaseTablesByInstanceName' +type MockDatabaseInterface_ListSyncedDatabaseTablesByInstanceName_Call struct { + *mock.Call +} + +// ListSyncedDatabaseTablesByInstanceName is a helper method to define mock.On call +// - ctx context.Context +// - instanceName string +func (_e *MockDatabaseInterface_Expecter) ListSyncedDatabaseTablesByInstanceName(ctx interface{}, instanceName interface{}) *MockDatabaseInterface_ListSyncedDatabaseTablesByInstanceName_Call { + return &MockDatabaseInterface_ListSyncedDatabaseTablesByInstanceName_Call{Call: _e.mock.On("ListSyncedDatabaseTablesByInstanceName", ctx, instanceName)} +} + +func (_c *MockDatabaseInterface_ListSyncedDatabaseTablesByInstanceName_Call) Run(run func(ctx context.Context, instanceName string)) *MockDatabaseInterface_ListSyncedDatabaseTablesByInstanceName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockDatabaseInterface_ListSyncedDatabaseTablesByInstanceName_Call) Return(_a0 *database.ListSyncedDatabaseTablesResponse, _a1 error) *MockDatabaseInterface_ListSyncedDatabaseTablesByInstanceName_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockDatabaseInterface_ListSyncedDatabaseTablesByInstanceName_Call) RunAndReturn(run func(context.Context, string) (*database.ListSyncedDatabaseTablesResponse, error)) *MockDatabaseInterface_ListSyncedDatabaseTablesByInstanceName_Call { + _c.Call.Return(run) + return _c +} + +// UpdateDatabaseCatalog provides a mock function with given fields: ctx, request +func (_m *MockDatabaseInterface) UpdateDatabaseCatalog(ctx context.Context, request database.UpdateDatabaseCatalogRequest) (*database.DatabaseCatalog, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for UpdateDatabaseCatalog") + } + + var r0 *database.DatabaseCatalog + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, database.UpdateDatabaseCatalogRequest) (*database.DatabaseCatalog, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, database.UpdateDatabaseCatalogRequest) *database.DatabaseCatalog); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*database.DatabaseCatalog) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, database.UpdateDatabaseCatalogRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockDatabaseInterface_UpdateDatabaseCatalog_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateDatabaseCatalog' +type MockDatabaseInterface_UpdateDatabaseCatalog_Call struct { + *mock.Call +} + +// UpdateDatabaseCatalog is a helper method to define mock.On call +// - ctx context.Context +// - request database.UpdateDatabaseCatalogRequest +func (_e *MockDatabaseInterface_Expecter) UpdateDatabaseCatalog(ctx interface{}, request interface{}) *MockDatabaseInterface_UpdateDatabaseCatalog_Call { + return &MockDatabaseInterface_UpdateDatabaseCatalog_Call{Call: _e.mock.On("UpdateDatabaseCatalog", ctx, request)} +} + +func (_c *MockDatabaseInterface_UpdateDatabaseCatalog_Call) Run(run func(ctx context.Context, request database.UpdateDatabaseCatalogRequest)) *MockDatabaseInterface_UpdateDatabaseCatalog_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(database.UpdateDatabaseCatalogRequest)) + }) + return _c +} + +func (_c *MockDatabaseInterface_UpdateDatabaseCatalog_Call) Return(_a0 *database.DatabaseCatalog, _a1 error) *MockDatabaseInterface_UpdateDatabaseCatalog_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockDatabaseInterface_UpdateDatabaseCatalog_Call) RunAndReturn(run func(context.Context, database.UpdateDatabaseCatalogRequest) (*database.DatabaseCatalog, error)) *MockDatabaseInterface_UpdateDatabaseCatalog_Call { + _c.Call.Return(run) + return _c +} + // UpdateDatabaseInstance provides a mock function with given fields: ctx, request func (_m *MockDatabaseInterface) UpdateDatabaseInstance(ctx context.Context, request database.UpdateDatabaseInstanceRequest) (*database.DatabaseInstance, error) { ret := _m.Called(ctx, request) @@ -1393,6 +2285,65 @@ func (_c *MockDatabaseInterface_UpdateDatabaseInstance_Call) RunAndReturn(run fu return _c } +// UpdateSyncedDatabaseTable provides a mock function with given fields: ctx, request +func (_m *MockDatabaseInterface) UpdateSyncedDatabaseTable(ctx context.Context, request database.UpdateSyncedDatabaseTableRequest) (*database.SyncedDatabaseTable, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for UpdateSyncedDatabaseTable") + } + + var r0 *database.SyncedDatabaseTable + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, database.UpdateSyncedDatabaseTableRequest) (*database.SyncedDatabaseTable, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, database.UpdateSyncedDatabaseTableRequest) *database.SyncedDatabaseTable); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*database.SyncedDatabaseTable) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, database.UpdateSyncedDatabaseTableRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockDatabaseInterface_UpdateSyncedDatabaseTable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateSyncedDatabaseTable' +type MockDatabaseInterface_UpdateSyncedDatabaseTable_Call struct { + *mock.Call +} + +// UpdateSyncedDatabaseTable is a helper method to define mock.On call +// - ctx context.Context +// - request database.UpdateSyncedDatabaseTableRequest +func (_e *MockDatabaseInterface_Expecter) UpdateSyncedDatabaseTable(ctx interface{}, request interface{}) *MockDatabaseInterface_UpdateSyncedDatabaseTable_Call { + return &MockDatabaseInterface_UpdateSyncedDatabaseTable_Call{Call: _e.mock.On("UpdateSyncedDatabaseTable", ctx, request)} +} + +func (_c *MockDatabaseInterface_UpdateSyncedDatabaseTable_Call) Run(run func(ctx context.Context, request database.UpdateSyncedDatabaseTableRequest)) *MockDatabaseInterface_UpdateSyncedDatabaseTable_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(database.UpdateSyncedDatabaseTableRequest)) + }) + return _c +} + +func (_c *MockDatabaseInterface_UpdateSyncedDatabaseTable_Call) Return(_a0 *database.SyncedDatabaseTable, _a1 error) *MockDatabaseInterface_UpdateSyncedDatabaseTable_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockDatabaseInterface_UpdateSyncedDatabaseTable_Call) RunAndReturn(run func(context.Context, database.UpdateSyncedDatabaseTableRequest) (*database.SyncedDatabaseTable, error)) *MockDatabaseInterface_UpdateSyncedDatabaseTable_Call { + _c.Call.Return(run) + return _c +} + // NewMockDatabaseInterface creates a new instance of MockDatabaseInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockDatabaseInterface(t interface { diff --git a/experimental/mocks/service/ml/mock_experiments_interface.go b/experimental/mocks/service/ml/mock_experiments_interface.go index 20e4fce27..89a70eefa 100644 --- a/experimental/mocks/service/ml/mock_experiments_interface.go +++ b/experimental/mocks/service/ml/mock_experiments_interface.go @@ -993,6 +993,65 @@ func (_c *MockExperimentsInterface_GetLoggedModelByModelId_Call) RunAndReturn(ru return _c } +// GetLoggedModels provides a mock function with given fields: ctx, request +func (_m *MockExperimentsInterface) GetLoggedModels(ctx context.Context, request ml.GetLoggedModelsRequest) (*ml.GetLoggedModelsRequestResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for GetLoggedModels") + } + + var r0 *ml.GetLoggedModelsRequestResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, ml.GetLoggedModelsRequest) (*ml.GetLoggedModelsRequestResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, ml.GetLoggedModelsRequest) *ml.GetLoggedModelsRequestResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ml.GetLoggedModelsRequestResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, ml.GetLoggedModelsRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockExperimentsInterface_GetLoggedModels_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLoggedModels' +type MockExperimentsInterface_GetLoggedModels_Call struct { + *mock.Call +} + +// GetLoggedModels is a helper method to define mock.On call +// - ctx context.Context +// - request ml.GetLoggedModelsRequest +func (_e *MockExperimentsInterface_Expecter) GetLoggedModels(ctx interface{}, request interface{}) *MockExperimentsInterface_GetLoggedModels_Call { + return &MockExperimentsInterface_GetLoggedModels_Call{Call: _e.mock.On("GetLoggedModels", ctx, request)} +} + +func (_c *MockExperimentsInterface_GetLoggedModels_Call) Run(run func(ctx context.Context, request ml.GetLoggedModelsRequest)) *MockExperimentsInterface_GetLoggedModels_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ml.GetLoggedModelsRequest)) + }) + return _c +} + +func (_c *MockExperimentsInterface_GetLoggedModels_Call) Return(_a0 *ml.GetLoggedModelsRequestResponse, _a1 error) *MockExperimentsInterface_GetLoggedModels_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockExperimentsInterface_GetLoggedModels_Call) RunAndReturn(run func(context.Context, ml.GetLoggedModelsRequest) (*ml.GetLoggedModelsRequestResponse, error)) *MockExperimentsInterface_GetLoggedModels_Call { + _c.Call.Return(run) + return _c +} + // GetPermissionLevels provides a mock function with given fields: ctx, request func (_m *MockExperimentsInterface) GetPermissionLevels(ctx context.Context, request ml.GetExperimentPermissionLevelsRequest) (*ml.GetExperimentPermissionLevelsResponse, error) { ret := _m.Called(ctx, request) diff --git a/experimental/mocks/service/ml/mock_materialized_features_interface.go b/experimental/mocks/service/ml/mock_materialized_features_interface.go new file mode 100644 index 000000000..835e555e1 --- /dev/null +++ b/experimental/mocks/service/ml/mock_materialized_features_interface.go @@ -0,0 +1,660 @@ +// Code generated by mockery v2.53.2. DO NOT EDIT. + +package ml + +import ( + context "context" + + listing "github.com/databricks/databricks-sdk-go/listing" + ml "github.com/databricks/databricks-sdk-go/service/ml" + + mock "github.com/stretchr/testify/mock" +) + +// MockMaterializedFeaturesInterface is an autogenerated mock type for the MaterializedFeaturesInterface type +type MockMaterializedFeaturesInterface struct { + mock.Mock +} + +type MockMaterializedFeaturesInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *MockMaterializedFeaturesInterface) EXPECT() *MockMaterializedFeaturesInterface_Expecter { + return &MockMaterializedFeaturesInterface_Expecter{mock: &_m.Mock} +} + +// CreateFeatureTag provides a mock function with given fields: ctx, request +func (_m *MockMaterializedFeaturesInterface) CreateFeatureTag(ctx context.Context, request ml.CreateFeatureTagRequest) (*ml.FeatureTag, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for CreateFeatureTag") + } + + var r0 *ml.FeatureTag + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, ml.CreateFeatureTagRequest) (*ml.FeatureTag, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, ml.CreateFeatureTagRequest) *ml.FeatureTag); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ml.FeatureTag) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, ml.CreateFeatureTagRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockMaterializedFeaturesInterface_CreateFeatureTag_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateFeatureTag' +type MockMaterializedFeaturesInterface_CreateFeatureTag_Call struct { + *mock.Call +} + +// CreateFeatureTag is a helper method to define mock.On call +// - ctx context.Context +// - request ml.CreateFeatureTagRequest +func (_e *MockMaterializedFeaturesInterface_Expecter) CreateFeatureTag(ctx interface{}, request interface{}) *MockMaterializedFeaturesInterface_CreateFeatureTag_Call { + return &MockMaterializedFeaturesInterface_CreateFeatureTag_Call{Call: _e.mock.On("CreateFeatureTag", ctx, request)} +} + +func (_c *MockMaterializedFeaturesInterface_CreateFeatureTag_Call) Run(run func(ctx context.Context, request ml.CreateFeatureTagRequest)) *MockMaterializedFeaturesInterface_CreateFeatureTag_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ml.CreateFeatureTagRequest)) + }) + return _c +} + +func (_c *MockMaterializedFeaturesInterface_CreateFeatureTag_Call) Return(_a0 *ml.FeatureTag, _a1 error) *MockMaterializedFeaturesInterface_CreateFeatureTag_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockMaterializedFeaturesInterface_CreateFeatureTag_Call) RunAndReturn(run func(context.Context, ml.CreateFeatureTagRequest) (*ml.FeatureTag, error)) *MockMaterializedFeaturesInterface_CreateFeatureTag_Call { + _c.Call.Return(run) + return _c +} + +// DeleteFeatureTag provides a mock function with given fields: ctx, request +func (_m *MockMaterializedFeaturesInterface) DeleteFeatureTag(ctx context.Context, request ml.DeleteFeatureTagRequest) error { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for DeleteFeatureTag") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, ml.DeleteFeatureTagRequest) error); ok { + r0 = rf(ctx, request) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockMaterializedFeaturesInterface_DeleteFeatureTag_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteFeatureTag' +type MockMaterializedFeaturesInterface_DeleteFeatureTag_Call struct { + *mock.Call +} + +// DeleteFeatureTag is a helper method to define mock.On call +// - ctx context.Context +// - request ml.DeleteFeatureTagRequest +func (_e *MockMaterializedFeaturesInterface_Expecter) DeleteFeatureTag(ctx interface{}, request interface{}) *MockMaterializedFeaturesInterface_DeleteFeatureTag_Call { + return &MockMaterializedFeaturesInterface_DeleteFeatureTag_Call{Call: _e.mock.On("DeleteFeatureTag", ctx, request)} +} + +func (_c *MockMaterializedFeaturesInterface_DeleteFeatureTag_Call) Run(run func(ctx context.Context, request ml.DeleteFeatureTagRequest)) *MockMaterializedFeaturesInterface_DeleteFeatureTag_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ml.DeleteFeatureTagRequest)) + }) + return _c +} + +func (_c *MockMaterializedFeaturesInterface_DeleteFeatureTag_Call) Return(_a0 error) *MockMaterializedFeaturesInterface_DeleteFeatureTag_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockMaterializedFeaturesInterface_DeleteFeatureTag_Call) RunAndReturn(run func(context.Context, ml.DeleteFeatureTagRequest) error) *MockMaterializedFeaturesInterface_DeleteFeatureTag_Call { + _c.Call.Return(run) + return _c +} + +// DeleteFeatureTagByTableNameAndFeatureNameAndKey provides a mock function with given fields: ctx, tableName, featureName, key +func (_m *MockMaterializedFeaturesInterface) DeleteFeatureTagByTableNameAndFeatureNameAndKey(ctx context.Context, tableName string, featureName string, key string) error { + ret := _m.Called(ctx, tableName, featureName, key) + + if len(ret) == 0 { + panic("no return value specified for DeleteFeatureTagByTableNameAndFeatureNameAndKey") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string) error); ok { + r0 = rf(ctx, tableName, featureName, key) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockMaterializedFeaturesInterface_DeleteFeatureTagByTableNameAndFeatureNameAndKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteFeatureTagByTableNameAndFeatureNameAndKey' +type MockMaterializedFeaturesInterface_DeleteFeatureTagByTableNameAndFeatureNameAndKey_Call struct { + *mock.Call +} + +// DeleteFeatureTagByTableNameAndFeatureNameAndKey is a helper method to define mock.On call +// - ctx context.Context +// - tableName string +// - featureName string +// - key string +func (_e *MockMaterializedFeaturesInterface_Expecter) DeleteFeatureTagByTableNameAndFeatureNameAndKey(ctx interface{}, tableName interface{}, featureName interface{}, key interface{}) *MockMaterializedFeaturesInterface_DeleteFeatureTagByTableNameAndFeatureNameAndKey_Call { + return &MockMaterializedFeaturesInterface_DeleteFeatureTagByTableNameAndFeatureNameAndKey_Call{Call: _e.mock.On("DeleteFeatureTagByTableNameAndFeatureNameAndKey", ctx, tableName, featureName, key)} +} + +func (_c *MockMaterializedFeaturesInterface_DeleteFeatureTagByTableNameAndFeatureNameAndKey_Call) Run(run func(ctx context.Context, tableName string, featureName string, key string)) *MockMaterializedFeaturesInterface_DeleteFeatureTagByTableNameAndFeatureNameAndKey_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string)) + }) + return _c +} + +func (_c *MockMaterializedFeaturesInterface_DeleteFeatureTagByTableNameAndFeatureNameAndKey_Call) Return(_a0 error) *MockMaterializedFeaturesInterface_DeleteFeatureTagByTableNameAndFeatureNameAndKey_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockMaterializedFeaturesInterface_DeleteFeatureTagByTableNameAndFeatureNameAndKey_Call) RunAndReturn(run func(context.Context, string, string, string) error) *MockMaterializedFeaturesInterface_DeleteFeatureTagByTableNameAndFeatureNameAndKey_Call { + _c.Call.Return(run) + return _c +} + +// GetFeatureLineage provides a mock function with given fields: ctx, request +func (_m *MockMaterializedFeaturesInterface) GetFeatureLineage(ctx context.Context, request ml.GetFeatureLineageRequest) (*ml.FeatureLineage, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for GetFeatureLineage") + } + + var r0 *ml.FeatureLineage + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, ml.GetFeatureLineageRequest) (*ml.FeatureLineage, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, ml.GetFeatureLineageRequest) *ml.FeatureLineage); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ml.FeatureLineage) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, ml.GetFeatureLineageRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockMaterializedFeaturesInterface_GetFeatureLineage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFeatureLineage' +type MockMaterializedFeaturesInterface_GetFeatureLineage_Call struct { + *mock.Call +} + +// GetFeatureLineage is a helper method to define mock.On call +// - ctx context.Context +// - request ml.GetFeatureLineageRequest +func (_e *MockMaterializedFeaturesInterface_Expecter) GetFeatureLineage(ctx interface{}, request interface{}) *MockMaterializedFeaturesInterface_GetFeatureLineage_Call { + return &MockMaterializedFeaturesInterface_GetFeatureLineage_Call{Call: _e.mock.On("GetFeatureLineage", ctx, request)} +} + +func (_c *MockMaterializedFeaturesInterface_GetFeatureLineage_Call) Run(run func(ctx context.Context, request ml.GetFeatureLineageRequest)) *MockMaterializedFeaturesInterface_GetFeatureLineage_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ml.GetFeatureLineageRequest)) + }) + return _c +} + +func (_c *MockMaterializedFeaturesInterface_GetFeatureLineage_Call) Return(_a0 *ml.FeatureLineage, _a1 error) *MockMaterializedFeaturesInterface_GetFeatureLineage_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockMaterializedFeaturesInterface_GetFeatureLineage_Call) RunAndReturn(run func(context.Context, ml.GetFeatureLineageRequest) (*ml.FeatureLineage, error)) *MockMaterializedFeaturesInterface_GetFeatureLineage_Call { + _c.Call.Return(run) + return _c +} + +// GetFeatureLineageByTableNameAndFeatureName provides a mock function with given fields: ctx, tableName, featureName +func (_m *MockMaterializedFeaturesInterface) GetFeatureLineageByTableNameAndFeatureName(ctx context.Context, tableName string, featureName string) (*ml.FeatureLineage, error) { + ret := _m.Called(ctx, tableName, featureName) + + if len(ret) == 0 { + panic("no return value specified for GetFeatureLineageByTableNameAndFeatureName") + } + + var r0 *ml.FeatureLineage + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) (*ml.FeatureLineage, error)); ok { + return rf(ctx, tableName, featureName) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string) *ml.FeatureLineage); ok { + r0 = rf(ctx, tableName, featureName) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ml.FeatureLineage) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = rf(ctx, tableName, featureName) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockMaterializedFeaturesInterface_GetFeatureLineageByTableNameAndFeatureName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFeatureLineageByTableNameAndFeatureName' +type MockMaterializedFeaturesInterface_GetFeatureLineageByTableNameAndFeatureName_Call struct { + *mock.Call +} + +// GetFeatureLineageByTableNameAndFeatureName is a helper method to define mock.On call +// - ctx context.Context +// - tableName string +// - featureName string +func (_e *MockMaterializedFeaturesInterface_Expecter) GetFeatureLineageByTableNameAndFeatureName(ctx interface{}, tableName interface{}, featureName interface{}) *MockMaterializedFeaturesInterface_GetFeatureLineageByTableNameAndFeatureName_Call { + return &MockMaterializedFeaturesInterface_GetFeatureLineageByTableNameAndFeatureName_Call{Call: _e.mock.On("GetFeatureLineageByTableNameAndFeatureName", ctx, tableName, featureName)} +} + +func (_c *MockMaterializedFeaturesInterface_GetFeatureLineageByTableNameAndFeatureName_Call) Run(run func(ctx context.Context, tableName string, featureName string)) *MockMaterializedFeaturesInterface_GetFeatureLineageByTableNameAndFeatureName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *MockMaterializedFeaturesInterface_GetFeatureLineageByTableNameAndFeatureName_Call) Return(_a0 *ml.FeatureLineage, _a1 error) *MockMaterializedFeaturesInterface_GetFeatureLineageByTableNameAndFeatureName_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockMaterializedFeaturesInterface_GetFeatureLineageByTableNameAndFeatureName_Call) RunAndReturn(run func(context.Context, string, string) (*ml.FeatureLineage, error)) *MockMaterializedFeaturesInterface_GetFeatureLineageByTableNameAndFeatureName_Call { + _c.Call.Return(run) + return _c +} + +// GetFeatureTag provides a mock function with given fields: ctx, request +func (_m *MockMaterializedFeaturesInterface) GetFeatureTag(ctx context.Context, request ml.GetFeatureTagRequest) (*ml.FeatureTag, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for GetFeatureTag") + } + + var r0 *ml.FeatureTag + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, ml.GetFeatureTagRequest) (*ml.FeatureTag, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, ml.GetFeatureTagRequest) *ml.FeatureTag); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ml.FeatureTag) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, ml.GetFeatureTagRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockMaterializedFeaturesInterface_GetFeatureTag_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFeatureTag' +type MockMaterializedFeaturesInterface_GetFeatureTag_Call struct { + *mock.Call +} + +// GetFeatureTag is a helper method to define mock.On call +// - ctx context.Context +// - request ml.GetFeatureTagRequest +func (_e *MockMaterializedFeaturesInterface_Expecter) GetFeatureTag(ctx interface{}, request interface{}) *MockMaterializedFeaturesInterface_GetFeatureTag_Call { + return &MockMaterializedFeaturesInterface_GetFeatureTag_Call{Call: _e.mock.On("GetFeatureTag", ctx, request)} +} + +func (_c *MockMaterializedFeaturesInterface_GetFeatureTag_Call) Run(run func(ctx context.Context, request ml.GetFeatureTagRequest)) *MockMaterializedFeaturesInterface_GetFeatureTag_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ml.GetFeatureTagRequest)) + }) + return _c +} + +func (_c *MockMaterializedFeaturesInterface_GetFeatureTag_Call) Return(_a0 *ml.FeatureTag, _a1 error) *MockMaterializedFeaturesInterface_GetFeatureTag_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockMaterializedFeaturesInterface_GetFeatureTag_Call) RunAndReturn(run func(context.Context, ml.GetFeatureTagRequest) (*ml.FeatureTag, error)) *MockMaterializedFeaturesInterface_GetFeatureTag_Call { + _c.Call.Return(run) + return _c +} + +// GetFeatureTagByTableNameAndFeatureNameAndKey provides a mock function with given fields: ctx, tableName, featureName, key +func (_m *MockMaterializedFeaturesInterface) GetFeatureTagByTableNameAndFeatureNameAndKey(ctx context.Context, tableName string, featureName string, key string) (*ml.FeatureTag, error) { + ret := _m.Called(ctx, tableName, featureName, key) + + if len(ret) == 0 { + panic("no return value specified for GetFeatureTagByTableNameAndFeatureNameAndKey") + } + + var r0 *ml.FeatureTag + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string) (*ml.FeatureTag, error)); ok { + return rf(ctx, tableName, featureName, key) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string, string) *ml.FeatureTag); ok { + r0 = rf(ctx, tableName, featureName, key) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ml.FeatureTag) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string, string) error); ok { + r1 = rf(ctx, tableName, featureName, key) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockMaterializedFeaturesInterface_GetFeatureTagByTableNameAndFeatureNameAndKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFeatureTagByTableNameAndFeatureNameAndKey' +type MockMaterializedFeaturesInterface_GetFeatureTagByTableNameAndFeatureNameAndKey_Call struct { + *mock.Call +} + +// GetFeatureTagByTableNameAndFeatureNameAndKey is a helper method to define mock.On call +// - ctx context.Context +// - tableName string +// - featureName string +// - key string +func (_e *MockMaterializedFeaturesInterface_Expecter) GetFeatureTagByTableNameAndFeatureNameAndKey(ctx interface{}, tableName interface{}, featureName interface{}, key interface{}) *MockMaterializedFeaturesInterface_GetFeatureTagByTableNameAndFeatureNameAndKey_Call { + return &MockMaterializedFeaturesInterface_GetFeatureTagByTableNameAndFeatureNameAndKey_Call{Call: _e.mock.On("GetFeatureTagByTableNameAndFeatureNameAndKey", ctx, tableName, featureName, key)} +} + +func (_c *MockMaterializedFeaturesInterface_GetFeatureTagByTableNameAndFeatureNameAndKey_Call) Run(run func(ctx context.Context, tableName string, featureName string, key string)) *MockMaterializedFeaturesInterface_GetFeatureTagByTableNameAndFeatureNameAndKey_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string)) + }) + return _c +} + +func (_c *MockMaterializedFeaturesInterface_GetFeatureTagByTableNameAndFeatureNameAndKey_Call) Return(_a0 *ml.FeatureTag, _a1 error) *MockMaterializedFeaturesInterface_GetFeatureTagByTableNameAndFeatureNameAndKey_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockMaterializedFeaturesInterface_GetFeatureTagByTableNameAndFeatureNameAndKey_Call) RunAndReturn(run func(context.Context, string, string, string) (*ml.FeatureTag, error)) *MockMaterializedFeaturesInterface_GetFeatureTagByTableNameAndFeatureNameAndKey_Call { + _c.Call.Return(run) + return _c +} + +// ListFeatureTags provides a mock function with given fields: ctx, request +func (_m *MockMaterializedFeaturesInterface) ListFeatureTags(ctx context.Context, request ml.ListFeatureTagsRequest) listing.Iterator[ml.FeatureTag] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListFeatureTags") + } + + var r0 listing.Iterator[ml.FeatureTag] + if rf, ok := ret.Get(0).(func(context.Context, ml.ListFeatureTagsRequest) listing.Iterator[ml.FeatureTag]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[ml.FeatureTag]) + } + } + + return r0 +} + +// MockMaterializedFeaturesInterface_ListFeatureTags_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListFeatureTags' +type MockMaterializedFeaturesInterface_ListFeatureTags_Call struct { + *mock.Call +} + +// ListFeatureTags is a helper method to define mock.On call +// - ctx context.Context +// - request ml.ListFeatureTagsRequest +func (_e *MockMaterializedFeaturesInterface_Expecter) ListFeatureTags(ctx interface{}, request interface{}) *MockMaterializedFeaturesInterface_ListFeatureTags_Call { + return &MockMaterializedFeaturesInterface_ListFeatureTags_Call{Call: _e.mock.On("ListFeatureTags", ctx, request)} +} + +func (_c *MockMaterializedFeaturesInterface_ListFeatureTags_Call) Run(run func(ctx context.Context, request ml.ListFeatureTagsRequest)) *MockMaterializedFeaturesInterface_ListFeatureTags_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ml.ListFeatureTagsRequest)) + }) + return _c +} + +func (_c *MockMaterializedFeaturesInterface_ListFeatureTags_Call) Return(_a0 listing.Iterator[ml.FeatureTag]) *MockMaterializedFeaturesInterface_ListFeatureTags_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockMaterializedFeaturesInterface_ListFeatureTags_Call) RunAndReturn(run func(context.Context, ml.ListFeatureTagsRequest) listing.Iterator[ml.FeatureTag]) *MockMaterializedFeaturesInterface_ListFeatureTags_Call { + _c.Call.Return(run) + return _c +} + +// ListFeatureTagsAll provides a mock function with given fields: ctx, request +func (_m *MockMaterializedFeaturesInterface) ListFeatureTagsAll(ctx context.Context, request ml.ListFeatureTagsRequest) ([]ml.FeatureTag, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListFeatureTagsAll") + } + + var r0 []ml.FeatureTag + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, ml.ListFeatureTagsRequest) ([]ml.FeatureTag, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, ml.ListFeatureTagsRequest) []ml.FeatureTag); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]ml.FeatureTag) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, ml.ListFeatureTagsRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockMaterializedFeaturesInterface_ListFeatureTagsAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListFeatureTagsAll' +type MockMaterializedFeaturesInterface_ListFeatureTagsAll_Call struct { + *mock.Call +} + +// ListFeatureTagsAll is a helper method to define mock.On call +// - ctx context.Context +// - request ml.ListFeatureTagsRequest +func (_e *MockMaterializedFeaturesInterface_Expecter) ListFeatureTagsAll(ctx interface{}, request interface{}) *MockMaterializedFeaturesInterface_ListFeatureTagsAll_Call { + return &MockMaterializedFeaturesInterface_ListFeatureTagsAll_Call{Call: _e.mock.On("ListFeatureTagsAll", ctx, request)} +} + +func (_c *MockMaterializedFeaturesInterface_ListFeatureTagsAll_Call) Run(run func(ctx context.Context, request ml.ListFeatureTagsRequest)) *MockMaterializedFeaturesInterface_ListFeatureTagsAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ml.ListFeatureTagsRequest)) + }) + return _c +} + +func (_c *MockMaterializedFeaturesInterface_ListFeatureTagsAll_Call) Return(_a0 []ml.FeatureTag, _a1 error) *MockMaterializedFeaturesInterface_ListFeatureTagsAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockMaterializedFeaturesInterface_ListFeatureTagsAll_Call) RunAndReturn(run func(context.Context, ml.ListFeatureTagsRequest) ([]ml.FeatureTag, error)) *MockMaterializedFeaturesInterface_ListFeatureTagsAll_Call { + _c.Call.Return(run) + return _c +} + +// ListFeatureTagsByTableNameAndFeatureName provides a mock function with given fields: ctx, tableName, featureName +func (_m *MockMaterializedFeaturesInterface) ListFeatureTagsByTableNameAndFeatureName(ctx context.Context, tableName string, featureName string) (*ml.ListFeatureTagsResponse, error) { + ret := _m.Called(ctx, tableName, featureName) + + if len(ret) == 0 { + panic("no return value specified for ListFeatureTagsByTableNameAndFeatureName") + } + + var r0 *ml.ListFeatureTagsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) (*ml.ListFeatureTagsResponse, error)); ok { + return rf(ctx, tableName, featureName) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string) *ml.ListFeatureTagsResponse); ok { + r0 = rf(ctx, tableName, featureName) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ml.ListFeatureTagsResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = rf(ctx, tableName, featureName) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockMaterializedFeaturesInterface_ListFeatureTagsByTableNameAndFeatureName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListFeatureTagsByTableNameAndFeatureName' +type MockMaterializedFeaturesInterface_ListFeatureTagsByTableNameAndFeatureName_Call struct { + *mock.Call +} + +// ListFeatureTagsByTableNameAndFeatureName is a helper method to define mock.On call +// - ctx context.Context +// - tableName string +// - featureName string +func (_e *MockMaterializedFeaturesInterface_Expecter) ListFeatureTagsByTableNameAndFeatureName(ctx interface{}, tableName interface{}, featureName interface{}) *MockMaterializedFeaturesInterface_ListFeatureTagsByTableNameAndFeatureName_Call { + return &MockMaterializedFeaturesInterface_ListFeatureTagsByTableNameAndFeatureName_Call{Call: _e.mock.On("ListFeatureTagsByTableNameAndFeatureName", ctx, tableName, featureName)} +} + +func (_c *MockMaterializedFeaturesInterface_ListFeatureTagsByTableNameAndFeatureName_Call) Run(run func(ctx context.Context, tableName string, featureName string)) *MockMaterializedFeaturesInterface_ListFeatureTagsByTableNameAndFeatureName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *MockMaterializedFeaturesInterface_ListFeatureTagsByTableNameAndFeatureName_Call) Return(_a0 *ml.ListFeatureTagsResponse, _a1 error) *MockMaterializedFeaturesInterface_ListFeatureTagsByTableNameAndFeatureName_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockMaterializedFeaturesInterface_ListFeatureTagsByTableNameAndFeatureName_Call) RunAndReturn(run func(context.Context, string, string) (*ml.ListFeatureTagsResponse, error)) *MockMaterializedFeaturesInterface_ListFeatureTagsByTableNameAndFeatureName_Call { + _c.Call.Return(run) + return _c +} + +// UpdateFeatureTag provides a mock function with given fields: ctx, request +func (_m *MockMaterializedFeaturesInterface) UpdateFeatureTag(ctx context.Context, request ml.UpdateFeatureTagRequest) (*ml.FeatureTag, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for UpdateFeatureTag") + } + + var r0 *ml.FeatureTag + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, ml.UpdateFeatureTagRequest) (*ml.FeatureTag, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, ml.UpdateFeatureTagRequest) *ml.FeatureTag); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ml.FeatureTag) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, ml.UpdateFeatureTagRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockMaterializedFeaturesInterface_UpdateFeatureTag_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateFeatureTag' +type MockMaterializedFeaturesInterface_UpdateFeatureTag_Call struct { + *mock.Call +} + +// UpdateFeatureTag is a helper method to define mock.On call +// - ctx context.Context +// - request ml.UpdateFeatureTagRequest +func (_e *MockMaterializedFeaturesInterface_Expecter) UpdateFeatureTag(ctx interface{}, request interface{}) *MockMaterializedFeaturesInterface_UpdateFeatureTag_Call { + return &MockMaterializedFeaturesInterface_UpdateFeatureTag_Call{Call: _e.mock.On("UpdateFeatureTag", ctx, request)} +} + +func (_c *MockMaterializedFeaturesInterface_UpdateFeatureTag_Call) Run(run func(ctx context.Context, request ml.UpdateFeatureTagRequest)) *MockMaterializedFeaturesInterface_UpdateFeatureTag_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ml.UpdateFeatureTagRequest)) + }) + return _c +} + +func (_c *MockMaterializedFeaturesInterface_UpdateFeatureTag_Call) Return(_a0 *ml.FeatureTag, _a1 error) *MockMaterializedFeaturesInterface_UpdateFeatureTag_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockMaterializedFeaturesInterface_UpdateFeatureTag_Call) RunAndReturn(run func(context.Context, ml.UpdateFeatureTagRequest) (*ml.FeatureTag, error)) *MockMaterializedFeaturesInterface_UpdateFeatureTag_Call { + _c.Call.Return(run) + return _c +} + +// NewMockMaterializedFeaturesInterface creates a new instance of MockMaterializedFeaturesInterface. 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 NewMockMaterializedFeaturesInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *MockMaterializedFeaturesInterface { + mock := &MockMaterializedFeaturesInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/experimental/mocks/service/sql/mock_alerts_legacy_interface.go b/experimental/mocks/service/sql/mock_alerts_legacy_interface.go index 16a24de53..f4c7d6f6f 100644 --- a/experimental/mocks/service/sql/mock_alerts_legacy_interface.go +++ b/experimental/mocks/service/sql/mock_alerts_legacy_interface.go @@ -293,123 +293,6 @@ func (_c *MockAlertsLegacyInterface_GetByAlertId_Call) RunAndReturn(run func(con return _c } -// GetByName provides a mock function with given fields: ctx, name -func (_m *MockAlertsLegacyInterface) GetByName(ctx context.Context, name string) (*sql.LegacyAlert, error) { - ret := _m.Called(ctx, name) - - if len(ret) == 0 { - panic("no return value specified for GetByName") - } - - var r0 *sql.LegacyAlert - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*sql.LegacyAlert, error)); ok { - return rf(ctx, name) - } - if rf, ok := ret.Get(0).(func(context.Context, string) *sql.LegacyAlert); ok { - r0 = rf(ctx, name) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*sql.LegacyAlert) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, name) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockAlertsLegacyInterface_GetByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetByName' -type MockAlertsLegacyInterface_GetByName_Call struct { - *mock.Call -} - -// GetByName is a helper method to define mock.On call -// - ctx context.Context -// - name string -func (_e *MockAlertsLegacyInterface_Expecter) GetByName(ctx interface{}, name interface{}) *MockAlertsLegacyInterface_GetByName_Call { - return &MockAlertsLegacyInterface_GetByName_Call{Call: _e.mock.On("GetByName", ctx, name)} -} - -func (_c *MockAlertsLegacyInterface_GetByName_Call) Run(run func(ctx context.Context, name string)) *MockAlertsLegacyInterface_GetByName_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) - }) - return _c -} - -func (_c *MockAlertsLegacyInterface_GetByName_Call) Return(_a0 *sql.LegacyAlert, _a1 error) *MockAlertsLegacyInterface_GetByName_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockAlertsLegacyInterface_GetByName_Call) RunAndReturn(run func(context.Context, string) (*sql.LegacyAlert, error)) *MockAlertsLegacyInterface_GetByName_Call { - _c.Call.Return(run) - return _c -} - -// LegacyAlertNameToIdMap provides a mock function with given fields: ctx -func (_m *MockAlertsLegacyInterface) LegacyAlertNameToIdMap(ctx context.Context) (map[string]string, error) { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for LegacyAlertNameToIdMap") - } - - var r0 map[string]string - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (map[string]string, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) map[string]string); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(map[string]string) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockAlertsLegacyInterface_LegacyAlertNameToIdMap_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LegacyAlertNameToIdMap' -type MockAlertsLegacyInterface_LegacyAlertNameToIdMap_Call struct { - *mock.Call -} - -// LegacyAlertNameToIdMap is a helper method to define mock.On call -// - ctx context.Context -func (_e *MockAlertsLegacyInterface_Expecter) LegacyAlertNameToIdMap(ctx interface{}) *MockAlertsLegacyInterface_LegacyAlertNameToIdMap_Call { - return &MockAlertsLegacyInterface_LegacyAlertNameToIdMap_Call{Call: _e.mock.On("LegacyAlertNameToIdMap", ctx)} -} - -func (_c *MockAlertsLegacyInterface_LegacyAlertNameToIdMap_Call) Run(run func(ctx context.Context)) *MockAlertsLegacyInterface_LegacyAlertNameToIdMap_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) - }) - return _c -} - -func (_c *MockAlertsLegacyInterface_LegacyAlertNameToIdMap_Call) Return(_a0 map[string]string, _a1 error) *MockAlertsLegacyInterface_LegacyAlertNameToIdMap_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockAlertsLegacyInterface_LegacyAlertNameToIdMap_Call) RunAndReturn(run func(context.Context) (map[string]string, error)) *MockAlertsLegacyInterface_LegacyAlertNameToIdMap_Call { - _c.Call.Return(run) - return _c -} - // List provides a mock function with given fields: ctx func (_m *MockAlertsLegacyInterface) List(ctx context.Context) ([]sql.LegacyAlert, error) { ret := _m.Called(ctx) diff --git a/experimental/mocks/service/sql/mock_dashboard_widgets_interface.go b/experimental/mocks/service/sql/mock_dashboard_widgets_interface.go index 160f3d3c6..10ba059fd 100644 --- a/experimental/mocks/service/sql/mock_dashboard_widgets_interface.go +++ b/experimental/mocks/service/sql/mock_dashboard_widgets_interface.go @@ -176,7 +176,7 @@ func (_c *MockDashboardWidgetsInterface_DeleteById_Call) RunAndReturn(run func(c } // Update provides a mock function with given fields: ctx, request -func (_m *MockDashboardWidgetsInterface) Update(ctx context.Context, request sql.CreateWidget) (*sql.Widget, error) { +func (_m *MockDashboardWidgetsInterface) Update(ctx context.Context, request sql.UpdateWidgetRequest) (*sql.Widget, error) { ret := _m.Called(ctx, request) if len(ret) == 0 { @@ -185,10 +185,10 @@ func (_m *MockDashboardWidgetsInterface) Update(ctx context.Context, request sql var r0 *sql.Widget var r1 error - if rf, ok := ret.Get(0).(func(context.Context, sql.CreateWidget) (*sql.Widget, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, sql.UpdateWidgetRequest) (*sql.Widget, error)); ok { return rf(ctx, request) } - if rf, ok := ret.Get(0).(func(context.Context, sql.CreateWidget) *sql.Widget); ok { + if rf, ok := ret.Get(0).(func(context.Context, sql.UpdateWidgetRequest) *sql.Widget); ok { r0 = rf(ctx, request) } else { if ret.Get(0) != nil { @@ -196,7 +196,7 @@ func (_m *MockDashboardWidgetsInterface) Update(ctx context.Context, request sql } } - if rf, ok := ret.Get(1).(func(context.Context, sql.CreateWidget) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, sql.UpdateWidgetRequest) error); ok { r1 = rf(ctx, request) } else { r1 = ret.Error(1) @@ -212,14 +212,14 @@ type MockDashboardWidgetsInterface_Update_Call struct { // Update is a helper method to define mock.On call // - ctx context.Context -// - request sql.CreateWidget +// - request sql.UpdateWidgetRequest func (_e *MockDashboardWidgetsInterface_Expecter) Update(ctx interface{}, request interface{}) *MockDashboardWidgetsInterface_Update_Call { return &MockDashboardWidgetsInterface_Update_Call{Call: _e.mock.On("Update", ctx, request)} } -func (_c *MockDashboardWidgetsInterface_Update_Call) Run(run func(ctx context.Context, request sql.CreateWidget)) *MockDashboardWidgetsInterface_Update_Call { +func (_c *MockDashboardWidgetsInterface_Update_Call) Run(run func(ctx context.Context, request sql.UpdateWidgetRequest)) *MockDashboardWidgetsInterface_Update_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(sql.CreateWidget)) + run(args[0].(context.Context), args[1].(sql.UpdateWidgetRequest)) }) return _c } @@ -229,7 +229,7 @@ func (_c *MockDashboardWidgetsInterface_Update_Call) Return(_a0 *sql.Widget, _a1 return _c } -func (_c *MockDashboardWidgetsInterface_Update_Call) RunAndReturn(run func(context.Context, sql.CreateWidget) (*sql.Widget, error)) *MockDashboardWidgetsInterface_Update_Call { +func (_c *MockDashboardWidgetsInterface_Update_Call) RunAndReturn(run func(context.Context, sql.UpdateWidgetRequest) (*sql.Widget, error)) *MockDashboardWidgetsInterface_Update_Call { _c.Call.Return(run) return _c } diff --git a/experimental/mocks/service/sql/mock_dashboards_interface.go b/experimental/mocks/service/sql/mock_dashboards_interface.go index 8771ff5f2..1c181f76d 100644 --- a/experimental/mocks/service/sql/mock_dashboards_interface.go +++ b/experimental/mocks/service/sql/mock_dashboards_interface.go @@ -83,65 +83,6 @@ func (_c *MockDashboardsInterface_Create_Call) RunAndReturn(run func(context.Con return _c } -// DashboardNameToIdMap provides a mock function with given fields: ctx, request -func (_m *MockDashboardsInterface) DashboardNameToIdMap(ctx context.Context, request sql.ListDashboardsRequest) (map[string]string, error) { - ret := _m.Called(ctx, request) - - if len(ret) == 0 { - panic("no return value specified for DashboardNameToIdMap") - } - - var r0 map[string]string - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, sql.ListDashboardsRequest) (map[string]string, error)); ok { - return rf(ctx, request) - } - if rf, ok := ret.Get(0).(func(context.Context, sql.ListDashboardsRequest) map[string]string); ok { - r0 = rf(ctx, request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(map[string]string) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, sql.ListDashboardsRequest) error); ok { - r1 = rf(ctx, request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockDashboardsInterface_DashboardNameToIdMap_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DashboardNameToIdMap' -type MockDashboardsInterface_DashboardNameToIdMap_Call struct { - *mock.Call -} - -// DashboardNameToIdMap is a helper method to define mock.On call -// - ctx context.Context -// - request sql.ListDashboardsRequest -func (_e *MockDashboardsInterface_Expecter) DashboardNameToIdMap(ctx interface{}, request interface{}) *MockDashboardsInterface_DashboardNameToIdMap_Call { - return &MockDashboardsInterface_DashboardNameToIdMap_Call{Call: _e.mock.On("DashboardNameToIdMap", ctx, request)} -} - -func (_c *MockDashboardsInterface_DashboardNameToIdMap_Call) Run(run func(ctx context.Context, request sql.ListDashboardsRequest)) *MockDashboardsInterface_DashboardNameToIdMap_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(sql.ListDashboardsRequest)) - }) - return _c -} - -func (_c *MockDashboardsInterface_DashboardNameToIdMap_Call) Return(_a0 map[string]string, _a1 error) *MockDashboardsInterface_DashboardNameToIdMap_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockDashboardsInterface_DashboardNameToIdMap_Call) RunAndReturn(run func(context.Context, sql.ListDashboardsRequest) (map[string]string, error)) *MockDashboardsInterface_DashboardNameToIdMap_Call { - _c.Call.Return(run) - return _c -} - // Delete provides a mock function with given fields: ctx, request func (_m *MockDashboardsInterface) Delete(ctx context.Context, request sql.DeleteDashboardRequest) error { ret := _m.Called(ctx, request) @@ -354,65 +295,6 @@ func (_c *MockDashboardsInterface_GetByDashboardId_Call) RunAndReturn(run func(c return _c } -// GetByName provides a mock function with given fields: ctx, name -func (_m *MockDashboardsInterface) GetByName(ctx context.Context, name string) (*sql.Dashboard, error) { - ret := _m.Called(ctx, name) - - if len(ret) == 0 { - panic("no return value specified for GetByName") - } - - var r0 *sql.Dashboard - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*sql.Dashboard, error)); ok { - return rf(ctx, name) - } - if rf, ok := ret.Get(0).(func(context.Context, string) *sql.Dashboard); ok { - r0 = rf(ctx, name) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*sql.Dashboard) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, name) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockDashboardsInterface_GetByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetByName' -type MockDashboardsInterface_GetByName_Call struct { - *mock.Call -} - -// GetByName is a helper method to define mock.On call -// - ctx context.Context -// - name string -func (_e *MockDashboardsInterface_Expecter) GetByName(ctx interface{}, name interface{}) *MockDashboardsInterface_GetByName_Call { - return &MockDashboardsInterface_GetByName_Call{Call: _e.mock.On("GetByName", ctx, name)} -} - -func (_c *MockDashboardsInterface_GetByName_Call) Run(run func(ctx context.Context, name string)) *MockDashboardsInterface_GetByName_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) - }) - return _c -} - -func (_c *MockDashboardsInterface_GetByName_Call) Return(_a0 *sql.Dashboard, _a1 error) *MockDashboardsInterface_GetByName_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockDashboardsInterface_GetByName_Call) RunAndReturn(run func(context.Context, string) (*sql.Dashboard, error)) *MockDashboardsInterface_GetByName_Call { - _c.Call.Return(run) - return _c -} - // List provides a mock function with given fields: ctx, request func (_m *MockDashboardsInterface) List(ctx context.Context, request sql.ListDashboardsRequest) listing.Iterator[sql.Dashboard] { ret := _m.Called(ctx, request) diff --git a/experimental/mocks/service/sql/mock_data_sources_interface.go b/experimental/mocks/service/sql/mock_data_sources_interface.go index 963277e92..5153f5997 100644 --- a/experimental/mocks/service/sql/mock_data_sources_interface.go +++ b/experimental/mocks/service/sql/mock_data_sources_interface.go @@ -22,123 +22,6 @@ func (_m *MockDataSourcesInterface) EXPECT() *MockDataSourcesInterface_Expecter return &MockDataSourcesInterface_Expecter{mock: &_m.Mock} } -// DataSourceNameToIdMap provides a mock function with given fields: ctx -func (_m *MockDataSourcesInterface) DataSourceNameToIdMap(ctx context.Context) (map[string]string, error) { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for DataSourceNameToIdMap") - } - - var r0 map[string]string - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (map[string]string, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) map[string]string); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(map[string]string) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockDataSourcesInterface_DataSourceNameToIdMap_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DataSourceNameToIdMap' -type MockDataSourcesInterface_DataSourceNameToIdMap_Call struct { - *mock.Call -} - -// DataSourceNameToIdMap is a helper method to define mock.On call -// - ctx context.Context -func (_e *MockDataSourcesInterface_Expecter) DataSourceNameToIdMap(ctx interface{}) *MockDataSourcesInterface_DataSourceNameToIdMap_Call { - return &MockDataSourcesInterface_DataSourceNameToIdMap_Call{Call: _e.mock.On("DataSourceNameToIdMap", ctx)} -} - -func (_c *MockDataSourcesInterface_DataSourceNameToIdMap_Call) Run(run func(ctx context.Context)) *MockDataSourcesInterface_DataSourceNameToIdMap_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) - }) - return _c -} - -func (_c *MockDataSourcesInterface_DataSourceNameToIdMap_Call) Return(_a0 map[string]string, _a1 error) *MockDataSourcesInterface_DataSourceNameToIdMap_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockDataSourcesInterface_DataSourceNameToIdMap_Call) RunAndReturn(run func(context.Context) (map[string]string, error)) *MockDataSourcesInterface_DataSourceNameToIdMap_Call { - _c.Call.Return(run) - return _c -} - -// GetByName provides a mock function with given fields: ctx, name -func (_m *MockDataSourcesInterface) GetByName(ctx context.Context, name string) (*sql.DataSource, error) { - ret := _m.Called(ctx, name) - - if len(ret) == 0 { - panic("no return value specified for GetByName") - } - - var r0 *sql.DataSource - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*sql.DataSource, error)); ok { - return rf(ctx, name) - } - if rf, ok := ret.Get(0).(func(context.Context, string) *sql.DataSource); ok { - r0 = rf(ctx, name) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*sql.DataSource) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, name) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockDataSourcesInterface_GetByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetByName' -type MockDataSourcesInterface_GetByName_Call struct { - *mock.Call -} - -// GetByName is a helper method to define mock.On call -// - ctx context.Context -// - name string -func (_e *MockDataSourcesInterface_Expecter) GetByName(ctx interface{}, name interface{}) *MockDataSourcesInterface_GetByName_Call { - return &MockDataSourcesInterface_GetByName_Call{Call: _e.mock.On("GetByName", ctx, name)} -} - -func (_c *MockDataSourcesInterface_GetByName_Call) Run(run func(ctx context.Context, name string)) *MockDataSourcesInterface_GetByName_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) - }) - return _c -} - -func (_c *MockDataSourcesInterface_GetByName_Call) Return(_a0 *sql.DataSource, _a1 error) *MockDataSourcesInterface_GetByName_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockDataSourcesInterface_GetByName_Call) RunAndReturn(run func(context.Context, string) (*sql.DataSource, error)) *MockDataSourcesInterface_GetByName_Call { - _c.Call.Return(run) - return _c -} - // List provides a mock function with given fields: ctx func (_m *MockDataSourcesInterface) List(ctx context.Context) ([]sql.DataSource, error) { ret := _m.Called(ctx) diff --git a/experimental/mocks/service/sql/mock_queries_legacy_interface.go b/experimental/mocks/service/sql/mock_queries_legacy_interface.go index 2997c23c5..37128f75c 100644 --- a/experimental/mocks/service/sql/mock_queries_legacy_interface.go +++ b/experimental/mocks/service/sql/mock_queries_legacy_interface.go @@ -236,65 +236,6 @@ func (_c *MockQueriesLegacyInterface_Get_Call) RunAndReturn(run func(context.Con return _c } -// GetByName provides a mock function with given fields: ctx, name -func (_m *MockQueriesLegacyInterface) GetByName(ctx context.Context, name string) (*sql.LegacyQuery, error) { - ret := _m.Called(ctx, name) - - if len(ret) == 0 { - panic("no return value specified for GetByName") - } - - var r0 *sql.LegacyQuery - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*sql.LegacyQuery, error)); ok { - return rf(ctx, name) - } - if rf, ok := ret.Get(0).(func(context.Context, string) *sql.LegacyQuery); ok { - r0 = rf(ctx, name) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*sql.LegacyQuery) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, name) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockQueriesLegacyInterface_GetByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetByName' -type MockQueriesLegacyInterface_GetByName_Call struct { - *mock.Call -} - -// GetByName is a helper method to define mock.On call -// - ctx context.Context -// - name string -func (_e *MockQueriesLegacyInterface_Expecter) GetByName(ctx interface{}, name interface{}) *MockQueriesLegacyInterface_GetByName_Call { - return &MockQueriesLegacyInterface_GetByName_Call{Call: _e.mock.On("GetByName", ctx, name)} -} - -func (_c *MockQueriesLegacyInterface_GetByName_Call) Run(run func(ctx context.Context, name string)) *MockQueriesLegacyInterface_GetByName_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) - }) - return _c -} - -func (_c *MockQueriesLegacyInterface_GetByName_Call) Return(_a0 *sql.LegacyQuery, _a1 error) *MockQueriesLegacyInterface_GetByName_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockQueriesLegacyInterface_GetByName_Call) RunAndReturn(run func(context.Context, string) (*sql.LegacyQuery, error)) *MockQueriesLegacyInterface_GetByName_Call { - _c.Call.Return(run) - return _c -} - // GetByQueryId provides a mock function with given fields: ctx, queryId func (_m *MockQueriesLegacyInterface) GetByQueryId(ctx context.Context, queryId string) (*sql.LegacyQuery, error) { ret := _m.Called(ctx, queryId) @@ -354,65 +295,6 @@ func (_c *MockQueriesLegacyInterface_GetByQueryId_Call) RunAndReturn(run func(co return _c } -// LegacyQueryNameToIdMap provides a mock function with given fields: ctx, request -func (_m *MockQueriesLegacyInterface) LegacyQueryNameToIdMap(ctx context.Context, request sql.ListQueriesLegacyRequest) (map[string]string, error) { - ret := _m.Called(ctx, request) - - if len(ret) == 0 { - panic("no return value specified for LegacyQueryNameToIdMap") - } - - var r0 map[string]string - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, sql.ListQueriesLegacyRequest) (map[string]string, error)); ok { - return rf(ctx, request) - } - if rf, ok := ret.Get(0).(func(context.Context, sql.ListQueriesLegacyRequest) map[string]string); ok { - r0 = rf(ctx, request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(map[string]string) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, sql.ListQueriesLegacyRequest) error); ok { - r1 = rf(ctx, request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockQueriesLegacyInterface_LegacyQueryNameToIdMap_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LegacyQueryNameToIdMap' -type MockQueriesLegacyInterface_LegacyQueryNameToIdMap_Call struct { - *mock.Call -} - -// LegacyQueryNameToIdMap is a helper method to define mock.On call -// - ctx context.Context -// - request sql.ListQueriesLegacyRequest -func (_e *MockQueriesLegacyInterface_Expecter) LegacyQueryNameToIdMap(ctx interface{}, request interface{}) *MockQueriesLegacyInterface_LegacyQueryNameToIdMap_Call { - return &MockQueriesLegacyInterface_LegacyQueryNameToIdMap_Call{Call: _e.mock.On("LegacyQueryNameToIdMap", ctx, request)} -} - -func (_c *MockQueriesLegacyInterface_LegacyQueryNameToIdMap_Call) Run(run func(ctx context.Context, request sql.ListQueriesLegacyRequest)) *MockQueriesLegacyInterface_LegacyQueryNameToIdMap_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(sql.ListQueriesLegacyRequest)) - }) - return _c -} - -func (_c *MockQueriesLegacyInterface_LegacyQueryNameToIdMap_Call) Return(_a0 map[string]string, _a1 error) *MockQueriesLegacyInterface_LegacyQueryNameToIdMap_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockQueriesLegacyInterface_LegacyQueryNameToIdMap_Call) RunAndReturn(run func(context.Context, sql.ListQueriesLegacyRequest) (map[string]string, error)) *MockQueriesLegacyInterface_LegacyQueryNameToIdMap_Call { - _c.Call.Return(run) - return _c -} - // List provides a mock function with given fields: ctx, request func (_m *MockQueriesLegacyInterface) List(ctx context.Context, request sql.ListQueriesLegacyRequest) listing.Iterator[sql.LegacyQuery] { ret := _m.Called(ctx, request) diff --git a/service/aibuilder/impl.go b/service/aibuilder/impl.go index ba644c86a..e1d1b51a0 100755 --- a/service/aibuilder/impl.go +++ b/service/aibuilder/impl.go @@ -16,13 +16,12 @@ type aiBuilderImpl struct { } func (a *aiBuilderImpl) CancelOptimize(ctx context.Context, request CancelCustomLlmOptimizationRunRequest) error { - var cancelOptimizeResponse CancelOptimizeResponse path := fmt.Sprintf("/api/2.0/custom-llms/%v/optimize/cancel", request.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &cancelOptimizeResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } @@ -38,12 +37,11 @@ func (a *aiBuilderImpl) CreateCustomLlm(ctx context.Context, request CreateCusto } func (a *aiBuilderImpl) DeleteCustomLlm(ctx context.Context, request DeleteCustomLlmRequest) error { - var deleteCustomLlmResponse DeleteCustomLlmResponse path := fmt.Sprintf("/api/2.0/custom-lms/%v", request.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteCustomLlmResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } diff --git a/service/aibuilder/model.go b/service/aibuilder/model.go index c88ca98f2..955899c6d 100755 --- a/service/aibuilder/model.go +++ b/service/aibuilder/model.go @@ -77,7 +77,6 @@ type Dataset struct { Table Table `json:"table"` } -// Delete a Custom LLM type DeleteCustomLlmRequest struct { // The id of the custom llm Id string `json:"-" url:"-"` @@ -86,7 +85,6 @@ type DeleteCustomLlmRequest struct { type DeleteCustomLlmResponse struct { } -// Get a Custom LLM type GetCustomLlmRequest struct { // The id of the custom llm Id string `json:"-" url:"-"` diff --git a/service/apps/model.go b/service/apps/model.go index b090cbd9b..5a782ff67 100755 --- a/service/apps/model.go +++ b/service/apps/model.go @@ -794,14 +794,12 @@ func (s ComputeStatus) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Create an app deployment type CreateAppDeploymentRequest struct { AppDeployment AppDeployment `json:"app_deployment"` // The name of the app. AppName string `json:"-" url:"-"` } -// Create an app type CreateAppRequest struct { App App `json:"app"` // If true, the app will not be started after creation. @@ -818,13 +816,11 @@ func (s CreateAppRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Delete an app type DeleteAppRequest struct { // The name of the app. Name string `json:"-" url:"-"` } -// Get an app deployment type GetAppDeploymentRequest struct { // The name of the app. AppName string `json:"-" url:"-"` @@ -832,7 +828,6 @@ type GetAppDeploymentRequest struct { DeploymentId string `json:"-" url:"-"` } -// Get app permission levels type GetAppPermissionLevelsRequest struct { // The app for which to get or manage permissions. AppName string `json:"-" url:"-"` @@ -843,19 +838,16 @@ type GetAppPermissionLevelsResponse struct { PermissionLevels []AppPermissionsDescription `json:"permission_levels,omitempty"` } -// Get app permissions type GetAppPermissionsRequest struct { // The app for which to get or manage permissions. AppName string `json:"-" url:"-"` } -// Get an app type GetAppRequest struct { // The name of the app. Name string `json:"-" url:"-"` } -// List app deployments type ListAppDeploymentsRequest struct { // The name of the app. AppName string `json:"-" url:"-"` @@ -893,7 +885,6 @@ func (s ListAppDeploymentsResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List apps type ListAppsRequest struct { // Upper bound for items returned. PageSize int `json:"-" url:"page_size,omitempty"` @@ -938,7 +929,6 @@ type StopAppRequest struct { Name string `json:"-" url:"-"` } -// Update an app type UpdateAppRequest struct { App App `json:"app"` // The name of the app. The name must contain only lowercase alphanumeric diff --git a/service/billing/impl.go b/service/billing/impl.go index 3aeb3f8bf..db5ded6ff 100755 --- a/service/billing/impl.go +++ b/service/billing/impl.go @@ -44,12 +44,11 @@ func (a *budgetPolicyImpl) Create(ctx context.Context, request CreateBudgetPolic } func (a *budgetPolicyImpl) Delete(ctx context.Context, request DeleteBudgetPolicyRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.1/accounts/%v/budget-policies/%v", a.client.ConfiguredAccountID(), request.PolicyId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -137,12 +136,11 @@ func (a *budgetsImpl) Create(ctx context.Context, request CreateBudgetConfigurat } func (a *budgetsImpl) Delete(ctx context.Context, request DeleteBudgetConfigurationRequest) error { - var deleteBudgetConfigurationResponse DeleteBudgetConfigurationResponse path := fmt.Sprintf("/api/2.1/accounts/%v/budgets/%v", a.client.ConfiguredAccountID(), request.BudgetId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteBudgetConfigurationResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -278,13 +276,12 @@ func (a *logDeliveryImpl) internalList(ctx context.Context, request ListLogDeliv } func (a *logDeliveryImpl) PatchStatus(ctx context.Context, request UpdateLogDeliveryConfigurationStatusRequest) error { - var patchStatusResponse PatchStatusResponse path := fmt.Sprintf("/api/2.0/accounts/%v/log-delivery/%v", a.client.ConfiguredAccountID(), request.LogDeliveryConfigurationId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &patchStatusResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, nil) return err } diff --git a/service/billing/model.go b/service/billing/model.go index 542b9b5a3..c19bf8121 100644 --- a/service/billing/model.go +++ b/service/billing/model.go @@ -539,7 +539,6 @@ func (s CreateLogDeliveryConfigurationParams) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Delete budget type DeleteBudgetConfigurationRequest struct { // The Databricks budget configuration ID. BudgetId string `json:"-" url:"-"` @@ -548,7 +547,6 @@ type DeleteBudgetConfigurationRequest struct { type DeleteBudgetConfigurationResponse struct { } -// Delete a budget policy type DeleteBudgetPolicyRequest struct { // The Id of the policy. PolicyId string `json:"-" url:"-"` @@ -612,7 +610,6 @@ func (f *DeliveryStatus) Type() string { return "DeliveryStatus" } -// Return billable usage logs type DownloadRequest struct { // Format: `YYYY-MM`. Last month to return billable usage logs for. This // field is required. @@ -664,7 +661,6 @@ func (s Filter) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get usage dashboard type GetBillingUsageDashboardRequest struct { // Workspace level usage dashboard shows usage data for the specified // workspace ID. Global level usage dashboard shows usage data for all @@ -702,7 +698,6 @@ func (s GetBillingUsageDashboardResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get budget type GetBudgetConfigurationRequest struct { // The budget configuration ID BudgetId string `json:"-" url:"-"` @@ -712,7 +707,6 @@ type GetBudgetConfigurationResponse struct { Budget *BudgetConfiguration `json:"budget,omitempty"` } -// Get a budget policy type GetBudgetPolicyRequest struct { // The Id of the policy. PolicyId string `json:"-" url:"-"` @@ -723,7 +717,6 @@ type GetLogDeliveryConfigurationResponse struct { LogDeliveryConfiguration *LogDeliveryConfiguration `json:"log_delivery_configuration,omitempty"` } -// Get log delivery configuration type GetLogDeliveryRequest struct { // The log delivery configuration id of customer LogDeliveryConfigurationId string `json:"-" url:"-"` @@ -734,7 +727,6 @@ type GetLogDeliveryRequest struct { type LimitConfig struct { } -// Get all budgets type ListBudgetConfigurationsRequest struct { // A page token received from a previous get all budget configurations call. // This token can be used to retrieve the subsequent page. Requests first @@ -769,7 +761,6 @@ func (s ListBudgetConfigurationsResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List policies type ListBudgetPoliciesRequest struct { // A filter to apply to the list of policies. FilterBy *Filter `json:"-" url:"filter_by,omitempty"` @@ -821,7 +812,6 @@ func (s ListBudgetPoliciesResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get all log delivery configurations type ListLogDeliveryRequest struct { // The Credentials id to filter the search results with CredentialsId string `json:"-" url:"credentials_id,omitempty"` @@ -1179,7 +1169,6 @@ type UpdateBudgetConfigurationResponse struct { Budget *BudgetConfiguration `json:"budget,omitempty"` } -// Update a budget policy type UpdateBudgetPolicyRequest struct { // DEPRECATED. This is redundant field as LimitConfig is part of the // BudgetPolicy diff --git a/service/catalog/api.go b/service/catalog/api.go index db5f59973..6f954a76f 100755 --- a/service/catalog/api.go +++ b/service/catalog/api.go @@ -1,6 +1,6 @@ // Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. -// These APIs allow you to manage Account Metastore Assignments, Account Metastores, Account Storage Credentials, Artifact Allowlists, Catalogs, Connections, Credentials, External Locations, Functions, Grants, Metastores, Model Versions, Online Tables, Quality Monitors, Registered Models, Resource Quotas, Schemas, Storage Credentials, System Schemas, Table Constraints, Tables, Temporary Table Credentials, Volumes, Workspace Bindings, etc. +// These APIs allow you to manage Account Metastore Assignments, Account Metastores, Account Storage Credentials, Artifact Allowlists, Catalogs, Connections, Credentials, External Lineage, External Locations, External Metadata, Functions, Grants, Metastores, Model Versions, Online Tables, Quality Monitors, Registered Models, Resource Quotas, Schemas, Storage Credentials, System Schemas, Table Constraints, Tables, Temporary Table Credentials, Volumes, Workspace Bindings, etc. package catalog import ( @@ -596,6 +596,52 @@ func (a *CredentialsAPI) GetCredentialByNameArg(ctx context.Context, nameArg str }) } +type ExternalLineageInterface interface { + + // Creates an external lineage relationship between a Databricks or external + // metadata object and another external metadata object. + CreateExternalLineageRelationship(ctx context.Context, request CreateExternalLineageRelationshipRequest) (*ExternalLineageRelationship, error) + + // Deletes an external lineage relationship between a Databricks or external + // metadata object and another external metadata object. + DeleteExternalLineageRelationship(ctx context.Context, request DeleteExternalLineageRelationshipRequest) error + + // Lists external lineage relationships of a Databricks object or external + // metadata given a supplied direction. + // + // This method is generated by Databricks SDK Code Generator. + ListExternalLineageRelationships(ctx context.Context, request ListExternalLineageRelationshipsRequest) listing.Iterator[ExternalLineageInfo] + + // Lists external lineage relationships of a Databricks object or external + // metadata given a supplied direction. + // + // This method is generated by Databricks SDK Code Generator. + ListExternalLineageRelationshipsAll(ctx context.Context, request ListExternalLineageRelationshipsRequest) ([]ExternalLineageInfo, error) + + // Updates an external lineage relationship between a Databricks or external + // metadata object and another external metadata object. + UpdateExternalLineageRelationship(ctx context.Context, request UpdateExternalLineageRelationshipRequest) (*ExternalLineageRelationship, error) +} + +func NewExternalLineage(client *client.DatabricksClient) *ExternalLineageAPI { + return &ExternalLineageAPI{ + externalLineageImpl: externalLineageImpl{ + client: client, + }, + } +} + +// External Lineage APIs enable defining and managing lineage relationships +// between Databricks objects and external systems. These APIs allow users to +// capture data flows connecting Databricks tables, models, and file paths with +// external metadata objects. +// +// With these APIs, users can create, update, delete, and list lineage +// relationships with support for column-level mappings and custom properties. +type ExternalLineageAPI struct { + externalLineageImpl +} + type ExternalLocationsInterface interface { // Creates a new external location entry in the metastore. The caller must be a @@ -687,6 +733,96 @@ func (a *ExternalLocationsAPI) GetByName(ctx context.Context, name string) (*Ext }) } +type ExternalMetadataInterface interface { + + // Creates a new external metadata object in the parent metastore if the caller + // is a metastore admin or has the **CREATE_EXTERNAL_METADATA** privilege. + // Grants **BROWSE** to all account users upon creation by default. + CreateExternalMetadata(ctx context.Context, request CreateExternalMetadataRequest) (*ExternalMetadata, error) + + // Deletes the external metadata object that matches the supplied name. The + // caller must be a metastore admin, the owner of the external metadata object, + // or a user that has the **MANAGE** privilege. + DeleteExternalMetadata(ctx context.Context, request DeleteExternalMetadataRequest) error + + // Deletes the external metadata object that matches the supplied name. The + // caller must be a metastore admin, the owner of the external metadata object, + // or a user that has the **MANAGE** privilege. + DeleteExternalMetadataByName(ctx context.Context, name string) error + + // Gets the specified external metadata object in a metastore. The caller must + // be a metastore admin, the owner of the external metadata object, or a user + // that has the **BROWSE** privilege. + GetExternalMetadata(ctx context.Context, request GetExternalMetadataRequest) (*ExternalMetadata, error) + + // Gets the specified external metadata object in a metastore. The caller must + // be a metastore admin, the owner of the external metadata object, or a user + // that has the **BROWSE** privilege. + GetExternalMetadataByName(ctx context.Context, name string) (*ExternalMetadata, error) + + // Gets an array of external metadata objects in the metastore. If the caller is + // the metastore admin, all external metadata objects will be retrieved. + // Otherwise, only external metadata objects that the caller has **BROWSE** on + // will be retrieved. There is no guarantee of a specific ordering of the + // elements in the array. + // + // This method is generated by Databricks SDK Code Generator. + ListExternalMetadata(ctx context.Context, request ListExternalMetadataRequest) listing.Iterator[ExternalMetadata] + + // Gets an array of external metadata objects in the metastore. If the caller is + // the metastore admin, all external metadata objects will be retrieved. + // Otherwise, only external metadata objects that the caller has **BROWSE** on + // will be retrieved. There is no guarantee of a specific ordering of the + // elements in the array. + // + // This method is generated by Databricks SDK Code Generator. + ListExternalMetadataAll(ctx context.Context, request ListExternalMetadataRequest) ([]ExternalMetadata, error) + + // Updates the external metadata object that matches the supplied name. The + // caller can only update either the owner or other metadata fields in one + // request. The caller must be a metastore admin, the owner of the external + // metadata object, or a user that has the **MODIFY** privilege. If the caller + // is updating the owner, they must also have the **MANAGE** privilege. + UpdateExternalMetadata(ctx context.Context, request UpdateExternalMetadataRequest) (*ExternalMetadata, error) +} + +func NewExternalMetadata(client *client.DatabricksClient) *ExternalMetadataAPI { + return &ExternalMetadataAPI{ + externalMetadataImpl: externalMetadataImpl{ + client: client, + }, + } +} + +// External Metadata objects enable customers to register and manage metadata +// about external systems within Unity Catalog. +// +// These APIs provide a standardized way to create, update, retrieve, list, and +// delete external metadata objects. Fine-grained authorization ensures that +// only users with appropriate permissions can view and manage external metadata +// objects. +type ExternalMetadataAPI struct { + externalMetadataImpl +} + +// Deletes the external metadata object that matches the supplied name. The +// caller must be a metastore admin, the owner of the external metadata object, +// or a user that has the **MANAGE** privilege. +func (a *ExternalMetadataAPI) DeleteExternalMetadataByName(ctx context.Context, name string) error { + return a.externalMetadataImpl.DeleteExternalMetadata(ctx, DeleteExternalMetadataRequest{ + Name: name, + }) +} + +// Gets the specified external metadata object in a metastore. The caller must +// be a metastore admin, the owner of the external metadata object, or a user +// that has the **BROWSE** privilege. +func (a *ExternalMetadataAPI) GetExternalMetadataByName(ctx context.Context, name string) (*ExternalMetadata, error) { + return a.externalMetadataImpl.GetExternalMetadata(ctx, GetExternalMetadataRequest{ + Name: name, + }) +} + type FunctionsInterface interface { // **WARNING: This API is experimental and will change in future versions** @@ -2377,24 +2513,6 @@ type TablesInterface interface { // This method is generated by Databricks SDK Code Generator. ListAll(ctx context.Context, request ListTablesRequest) ([]TableInfo, error) - // TableInfoNameToTableIdMap calls [TablesAPI.ListAll] and creates a map of results with [TableInfo].Name as key and [TableInfo].TableId as value. - // - // Returns an error if there's more than one [TableInfo] with the same .Name. - // - // Note: All [TableInfo] instances are loaded into memory before creating a map. - // - // This method is generated by Databricks SDK Code Generator. - TableInfoNameToTableIdMap(ctx context.Context, request ListTablesRequest) (map[string]string, error) - - // GetByName calls [TablesAPI.TableInfoNameToTableIdMap] and returns a single [TableInfo]. - // - // Returns an error if there's more than one [TableInfo] with the same .Name. - // - // Note: All [TableInfo] instances are loaded into memory before returning matching by name. - // - // This method is generated by Databricks SDK Code Generator. - GetByName(ctx context.Context, name string) (*TableInfo, error) - // Gets an array of summaries for tables for a schema and catalog within the // metastore. The table summaries returned are either: // @@ -2493,59 +2611,6 @@ func (a *TablesAPI) GetByFullName(ctx context.Context, fullName string) (*TableI }) } -// TableInfoNameToTableIdMap calls [TablesAPI.ListAll] and creates a map of results with [TableInfo].Name as key and [TableInfo].TableId as value. -// -// Returns an error if there's more than one [TableInfo] with the same .Name. -// -// Note: All [TableInfo] instances are loaded into memory before creating a map. -// -// This method is generated by Databricks SDK Code Generator. -func (a *TablesAPI) TableInfoNameToTableIdMap(ctx context.Context, request ListTablesRequest) (map[string]string, error) { - ctx = useragent.InContext(ctx, "sdk-feature", "name-to-id") - mapping := map[string]string{} - result, err := a.ListAll(ctx, request) - if err != nil { - return nil, err - } - for _, v := range result { - key := v.Name - _, duplicate := mapping[key] - if duplicate { - return nil, fmt.Errorf("duplicate .Name: %s", key) - } - mapping[key] = v.TableId - } - return mapping, nil -} - -// GetByName calls [TablesAPI.TableInfoNameToTableIdMap] and returns a single [TableInfo]. -// -// Returns an error if there's more than one [TableInfo] with the same .Name. -// -// Note: All [TableInfo] instances are loaded into memory before returning matching by name. -// -// This method is generated by Databricks SDK Code Generator. -func (a *TablesAPI) GetByName(ctx context.Context, name string) (*TableInfo, error) { - ctx = useragent.InContext(ctx, "sdk-feature", "get-by-name") - result, err := a.ListAll(ctx, ListTablesRequest{}) - if err != nil { - return nil, err - } - tmp := map[string][]TableInfo{} - for _, v := range result { - key := v.Name - tmp[key] = append(tmp[key], v) - } - alternatives, ok := tmp[name] - if !ok || len(alternatives) == 0 { - return nil, fmt.Errorf("TableInfo named '%s' does not exist", name) - } - if len(alternatives) > 1 { - return nil, fmt.Errorf("there are %d instances of TableInfo named '%s'", len(alternatives), name) - } - return &alternatives[0], nil -} - type TemporaryTableCredentialsInterface interface { // Get a short-lived credential for directly accessing the table data on cloud diff --git a/service/catalog/impl.go b/service/catalog/impl.go index 4545ea223..e6ebc68f0 100755 --- a/service/catalog/impl.go +++ b/service/catalog/impl.go @@ -18,23 +18,21 @@ type accountMetastoreAssignmentsImpl struct { } func (a *accountMetastoreAssignmentsImpl) Create(ctx context.Context, request AccountsCreateMetastoreAssignment) error { - var createResponse CreateResponse path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v/metastores/%v", a.client.ConfiguredAccountID(), request.WorkspaceId, request.MetastoreId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } func (a *accountMetastoreAssignmentsImpl) Delete(ctx context.Context, request DeleteAccountMetastoreAssignmentRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v/metastores/%v", a.client.ConfiguredAccountID(), request.WorkspaceId, request.MetastoreId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -86,13 +84,12 @@ func (a *accountMetastoreAssignmentsImpl) internalList(ctx context.Context, requ } func (a *accountMetastoreAssignmentsImpl) Update(ctx context.Context, request AccountsUpdateMetastoreAssignment) error { - var updateResponse UpdateResponse path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v/metastores/%v", a.client.ConfiguredAccountID(), request.WorkspaceId, request.MetastoreId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &updateResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, nil) return err } @@ -113,12 +110,11 @@ func (a *accountMetastoresImpl) Create(ctx context.Context, request AccountsCrea } func (a *accountMetastoresImpl) Delete(ctx context.Context, request DeleteAccountMetastoreRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/accounts/%v/metastores/%v", a.client.ConfiguredAccountID(), request.MetastoreId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -196,12 +192,11 @@ func (a *accountStorageCredentialsImpl) Create(ctx context.Context, request Acco } func (a *accountStorageCredentialsImpl) Delete(ctx context.Context, request DeleteAccountStorageCredentialRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/accounts/%v/metastores/%v/storage-credentials/%v", a.client.ConfiguredAccountID(), request.MetastoreId, request.StorageCredentialName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -306,12 +301,11 @@ func (a *catalogsImpl) Create(ctx context.Context, request CreateCatalog) (*Cata } func (a *catalogsImpl) Delete(ctx context.Context, request DeleteCatalogRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.1/unity-catalog/catalogs/%v", request.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -402,12 +396,11 @@ func (a *connectionsImpl) Create(ctx context.Context, request CreateConnection) } func (a *connectionsImpl) Delete(ctx context.Context, request DeleteConnectionRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.1/unity-catalog/connections/%v", request.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -490,12 +483,11 @@ func (a *credentialsImpl) CreateCredential(ctx context.Context, request CreateCr } func (a *credentialsImpl) DeleteCredential(ctx context.Context, request DeleteCredentialRequest) error { - var deleteCredentialResponse DeleteCredentialResponse path := fmt.Sprintf("/api/2.1/unity-catalog/credentials/%v", request.NameArg) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteCredentialResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -593,6 +585,88 @@ func (a *credentialsImpl) ValidateCredential(ctx context.Context, request Valida return &validateCredentialResponse, err } +// unexported type that holds implementations of just ExternalLineage API methods +type externalLineageImpl struct { + client *client.DatabricksClient +} + +func (a *externalLineageImpl) CreateExternalLineageRelationship(ctx context.Context, request CreateExternalLineageRelationshipRequest) (*ExternalLineageRelationship, error) { + var externalLineageRelationship ExternalLineageRelationship + path := "/api/2.0/lineage-tracking/external-lineage" + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request.ExternalLineageRelationship, &externalLineageRelationship) + return &externalLineageRelationship, err +} + +func (a *externalLineageImpl) DeleteExternalLineageRelationship(ctx context.Context, request DeleteExternalLineageRelationshipRequest) error { + path := "/api/2.0/lineage-tracking/external-lineage" + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) + return err +} + +// Lists external lineage relationships of a Databricks object or external +// metadata given a supplied direction. +func (a *externalLineageImpl) ListExternalLineageRelationships(ctx context.Context, request ListExternalLineageRelationshipsRequest) listing.Iterator[ExternalLineageInfo] { + + getNextPage := func(ctx context.Context, req ListExternalLineageRelationshipsRequest) (*ListExternalLineageRelationshipsResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.internalListExternalLineageRelationships(ctx, req) + } + getItems := func(resp *ListExternalLineageRelationshipsResponse) []ExternalLineageInfo { + return resp.ExternalLineageRelationships + } + getNextReq := func(resp *ListExternalLineageRelationshipsResponse) *ListExternalLineageRelationshipsRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// Lists external lineage relationships of a Databricks object or external +// metadata given a supplied direction. +func (a *externalLineageImpl) ListExternalLineageRelationshipsAll(ctx context.Context, request ListExternalLineageRelationshipsRequest) ([]ExternalLineageInfo, error) { + iterator := a.ListExternalLineageRelationships(ctx, request) + return listing.ToSlice[ExternalLineageInfo](ctx, iterator) +} + +func (a *externalLineageImpl) internalListExternalLineageRelationships(ctx context.Context, request ListExternalLineageRelationshipsRequest) (*ListExternalLineageRelationshipsResponse, error) { + var listExternalLineageRelationshipsResponse ListExternalLineageRelationshipsResponse + path := "/api/2.0/lineage-tracking/external-lineage" + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listExternalLineageRelationshipsResponse) + return &listExternalLineageRelationshipsResponse, err +} + +func (a *externalLineageImpl) UpdateExternalLineageRelationship(ctx context.Context, request UpdateExternalLineageRelationshipRequest) (*ExternalLineageRelationship, error) { + var externalLineageRelationship ExternalLineageRelationship + path := "/api/2.0/lineage-tracking/external-lineage" + queryParams := make(map[string]any) + if request.UpdateMask != "" { + queryParams["update_mask"] = request.UpdateMask + } + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request.ExternalLineageRelationship, &externalLineageRelationship) + return &externalLineageRelationship, err +} + // unexported type that holds implementations of just ExternalLocations API methods type externalLocationsImpl struct { client *client.DatabricksClient @@ -610,12 +684,11 @@ func (a *externalLocationsImpl) Create(ctx context.Context, request CreateExtern } func (a *externalLocationsImpl) Delete(ctx context.Context, request DeleteExternalLocationRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.1/unity-catalog/external-locations/%v", request.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -689,6 +762,104 @@ func (a *externalLocationsImpl) Update(ctx context.Context, request UpdateExtern return &externalLocationInfo, err } +// unexported type that holds implementations of just ExternalMetadata API methods +type externalMetadataImpl struct { + client *client.DatabricksClient +} + +func (a *externalMetadataImpl) CreateExternalMetadata(ctx context.Context, request CreateExternalMetadataRequest) (*ExternalMetadata, error) { + var externalMetadata ExternalMetadata + path := "/api/2.0/lineage-tracking/external-metadata" + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request.ExternalMetadata, &externalMetadata) + return &externalMetadata, err +} + +func (a *externalMetadataImpl) DeleteExternalMetadata(ctx context.Context, request DeleteExternalMetadataRequest) error { + path := fmt.Sprintf("/api/2.0/lineage-tracking/external-metadata/%v", request.Name) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) + return err +} + +func (a *externalMetadataImpl) GetExternalMetadata(ctx context.Context, request GetExternalMetadataRequest) (*ExternalMetadata, error) { + var externalMetadata ExternalMetadata + path := fmt.Sprintf("/api/2.0/lineage-tracking/external-metadata/%v", request.Name) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &externalMetadata) + return &externalMetadata, err +} + +// Gets an array of external metadata objects in the metastore. If the caller is +// the metastore admin, all external metadata objects will be retrieved. +// Otherwise, only external metadata objects that the caller has **BROWSE** on +// will be retrieved. There is no guarantee of a specific ordering of the +// elements in the array. +func (a *externalMetadataImpl) ListExternalMetadata(ctx context.Context, request ListExternalMetadataRequest) listing.Iterator[ExternalMetadata] { + + getNextPage := func(ctx context.Context, req ListExternalMetadataRequest) (*ListExternalMetadataResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.internalListExternalMetadata(ctx, req) + } + getItems := func(resp *ListExternalMetadataResponse) []ExternalMetadata { + return resp.ExternalMetadata + } + getNextReq := func(resp *ListExternalMetadataResponse) *ListExternalMetadataRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// Gets an array of external metadata objects in the metastore. If the caller is +// the metastore admin, all external metadata objects will be retrieved. +// Otherwise, only external metadata objects that the caller has **BROWSE** on +// will be retrieved. There is no guarantee of a specific ordering of the +// elements in the array. +func (a *externalMetadataImpl) ListExternalMetadataAll(ctx context.Context, request ListExternalMetadataRequest) ([]ExternalMetadata, error) { + iterator := a.ListExternalMetadata(ctx, request) + return listing.ToSlice[ExternalMetadata](ctx, iterator) +} + +func (a *externalMetadataImpl) internalListExternalMetadata(ctx context.Context, request ListExternalMetadataRequest) (*ListExternalMetadataResponse, error) { + var listExternalMetadataResponse ListExternalMetadataResponse + path := "/api/2.0/lineage-tracking/external-metadata" + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listExternalMetadataResponse) + return &listExternalMetadataResponse, err +} + +func (a *externalMetadataImpl) UpdateExternalMetadata(ctx context.Context, request UpdateExternalMetadataRequest) (*ExternalMetadata, error) { + var externalMetadata ExternalMetadata + path := fmt.Sprintf("/api/2.0/lineage-tracking/external-metadata/%v", request.Name) + queryParams := make(map[string]any) + if request.UpdateMask != "" { + queryParams["update_mask"] = request.UpdateMask + } + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request.ExternalMetadata, &externalMetadata) + return &externalMetadata, err +} + // unexported type that holds implementations of just Functions API methods type functionsImpl struct { client *client.DatabricksClient @@ -706,12 +877,11 @@ func (a *functionsImpl) Create(ctx context.Context, request CreateFunctionReques } func (a *functionsImpl) Delete(ctx context.Context, request DeleteFunctionRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.1/unity-catalog/functions/%v", request.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -831,13 +1001,12 @@ type metastoresImpl struct { } func (a *metastoresImpl) Assign(ctx context.Context, request CreateMetastoreAssignment) error { - var assignResponse AssignResponse path := fmt.Sprintf("/api/2.1/unity-catalog/workspaces/%v/metastore", request.WorkspaceId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &assignResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, nil) return err } @@ -863,12 +1032,11 @@ func (a *metastoresImpl) Current(ctx context.Context) (*MetastoreAssignment, err } func (a *metastoresImpl) Delete(ctx context.Context, request DeleteMetastoreRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.1/unity-catalog/metastores/%v", request.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -938,12 +1106,11 @@ func (a *metastoresImpl) Summary(ctx context.Context) (*GetMetastoreSummaryRespo } func (a *metastoresImpl) Unassign(ctx context.Context, request UnassignRequest) error { - var unassignResponse UnassignResponse path := fmt.Sprintf("/api/2.1/unity-catalog/workspaces/%v/metastore", request.WorkspaceId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &unassignResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -959,13 +1126,12 @@ func (a *metastoresImpl) Update(ctx context.Context, request UpdateMetastore) (* } func (a *metastoresImpl) UpdateAssignment(ctx context.Context, request UpdateMetastoreAssignment) error { - var updateAssignmentResponse UpdateAssignmentResponse path := fmt.Sprintf("/api/2.1/unity-catalog/workspaces/%v/metastore", request.WorkspaceId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateAssignmentResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, nil) return err } @@ -975,11 +1141,10 @@ type modelVersionsImpl struct { } func (a *modelVersionsImpl) Delete(ctx context.Context, request DeleteModelVersionRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.1/unity-catalog/models/%v/versions/%v", request.FullName, request.Version) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -1096,12 +1261,11 @@ func (a *onlineTablesImpl) Create(ctx context.Context, request CreateOnlineTable } func (a *onlineTablesImpl) Delete(ctx context.Context, request DeleteOnlineTableRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/online-tables/%v", request.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -1121,11 +1285,10 @@ type qualityMonitorsImpl struct { } func (a *qualityMonitorsImpl) CancelRefresh(ctx context.Context, request CancelRefreshRequest) error { - var cancelRefreshResponse CancelRefreshResponse path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor/refreshes/%v/cancel", request.TableName, request.RefreshId) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, &cancelRefreshResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, nil) return err } @@ -1141,11 +1304,10 @@ func (a *qualityMonitorsImpl) Create(ctx context.Context, request CreateMonitor) } func (a *qualityMonitorsImpl) Delete(ctx context.Context, request DeleteQualityMonitorRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor", request.TableName) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -1228,20 +1390,18 @@ func (a *registeredModelsImpl) Create(ctx context.Context, request CreateRegiste } func (a *registeredModelsImpl) Delete(ctx context.Context, request DeleteRegisteredModelRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.1/unity-catalog/models/%v", request.FullName) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } func (a *registeredModelsImpl) DeleteAlias(ctx context.Context, request DeleteAliasRequest) error { - var deleteAliasResponse DeleteAliasResponse path := fmt.Sprintf("/api/2.1/unity-catalog/models/%v/aliases/%v", request.FullName, request.Alias) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteAliasResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -1417,12 +1577,11 @@ func (a *schemasImpl) Create(ctx context.Context, request CreateSchema) (*Schema } func (a *schemasImpl) Delete(ctx context.Context, request DeleteSchemaRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.1/unity-catalog/schemas/%v", request.FullName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -1513,12 +1672,11 @@ func (a *storageCredentialsImpl) Create(ctx context.Context, request CreateStora } func (a *storageCredentialsImpl) Delete(ctx context.Context, request DeleteStorageCredentialRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.1/unity-catalog/storage-credentials/%v", request.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -1609,23 +1767,21 @@ type systemSchemasImpl struct { } func (a *systemSchemasImpl) Disable(ctx context.Context, request DisableRequest) error { - var disableResponse DisableResponse path := fmt.Sprintf("/api/2.1/unity-catalog/metastores/%v/systemschemas/%v", request.MetastoreId, request.SchemaName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &disableResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } func (a *systemSchemasImpl) Enable(ctx context.Context, request EnableRequest) error { - var enableResponse EnableResponse path := fmt.Sprintf("/api/2.1/unity-catalog/metastores/%v/systemschemas/%v", request.MetastoreId, request.SchemaName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &enableResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, nil) return err } @@ -1689,12 +1845,11 @@ func (a *tableConstraintsImpl) Create(ctx context.Context, request CreateTableCo } func (a *tableConstraintsImpl) Delete(ctx context.Context, request DeleteTableConstraintRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.1/unity-catalog/constraints/%v", request.FullName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -1704,12 +1859,11 @@ type tablesImpl struct { } func (a *tablesImpl) Delete(ctx context.Context, request DeleteTableRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v", request.FullName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -1741,8 +1895,6 @@ func (a *tablesImpl) Get(ctx context.Context, request GetTableRequest) (*TableIn // guarantee of a specific ordering of the elements in the array. func (a *tablesImpl) List(ctx context.Context, request ListTablesRequest) listing.Iterator[TableInfo] { - request.ForceSendFields = append(request.ForceSendFields, "MaxResults") - getNextPage := func(ctx context.Context, req ListTablesRequest) (*ListTablesResponse, error) { ctx = useragent.InContext(ctx, "sdk-feature", "pagination") return a.internalList(ctx, req) @@ -1799,8 +1951,6 @@ func (a *tablesImpl) internalList(ctx context.Context, request ListTablesRequest // There is no guarantee of a specific ordering of the elements in the array. func (a *tablesImpl) ListSummaries(ctx context.Context, request ListSummariesRequest) listing.Iterator[TableSummary] { - request.ForceSendFields = append(request.ForceSendFields, "MaxResults") - getNextPage := func(ctx context.Context, req ListSummariesRequest) (*ListTableSummariesResponse, error) { ctx = useragent.InContext(ctx, "sdk-feature", "pagination") return a.internalListSummaries(ctx, req) @@ -1850,13 +2000,12 @@ func (a *tablesImpl) internalListSummaries(ctx context.Context, request ListSumm } func (a *tablesImpl) Update(ctx context.Context, request UpdateTableRequest) error { - var updateResponse UpdateResponse path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v", request.FullName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, nil) return err } @@ -1893,11 +2042,10 @@ func (a *volumesImpl) Create(ctx context.Context, request CreateVolumeRequestCon } func (a *volumesImpl) Delete(ctx context.Context, request DeleteVolumeRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.1/unity-catalog/volumes/%v", request.Name) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } diff --git a/service/catalog/interface.go b/service/catalog/interface.go index cd695e968..762cf70bc 100755 --- a/service/catalog/interface.go +++ b/service/catalog/interface.go @@ -251,6 +251,34 @@ type CredentialsService interface { ValidateCredential(ctx context.Context, request ValidateCredentialRequest) (*ValidateCredentialResponse, error) } +// External Lineage APIs enable defining and managing lineage relationships +// between Databricks objects and external systems. These APIs allow users to +// capture data flows connecting Databricks tables, models, and file paths with +// external metadata objects. +// +// With these APIs, users can create, update, delete, and list lineage +// relationships with support for column-level mappings and custom properties. +// +// Deprecated: Do not use this interface, it will be removed in a future version of the SDK. +type ExternalLineageService interface { + + // Creates an external lineage relationship between a Databricks or external + // metadata object and another external metadata object. + CreateExternalLineageRelationship(ctx context.Context, request CreateExternalLineageRelationshipRequest) (*ExternalLineageRelationship, error) + + // Deletes an external lineage relationship between a Databricks or external + // metadata object and another external metadata object. + DeleteExternalLineageRelationship(ctx context.Context, request DeleteExternalLineageRelationshipRequest) error + + // Lists external lineage relationships of a Databricks object or external + // metadata given a supplied direction. + ListExternalLineageRelationships(ctx context.Context, request ListExternalLineageRelationshipsRequest) (*ListExternalLineageRelationshipsResponse, error) + + // Updates an external lineage relationship between a Databricks or external + // metadata object and another external metadata object. + UpdateExternalLineageRelationship(ctx context.Context, request UpdateExternalLineageRelationshipRequest) (*ExternalLineageRelationship, error) +} + // An external location is an object that combines a cloud storage path with a // storage credential that authorizes access to the cloud storage path. Each // external location is subject to Unity Catalog access-control policies that @@ -295,6 +323,49 @@ type ExternalLocationsService interface { Update(ctx context.Context, request UpdateExternalLocation) (*ExternalLocationInfo, error) } +// External Metadata objects enable customers to register and manage metadata +// about external systems within Unity Catalog. +// +// These APIs provide a standardized way to create, update, retrieve, list, and +// delete external metadata objects. Fine-grained authorization ensures that +// only users with appropriate permissions can view and manage external metadata +// objects. +// +// Deprecated: Do not use this interface, it will be removed in a future version of the SDK. +type ExternalMetadataService interface { + + // Creates a new external metadata object in the parent metastore if the + // caller is a metastore admin or has the **CREATE_EXTERNAL_METADATA** + // privilege. Grants **BROWSE** to all account users upon creation by + // default. + CreateExternalMetadata(ctx context.Context, request CreateExternalMetadataRequest) (*ExternalMetadata, error) + + // Deletes the external metadata object that matches the supplied name. The + // caller must be a metastore admin, the owner of the external metadata + // object, or a user that has the **MANAGE** privilege. + DeleteExternalMetadata(ctx context.Context, request DeleteExternalMetadataRequest) error + + // Gets the specified external metadata object in a metastore. The caller + // must be a metastore admin, the owner of the external metadata object, or + // a user that has the **BROWSE** privilege. + GetExternalMetadata(ctx context.Context, request GetExternalMetadataRequest) (*ExternalMetadata, error) + + // Gets an array of external metadata objects in the metastore. If the + // caller is the metastore admin, all external metadata objects will be + // retrieved. Otherwise, only external metadata objects that the caller has + // **BROWSE** on will be retrieved. There is no guarantee of a specific + // ordering of the elements in the array. + ListExternalMetadata(ctx context.Context, request ListExternalMetadataRequest) (*ListExternalMetadataResponse, error) + + // Updates the external metadata object that matches the supplied name. The + // caller can only update either the owner or other metadata fields in one + // request. The caller must be a metastore admin, the owner of the external + // metadata object, or a user that has the **MODIFY** privilege. If the + // caller is updating the owner, they must also have the **MANAGE** + // privilege. + UpdateExternalMetadata(ctx context.Context, request UpdateExternalMetadataRequest) (*ExternalMetadata, error) +} + // Functions implement User-Defined Functions (UDFs) in Unity Catalog. // // The function implementation can be any SQL expression or Query, and it can be diff --git a/service/catalog/model.go b/service/catalog/model.go index e80afe7d3..bb1305edf 100755 --- a/service/catalog/model.go +++ b/service/catalog/model.go @@ -386,7 +386,6 @@ func (s AzureUserDelegationSas) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Cancel refresh type CancelRefreshRequest struct { // ID of the refresh. RefreshId string `json:"-" url:"-"` @@ -515,8 +514,6 @@ const CatalogTypeManagedOnlineCatalog CatalogType = `MANAGED_ONLINE_CATALOG` const CatalogTypeSystemCatalog CatalogType = `SYSTEM_CATALOG` -const CatalogTypeUnknownCatalogType CatalogType = `UNKNOWN_CATALOG_TYPE` - // String representation for [fmt.Print] func (f *CatalogType) String() string { return string(*f) @@ -525,11 +522,11 @@ func (f *CatalogType) String() string { // Set raw string value and validate it against allowed values func (f *CatalogType) Set(v string) error { switch v { - case `DELTASHARING_CATALOG`, `FOREIGN_CATALOG`, `INTERNAL_CATALOG`, `MANAGED_CATALOG`, `MANAGED_ONLINE_CATALOG`, `SYSTEM_CATALOG`, `UNKNOWN_CATALOG_TYPE`: + case `DELTASHARING_CATALOG`, `FOREIGN_CATALOG`, `INTERNAL_CATALOG`, `MANAGED_CATALOG`, `MANAGED_ONLINE_CATALOG`, `SYSTEM_CATALOG`: *f = CatalogType(v) return nil default: - return fmt.Errorf(`value "%s" is not one of "DELTASHARING_CATALOG", "FOREIGN_CATALOG", "INTERNAL_CATALOG", "MANAGED_CATALOG", "MANAGED_ONLINE_CATALOG", "SYSTEM_CATALOG", "UNKNOWN_CATALOG_TYPE"`, v) + return fmt.Errorf(`value "%s" is not one of "DELTASHARING_CATALOG", "FOREIGN_CATALOG", "INTERNAL_CATALOG", "MANAGED_CATALOG", "MANAGED_ONLINE_CATALOG", "SYSTEM_CATALOG"`, v) } } @@ -544,7 +541,6 @@ func (f *CatalogType) Values() []CatalogType { CatalogTypeManagedCatalog, CatalogTypeManagedOnlineCatalog, CatalogTypeSystemCatalog, - CatalogTypeUnknownCatalogType, } } @@ -621,6 +617,22 @@ func (s ColumnMask) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type ColumnRelationship struct { + Source string `json:"source,omitempty"` + + Target string `json:"target,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ColumnRelationship) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ColumnRelationship) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type ColumnTypeName string const ColumnTypeNameArray ColumnTypeName = `ARRAY` @@ -724,6 +736,23 @@ func (f *ColumnTypeName) Type() string { return "ColumnTypeName" } +// A connection that is dependent on a SQL object. +type ConnectionDependency struct { + // Full name of the dependent connection, in the form of + // __connection_name__. + ConnectionName string `json:"connection_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ConnectionDependency) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ConnectionDependency) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type ConnectionInfo struct { // User-provided free-form text description. Comment string `json:"comment,omitempty"` @@ -773,7 +802,7 @@ func (s ConnectionInfo) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Next Id: 33 +// Next Id: 36 type ConnectionType string const ConnectionTypeBigquery ConnectionType = `BIGQUERY` @@ -980,6 +1009,10 @@ func (s CreateCredentialRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type CreateExternalLineageRelationshipRequest struct { + ExternalLineageRelationship CreateRequestExternalLineage `json:"external_lineage_relationship"` +} + type CreateExternalLocation struct { // User-provided free-form text description. Comment string `json:"comment,omitempty"` @@ -1017,6 +1050,10 @@ func (s CreateExternalLocation) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type CreateExternalMetadataRequest struct { + ExternalMetadata ExternalMetadata `json:"external_metadata"` +} + type CreateFunction struct { // Name of parent catalog. CatalogName string `json:"catalog_name"` @@ -1314,7 +1351,6 @@ func (s CreateMonitor) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Create an Online Table type CreateOnlineTableRequest struct { // Online Table information. Table OnlineTable `json:"table"` @@ -1344,6 +1380,29 @@ func (s CreateRegisteredModelRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type CreateRequestExternalLineage struct { + // List of column relationships between source and target objects. + Columns []ColumnRelationship `json:"columns,omitempty"` + // Unique identifier of the external lineage relationship. + Id string `json:"id,omitempty"` + // Key-value properties associated with the external lineage relationship. + Properties map[string]string `json:"properties,omitempty"` + // Source object of the external lineage relationship. + Source ExternalLineageObject `json:"source"` + // Target object of the external lineage relationship. + Target ExternalLineageObject `json:"target"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *CreateRequestExternalLineage) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s CreateRequestExternalLineage) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type CreateResponse struct { } @@ -1443,6 +1502,23 @@ func (s CreateVolumeRequestContent) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +// A credential that is dependent on a SQL object. +type CredentialDependency struct { + // Full name of the dependent credential, in the form of + // __credential_name__. + CredentialName string `json:"credential_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *CredentialDependency) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s CredentialDependency) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type CredentialInfo struct { // The AWS IAM role configuration. AwsIamRole *AwsIamRole `json:"aws_iam_role,omitempty"` @@ -1533,9 +1609,11 @@ func (f *CredentialPurpose) Type() string { return "CredentialPurpose" } -// Next Id: 12 +// Next Id: 13 type CredentialType string +const CredentialTypeAnyStaticCredential CredentialType = `ANY_STATIC_CREDENTIAL` + const CredentialTypeBearerToken CredentialType = `BEARER_TOKEN` const CredentialTypeOauthAccessToken CredentialType = `OAUTH_ACCESS_TOKEN` @@ -1568,11 +1646,11 @@ func (f *CredentialType) String() string { // Set raw string value and validate it against allowed values func (f *CredentialType) Set(v string) error { switch v { - case `BEARER_TOKEN`, `OAUTH_ACCESS_TOKEN`, `OAUTH_M2M`, `OAUTH_REFRESH_TOKEN`, `OAUTH_RESOURCE_OWNER_PASSWORD`, `OAUTH_U2M`, `OAUTH_U2M_MAPPING`, `OIDC_TOKEN`, `PEM_PRIVATE_KEY`, `SERVICE_CREDENTIAL`, `UNKNOWN_CREDENTIAL_TYPE`, `USERNAME_PASSWORD`: + case `ANY_STATIC_CREDENTIAL`, `BEARER_TOKEN`, `OAUTH_ACCESS_TOKEN`, `OAUTH_M2M`, `OAUTH_REFRESH_TOKEN`, `OAUTH_RESOURCE_OWNER_PASSWORD`, `OAUTH_U2M`, `OAUTH_U2M_MAPPING`, `OIDC_TOKEN`, `PEM_PRIVATE_KEY`, `SERVICE_CREDENTIAL`, `UNKNOWN_CREDENTIAL_TYPE`, `USERNAME_PASSWORD`: *f = CredentialType(v) return nil default: - return fmt.Errorf(`value "%s" is not one of "BEARER_TOKEN", "OAUTH_ACCESS_TOKEN", "OAUTH_M2M", "OAUTH_REFRESH_TOKEN", "OAUTH_RESOURCE_OWNER_PASSWORD", "OAUTH_U2M", "OAUTH_U2M_MAPPING", "OIDC_TOKEN", "PEM_PRIVATE_KEY", "SERVICE_CREDENTIAL", "UNKNOWN_CREDENTIAL_TYPE", "USERNAME_PASSWORD"`, v) + return fmt.Errorf(`value "%s" is not one of "ANY_STATIC_CREDENTIAL", "BEARER_TOKEN", "OAUTH_ACCESS_TOKEN", "OAUTH_M2M", "OAUTH_REFRESH_TOKEN", "OAUTH_RESOURCE_OWNER_PASSWORD", "OAUTH_U2M", "OAUTH_U2M_MAPPING", "OIDC_TOKEN", "PEM_PRIVATE_KEY", "SERVICE_CREDENTIAL", "UNKNOWN_CREDENTIAL_TYPE", "USERNAME_PASSWORD"`, v) } } @@ -1581,6 +1659,7 @@ func (f *CredentialType) Set(v string) error { // There is no guarantee on the order of the values in the slice. func (f *CredentialType) Values() []CredentialType { return []CredentialType{ + CredentialTypeAnyStaticCredential, CredentialTypeBearerToken, CredentialTypeOauthAccessToken, CredentialTypeOauthM2m, @@ -1629,20 +1708,30 @@ const DataSourceFormatCsv DataSourceFormat = `CSV` const DataSourceFormatDatabricksFormat DataSourceFormat = `DATABRICKS_FORMAT` +const DataSourceFormatDatabricksRowStoreFormat DataSourceFormat = `DATABRICKS_ROW_STORE_FORMAT` + const DataSourceFormatDelta DataSourceFormat = `DELTA` const DataSourceFormatDeltasharing DataSourceFormat = `DELTASHARING` -const DataSourceFormatHiveCustom DataSourceFormat = `HIVE_CUSTOM` +const DataSourceFormatDeltaUniformHudi DataSourceFormat = `DELTA_UNIFORM_HUDI` + +const DataSourceFormatDeltaUniformIceberg DataSourceFormat = `DELTA_UNIFORM_ICEBERG` -const DataSourceFormatHiveSerde DataSourceFormat = `HIVE_SERDE` +const DataSourceFormatHive DataSourceFormat = `HIVE` + +const DataSourceFormatIceberg DataSourceFormat = `ICEBERG` const DataSourceFormatJson DataSourceFormat = `JSON` +const DataSourceFormatMongodbFormat DataSourceFormat = `MONGODB_FORMAT` + const DataSourceFormatMysqlFormat DataSourceFormat = `MYSQL_FORMAT` const DataSourceFormatNetsuiteFormat DataSourceFormat = `NETSUITE_FORMAT` +const DataSourceFormatOracleFormat DataSourceFormat = `ORACLE_FORMAT` + const DataSourceFormatOrc DataSourceFormat = `ORC` const DataSourceFormatParquet DataSourceFormat = `PARQUET` @@ -1651,6 +1740,8 @@ const DataSourceFormatPostgresqlFormat DataSourceFormat = `POSTGRESQL_FORMAT` const DataSourceFormatRedshiftFormat DataSourceFormat = `REDSHIFT_FORMAT` +const DataSourceFormatSalesforceDataCloudFormat DataSourceFormat = `SALESFORCE_DATA_CLOUD_FORMAT` + const DataSourceFormatSalesforceFormat DataSourceFormat = `SALESFORCE_FORMAT` const DataSourceFormatSnowflakeFormat DataSourceFormat = `SNOWFLAKE_FORMAT` @@ -1659,6 +1750,8 @@ const DataSourceFormatSqldwFormat DataSourceFormat = `SQLDW_FORMAT` const DataSourceFormatSqlserverFormat DataSourceFormat = `SQLSERVER_FORMAT` +const DataSourceFormatTeradataFormat DataSourceFormat = `TERADATA_FORMAT` + const DataSourceFormatText DataSourceFormat = `TEXT` const DataSourceFormatUnityCatalog DataSourceFormat = `UNITY_CATALOG` @@ -1675,11 +1768,11 @@ func (f *DataSourceFormat) String() string { // Set raw string value and validate it against allowed values func (f *DataSourceFormat) Set(v string) error { switch v { - case `AVRO`, `BIGQUERY_FORMAT`, `CSV`, `DATABRICKS_FORMAT`, `DELTA`, `DELTASHARING`, `HIVE_CUSTOM`, `HIVE_SERDE`, `JSON`, `MYSQL_FORMAT`, `NETSUITE_FORMAT`, `ORC`, `PARQUET`, `POSTGRESQL_FORMAT`, `REDSHIFT_FORMAT`, `SALESFORCE_FORMAT`, `SNOWFLAKE_FORMAT`, `SQLDW_FORMAT`, `SQLSERVER_FORMAT`, `TEXT`, `UNITY_CATALOG`, `VECTOR_INDEX_FORMAT`, `WORKDAY_RAAS_FORMAT`: + case `AVRO`, `BIGQUERY_FORMAT`, `CSV`, `DATABRICKS_FORMAT`, `DATABRICKS_ROW_STORE_FORMAT`, `DELTA`, `DELTASHARING`, `DELTA_UNIFORM_HUDI`, `DELTA_UNIFORM_ICEBERG`, `HIVE`, `ICEBERG`, `JSON`, `MONGODB_FORMAT`, `MYSQL_FORMAT`, `NETSUITE_FORMAT`, `ORACLE_FORMAT`, `ORC`, `PARQUET`, `POSTGRESQL_FORMAT`, `REDSHIFT_FORMAT`, `SALESFORCE_DATA_CLOUD_FORMAT`, `SALESFORCE_FORMAT`, `SNOWFLAKE_FORMAT`, `SQLDW_FORMAT`, `SQLSERVER_FORMAT`, `TERADATA_FORMAT`, `TEXT`, `UNITY_CATALOG`, `VECTOR_INDEX_FORMAT`, `WORKDAY_RAAS_FORMAT`: *f = DataSourceFormat(v) return nil default: - return fmt.Errorf(`value "%s" is not one of "AVRO", "BIGQUERY_FORMAT", "CSV", "DATABRICKS_FORMAT", "DELTA", "DELTASHARING", "HIVE_CUSTOM", "HIVE_SERDE", "JSON", "MYSQL_FORMAT", "NETSUITE_FORMAT", "ORC", "PARQUET", "POSTGRESQL_FORMAT", "REDSHIFT_FORMAT", "SALESFORCE_FORMAT", "SNOWFLAKE_FORMAT", "SQLDW_FORMAT", "SQLSERVER_FORMAT", "TEXT", "UNITY_CATALOG", "VECTOR_INDEX_FORMAT", "WORKDAY_RAAS_FORMAT"`, v) + return fmt.Errorf(`value "%s" is not one of "AVRO", "BIGQUERY_FORMAT", "CSV", "DATABRICKS_FORMAT", "DATABRICKS_ROW_STORE_FORMAT", "DELTA", "DELTASHARING", "DELTA_UNIFORM_HUDI", "DELTA_UNIFORM_ICEBERG", "HIVE", "ICEBERG", "JSON", "MONGODB_FORMAT", "MYSQL_FORMAT", "NETSUITE_FORMAT", "ORACLE_FORMAT", "ORC", "PARQUET", "POSTGRESQL_FORMAT", "REDSHIFT_FORMAT", "SALESFORCE_DATA_CLOUD_FORMAT", "SALESFORCE_FORMAT", "SNOWFLAKE_FORMAT", "SQLDW_FORMAT", "SQLSERVER_FORMAT", "TERADATA_FORMAT", "TEXT", "UNITY_CATALOG", "VECTOR_INDEX_FORMAT", "WORKDAY_RAAS_FORMAT"`, v) } } @@ -1692,21 +1785,28 @@ func (f *DataSourceFormat) Values() []DataSourceFormat { DataSourceFormatBigqueryFormat, DataSourceFormatCsv, DataSourceFormatDatabricksFormat, + DataSourceFormatDatabricksRowStoreFormat, DataSourceFormatDelta, DataSourceFormatDeltasharing, - DataSourceFormatHiveCustom, - DataSourceFormatHiveSerde, + DataSourceFormatDeltaUniformHudi, + DataSourceFormatDeltaUniformIceberg, + DataSourceFormatHive, + DataSourceFormatIceberg, DataSourceFormatJson, + DataSourceFormatMongodbFormat, DataSourceFormatMysqlFormat, DataSourceFormatNetsuiteFormat, + DataSourceFormatOracleFormat, DataSourceFormatOrc, DataSourceFormatParquet, DataSourceFormatPostgresqlFormat, DataSourceFormatRedshiftFormat, + DataSourceFormatSalesforceDataCloudFormat, DataSourceFormatSalesforceFormat, DataSourceFormatSnowflakeFormat, DataSourceFormatSqldwFormat, DataSourceFormatSqlserverFormat, + DataSourceFormatTeradataFormat, DataSourceFormatText, DataSourceFormatUnityCatalog, DataSourceFormatVectorIndexFormat, @@ -1764,7 +1864,6 @@ func (s DatabricksGcpServiceAccountResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Delete a metastore assignment type DeleteAccountMetastoreAssignmentRequest struct { // Unity Catalog metastore ID MetastoreId string `json:"-" url:"-"` @@ -1772,7 +1871,6 @@ type DeleteAccountMetastoreAssignmentRequest struct { WorkspaceId int64 `json:"-" url:"-"` } -// Delete a metastore type DeleteAccountMetastoreRequest struct { // Force deletion even if the metastore is not empty. Default is false. Force bool `json:"-" url:"force,omitempty"` @@ -1790,7 +1888,6 @@ func (s DeleteAccountMetastoreRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Delete a storage credential type DeleteAccountStorageCredentialRequest struct { // Force deletion even if the Storage Credential is not empty. Default is // false. @@ -1811,7 +1908,6 @@ func (s DeleteAccountStorageCredentialRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Delete a Registered Model Alias type DeleteAliasRequest struct { // The name of the alias Alias string `json:"-" url:"-"` @@ -1822,7 +1918,6 @@ type DeleteAliasRequest struct { type DeleteAliasResponse struct { } -// Delete a catalog type DeleteCatalogRequest struct { // Force deletion even if the catalog is not empty. Force bool `json:"-" url:"force,omitempty"` @@ -1840,13 +1935,11 @@ func (s DeleteCatalogRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Delete a connection type DeleteConnectionRequest struct { // The name of the connection to be deleted. Name string `json:"-" url:"-"` } -// Delete a credential type DeleteCredentialRequest struct { // Force an update even if there are dependent services (when purpose is // **SERVICE**) or dependent external locations and external tables (when @@ -1869,7 +1962,13 @@ func (s DeleteCredentialRequest) MarshalJSON() ([]byte, error) { type DeleteCredentialResponse struct { } -// Delete an external location +type DeleteExternalLineageRelationshipRequest struct { + ExternalLineageRelationship DeleteRequestExternalLineage `json:"-" url:"external_lineage_relationship"` +} + +type DeleteExternalLineageRelationshipResponse struct { +} + type DeleteExternalLocationRequest struct { // Force deletion even if there are dependent external tables or mounts. Force bool `json:"-" url:"force,omitempty"` @@ -1887,7 +1986,13 @@ func (s DeleteExternalLocationRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Delete a function +type DeleteExternalMetadataRequest struct { + Name string `json:"-" url:"-"` +} + +type DeleteExternalMetadataResponse struct { +} + type DeleteFunctionRequest struct { // Force deletion even if the function is notempty. Force bool `json:"-" url:"force,omitempty"` @@ -1906,7 +2011,6 @@ func (s DeleteFunctionRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Delete a metastore type DeleteMetastoreRequest struct { // Force deletion even if the metastore is not empty. Default is false. Force bool `json:"-" url:"force,omitempty"` @@ -1924,7 +2028,6 @@ func (s DeleteMetastoreRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Delete a Model Version type DeleteModelVersionRequest struct { // The three-level (fully qualified) name of the model version FullName string `json:"-" url:"-"` @@ -1932,28 +2035,43 @@ type DeleteModelVersionRequest struct { Version int `json:"-" url:"-"` } -// Delete an Online Table type DeleteOnlineTableRequest struct { // Full three-part (catalog, schema, table) name of the table. Name string `json:"-" url:"-"` } -// Delete a table monitor type DeleteQualityMonitorRequest struct { // Full name of the table. TableName string `json:"-" url:"-"` } -// Delete a Registered Model type DeleteRegisteredModelRequest struct { // The three-level (fully qualified) name of the registered model FullName string `json:"-" url:"-"` } +type DeleteRequestExternalLineage struct { + // Unique identifier of the external lineage relationship. + Id string `json:"id,omitempty" url:"id,omitempty"` + // Source object of the external lineage relationship. + Source ExternalLineageObject `json:"source" url:"source"` + // Target object of the external lineage relationship. + Target ExternalLineageObject `json:"target" url:"target"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *DeleteRequestExternalLineage) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s DeleteRequestExternalLineage) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type DeleteResponse struct { } -// Delete a schema type DeleteSchemaRequest struct { // Force deletion even if the schema is not empty. Force bool `json:"-" url:"force,omitempty"` @@ -1971,7 +2089,6 @@ func (s DeleteSchemaRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Delete a credential type DeleteStorageCredentialRequest struct { // Force an update even if there are dependent external locations or // external tables (when purpose is **STORAGE**) or dependent services (when @@ -1991,7 +2108,6 @@ func (s DeleteStorageCredentialRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Delete a table constraint type DeleteTableConstraintRequest struct { // If true, try deleting all child constraints of the current constraint. If // false, reject this operation if the current constraint has any child @@ -2003,13 +2119,11 @@ type DeleteTableConstraintRequest struct { FullName string `json:"-" url:"-"` } -// Delete a table type DeleteTableRequest struct { // Full name of the table. FullName string `json:"-" url:"-"` } -// Delete a Volume type DeleteVolumeRequest struct { // The three-level (fully qualified) name of the volume Name string `json:"-" url:"-"` @@ -2060,9 +2174,13 @@ func (f *DeltaSharingScopeEnum) Type() string { return "DeltaSharingScopeEnum" } -// A dependency of a SQL object. Either the __table__ field or the __function__ -// field must be defined. +// A dependency of a SQL object. One of the following fields must be defined: +// __table__, __function__, __connection__, or __credential__. type Dependency struct { + // A connection that is dependent on a SQL object. + Connection *ConnectionDependency `json:"connection,omitempty"` + // A credential that is dependent on a SQL object. + Credential *CredentialDependency `json:"credential,omitempty"` // A function that is dependent on a SQL object. Function *FunctionDependency `json:"function,omitempty"` // A table that is dependent on a SQL object. @@ -2075,7 +2193,6 @@ type DependencyList struct { Dependencies []Dependency `json:"dependencies,omitempty"` } -// Disable a system schema type DisableRequest struct { // The metastore ID under which the system schema lives. MetastoreId string `json:"-" url:"-"` @@ -2276,12 +2393,227 @@ type EncryptionDetails struct { SseEncryptionDetails *SseEncryptionDetails `json:"sse_encryption_details,omitempty"` } -// Get boolean reflecting if table exists type ExistsRequest struct { // Full name of the table. FullName string `json:"-" url:"-"` } +type ExternalLineageExternalMetadata struct { + Name string `json:"name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ExternalLineageExternalMetadata) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ExternalLineageExternalMetadata) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Represents the external metadata object in the lineage event. +type ExternalLineageExternalMetadataInfo struct { + // Type of entity represented by the external metadata object. + EntityType string `json:"entity_type,omitempty"` + // Timestamp of the lineage event. + EventTime string `json:"event_time,omitempty"` + // Name of the external metadata object. + Name string `json:"name,omitempty"` + // Type of external system. + SystemType SystemType `json:"system_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ExternalLineageExternalMetadataInfo) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ExternalLineageExternalMetadataInfo) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Represents the path information in the lineage event. +type ExternalLineageFileInfo struct { + // Timestamp of the lineage event. + EventTime string `json:"event_time,omitempty"` + // URL of the path. + Path string `json:"path,omitempty"` + // The full name of the securable on the path. + SecurableName string `json:"securable_name,omitempty"` + // The securable type of the securable on the path. + SecurableType string `json:"securable_type,omitempty"` + // The storage location associated with securable on the path. + StorageLocation string `json:"storage_location,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ExternalLineageFileInfo) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ExternalLineageFileInfo) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Lineage response containing lineage information of a data asset. +type ExternalLineageInfo struct { + // Information about the edge metadata of the external lineage relationship. + ExternalLineageInfo *ExternalLineageRelationshipInfo `json:"external_lineage_info,omitempty"` + // Information about external metadata involved in the lineage relationship. + ExternalMetadataInfo *ExternalLineageExternalMetadataInfo `json:"external_metadata_info,omitempty"` + // Information about the file involved in the lineage relationship. + FileInfo *ExternalLineageFileInfo `json:"file_info,omitempty"` + // Information about the model version involved in the lineage relationship. + ModelInfo *ExternalLineageModelVersionInfo `json:"model_info,omitempty"` + // Information about the table involved in the lineage relationship. + TableInfo *ExternalLineageTableInfo `json:"table_info,omitempty"` +} + +type ExternalLineageModelVersion struct { + Name string `json:"name,omitempty"` + + Version string `json:"version,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ExternalLineageModelVersion) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ExternalLineageModelVersion) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Represents the model version information in the lineage event. +type ExternalLineageModelVersionInfo struct { + // Timestamp of the lineage event. + EventTime string `json:"event_time,omitempty"` + // Name of the model. + ModelName string `json:"model_name,omitempty"` + // Version number of the model. + Version int64 `json:"version,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ExternalLineageModelVersionInfo) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ExternalLineageModelVersionInfo) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ExternalLineageObject struct { + ExternalMetadata *ExternalLineageExternalMetadata `json:"external_metadata,omitempty"` + + ModelVersion *ExternalLineageModelVersion `json:"model_version,omitempty"` + + Path *ExternalLineagePath `json:"path,omitempty"` + + Table *ExternalLineageTable `json:"table,omitempty"` +} + +type ExternalLineagePath struct { + Url string `json:"url,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ExternalLineagePath) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ExternalLineagePath) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ExternalLineageRelationship struct { + // List of column relationships between source and target objects. + Columns []ColumnRelationship `json:"columns,omitempty"` + // Unique identifier of the external lineage relationship. + Id string `json:"id,omitempty"` + // Key-value properties associated with the external lineage relationship. + Properties map[string]string `json:"properties,omitempty"` + // Source object of the external lineage relationship. + Source ExternalLineageObject `json:"source"` + // Target object of the external lineage relationship. + Target ExternalLineageObject `json:"target"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ExternalLineageRelationship) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ExternalLineageRelationship) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ExternalLineageRelationshipInfo struct { + // List of column relationships between source and target objects. + Columns []ColumnRelationship `json:"columns,omitempty"` + // Unique identifier of the external lineage relationship. + Id string `json:"id,omitempty"` + // Key-value properties associated with the external lineage relationship. + Properties map[string]string `json:"properties,omitempty"` + // Source object of the external lineage relationship. + Source ExternalLineageObject `json:"source"` + // Target object of the external lineage relationship. + Target ExternalLineageObject `json:"target"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ExternalLineageRelationshipInfo) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ExternalLineageRelationshipInfo) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ExternalLineageTable struct { + Name string `json:"name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ExternalLineageTable) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ExternalLineageTable) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Represents the table information in the lineage event. +type ExternalLineageTableInfo struct { + // Name of Catalog. + CatalogName string `json:"catalog_name,omitempty"` + // Timestamp of the lineage event. + EventTime string `json:"event_time,omitempty"` + // Name of Table. + Name string `json:"name,omitempty"` + // Name of Schema. + SchemaName string `json:"schema_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ExternalLineageTableInfo) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ExternalLineageTableInfo) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type ExternalLocationInfo struct { // Indicates whether the principal is limited to retrieving metadata for the // associated object through the BROWSE privilege when include_browse is @@ -2337,6 +2669,47 @@ func (s ExternalLocationInfo) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type ExternalMetadata struct { + // List of columns associated with the external metadata object. + Columns []string `json:"columns,omitempty"` + // Time at which this external metadata object was created. + CreateTime string `json:"create_time,omitempty"` + // Username of external metadata object creator. + CreatedBy string `json:"created_by,omitempty"` + // User-provided free-form text description. + Description string `json:"description,omitempty"` + // Type of entity within the external system. + EntityType string `json:"entity_type"` + // Unique identifier of the external metadata object. + Id string `json:"id,omitempty"` + // Unique identifier of parent metastore. + MetastoreId string `json:"metastore_id,omitempty"` + // Name of the external metadata object. + Name string `json:"name"` + // Owner of the external metadata object. + Owner string `json:"owner,omitempty"` + // A map of key-value properties attached to the external metadata object. + Properties map[string]string `json:"properties,omitempty"` + // Type of external system. + SystemType SystemType `json:"system_type"` + // Time at which this external metadata object was last modified. + UpdateTime string `json:"update_time,omitempty"` + // Username of user who last modified external metadata object. + UpdatedBy string `json:"updated_by,omitempty"` + // URL associated with the external metadata object. + Url string `json:"url,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ExternalMetadata) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ExternalMetadata) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + // Detailed status of an online table. Shown if the online table is in the // OFFLINE_FAILED or the ONLINE_PIPELINE_FAILED state. type FailedStatus struct { @@ -2384,6 +2757,18 @@ type ForeignKeyConstraint struct { ParentColumns []string `json:"parent_columns"` // The full name of the parent constraint. ParentTable string `json:"parent_table"` + // True if the constraint is RELY, false or unset if NORELY. + Rely bool `json:"rely,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ForeignKeyConstraint) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ForeignKeyConstraint) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) } // A function that is dependent on a SQL object. @@ -2856,19 +3241,16 @@ func (s GenerateTemporaryTableCredentialResponse) MarshalJSON() ([]byte, error) return marshal.Marshal(s) } -// Gets the metastore assignment for a workspace type GetAccountMetastoreAssignmentRequest struct { // Workspace ID. WorkspaceId int64 `json:"-" url:"-"` } -// Get a metastore type GetAccountMetastoreRequest struct { // Unity Catalog metastore ID MetastoreId string `json:"-" url:"-"` } -// Gets the named storage credential type GetAccountStorageCredentialRequest struct { // Unity Catalog metastore ID MetastoreId string `json:"-" url:"-"` @@ -2876,13 +3258,11 @@ type GetAccountStorageCredentialRequest struct { StorageCredentialName string `json:"-" url:"-"` } -// Get an artifact allowlist type GetArtifactAllowlistRequest struct { // The artifact type of the allowlist. ArtifactType ArtifactType `json:"-" url:"-"` } -// Get securable workspace bindings type GetBindingsRequest struct { // Maximum number of workspace bindings to return. - When set to 0, the page // length is set to a server configured value (recommended); - When set to a @@ -2910,7 +3290,6 @@ func (s GetBindingsRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get Model Version By Alias type GetByAliasRequest struct { // The name of the alias Alias string `json:"-" url:"-"` @@ -2931,7 +3310,6 @@ func (s GetByAliasRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get a catalog type GetCatalogRequest struct { // Whether to include catalogs in the response for which the principal can // only access selective metadata for @@ -2955,19 +3333,16 @@ type GetCatalogWorkspaceBindingsResponse struct { Workspaces []int64 `json:"workspaces,omitempty"` } -// Get a connection type GetConnectionRequest struct { // Name of the connection. Name string `json:"-" url:"-"` } -// Get a credential type GetCredentialRequest struct { // Name of the credential. NameArg string `json:"-" url:"-"` } -// Get effective permissions type GetEffectiveRequest struct { // Full name of securable. FullName string `json:"-" url:"-"` @@ -3003,7 +3378,6 @@ func (s GetEffectiveRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get an external location type GetExternalLocationRequest struct { // Whether to include external locations in the response for which the // principal can only access selective metadata for @@ -3022,7 +3396,10 @@ func (s GetExternalLocationRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get a function +type GetExternalMetadataRequest struct { + Name string `json:"-" url:"-"` +} + type GetFunctionRequest struct { // Whether to include functions in the response for which the principal can // only access selective metadata for @@ -3042,10 +3419,12 @@ func (s GetFunctionRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get permissions type GetGrantRequest struct { // Full name of securable. FullName string `json:"-" url:"-"` + // Optional. If true, also return privilege assignments whose principals + // have been deleted. + IncludeDeletedPrincipals bool `json:"-" url:"include_deleted_principals,omitempty"` // Specifies the maximum number of privileges to return (page length). Every // PrivilegeAssignment present in a single page response is guaranteed to // contain all the privileges granted on the requested Securable for the @@ -3078,7 +3457,6 @@ func (s GetGrantRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get a metastore type GetMetastoreRequest struct { // Unique ID of the metastore. Id string `json:"-" url:"-"` @@ -3139,7 +3517,6 @@ func (s GetMetastoreSummaryResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get a Model Version type GetModelVersionRequest struct { // The three-level (fully qualified) name of the model version FullName string `json:"-" url:"-"` @@ -3163,7 +3540,6 @@ func (s GetModelVersionRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get an Online Table type GetOnlineTableRequest struct { // Full three-part (catalog, schema, table) name of the table. Name string `json:"-" url:"-"` @@ -3188,13 +3564,11 @@ func (s GetPermissionsResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get a table monitor type GetQualityMonitorRequest struct { // Full name of the table. TableName string `json:"-" url:"-"` } -// Get information for a single resource quota. type GetQuotaRequest struct { // Full name of the parent resource. Provide the metastore ID if the parent // is a metastore. @@ -3211,7 +3585,6 @@ type GetQuotaResponse struct { QuotaInfo *QuotaInfo `json:"quota_info,omitempty"` } -// Get refresh type GetRefreshRequest struct { // ID of the refresh. RefreshId string `json:"-" url:"-"` @@ -3219,7 +3592,6 @@ type GetRefreshRequest struct { TableName string `json:"-" url:"-"` } -// Get a Registered Model type GetRegisteredModelRequest struct { // The three-level (fully qualified) name of the registered model FullName string `json:"-" url:"-"` @@ -3240,7 +3612,6 @@ func (s GetRegisteredModelRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get a schema type GetSchemaRequest struct { // Full name of the schema. FullName string `json:"-" url:"-"` @@ -3259,22 +3630,21 @@ func (s GetSchemaRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get a credential type GetStorageCredentialRequest struct { // Name of the storage credential. Name string `json:"-" url:"-"` } -// Get a table type GetTableRequest struct { // Full name of the table. FullName string `json:"-" url:"-"` // Whether to include tables in the response for which the principal can - // only access selective metadata for + // only access selective metadata for. IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` // Whether delta metadata should be included in the response. IncludeDeltaMetadata bool `json:"-" url:"include_delta_metadata,omitempty"` - // Whether to include a manifest containing capabilities the table has. + // Whether to include a manifest containing table capabilities in the + // response. IncludeManifestCapabilities bool `json:"-" url:"include_manifest_capabilities,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -3288,7 +3658,6 @@ func (s GetTableRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get catalog workspace bindings type GetWorkspaceBindingRequest struct { // The name of the catalog. Name string `json:"-" url:"-"` @@ -3350,7 +3719,43 @@ func (f *IsolationMode) Type() string { return "IsolationMode" } -// Get all workspaces assigned to a metastore +type LineageDirection string + +const LineageDirectionDownstream LineageDirection = `DOWNSTREAM` + +const LineageDirectionUpstream LineageDirection = `UPSTREAM` + +// String representation for [fmt.Print] +func (f *LineageDirection) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *LineageDirection) Set(v string) error { + switch v { + case `DOWNSTREAM`, `UPSTREAM`: + *f = LineageDirection(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "DOWNSTREAM", "UPSTREAM"`, v) + } +} + +// Values returns all possible values for LineageDirection. +// +// There is no guarantee on the order of the values in the slice. +func (f *LineageDirection) Values() []LineageDirection { + return []LineageDirection{ + LineageDirectionDownstream, + LineageDirectionUpstream, + } +} + +// Type always returns LineageDirection to satisfy [pflag.Value] interface +func (f *LineageDirection) Type() string { + return "LineageDirection" +} + type ListAccountMetastoreAssignmentsRequest struct { // Unity Catalog metastore ID MetastoreId string `json:"-" url:"-"` @@ -3361,7 +3766,6 @@ type ListAccountMetastoreAssignmentsResponse struct { WorkspaceIds []int64 `json:"workspace_ids,omitempty"` } -// Get all storage credentials assigned to a metastore type ListAccountStorageCredentialsRequest struct { // Unity Catalog metastore ID MetastoreId string `json:"-" url:"-"` @@ -3372,7 +3776,6 @@ type ListAccountStorageCredentialsResponse struct { StorageCredentials []StorageCredentialInfo `json:"storage_credentials,omitempty"` } -// List catalogs type ListCatalogsRequest struct { // Whether to include catalogs in the response for which the principal can // only access selective metadata for @@ -3420,7 +3823,6 @@ func (s ListCatalogsResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List connections type ListConnectionsRequest struct { // Maximum number of connections to return. - If not set, all connections // are returned (not recommended). - when set to a value greater than 0, the @@ -3462,7 +3864,6 @@ func (s ListConnectionsResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List credentials type ListCredentialsRequest struct { // Maximum number of credentials to return. - If not set, the default max // page size is used. - When set to a value greater than 0, the page length @@ -3472,39 +3873,75 @@ type ListCredentialsRequest struct { MaxResults int `json:"-" url:"max_results,omitempty"` // Opaque token to retrieve the next page of results. PageToken string `json:"-" url:"page_token,omitempty"` - // Return only credentials for the specified purpose. - Purpose CredentialPurpose `json:"-" url:"purpose,omitempty"` + // Return only credentials for the specified purpose. + Purpose CredentialPurpose `json:"-" url:"purpose,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListCredentialsRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListCredentialsRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListCredentialsResponse struct { + Credentials []CredentialInfo `json:"credentials,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:"-" url:"-"` +} + +func (s *ListCredentialsResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListCredentialsResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListExternalLineageRelationshipsRequest struct { + // The lineage direction to filter on. + LineageDirection LineageDirection `json:"-" url:"lineage_direction"` + // The object to query external lineage relationship on. + ObjectInfo ExternalLineageObject `json:"-" url:"object_info"` + + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } -func (s *ListCredentialsRequest) UnmarshalJSON(b []byte) error { +func (s *ListExternalLineageRelationshipsRequest) UnmarshalJSON(b []byte) error { return marshal.Unmarshal(b, s) } -func (s ListCredentialsRequest) MarshalJSON() ([]byte, error) { +func (s ListExternalLineageRelationshipsRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -type ListCredentialsResponse struct { - Credentials []CredentialInfo `json:"credentials,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). +type ListExternalLineageRelationshipsResponse struct { + ExternalLineageRelationships []ExternalLineageInfo `json:"external_lineage_relationships,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` ForceSendFields []string `json:"-" url:"-"` } -func (s *ListCredentialsResponse) UnmarshalJSON(b []byte) error { +func (s *ListExternalLineageRelationshipsResponse) UnmarshalJSON(b []byte) error { return marshal.Unmarshal(b, s) } -func (s ListCredentialsResponse) MarshalJSON() ([]byte, error) { +func (s ListExternalLineageRelationshipsResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List external locations type ListExternalLocationsRequest struct { // Whether to include external locations in the response for which the // principal can only access selective metadata for @@ -3549,7 +3986,38 @@ func (s ListExternalLocationsResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List functions +type ListExternalMetadataRequest struct { + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListExternalMetadataRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListExternalMetadataRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListExternalMetadataResponse struct { + ExternalMetadata []ExternalMetadata `json:"external_metadata,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListExternalMetadataResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListExternalMetadataResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type ListFunctionsRequest struct { // Name of parent catalog for functions of interest. CatalogName string `json:"-" url:"catalog_name"` @@ -3598,7 +4066,6 @@ func (s ListFunctionsResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List metastores type ListMetastoresRequest struct { // Maximum number of metastores to return. - when set to a value greater // than 0, the page length is the minimum of this value and a server @@ -3643,7 +4110,6 @@ func (s ListMetastoresResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List Model Versions type ListModelVersionsRequest struct { // The full three-level name of the registered model under which to list // model versions @@ -3691,7 +4157,6 @@ func (s ListModelVersionsResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List all resource quotas under a metastore. type ListQuotasRequest struct { // The number of quotas to return. MaxResults int `json:"-" url:"max_results,omitempty"` @@ -3728,13 +4193,11 @@ func (s ListQuotasResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List refreshes type ListRefreshesRequest struct { // Full name of the table. TableName string `json:"-" url:"-"` } -// List Registered Models type ListRegisteredModelsRequest struct { // The identifier of the catalog under which to list registered models. If // specified, schema_name must be specified. @@ -3795,7 +4258,6 @@ func (s ListRegisteredModelsResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List schemas type ListSchemasRequest struct { // Parent catalog for schemas of interest. CatalogName string `json:"-" url:"catalog_name"` @@ -3842,7 +4304,6 @@ func (s ListSchemasResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List credentials type ListStorageCredentialsRequest struct { // Maximum number of storage credentials to return. If not set, all the // storage credentials are returned (not recommended). - when set to a value @@ -3884,11 +4345,11 @@ func (s ListStorageCredentialsResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List table summaries type ListSummariesRequest struct { // Name of parent catalog for tables of interest. CatalogName string `json:"-" url:"catalog_name"` - // Whether to include a manifest containing capabilities the table has. + // Whether to include a manifest containing table capabilities in the + // response. IncludeManifestCapabilities bool `json:"-" url:"include_manifest_capabilities,omitempty"` // Maximum number of summaries for tables to return. If not set, the page // length is set to a server configured value (10000, as of 1/5/2024). - @@ -3918,7 +4379,6 @@ func (s ListSummariesRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List system schemas type ListSystemSchemasRequest struct { // Maximum number of schemas to return. - When set to 0, the page length is // set to a server configured value (recommended); - When set to a value @@ -3981,16 +4441,14 @@ func (s ListTableSummariesResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List tables type ListTablesRequest struct { // Name of parent catalog for tables of interest. CatalogName string `json:"-" url:"catalog_name"` // Whether to include tables in the response for which the principal can - // only access selective metadata for + // only access selective metadata for. IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` - // Whether delta metadata should be included in the response. - IncludeDeltaMetadata bool `json:"-" url:"include_delta_metadata,omitempty"` - // Whether to include a manifest containing capabilities the table has. + // Whether to include a manifest containing table capabilities in the + // response. IncludeManifestCapabilities bool `json:"-" url:"include_manifest_capabilities,omitempty"` // Maximum number of tables to return. If not set, all the tables are // returned (not recommended). - when set to a value greater than 0, the @@ -4041,7 +4499,6 @@ func (s ListTablesResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List Volumes type ListVolumesRequest struct { // The identifier of the catalog CatalogName string `json:"-" url:"catalog_name"` @@ -4965,6 +5422,158 @@ func (s OnlineTableStatus) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +// Spec of an allowed option on a securable kind and its attributes. This is +// mostly used by UI to provide user friendly hints and descriptions in order to +// facilitate the securable creation process. +type OptionSpec struct { + // For drop down / radio button selections, UI will want to know the + // possible input values, it can also be used by other option types to limit + // input selections. + AllowedValues []string `json:"allowed_values,omitempty"` + // The default value of the option, for example, value '443' for 'port' + // option. + DefaultValue string `json:"default_value,omitempty"` + // A concise user facing description of what the input value of this option + // should look like. + Description string `json:"description,omitempty"` + // The hint is used on the UI to suggest what the input value can possibly + // be like, for example: example.com for 'host' option. Unlike default + // value, it will not be applied automatically without user input. + Hint string `json:"hint,omitempty"` + // Indicates whether an option should be displayed with copy button on the + // UI. + IsCopiable bool `json:"is_copiable,omitempty"` + // Indicates whether an option can be provided by users in the create/update + // path of an entity. + IsCreatable bool `json:"is_creatable,omitempty"` + // Is the option value not user settable and is thus not shown on the UI. + IsHidden bool `json:"is_hidden,omitempty"` + // Specifies whether this option is safe to log, i.e. no sensitive + // information. + IsLoggable bool `json:"is_loggable,omitempty"` + // Is the option required. + IsRequired bool `json:"is_required,omitempty"` + // Is the option value considered secret and thus redacted on the UI. + IsSecret bool `json:"is_secret,omitempty"` + // Is the option updatable by users. + IsUpdatable bool `json:"is_updatable,omitempty"` + // The unique name of the option. + Name string `json:"name,omitempty"` + // Specifies when the option value is displayed on the UI within the OAuth + // flow. + OauthStage OptionSpecOauthStage `json:"oauth_stage,omitempty"` + // The type of the option. + Type OptionSpecOptionType `json:"type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *OptionSpec) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s OptionSpec) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// During the OAuth flow, specifies which stage the option should be displayed +// in the UI. OAUTH_STAGE_UNSPECIFIED is the default value for options unrelated +// to the OAuth flow. BEFORE_AUTHORIZATION_CODE corresponds to options necessary +// to initiate the OAuth process. BEFORE_ACCESS_TOKEN corresponds to options +// that are necessary to create a foreign connection, but that should be +// displayed after the authorization code has already been received. +type OptionSpecOauthStage string + +const OptionSpecOauthStageBeforeAccessToken OptionSpecOauthStage = `BEFORE_ACCESS_TOKEN` + +const OptionSpecOauthStageBeforeAuthorizationCode OptionSpecOauthStage = `BEFORE_AUTHORIZATION_CODE` + +// String representation for [fmt.Print] +func (f *OptionSpecOauthStage) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *OptionSpecOauthStage) Set(v string) error { + switch v { + case `BEFORE_ACCESS_TOKEN`, `BEFORE_AUTHORIZATION_CODE`: + *f = OptionSpecOauthStage(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "BEFORE_ACCESS_TOKEN", "BEFORE_AUTHORIZATION_CODE"`, v) + } +} + +// Values returns all possible values for OptionSpecOauthStage. +// +// There is no guarantee on the order of the values in the slice. +func (f *OptionSpecOauthStage) Values() []OptionSpecOauthStage { + return []OptionSpecOauthStage{ + OptionSpecOauthStageBeforeAccessToken, + OptionSpecOauthStageBeforeAuthorizationCode, + } +} + +// Type always returns OptionSpecOauthStage to satisfy [pflag.Value] interface +func (f *OptionSpecOauthStage) Type() string { + return "OptionSpecOauthStage" +} + +// Type of the option, we purposely follow JavaScript types so that the UI can +// map the options to JS types. https://www.w3schools.com/js/js_datatypes.asp +// Enum is a special case that it's just string with selections. +type OptionSpecOptionType string + +const OptionSpecOptionTypeOptionBigint OptionSpecOptionType = `OPTION_BIGINT` + +const OptionSpecOptionTypeOptionBoolean OptionSpecOptionType = `OPTION_BOOLEAN` + +const OptionSpecOptionTypeOptionEnum OptionSpecOptionType = `OPTION_ENUM` + +const OptionSpecOptionTypeOptionMultilineString OptionSpecOptionType = `OPTION_MULTILINE_STRING` + +const OptionSpecOptionTypeOptionNumber OptionSpecOptionType = `OPTION_NUMBER` + +const OptionSpecOptionTypeOptionServiceCredential OptionSpecOptionType = `OPTION_SERVICE_CREDENTIAL` + +const OptionSpecOptionTypeOptionString OptionSpecOptionType = `OPTION_STRING` + +// String representation for [fmt.Print] +func (f *OptionSpecOptionType) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *OptionSpecOptionType) Set(v string) error { + switch v { + case `OPTION_BIGINT`, `OPTION_BOOLEAN`, `OPTION_ENUM`, `OPTION_MULTILINE_STRING`, `OPTION_NUMBER`, `OPTION_SERVICE_CREDENTIAL`, `OPTION_STRING`: + *f = OptionSpecOptionType(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "OPTION_BIGINT", "OPTION_BOOLEAN", "OPTION_ENUM", "OPTION_MULTILINE_STRING", "OPTION_NUMBER", "OPTION_SERVICE_CREDENTIAL", "OPTION_STRING"`, v) + } +} + +// Values returns all possible values for OptionSpecOptionType. +// +// There is no guarantee on the order of the values in the slice. +func (f *OptionSpecOptionType) Values() []OptionSpecOptionType { + return []OptionSpecOptionType{ + OptionSpecOptionTypeOptionBigint, + OptionSpecOptionTypeOptionBoolean, + OptionSpecOptionTypeOptionEnum, + OptionSpecOptionTypeOptionMultilineString, + OptionSpecOptionTypeOptionNumber, + OptionSpecOptionTypeOptionServiceCredential, + OptionSpecOptionTypeOptionString, + } +} + +// Type always returns OptionSpecOptionType to satisfy [pflag.Value] interface +func (f *OptionSpecOptionType) Type() string { + return "OptionSpecOptionType" +} + type PermissionsChange struct { // The set of privileges to add. Add []Privilege `json:"add,omitempty"` @@ -5015,8 +5624,20 @@ type PrimaryKeyConstraint struct { ChildColumns []string `json:"child_columns"` // The name of the constraint. Name string `json:"name"` + // True if the constraint is RELY, false or unset if NORELY. + Rely bool `json:"rely,omitempty"` // Column names that represent a timeseries. TimeseriesColumns []string `json:"timeseries_columns,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *PrimaryKeyConstraint) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s PrimaryKeyConstraint) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) } type Privilege string @@ -5198,8 +5819,12 @@ func (f *Privilege) Type() string { } type PrivilegeAssignment struct { - // The principal (user email address or group name). + // The principal (user email address or group name). For deleted principals, + // `principal` is empty while `principal_id` is populated. Principal string `json:"principal,omitempty"` + // Unique identifier of the principal. For active principals, both + // `principal` and `principal_id` are present. + PrincipalId int64 `json:"principal_id,omitempty"` // The privileges assigned to the principal. Privileges []Privilege `json:"privileges,omitempty"` @@ -5324,7 +5949,6 @@ func (s R2Credentials) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get a Volume type ReadVolumeRequest struct { // Whether to include volumes in the response for which the principal can // only access selective metadata for @@ -5442,7 +6066,6 @@ func (s RegisteredModelInfo) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Queue a metric refresh for a monitor type RunRefreshRequest struct { // Full name of the table. TableName string `json:"-" url:"-"` @@ -5501,6 +6124,229 @@ func (s SchemaInfo) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +// Latest kind: CONNECTION_JDBC = 251; Next id:252 +type SecurableKind string + +const SecurableKindTableDbStorage SecurableKind = `TABLE_DB_STORAGE` + +const SecurableKindTableDelta SecurableKind = `TABLE_DELTA` + +const SecurableKindTableDeltasharing SecurableKind = `TABLE_DELTASHARING` + +const SecurableKindTableDeltasharingMutable SecurableKind = `TABLE_DELTASHARING_MUTABLE` + +const SecurableKindTableDeltaExternal SecurableKind = `TABLE_DELTA_EXTERNAL` + +const SecurableKindTableDeltaIcebergManaged SecurableKind = `TABLE_DELTA_ICEBERG_MANAGED` + +const SecurableKindTableDeltaUniformHudiExternal SecurableKind = `TABLE_DELTA_UNIFORM_HUDI_EXTERNAL` + +const SecurableKindTableDeltaUniformIcebergExternal SecurableKind = `TABLE_DELTA_UNIFORM_ICEBERG_EXTERNAL` + +const SecurableKindTableDeltaUniformIcebergForeignHiveMetastoreExternal SecurableKind = `TABLE_DELTA_UNIFORM_ICEBERG_FOREIGN_HIVE_METASTORE_EXTERNAL` + +const SecurableKindTableDeltaUniformIcebergForeignHiveMetastoreManaged SecurableKind = `TABLE_DELTA_UNIFORM_ICEBERG_FOREIGN_HIVE_METASTORE_MANAGED` + +const SecurableKindTableDeltaUniformIcebergForeignSnowflake SecurableKind = `TABLE_DELTA_UNIFORM_ICEBERG_FOREIGN_SNOWFLAKE` + +const SecurableKindTableExternal SecurableKind = `TABLE_EXTERNAL` + +const SecurableKindTableFeatureStore SecurableKind = `TABLE_FEATURE_STORE` + +const SecurableKindTableFeatureStoreExternal SecurableKind = `TABLE_FEATURE_STORE_EXTERNAL` + +const SecurableKindTableForeignBigquery SecurableKind = `TABLE_FOREIGN_BIGQUERY` + +const SecurableKindTableForeignDatabricks SecurableKind = `TABLE_FOREIGN_DATABRICKS` + +const SecurableKindTableForeignDeltasharing SecurableKind = `TABLE_FOREIGN_DELTASHARING` + +const SecurableKindTableForeignHiveMetastore SecurableKind = `TABLE_FOREIGN_HIVE_METASTORE` + +const SecurableKindTableForeignHiveMetastoreDbfsExternal SecurableKind = `TABLE_FOREIGN_HIVE_METASTORE_DBFS_EXTERNAL` + +const SecurableKindTableForeignHiveMetastoreDbfsManaged SecurableKind = `TABLE_FOREIGN_HIVE_METASTORE_DBFS_MANAGED` + +const SecurableKindTableForeignHiveMetastoreDbfsShallowCloneExternal SecurableKind = `TABLE_FOREIGN_HIVE_METASTORE_DBFS_SHALLOW_CLONE_EXTERNAL` + +const SecurableKindTableForeignHiveMetastoreDbfsShallowCloneManaged SecurableKind = `TABLE_FOREIGN_HIVE_METASTORE_DBFS_SHALLOW_CLONE_MANAGED` + +const SecurableKindTableForeignHiveMetastoreDbfsView SecurableKind = `TABLE_FOREIGN_HIVE_METASTORE_DBFS_VIEW` + +const SecurableKindTableForeignHiveMetastoreExternal SecurableKind = `TABLE_FOREIGN_HIVE_METASTORE_EXTERNAL` + +const SecurableKindTableForeignHiveMetastoreManaged SecurableKind = `TABLE_FOREIGN_HIVE_METASTORE_MANAGED` + +const SecurableKindTableForeignHiveMetastoreShallowCloneExternal SecurableKind = `TABLE_FOREIGN_HIVE_METASTORE_SHALLOW_CLONE_EXTERNAL` + +const SecurableKindTableForeignHiveMetastoreShallowCloneManaged SecurableKind = `TABLE_FOREIGN_HIVE_METASTORE_SHALLOW_CLONE_MANAGED` + +const SecurableKindTableForeignHiveMetastoreView SecurableKind = `TABLE_FOREIGN_HIVE_METASTORE_VIEW` + +const SecurableKindTableForeignMongodb SecurableKind = `TABLE_FOREIGN_MONGODB` + +const SecurableKindTableForeignMysql SecurableKind = `TABLE_FOREIGN_MYSQL` + +const SecurableKindTableForeignNetsuite SecurableKind = `TABLE_FOREIGN_NETSUITE` + +const SecurableKindTableForeignOracle SecurableKind = `TABLE_FOREIGN_ORACLE` + +const SecurableKindTableForeignPostgresql SecurableKind = `TABLE_FOREIGN_POSTGRESQL` + +const SecurableKindTableForeignRedshift SecurableKind = `TABLE_FOREIGN_REDSHIFT` + +const SecurableKindTableForeignSalesforce SecurableKind = `TABLE_FOREIGN_SALESFORCE` + +const SecurableKindTableForeignSalesforceDataCloud SecurableKind = `TABLE_FOREIGN_SALESFORCE_DATA_CLOUD` + +const SecurableKindTableForeignSalesforceDataCloudFileSharing SecurableKind = `TABLE_FOREIGN_SALESFORCE_DATA_CLOUD_FILE_SHARING` + +const SecurableKindTableForeignSalesforceDataCloudFileSharingView SecurableKind = `TABLE_FOREIGN_SALESFORCE_DATA_CLOUD_FILE_SHARING_VIEW` + +const SecurableKindTableForeignSnowflake SecurableKind = `TABLE_FOREIGN_SNOWFLAKE` + +const SecurableKindTableForeignSqldw SecurableKind = `TABLE_FOREIGN_SQLDW` + +const SecurableKindTableForeignSqlserver SecurableKind = `TABLE_FOREIGN_SQLSERVER` + +const SecurableKindTableForeignTeradata SecurableKind = `TABLE_FOREIGN_TERADATA` + +const SecurableKindTableForeignWorkdayRaas SecurableKind = `TABLE_FOREIGN_WORKDAY_RAAS` + +const SecurableKindTableIcebergUniformManaged SecurableKind = `TABLE_ICEBERG_UNIFORM_MANAGED` + +const SecurableKindTableInternal SecurableKind = `TABLE_INTERNAL` + +const SecurableKindTableManagedPostgresql SecurableKind = `TABLE_MANAGED_POSTGRESQL` + +const SecurableKindTableMaterializedView SecurableKind = `TABLE_MATERIALIZED_VIEW` + +const SecurableKindTableMaterializedViewDeltasharing SecurableKind = `TABLE_MATERIALIZED_VIEW_DELTASHARING` + +const SecurableKindTableMetricView SecurableKind = `TABLE_METRIC_VIEW` + +const SecurableKindTableOnlineVectorIndexDirect SecurableKind = `TABLE_ONLINE_VECTOR_INDEX_DIRECT` + +const SecurableKindTableOnlineVectorIndexReplica SecurableKind = `TABLE_ONLINE_VECTOR_INDEX_REPLICA` + +const SecurableKindTableOnlineView SecurableKind = `TABLE_ONLINE_VIEW` + +const SecurableKindTableStandard SecurableKind = `TABLE_STANDARD` + +const SecurableKindTableStreamingLiveTable SecurableKind = `TABLE_STREAMING_LIVE_TABLE` + +const SecurableKindTableStreamingLiveTableDeltasharing SecurableKind = `TABLE_STREAMING_LIVE_TABLE_DELTASHARING` + +const SecurableKindTableSystem SecurableKind = `TABLE_SYSTEM` + +const SecurableKindTableSystemDeltasharing SecurableKind = `TABLE_SYSTEM_DELTASHARING` + +const SecurableKindTableView SecurableKind = `TABLE_VIEW` + +const SecurableKindTableViewDeltasharing SecurableKind = `TABLE_VIEW_DELTASHARING` + +// String representation for [fmt.Print] +func (f *SecurableKind) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *SecurableKind) Set(v string) error { + switch v { + case `TABLE_DB_STORAGE`, `TABLE_DELTA`, `TABLE_DELTASHARING`, `TABLE_DELTASHARING_MUTABLE`, `TABLE_DELTA_EXTERNAL`, `TABLE_DELTA_ICEBERG_MANAGED`, `TABLE_DELTA_UNIFORM_HUDI_EXTERNAL`, `TABLE_DELTA_UNIFORM_ICEBERG_EXTERNAL`, `TABLE_DELTA_UNIFORM_ICEBERG_FOREIGN_HIVE_METASTORE_EXTERNAL`, `TABLE_DELTA_UNIFORM_ICEBERG_FOREIGN_HIVE_METASTORE_MANAGED`, `TABLE_DELTA_UNIFORM_ICEBERG_FOREIGN_SNOWFLAKE`, `TABLE_EXTERNAL`, `TABLE_FEATURE_STORE`, `TABLE_FEATURE_STORE_EXTERNAL`, `TABLE_FOREIGN_BIGQUERY`, `TABLE_FOREIGN_DATABRICKS`, `TABLE_FOREIGN_DELTASHARING`, `TABLE_FOREIGN_HIVE_METASTORE`, `TABLE_FOREIGN_HIVE_METASTORE_DBFS_EXTERNAL`, `TABLE_FOREIGN_HIVE_METASTORE_DBFS_MANAGED`, `TABLE_FOREIGN_HIVE_METASTORE_DBFS_SHALLOW_CLONE_EXTERNAL`, `TABLE_FOREIGN_HIVE_METASTORE_DBFS_SHALLOW_CLONE_MANAGED`, `TABLE_FOREIGN_HIVE_METASTORE_DBFS_VIEW`, `TABLE_FOREIGN_HIVE_METASTORE_EXTERNAL`, `TABLE_FOREIGN_HIVE_METASTORE_MANAGED`, `TABLE_FOREIGN_HIVE_METASTORE_SHALLOW_CLONE_EXTERNAL`, `TABLE_FOREIGN_HIVE_METASTORE_SHALLOW_CLONE_MANAGED`, `TABLE_FOREIGN_HIVE_METASTORE_VIEW`, `TABLE_FOREIGN_MONGODB`, `TABLE_FOREIGN_MYSQL`, `TABLE_FOREIGN_NETSUITE`, `TABLE_FOREIGN_ORACLE`, `TABLE_FOREIGN_POSTGRESQL`, `TABLE_FOREIGN_REDSHIFT`, `TABLE_FOREIGN_SALESFORCE`, `TABLE_FOREIGN_SALESFORCE_DATA_CLOUD`, `TABLE_FOREIGN_SALESFORCE_DATA_CLOUD_FILE_SHARING`, `TABLE_FOREIGN_SALESFORCE_DATA_CLOUD_FILE_SHARING_VIEW`, `TABLE_FOREIGN_SNOWFLAKE`, `TABLE_FOREIGN_SQLDW`, `TABLE_FOREIGN_SQLSERVER`, `TABLE_FOREIGN_TERADATA`, `TABLE_FOREIGN_WORKDAY_RAAS`, `TABLE_ICEBERG_UNIFORM_MANAGED`, `TABLE_INTERNAL`, `TABLE_MANAGED_POSTGRESQL`, `TABLE_MATERIALIZED_VIEW`, `TABLE_MATERIALIZED_VIEW_DELTASHARING`, `TABLE_METRIC_VIEW`, `TABLE_ONLINE_VECTOR_INDEX_DIRECT`, `TABLE_ONLINE_VECTOR_INDEX_REPLICA`, `TABLE_ONLINE_VIEW`, `TABLE_STANDARD`, `TABLE_STREAMING_LIVE_TABLE`, `TABLE_STREAMING_LIVE_TABLE_DELTASHARING`, `TABLE_SYSTEM`, `TABLE_SYSTEM_DELTASHARING`, `TABLE_VIEW`, `TABLE_VIEW_DELTASHARING`: + *f = SecurableKind(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "TABLE_DB_STORAGE", "TABLE_DELTA", "TABLE_DELTASHARING", "TABLE_DELTASHARING_MUTABLE", "TABLE_DELTA_EXTERNAL", "TABLE_DELTA_ICEBERG_MANAGED", "TABLE_DELTA_UNIFORM_HUDI_EXTERNAL", "TABLE_DELTA_UNIFORM_ICEBERG_EXTERNAL", "TABLE_DELTA_UNIFORM_ICEBERG_FOREIGN_HIVE_METASTORE_EXTERNAL", "TABLE_DELTA_UNIFORM_ICEBERG_FOREIGN_HIVE_METASTORE_MANAGED", "TABLE_DELTA_UNIFORM_ICEBERG_FOREIGN_SNOWFLAKE", "TABLE_EXTERNAL", "TABLE_FEATURE_STORE", "TABLE_FEATURE_STORE_EXTERNAL", "TABLE_FOREIGN_BIGQUERY", "TABLE_FOREIGN_DATABRICKS", "TABLE_FOREIGN_DELTASHARING", "TABLE_FOREIGN_HIVE_METASTORE", "TABLE_FOREIGN_HIVE_METASTORE_DBFS_EXTERNAL", "TABLE_FOREIGN_HIVE_METASTORE_DBFS_MANAGED", "TABLE_FOREIGN_HIVE_METASTORE_DBFS_SHALLOW_CLONE_EXTERNAL", "TABLE_FOREIGN_HIVE_METASTORE_DBFS_SHALLOW_CLONE_MANAGED", "TABLE_FOREIGN_HIVE_METASTORE_DBFS_VIEW", "TABLE_FOREIGN_HIVE_METASTORE_EXTERNAL", "TABLE_FOREIGN_HIVE_METASTORE_MANAGED", "TABLE_FOREIGN_HIVE_METASTORE_SHALLOW_CLONE_EXTERNAL", "TABLE_FOREIGN_HIVE_METASTORE_SHALLOW_CLONE_MANAGED", "TABLE_FOREIGN_HIVE_METASTORE_VIEW", "TABLE_FOREIGN_MONGODB", "TABLE_FOREIGN_MYSQL", "TABLE_FOREIGN_NETSUITE", "TABLE_FOREIGN_ORACLE", "TABLE_FOREIGN_POSTGRESQL", "TABLE_FOREIGN_REDSHIFT", "TABLE_FOREIGN_SALESFORCE", "TABLE_FOREIGN_SALESFORCE_DATA_CLOUD", "TABLE_FOREIGN_SALESFORCE_DATA_CLOUD_FILE_SHARING", "TABLE_FOREIGN_SALESFORCE_DATA_CLOUD_FILE_SHARING_VIEW", "TABLE_FOREIGN_SNOWFLAKE", "TABLE_FOREIGN_SQLDW", "TABLE_FOREIGN_SQLSERVER", "TABLE_FOREIGN_TERADATA", "TABLE_FOREIGN_WORKDAY_RAAS", "TABLE_ICEBERG_UNIFORM_MANAGED", "TABLE_INTERNAL", "TABLE_MANAGED_POSTGRESQL", "TABLE_MATERIALIZED_VIEW", "TABLE_MATERIALIZED_VIEW_DELTASHARING", "TABLE_METRIC_VIEW", "TABLE_ONLINE_VECTOR_INDEX_DIRECT", "TABLE_ONLINE_VECTOR_INDEX_REPLICA", "TABLE_ONLINE_VIEW", "TABLE_STANDARD", "TABLE_STREAMING_LIVE_TABLE", "TABLE_STREAMING_LIVE_TABLE_DELTASHARING", "TABLE_SYSTEM", "TABLE_SYSTEM_DELTASHARING", "TABLE_VIEW", "TABLE_VIEW_DELTASHARING"`, v) + } +} + +// Values returns all possible values for SecurableKind. +// +// There is no guarantee on the order of the values in the slice. +func (f *SecurableKind) Values() []SecurableKind { + return []SecurableKind{ + SecurableKindTableDbStorage, + SecurableKindTableDelta, + SecurableKindTableDeltasharing, + SecurableKindTableDeltasharingMutable, + SecurableKindTableDeltaExternal, + SecurableKindTableDeltaIcebergManaged, + SecurableKindTableDeltaUniformHudiExternal, + SecurableKindTableDeltaUniformIcebergExternal, + SecurableKindTableDeltaUniformIcebergForeignHiveMetastoreExternal, + SecurableKindTableDeltaUniformIcebergForeignHiveMetastoreManaged, + SecurableKindTableDeltaUniformIcebergForeignSnowflake, + SecurableKindTableExternal, + SecurableKindTableFeatureStore, + SecurableKindTableFeatureStoreExternal, + SecurableKindTableForeignBigquery, + SecurableKindTableForeignDatabricks, + SecurableKindTableForeignDeltasharing, + SecurableKindTableForeignHiveMetastore, + SecurableKindTableForeignHiveMetastoreDbfsExternal, + SecurableKindTableForeignHiveMetastoreDbfsManaged, + SecurableKindTableForeignHiveMetastoreDbfsShallowCloneExternal, + SecurableKindTableForeignHiveMetastoreDbfsShallowCloneManaged, + SecurableKindTableForeignHiveMetastoreDbfsView, + SecurableKindTableForeignHiveMetastoreExternal, + SecurableKindTableForeignHiveMetastoreManaged, + SecurableKindTableForeignHiveMetastoreShallowCloneExternal, + SecurableKindTableForeignHiveMetastoreShallowCloneManaged, + SecurableKindTableForeignHiveMetastoreView, + SecurableKindTableForeignMongodb, + SecurableKindTableForeignMysql, + SecurableKindTableForeignNetsuite, + SecurableKindTableForeignOracle, + SecurableKindTableForeignPostgresql, + SecurableKindTableForeignRedshift, + SecurableKindTableForeignSalesforce, + SecurableKindTableForeignSalesforceDataCloud, + SecurableKindTableForeignSalesforceDataCloudFileSharing, + SecurableKindTableForeignSalesforceDataCloudFileSharingView, + SecurableKindTableForeignSnowflake, + SecurableKindTableForeignSqldw, + SecurableKindTableForeignSqlserver, + SecurableKindTableForeignTeradata, + SecurableKindTableForeignWorkdayRaas, + SecurableKindTableIcebergUniformManaged, + SecurableKindTableInternal, + SecurableKindTableManagedPostgresql, + SecurableKindTableMaterializedView, + SecurableKindTableMaterializedViewDeltasharing, + SecurableKindTableMetricView, + SecurableKindTableOnlineVectorIndexDirect, + SecurableKindTableOnlineVectorIndexReplica, + SecurableKindTableOnlineView, + SecurableKindTableStandard, + SecurableKindTableStreamingLiveTable, + SecurableKindTableStreamingLiveTableDeltasharing, + SecurableKindTableSystem, + SecurableKindTableSystemDeltasharing, + SecurableKindTableView, + SecurableKindTableViewDeltasharing, + } +} + +// Type always returns SecurableKind to satisfy [pflag.Value] interface +func (f *SecurableKind) Type() string { + return "SecurableKind" +} + +// Manifest of a specific securable kind. +type SecurableKindManifest struct { + // Privileges that can be assigned to the securable. + AssignablePrivileges []string `json:"assignable_privileges,omitempty"` + // A list of capabilities in the securable kind. + Capabilities []string `json:"capabilities,omitempty"` + // Detailed specs of allowed options. + Options []OptionSpec `json:"options,omitempty"` + // Securable kind to get manifest of. + SecurableKind SecurableKind `json:"securable_kind,omitempty"` + // Securable Type of the kind. + SecurableType SecurableType `json:"securable_type,omitempty"` +} + // The type of Unity Catalog securable. type SecurableType string @@ -5536,8 +6382,6 @@ const SecurableTypeStorageCredential SecurableType = `STORAGE_CREDENTIAL` const SecurableTypeTable SecurableType = `TABLE` -const SecurableTypeUnknownSecurableType SecurableType = `UNKNOWN_SECURABLE_TYPE` - const SecurableTypeVolume SecurableType = `VOLUME` // String representation for [fmt.Print] @@ -5548,11 +6392,11 @@ func (f *SecurableType) String() string { // Set raw string value and validate it against allowed values func (f *SecurableType) Set(v string) error { switch v { - case `CATALOG`, `CLEAN_ROOM`, `CONNECTION`, `CREDENTIAL`, `EXTERNAL_LOCATION`, `EXTERNAL_METADATA`, `FUNCTION`, `METASTORE`, `PIPELINE`, `PROVIDER`, `RECIPIENT`, `SCHEMA`, `SHARE`, `STAGING_TABLE`, `STORAGE_CREDENTIAL`, `TABLE`, `UNKNOWN_SECURABLE_TYPE`, `VOLUME`: + case `CATALOG`, `CLEAN_ROOM`, `CONNECTION`, `CREDENTIAL`, `EXTERNAL_LOCATION`, `EXTERNAL_METADATA`, `FUNCTION`, `METASTORE`, `PIPELINE`, `PROVIDER`, `RECIPIENT`, `SCHEMA`, `SHARE`, `STAGING_TABLE`, `STORAGE_CREDENTIAL`, `TABLE`, `VOLUME`: *f = SecurableType(v) return nil default: - return fmt.Errorf(`value "%s" is not one of "CATALOG", "CLEAN_ROOM", "CONNECTION", "CREDENTIAL", "EXTERNAL_LOCATION", "EXTERNAL_METADATA", "FUNCTION", "METASTORE", "PIPELINE", "PROVIDER", "RECIPIENT", "SCHEMA", "SHARE", "STAGING_TABLE", "STORAGE_CREDENTIAL", "TABLE", "UNKNOWN_SECURABLE_TYPE", "VOLUME"`, v) + return fmt.Errorf(`value "%s" is not one of "CATALOG", "CLEAN_ROOM", "CONNECTION", "CREDENTIAL", "EXTERNAL_LOCATION", "EXTERNAL_METADATA", "FUNCTION", "METASTORE", "PIPELINE", "PROVIDER", "RECIPIENT", "SCHEMA", "SHARE", "STAGING_TABLE", "STORAGE_CREDENTIAL", "TABLE", "VOLUME"`, v) } } @@ -5577,7 +6421,6 @@ func (f *SecurableType) Values() []SecurableType { SecurableTypeStagingTable, SecurableTypeStorageCredential, SecurableTypeTable, - SecurableTypeUnknownSecurableType, SecurableTypeVolume, } } @@ -5740,6 +6583,97 @@ type SystemSchemaInfo struct { State string `json:"state"` } +type SystemType string + +const SystemTypeAmazonRedshift SystemType = `AMAZON_REDSHIFT` + +const SystemTypeAzureSynapse SystemType = `AZURE_SYNAPSE` + +const SystemTypeGoogleBigquery SystemType = `GOOGLE_BIGQUERY` + +const SystemTypeKafka SystemType = `KAFKA` + +const SystemTypeLooker SystemType = `LOOKER` + +const SystemTypeMicrosoftFabric SystemType = `MICROSOFT_FABRIC` + +const SystemTypeMicrosoftSqlServer SystemType = `MICROSOFT_SQL_SERVER` + +const SystemTypeMongodb SystemType = `MONGODB` + +const SystemTypeMysql SystemType = `MYSQL` + +const SystemTypeOracle SystemType = `ORACLE` + +const SystemTypeOther SystemType = `OTHER` + +const SystemTypePostgresql SystemType = `POSTGRESQL` + +const SystemTypePowerBi SystemType = `POWER_BI` + +const SystemTypeSalesforce SystemType = `SALESFORCE` + +const SystemTypeSap SystemType = `SAP` + +const SystemTypeServicenow SystemType = `SERVICENOW` + +const SystemTypeSnowflake SystemType = `SNOWFLAKE` + +const SystemTypeTableau SystemType = `TABLEAU` + +const SystemTypeTeradata SystemType = `TERADATA` + +const SystemTypeWorkday SystemType = `WORKDAY` + +// String representation for [fmt.Print] +func (f *SystemType) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *SystemType) Set(v string) error { + switch v { + case `AMAZON_REDSHIFT`, `AZURE_SYNAPSE`, `GOOGLE_BIGQUERY`, `KAFKA`, `LOOKER`, `MICROSOFT_FABRIC`, `MICROSOFT_SQL_SERVER`, `MONGODB`, `MYSQL`, `ORACLE`, `OTHER`, `POSTGRESQL`, `POWER_BI`, `SALESFORCE`, `SAP`, `SERVICENOW`, `SNOWFLAKE`, `TABLEAU`, `TERADATA`, `WORKDAY`: + *f = SystemType(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "AMAZON_REDSHIFT", "AZURE_SYNAPSE", "GOOGLE_BIGQUERY", "KAFKA", "LOOKER", "MICROSOFT_FABRIC", "MICROSOFT_SQL_SERVER", "MONGODB", "MYSQL", "ORACLE", "OTHER", "POSTGRESQL", "POWER_BI", "SALESFORCE", "SAP", "SERVICENOW", "SNOWFLAKE", "TABLEAU", "TERADATA", "WORKDAY"`, v) + } +} + +// Values returns all possible values for SystemType. +// +// There is no guarantee on the order of the values in the slice. +func (f *SystemType) Values() []SystemType { + return []SystemType{ + SystemTypeAmazonRedshift, + SystemTypeAzureSynapse, + SystemTypeGoogleBigquery, + SystemTypeKafka, + SystemTypeLooker, + SystemTypeMicrosoftFabric, + SystemTypeMicrosoftSqlServer, + SystemTypeMongodb, + SystemTypeMysql, + SystemTypeOracle, + SystemTypeOther, + SystemTypePostgresql, + SystemTypePowerBi, + SystemTypeSalesforce, + SystemTypeSap, + SystemTypeServicenow, + SystemTypeSnowflake, + SystemTypeTableau, + SystemTypeTeradata, + SystemTypeWorkday, + } +} + +// Type always returns SystemType to satisfy [pflag.Value] interface +func (f *SystemType) Type() string { + return "SystemType" +} + // A table constraint, as defined by *one* of the following fields being set: // __primary_key_constraint__, __foreign_key_constraint__, // __named_table_constraint__. @@ -5823,12 +6757,14 @@ type TableInfo struct { RowFilter *TableRowFilter `json:"row_filter,omitempty"` // Name of parent schema relative to its parent catalog. SchemaName string `json:"schema_name,omitempty"` + // SecurableKindManifest of table, including capabilities the table has. + SecurableKindManifest *SecurableKindManifest `json:"securable_kind_manifest,omitempty"` // List of schemes whose objects can be referenced without qualification. SqlPath string `json:"sql_path,omitempty"` // Name of the storage credential, when a storage credential is configured // for use with this table. StorageCredentialName string `json:"storage_credential_name,omitempty"` - // Storage root URL for table (for **MANAGED**, **EXTERNAL** tables) + // Storage root URL for table (for **MANAGED**, **EXTERNAL** tables). StorageLocation string `json:"storage_location,omitempty"` // List of table constraints. Note: this field is not set in the output of // the __listTables__ API. @@ -5911,6 +6847,8 @@ type TableRowFilter struct { type TableSummary struct { // The full name of the table. FullName string `json:"full_name,omitempty"` + // SecurableKindManifest of table, including capabilities the table has. + SecurableKindManifest *SecurableKindManifest `json:"securable_kind_manifest,omitempty"` TableType TableType `json:"table_type,omitempty"` @@ -5939,6 +6877,8 @@ const TableTypeManagedShallowClone TableType = `MANAGED_SHALLOW_CLONE` const TableTypeMaterializedView TableType = `MATERIALIZED_VIEW` +const TableTypeMetricView TableType = `METRIC_VIEW` + const TableTypeStreamingTable TableType = `STREAMING_TABLE` const TableTypeView TableType = `VIEW` @@ -5951,11 +6891,11 @@ func (f *TableType) String() string { // Set raw string value and validate it against allowed values func (f *TableType) Set(v string) error { switch v { - case `EXTERNAL`, `EXTERNAL_SHALLOW_CLONE`, `FOREIGN`, `MANAGED`, `MANAGED_SHALLOW_CLONE`, `MATERIALIZED_VIEW`, `STREAMING_TABLE`, `VIEW`: + case `EXTERNAL`, `EXTERNAL_SHALLOW_CLONE`, `FOREIGN`, `MANAGED`, `MANAGED_SHALLOW_CLONE`, `MATERIALIZED_VIEW`, `METRIC_VIEW`, `STREAMING_TABLE`, `VIEW`: *f = TableType(v) return nil default: - return fmt.Errorf(`value "%s" is not one of "EXTERNAL", "EXTERNAL_SHALLOW_CLONE", "FOREIGN", "MANAGED", "MANAGED_SHALLOW_CLONE", "MATERIALIZED_VIEW", "STREAMING_TABLE", "VIEW"`, v) + return fmt.Errorf(`value "%s" is not one of "EXTERNAL", "EXTERNAL_SHALLOW_CLONE", "FOREIGN", "MANAGED", "MANAGED_SHALLOW_CLONE", "MATERIALIZED_VIEW", "METRIC_VIEW", "STREAMING_TABLE", "VIEW"`, v) } } @@ -5970,6 +6910,7 @@ func (f *TableType) Values() []TableType { TableTypeManaged, TableTypeManagedShallowClone, TableTypeMaterializedView, + TableTypeMetricView, TableTypeStreamingTable, TableTypeView, } @@ -6047,7 +6988,6 @@ func (s TriggeredUpdateStatus) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Delete an assignment type UnassignRequest struct { // Query for the ID of the metastore to delete. MetastoreId string `json:"-" url:"metastore_id"` @@ -6160,6 +7100,22 @@ func (s UpdateCredentialRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type UpdateExternalLineageRelationshipRequest struct { + ExternalLineageRelationship UpdateRequestExternalLineage `json:"external_lineage_relationship"` + // The field mask must be a single string, with multiple fields separated by + // commas (no spaces). The field path is relative to the resource object, + // using a dot (`.`) to navigate sub-fields (e.g., `author.given_name`). + // Specification of elements in sequence or map fields is not allowed, as + // only the entire collection field can be specified. Field names must + // exactly match the resource field names. + // + // A field mask of `*` indicates full replacement. It’s recommended to + // always explicitly list the fields being updated and avoid using `*` + // wildcards, as it can lead to unintended results if the API changes in the + // future. + UpdateMask string `json:"-" url:"update_mask"` +} + type UpdateExternalLocation struct { // User-provided free-form text description. Comment string `json:"comment,omitempty"` @@ -6206,6 +7162,24 @@ func (s UpdateExternalLocation) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type UpdateExternalMetadataRequest struct { + ExternalMetadata ExternalMetadata `json:"external_metadata"` + // Name of the external metadata object. + Name string `json:"-" url:"-"` + // The field mask must be a single string, with multiple fields separated by + // commas (no spaces). The field path is relative to the resource object, + // using a dot (`.`) to navigate sub-fields (e.g., `author.given_name`). + // Specification of elements in sequence or map fields is not allowed, as + // only the entire collection field can be specified. Field names must + // exactly match the resource field names. + // + // A field mask of `*` indicates full replacement. It’s recommended to + // always explicitly list the fields being updated and avoid using `*` + // wildcards, as it can lead to unintended results if the API changes in the + // future. + UpdateMask string `json:"-" url:"update_mask"` +} + type UpdateFunction struct { // The fully-qualified name of the function (of the form // __catalog_name__.__schema_name__.__function__name__). @@ -6376,6 +7350,29 @@ func (s UpdateRegisteredModelRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type UpdateRequestExternalLineage struct { + // List of column relationships between source and target objects. + Columns []ColumnRelationship `json:"columns,omitempty"` + // Unique identifier of the external lineage relationship. + Id string `json:"id,omitempty"` + // Key-value properties associated with the external lineage relationship. + Properties map[string]string `json:"properties,omitempty"` + // Source object of the external lineage relationship. + Source ExternalLineageObject `json:"source"` + // Target object of the external lineage relationship. + Target ExternalLineageObject `json:"target"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *UpdateRequestExternalLineage) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s UpdateRequestExternalLineage) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type UpdateResponse struct { } @@ -6448,11 +7445,10 @@ func (s UpdateStorageCredential) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Update a table owner. type UpdateTableRequest struct { // Full name of the table. FullName string `json:"-" url:"-"` - + // Username of current owner of table. Owner string `json:"owner,omitempty"` ForceSendFields []string `json:"-" url:"-"` diff --git a/service/cleanrooms/impl.go b/service/cleanrooms/impl.go index 2ed4383cd..10da080cf 100755 --- a/service/cleanrooms/impl.go +++ b/service/cleanrooms/impl.go @@ -29,12 +29,11 @@ func (a *cleanRoomAssetsImpl) Create(ctx context.Context, request CreateCleanRoo } 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.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteCleanRoomAssetResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -174,12 +173,11 @@ func (a *cleanRoomsImpl) CreateOutputCatalog(ctx context.Context, request Create } func (a *cleanRoomsImpl) Delete(ctx context.Context, request DeleteCleanRoomRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/clean-rooms/%v", request.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } diff --git a/service/cleanrooms/model.go b/service/cleanrooms/model.go index a197fc105..f01d56079 100755 --- a/service/cleanrooms/model.go +++ b/service/cleanrooms/model.go @@ -702,7 +702,6 @@ 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"` @@ -710,7 +709,6 @@ type CreateCleanRoomAssetRequest struct { CleanRoomName string `json:"-" url:"-"` } -// Create an output catalog type CreateCleanRoomOutputCatalogRequest struct { // Name of the clean room. CleanRoomName string `json:"-" url:"-"` @@ -722,12 +720,10 @@ type CreateCleanRoomOutputCatalogResponse struct { OutputCatalog *CleanRoomOutputCatalog `json:"output_catalog,omitempty"` } -// Create a clean room type CreateCleanRoomRequest struct { CleanRoom CleanRoom `json:"clean_room"` } -// Delete an asset type DeleteCleanRoomAssetRequest struct { // The type of the asset. AssetType CleanRoomAssetAssetType `json:"-" url:"-"` @@ -743,7 +739,6 @@ type DeleteCleanRoomAssetRequest struct { type DeleteCleanRoomAssetResponse struct { } -// Delete a clean room type DeleteCleanRoomRequest struct { // Name of the clean room. Name string `json:"-" url:"-"` @@ -752,7 +747,6 @@ type DeleteCleanRoomRequest struct { type DeleteResponse struct { } -// Get an asset type GetCleanRoomAssetRequest struct { // The type of the asset. AssetType CleanRoomAssetAssetType `json:"-" url:"-"` @@ -763,12 +757,10 @@ type GetCleanRoomAssetRequest struct { Name 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:"-"` @@ -805,7 +797,6 @@ 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:"-"` @@ -847,7 +838,6 @@ 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. @@ -884,7 +874,6 @@ 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"` diff --git a/service/compute/api.go b/service/compute/api.go index ec56e450a..bc6c88c82 100755 --- a/service/compute/api.go +++ b/service/compute/api.go @@ -1999,14 +1999,57 @@ type LibrariesInterface interface { // particular order, are returned last. ClusterStatusByClusterId(ctx context.Context, clusterId string) (*ClusterLibraryStatuses, error) + // Create a default base environment within workspaces to define the environment + // version and a list of dependencies to be used in serverless notebooks and + // jobs. This process will asynchronously generate a cache to optimize + // dependency resolution. + CreateDefaultBaseEnvironment(ctx context.Context, request CreateDefaultBaseEnvironmentRequest) (*DefaultBaseEnvironment, error) + + // Delete the default base environment given an ID. The default base environment + // may be used by downstream workloads. Please ensure that the deletion is + // intentional. + DeleteDefaultBaseEnvironment(ctx context.Context, request DeleteDefaultBaseEnvironmentRequest) error + + // Delete the default base environment given an ID. The default base environment + // may be used by downstream workloads. Please ensure that the deletion is + // intentional. + DeleteDefaultBaseEnvironmentById(ctx context.Context, id string) error + // Add libraries to install on a cluster. The installation is asynchronous; it // happens in the background after the completion of this request. Install(ctx context.Context, request InstallLibraries) error + // List default base environments defined in the workspaces for the requested + // user. + // + // This method is generated by Databricks SDK Code Generator. + ListDefaultBaseEnvironments(ctx context.Context, request ListDefaultBaseEnvironmentsRequest) listing.Iterator[DefaultBaseEnvironment] + + // List default base environments defined in the workspaces for the requested + // user. + // + // This method is generated by Databricks SDK Code Generator. + ListDefaultBaseEnvironmentsAll(ctx context.Context, request ListDefaultBaseEnvironmentsRequest) ([]DefaultBaseEnvironment, error) + + // Refresh the cached default base environments for the given IDs. This process + // will asynchronously regenerate the caches. The existing caches remains + // available until it expires. + RefreshDefaultBaseEnvironments(ctx context.Context, request RefreshDefaultBaseEnvironmentsRequest) error + + // Refresh the cached default base environments for the given IDs. This process + // will asynchronously regenerate the caches. The existing caches remains + // available until it expires. + RefreshDefaultBaseEnvironmentsByIds(ctx context.Context, ids []string) error + // Set libraries to uninstall from a cluster. The libraries won't be uninstalled // until the cluster is restarted. A request to uninstall a library that is not // currently installed is ignored. Uninstall(ctx context.Context, request UninstallLibraries) error + + // Update the default base environment for the given ID. This process will + // asynchronously regenerate the cache. The existing cache remains available + // until it expires. + UpdateDefaultBaseEnvironment(ctx context.Context, request UpdateDefaultBaseEnvironmentRequest) (*DefaultBaseEnvironment, error) } func NewLibraries(client *client.DatabricksClient) *LibrariesAPI { @@ -2050,6 +2093,24 @@ func (a *LibrariesAPI) ClusterStatusByClusterId(ctx context.Context, clusterId s }) } +// Delete the default base environment given an ID. The default base environment +// may be used by downstream workloads. Please ensure that the deletion is +// intentional. +func (a *LibrariesAPI) DeleteDefaultBaseEnvironmentById(ctx context.Context, id string) error { + return a.librariesImpl.DeleteDefaultBaseEnvironment(ctx, DeleteDefaultBaseEnvironmentRequest{ + Id: id, + }) +} + +// Refresh the cached default base environments for the given IDs. This process +// will asynchronously regenerate the caches. The existing caches remains +// available until it expires. +func (a *LibrariesAPI) RefreshDefaultBaseEnvironmentsByIds(ctx context.Context, ids []string) error { + return a.librariesImpl.RefreshDefaultBaseEnvironments(ctx, RefreshDefaultBaseEnvironmentsRequest{ + Ids: ids, + }) +} + type PolicyComplianceForClustersInterface interface { // Updates a cluster to be compliant with the current version of its policy. A diff --git a/service/compute/impl.go b/service/compute/impl.go index 350ed12f9..c51e0b4b1 100755 --- a/service/compute/impl.go +++ b/service/compute/impl.go @@ -29,24 +29,22 @@ func (a *clusterPoliciesImpl) Create(ctx context.Context, request CreatePolicy) } func (a *clusterPoliciesImpl) Delete(ctx context.Context, request DeletePolicy) error { - var deletePolicyResponse DeletePolicyResponse path := "/api/2.0/policies/clusters/delete" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &deletePolicyResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } func (a *clusterPoliciesImpl) Edit(ctx context.Context, request EditPolicy) error { - var editPolicyResponse EditPolicyResponse path := "/api/2.0/policies/clusters/edit" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &editPolicyResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } @@ -143,13 +141,12 @@ type clustersImpl struct { } func (a *clustersImpl) ChangeOwner(ctx context.Context, request ChangeClusterOwner) error { - var changeClusterOwnerResponse ChangeClusterOwnerResponse path := "/api/2.1/clusters/change-owner" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &changeClusterOwnerResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } @@ -165,24 +162,22 @@ func (a *clustersImpl) Create(ctx context.Context, request CreateCluster) (*Crea } func (a *clustersImpl) Delete(ctx context.Context, request DeleteCluster) error { - var deleteClusterResponse DeleteClusterResponse path := "/api/2.1/clusters/delete" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &deleteClusterResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } func (a *clustersImpl) Edit(ctx context.Context, request EditCluster) error { - var editClusterResponse EditClusterResponse path := "/api/2.1/clusters/edit" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &editClusterResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } @@ -330,46 +325,42 @@ func (a *clustersImpl) ListZones(ctx context.Context) (*ListAvailableZonesRespon } func (a *clustersImpl) PermanentDelete(ctx context.Context, request PermanentDeleteCluster) error { - var permanentDeleteClusterResponse PermanentDeleteClusterResponse path := "/api/2.1/clusters/permanent-delete" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &permanentDeleteClusterResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } func (a *clustersImpl) Pin(ctx context.Context, request PinCluster) error { - var pinClusterResponse PinClusterResponse path := "/api/2.1/clusters/pin" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &pinClusterResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } func (a *clustersImpl) Resize(ctx context.Context, request ResizeCluster) error { - var resizeClusterResponse ResizeClusterResponse path := "/api/2.1/clusters/resize" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &resizeClusterResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } func (a *clustersImpl) Restart(ctx context.Context, request RestartCluster) error { - var restartClusterResponse RestartClusterResponse path := "/api/2.1/clusters/restart" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &restartClusterResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } @@ -395,35 +386,32 @@ func (a *clustersImpl) SparkVersions(ctx context.Context) (*GetSparkVersionsResp } func (a *clustersImpl) Start(ctx context.Context, request StartCluster) error { - var startClusterResponse StartClusterResponse path := "/api/2.1/clusters/start" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &startClusterResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } func (a *clustersImpl) Unpin(ctx context.Context, request UnpinCluster) error { - var unpinClusterResponse UnpinClusterResponse path := "/api/2.1/clusters/unpin" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &unpinClusterResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } func (a *clustersImpl) Update(ctx context.Context, request UpdateCluster) error { - var updateClusterResponse UpdateClusterResponse path := "/api/2.1/clusters/update" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &updateClusterResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } @@ -444,13 +432,12 @@ type commandExecutionImpl struct { } func (a *commandExecutionImpl) Cancel(ctx context.Context, request CancelCommand) error { - var cancelResponse CancelResponse path := "/api/1.2/commands/cancel" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &cancelResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } @@ -486,13 +473,12 @@ func (a *commandExecutionImpl) Create(ctx context.Context, request CreateContext } func (a *commandExecutionImpl) Destroy(ctx context.Context, request DestroyContext) error { - var destroyResponse DestroyResponse path := "/api/1.2/contexts/destroy" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &destroyResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } @@ -524,12 +510,11 @@ func (a *globalInitScriptsImpl) Create(ctx context.Context, request GlobalInitSc } func (a *globalInitScriptsImpl) Delete(ctx context.Context, request DeleteGlobalInitScriptRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/global-init-scripts/%v", request.ScriptId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -586,13 +571,12 @@ func (a *globalInitScriptsImpl) internalList(ctx context.Context) (*ListGlobalIn } func (a *globalInitScriptsImpl) Update(ctx context.Context, request GlobalInitScriptUpdateRequest) error { - var updateResponse UpdateResponse path := fmt.Sprintf("/api/2.0/global-init-scripts/%v", request.ScriptId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, nil) return err } @@ -613,24 +597,22 @@ func (a *instancePoolsImpl) Create(ctx context.Context, request CreateInstancePo } func (a *instancePoolsImpl) Delete(ctx context.Context, request DeleteInstancePool) error { - var deleteInstancePoolResponse DeleteInstancePoolResponse path := "/api/2.0/instance-pools/delete" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &deleteInstancePoolResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } func (a *instancePoolsImpl) Edit(ctx context.Context, request EditInstancePool) error { - var editInstancePoolResponse EditInstancePoolResponse path := "/api/2.0/instance-pools/edit" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &editInstancePoolResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } @@ -728,24 +710,22 @@ type instanceProfilesImpl struct { } func (a *instanceProfilesImpl) Add(ctx context.Context, request AddInstanceProfile) error { - var addResponse AddResponse path := "/api/2.0/instance-profiles/add" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &addResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } func (a *instanceProfilesImpl) Edit(ctx context.Context, request InstanceProfile) error { - var editResponse EditResponse path := "/api/2.0/instance-profiles/edit" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &editResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } @@ -790,13 +770,12 @@ func (a *instanceProfilesImpl) internalList(ctx context.Context) (*ListInstanceP } func (a *instanceProfilesImpl) Remove(ctx context.Context, request RemoveInstanceProfile) error { - var removeResponse RemoveResponse path := "/api/2.0/instance-profiles/remove" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &removeResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } @@ -890,28 +869,110 @@ func (a *librariesImpl) internalClusterStatus(ctx context.Context, request Clust return &clusterLibraryStatuses, err } +func (a *librariesImpl) CreateDefaultBaseEnvironment(ctx context.Context, request CreateDefaultBaseEnvironmentRequest) (*DefaultBaseEnvironment, error) { + var defaultBaseEnvironment DefaultBaseEnvironment + path := "/api/2.0/default-base-environments" + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &defaultBaseEnvironment) + return &defaultBaseEnvironment, err +} + +func (a *librariesImpl) DeleteDefaultBaseEnvironment(ctx context.Context, request DeleteDefaultBaseEnvironmentRequest) error { + path := fmt.Sprintf("/api/2.0/default-base-environments/%v", request.Id) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) + return err +} + func (a *librariesImpl) Install(ctx context.Context, request InstallLibraries) error { - var installLibrariesResponse InstallLibrariesResponse path := "/api/2.0/libraries/install" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &installLibrariesResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) + return err +} + +// List default base environments defined in the workspaces for the requested +// user. +func (a *librariesImpl) ListDefaultBaseEnvironments(ctx context.Context, request ListDefaultBaseEnvironmentsRequest) listing.Iterator[DefaultBaseEnvironment] { + + getNextPage := func(ctx context.Context, req ListDefaultBaseEnvironmentsRequest) (*ListDefaultBaseEnvironmentsResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.internalListDefaultBaseEnvironments(ctx, req) + } + getItems := func(resp *ListDefaultBaseEnvironmentsResponse) []DefaultBaseEnvironment { + return resp.DefaultBaseEnvironments + } + getNextReq := func(resp *ListDefaultBaseEnvironmentsResponse) *ListDefaultBaseEnvironmentsRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// List default base environments defined in the workspaces for the requested +// user. +func (a *librariesImpl) ListDefaultBaseEnvironmentsAll(ctx context.Context, request ListDefaultBaseEnvironmentsRequest) ([]DefaultBaseEnvironment, error) { + iterator := a.ListDefaultBaseEnvironments(ctx, request) + return listing.ToSlice[DefaultBaseEnvironment](ctx, iterator) +} + +func (a *librariesImpl) internalListDefaultBaseEnvironments(ctx context.Context, request ListDefaultBaseEnvironmentsRequest) (*ListDefaultBaseEnvironmentsResponse, error) { + var listDefaultBaseEnvironmentsResponse ListDefaultBaseEnvironmentsResponse + path := "/api/2.0/default-base-environments" + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listDefaultBaseEnvironmentsResponse) + return &listDefaultBaseEnvironmentsResponse, err +} + +func (a *librariesImpl) RefreshDefaultBaseEnvironments(ctx context.Context, request RefreshDefaultBaseEnvironmentsRequest) error { + path := "/api/2.0/default-base-environments/refresh" + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } func (a *librariesImpl) Uninstall(ctx context.Context, request UninstallLibraries) error { - var uninstallLibrariesResponse UninstallLibrariesResponse path := "/api/2.0/libraries/uninstall" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &uninstallLibrariesResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } +func (a *librariesImpl) UpdateDefaultBaseEnvironment(ctx context.Context, request UpdateDefaultBaseEnvironmentRequest) (*DefaultBaseEnvironment, error) { + var defaultBaseEnvironment DefaultBaseEnvironment + path := fmt.Sprintf("/api/2.0/default-base-environments/%v", request.Id) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &defaultBaseEnvironment) + return &defaultBaseEnvironment, err +} + // unexported type that holds implementations of just PolicyComplianceForClusters API methods type policyComplianceForClustersImpl struct { client *client.DatabricksClient diff --git a/service/compute/interface.go b/service/compute/interface.go index 71a8405b4..a3ba706b5 100755 --- a/service/compute/interface.go +++ b/service/compute/interface.go @@ -442,14 +442,39 @@ type LibrariesService interface { // removal, in no particular order, are returned last. ClusterStatus(ctx context.Context, request ClusterStatus) (*ClusterLibraryStatuses, error) + // Create a default base environment within workspaces to define the + // environment version and a list of dependencies to be used in serverless + // notebooks and jobs. This process will asynchronously generate a cache to + // optimize dependency resolution. + CreateDefaultBaseEnvironment(ctx context.Context, request CreateDefaultBaseEnvironmentRequest) (*DefaultBaseEnvironment, error) + + // Delete the default base environment given an ID. The default base + // environment may be used by downstream workloads. Please ensure that the + // deletion is intentional. + DeleteDefaultBaseEnvironment(ctx context.Context, request DeleteDefaultBaseEnvironmentRequest) error + // Add libraries to install on a cluster. The installation is asynchronous; // it happens in the background after the completion of this request. Install(ctx context.Context, request InstallLibraries) error + // List default base environments defined in the workspaces for the + // requested user. + ListDefaultBaseEnvironments(ctx context.Context, request ListDefaultBaseEnvironmentsRequest) (*ListDefaultBaseEnvironmentsResponse, error) + + // Refresh the cached default base environments for the given IDs. This + // process will asynchronously regenerate the caches. The existing caches + // remains available until it expires. + RefreshDefaultBaseEnvironments(ctx context.Context, request RefreshDefaultBaseEnvironmentsRequest) error + // Set libraries to uninstall from a cluster. The libraries won't be // uninstalled until the cluster is restarted. A request to uninstall a // library that is not currently installed is ignored. Uninstall(ctx context.Context, request UninstallLibraries) error + + // Update the default base environment for the given ID. This process will + // asynchronously regenerate the cache. The existing cache remains available + // until it expires. + UpdateDefaultBaseEnvironment(ctx context.Context, request UpdateDefaultBaseEnvironmentRequest) (*DefaultBaseEnvironment, error) } // The policy compliance APIs allow you to view and manage the policy compliance diff --git a/service/compute/model.go b/service/compute/model.go index 93b0bbfc0..82d4add7d 100755 --- a/service/compute/model.go +++ b/service/compute/model.go @@ -1543,7 +1543,6 @@ func (s ClusterSpec) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get status type ClusterStatus struct { // Unique identifier of the cluster whose status should be retrieved. ClusterId string `json:"-" url:"cluster_id"` @@ -1619,7 +1618,6 @@ func (f *CommandStatus) Type() string { return "CommandStatus" } -// Get command info type CommandStatusRequest struct { ClusterId string `json:"-" url:"clusterId"` @@ -1686,7 +1684,6 @@ func (f *ContextStatus) Type() string { return "ContextStatus" } -// Get status type ContextStatusRequest struct { ClusterId string `json:"-" url:"clusterId"` @@ -1955,6 +1952,23 @@ func (s CreateContext) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type CreateDefaultBaseEnvironmentRequest struct { + DefaultBaseEnvironment DefaultBaseEnvironment `json:"default_base_environment"` + // A unique identifier for this request. A random UUID is recommended. This + // request is only idempotent if a `request_id` is provided. + RequestId string `json:"request_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *CreateDefaultBaseEnvironmentRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s CreateDefaultBaseEnvironmentRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type CreateInstancePool struct { // Attributes related to instance pools running on Amazon Web Services. If // not specified at pool creation, a set of default values will be used. @@ -1971,6 +1985,10 @@ type CreateInstancePool struct { // Defines the specification of the disks that will be attached to all spark // containers. DiskSpec *DiskSpec `json:"disk_spec,omitempty"` + // For pools with node type flexibility (Fleet-V2), whether auto generated + // alternate node type ids are enabled. This field should not be true if + // node_type_flexibility is set. + EnableAutoAlternateNodeTypes bool `json:"enable_auto_alternate_node_types,omitempty"` // Autoscaling Local Storage: when enabled, this instances in this pool will // dynamically acquire additional disk space when its Spark workers are // running low on disk space. In AWS, this feature requires specific AWS @@ -1997,6 +2015,11 @@ type CreateInstancePool struct { MaxCapacity int `json:"max_capacity,omitempty"` // Minimum number of idle instances to keep in the instance pool MinIdleInstances int `json:"min_idle_instances,omitempty"` + // For pools with node type flexibility (Fleet-V2), this object contains the + // information about the alternate node type ids to use when attempting to + // launch a cluster if the node type id is not available. This field should + // not be set if enable_auto_alternate_node_types is true. + NodeTypeFlexibility *NodeTypeFlexibility `json:"node_type_flexibility,omitempty"` // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A @@ -2324,6 +2347,125 @@ type DbfsStorageInfo struct { Destination string `json:"destination"` } +type DefaultBaseEnvironment struct { + BaseEnvironmentCache []DefaultBaseEnvironmentCache `json:"base_environment_cache,omitempty"` + + CreatedTimestamp int64 `json:"created_timestamp,omitempty"` + + CreatorUserId int64 `json:"creator_user_id,omitempty"` + // Note: we made `environment` non-internal because we need to expose its + // `client` field. All other fields should be treated as internal. + Environment *Environment `json:"environment,omitempty"` + + Filepath string `json:"filepath,omitempty"` + + Id string `json:"id,omitempty"` + + LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + + LastUpdatedUserId int64 `json:"last_updated_user_id,omitempty"` + + Message string `json:"message,omitempty"` + + Name string `json:"name,omitempty"` + + PrincipalIds []int64 `json:"principal_ids,omitempty"` + + Status DefaultBaseEnvironmentCacheStatus `json:"status,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *DefaultBaseEnvironment) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s DefaultBaseEnvironment) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type DefaultBaseEnvironmentCache struct { + // Materialized Environment information enables environment sharing and + // reuse via Environment Caching during library installations. Currently + // this feature is only supported for Python libraries. + // + // - If the env cache entry in LMv2 DB doesn't exist or invalid, library + // installations and environment materialization will occur. A new + // Materialized Environment metadata will be sent from DP upon successful + // library installations and env materialization, and is persisted into + // database by LMv2. - If the env cache entry in LMv2 DB is valid, the + // Materialized Environment will be sent to DP by LMv2, and DP will restore + // the cached environment from a store instead of reinstalling libraries + // from scratch. + // + // If changed, also update + // estore/namespaces/defaultbaseenvironments/latest.proto with new version + MaterializedEnvironment *MaterializedEnvironment `json:"materialized_environment,omitempty"` + + Message string `json:"message,omitempty"` + + Status DefaultBaseEnvironmentCacheStatus `json:"status,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *DefaultBaseEnvironmentCache) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s DefaultBaseEnvironmentCache) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type DefaultBaseEnvironmentCacheStatus string + +const DefaultBaseEnvironmentCacheStatusCreated DefaultBaseEnvironmentCacheStatus = `CREATED` + +const DefaultBaseEnvironmentCacheStatusExpired DefaultBaseEnvironmentCacheStatus = `EXPIRED` + +const DefaultBaseEnvironmentCacheStatusFailed DefaultBaseEnvironmentCacheStatus = `FAILED` + +const DefaultBaseEnvironmentCacheStatusInvalid DefaultBaseEnvironmentCacheStatus = `INVALID` + +const DefaultBaseEnvironmentCacheStatusPending DefaultBaseEnvironmentCacheStatus = `PENDING` + +const DefaultBaseEnvironmentCacheStatusRefreshing DefaultBaseEnvironmentCacheStatus = `REFRESHING` + +// String representation for [fmt.Print] +func (f *DefaultBaseEnvironmentCacheStatus) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *DefaultBaseEnvironmentCacheStatus) Set(v string) error { + switch v { + case `CREATED`, `EXPIRED`, `FAILED`, `INVALID`, `PENDING`, `REFRESHING`: + *f = DefaultBaseEnvironmentCacheStatus(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "CREATED", "EXPIRED", "FAILED", "INVALID", "PENDING", "REFRESHING"`, v) + } +} + +// Values returns all possible values for DefaultBaseEnvironmentCacheStatus. +// +// There is no guarantee on the order of the values in the slice. +func (f *DefaultBaseEnvironmentCacheStatus) Values() []DefaultBaseEnvironmentCacheStatus { + return []DefaultBaseEnvironmentCacheStatus{ + DefaultBaseEnvironmentCacheStatusCreated, + DefaultBaseEnvironmentCacheStatusExpired, + DefaultBaseEnvironmentCacheStatusFailed, + DefaultBaseEnvironmentCacheStatusInvalid, + DefaultBaseEnvironmentCacheStatusPending, + DefaultBaseEnvironmentCacheStatusRefreshing, + } +} + +// Type always returns DefaultBaseEnvironmentCacheStatus to satisfy [pflag.Value] interface +func (f *DefaultBaseEnvironmentCacheStatus) Type() string { + return "DefaultBaseEnvironmentCacheStatus" +} + type DeleteCluster struct { // The cluster to be terminated. ClusterId string `json:"cluster_id"` @@ -2332,7 +2474,13 @@ type DeleteCluster struct { type DeleteClusterResponse struct { } -// Delete init script +type DeleteDefaultBaseEnvironmentRequest struct { + Id string `json:"-" url:"-"` +} + +type DeleteDefaultBaseEnvironmentResponse struct { +} + type DeleteGlobalInitScriptRequest struct { // The ID of the global init script. ScriptId string `json:"-" url:"-"` @@ -2800,6 +2948,10 @@ type EditInstancePool struct { // // - Currently, Databricks allows at most 45 custom tags CustomTags map[string]string `json:"custom_tags,omitempty"` + // For pools with node type flexibility (Fleet-V2), whether auto generated + // alternate node type ids are enabled. This field should not be true if + // node_type_flexibility is set. + EnableAutoAlternateNodeTypes bool `json:"enable_auto_alternate_node_types,omitempty"` // Automatically terminates the extra instances in the pool cache after they // are inactive for this time in minutes if min_idle_instances requirement // is already met. If not set, the extra pool instances will be @@ -2819,6 +2971,11 @@ type EditInstancePool struct { MaxCapacity int `json:"max_capacity,omitempty"` // Minimum number of idle instances to keep in the instance pool MinIdleInstances int `json:"min_idle_instances,omitempty"` + // For pools with node type flexibility (Fleet-V2), this object contains the + // information about the alternate node type ids to use when attempting to + // launch a cluster if the node type id is not available. This field should + // not be set if enable_auto_alternate_node_types is true. + NodeTypeFlexibility *NodeTypeFlexibility `json:"node_type_flexibility,omitempty"` // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A @@ -3290,7 +3447,6 @@ type GcsStorageInfo struct { Destination string `json:"destination"` } -// Get cluster policy compliance type GetClusterComplianceRequest struct { // The ID of the cluster to get the compliance status ClusterId string `json:"-" url:"cluster_id"` @@ -3318,7 +3474,6 @@ func (s GetClusterComplianceResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get cluster permission levels type GetClusterPermissionLevelsRequest struct { // The cluster for which to get or manage permissions. ClusterId string `json:"-" url:"-"` @@ -3329,13 +3484,11 @@ type GetClusterPermissionLevelsResponse struct { PermissionLevels []ClusterPermissionsDescription `json:"permission_levels,omitempty"` } -// Get cluster permissions type GetClusterPermissionsRequest struct { // The cluster for which to get or manage permissions. ClusterId string `json:"-" url:"-"` } -// Get cluster policy permission levels type GetClusterPolicyPermissionLevelsRequest struct { // The cluster policy for which to get or manage permissions. ClusterPolicyId string `json:"-" url:"-"` @@ -3346,19 +3499,16 @@ type GetClusterPolicyPermissionLevelsResponse struct { PermissionLevels []ClusterPolicyPermissionsDescription `json:"permission_levels,omitempty"` } -// Get cluster policy permissions type GetClusterPolicyPermissionsRequest struct { // The cluster policy for which to get or manage permissions. ClusterPolicyId string `json:"-" url:"-"` } -// Get a cluster policy type GetClusterPolicyRequest struct { // Canonical unique identifier for the Cluster Policy. PolicyId string `json:"-" url:"policy_id"` } -// Get cluster info type GetClusterRequest struct { // The cluster about which to retrieve information. ClusterId string `json:"-" url:"cluster_id"` @@ -3480,7 +3630,6 @@ func (s GetEventsResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get an init script type GetGlobalInitScriptRequest struct { // The ID of the global init script. ScriptId string `json:"-" url:"-"` @@ -3513,6 +3662,10 @@ type GetInstancePool struct { // Defines the specification of the disks that will be attached to all spark // containers. DiskSpec *DiskSpec `json:"disk_spec,omitempty"` + // For pools with node type flexibility (Fleet-V2), whether auto generated + // alternate node type ids are enabled. This field should not be true if + // node_type_flexibility is set. + EnableAutoAlternateNodeTypes bool `json:"enable_auto_alternate_node_types,omitempty"` // Autoscaling Local Storage: when enabled, this instances in this pool will // dynamically acquire additional disk space when its Spark workers are // running low on disk space. In AWS, this feature requires specific AWS @@ -3541,6 +3694,11 @@ type GetInstancePool struct { MaxCapacity int `json:"max_capacity,omitempty"` // Minimum number of idle instances to keep in the instance pool MinIdleInstances int `json:"min_idle_instances,omitempty"` + // For pools with node type flexibility (Fleet-V2), this object contains the + // information about the alternate node type ids to use when attempting to + // launch a cluster if the node type id is not available. This field should + // not be set if enable_auto_alternate_node_types is true. + NodeTypeFlexibility *NodeTypeFlexibility `json:"node_type_flexibility,omitempty"` // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A @@ -3578,7 +3736,6 @@ func (s GetInstancePool) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get instance pool permission levels type GetInstancePoolPermissionLevelsRequest struct { // The instance pool for which to get or manage permissions. InstancePoolId string `json:"-" url:"-"` @@ -3589,19 +3746,16 @@ type GetInstancePoolPermissionLevelsResponse struct { PermissionLevels []InstancePoolPermissionsDescription `json:"permission_levels,omitempty"` } -// Get instance pool permissions type GetInstancePoolPermissionsRequest struct { // The instance pool for which to get or manage permissions. InstancePoolId string `json:"-" url:"-"` } -// Get instance pool information type GetInstancePoolRequest struct { // The canonical unique identifier for the instance pool. InstancePoolId string `json:"-" url:"instance_pool_id"` } -// Get policy family information type GetPolicyFamilyRequest struct { // The family ID about which to retrieve information. PolicyFamilyId string `json:"-" url:"-"` @@ -3987,6 +4141,10 @@ type InstancePoolAndStats struct { // Defines the specification of the disks that will be attached to all spark // containers. DiskSpec *DiskSpec `json:"disk_spec,omitempty"` + // For pools with node type flexibility (Fleet-V2), whether auto generated + // alternate node type ids are enabled. This field should not be true if + // node_type_flexibility is set. + EnableAutoAlternateNodeTypes bool `json:"enable_auto_alternate_node_types,omitempty"` // Autoscaling Local Storage: when enabled, this instances in this pool will // dynamically acquire additional disk space when its Spark workers are // running low on disk space. In AWS, this feature requires specific AWS @@ -4015,6 +4173,11 @@ type InstancePoolAndStats struct { MaxCapacity int `json:"max_capacity,omitempty"` // Minimum number of idle instances to keep in the instance pool MinIdleInstances int `json:"min_idle_instances,omitempty"` + // For pools with node type flexibility (Fleet-V2), this object contains the + // information about the alternate node type ids to use when attempting to + // launch a cluster if the node type id is not available. This field should + // not be set if enable_auto_alternate_node_types is true. + NodeTypeFlexibility *NodeTypeFlexibility `json:"node_type_flexibility,omitempty"` // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A @@ -4676,7 +4839,6 @@ func (s ListAvailableZonesResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List cluster policy compliance type ListClusterCompliancesRequest struct { // Use this field to specify the maximum number of results to be returned by // the server. The server may further constrain the maximum number of @@ -4721,7 +4883,6 @@ func (s ListClusterCompliancesResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List cluster policies type ListClusterPoliciesRequest struct { // The cluster policy attribute to sort by. * `POLICY_CREATION_TIME` - Sort // result list by policy creation time. * `POLICY_NAME` - Sort result list @@ -4753,7 +4914,6 @@ func (s ListClustersFilterBy) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List clusters type ListClustersRequest struct { // Filters to apply to the list of clusters. FilterBy *ListClustersFilterBy `json:"-" url:"filter_by,omitempty"` @@ -4882,6 +5042,38 @@ func (f *ListClustersSortByField) Type() string { return "ListClustersSortByField" } +type ListDefaultBaseEnvironmentsRequest struct { + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListDefaultBaseEnvironmentsRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListDefaultBaseEnvironmentsRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListDefaultBaseEnvironmentsResponse struct { + DefaultBaseEnvironments []DefaultBaseEnvironment `json:"default_base_environments,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListDefaultBaseEnvironmentsResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListDefaultBaseEnvironmentsResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type ListGlobalInitScriptsResponse struct { Scripts []GlobalInitScriptDetails `json:"scripts,omitempty"` } @@ -4905,7 +5097,6 @@ type ListPoliciesResponse struct { Policies []Policy `json:"policies,omitempty"` } -// List policy families type ListPolicyFamiliesRequest struct { // Maximum number of policy families to return. MaxResults int64 `json:"-" url:"max_results,omitempty"` @@ -5058,6 +5249,36 @@ func (s LogSyncStatus) MarshalJSON() ([]byte, error) { type MapAny map[string]any +// Materialized Environment information enables environment sharing and reuse +// via Environment Caching during library installations. Currently this feature +// is only supported for Python libraries. +// +// - If the env cache entry in LMv2 DB doesn't exist or invalid, library +// installations and environment materialization will occur. A new Materialized +// Environment metadata will be sent from DP upon successful library +// installations and env materialization, and is persisted into database by +// LMv2. - If the env cache entry in LMv2 DB is valid, the Materialized +// Environment will be sent to DP by LMv2, and DP will restore the cached +// environment from a store instead of reinstalling libraries from scratch. +// +// If changed, also update +// estore/namespaces/defaultbaseenvironments/latest.proto with new version +type MaterializedEnvironment struct { + // The timestamp (in epoch milliseconds) when the materialized env is + // updated. + LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *MaterializedEnvironment) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s MaterializedEnvironment) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type MavenLibrary struct { // Gradle-style maven coordinates. For example: "org.jsoup:jsoup:1.7.2". Coordinates string `json:"coordinates"` @@ -5174,6 +5395,12 @@ func (s NodeType) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +// For Fleet-V2 using classic clusters, this object contains the information +// about the alternate node type ids to use when attempting to launch a cluster. +// It can be used with both the driver and worker node types. +type NodeTypeFlexibility struct { +} + // Error message of a failed pending instances type PendingInstanceError struct { InstanceId string `json:"instance_id,omitempty"` @@ -5327,6 +5554,13 @@ func (s RCranLibrary) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type RefreshDefaultBaseEnvironmentsRequest struct { + Ids []string `json:"ids"` +} + +type RefreshDefaultBaseEnvironmentsResponse struct { +} + type RemoveInstanceProfile struct { // The ARN of the instance profile to remove. This field is required. InstanceProfileArn string `json:"instance_profile_arn"` @@ -5986,6 +6220,8 @@ const TerminationReasonCodeSecretPermissionDenied TerminationReasonCode = `SECRE const TerminationReasonCodeSecretResolutionError TerminationReasonCode = `SECRET_RESOLUTION_ERROR` +const TerminationReasonCodeSecurityAgentsFailedInitialVerification TerminationReasonCode = `SECURITY_AGENTS_FAILED_INITIAL_VERIFICATION` + const TerminationReasonCodeSecurityDaemonRegistrationException TerminationReasonCode = `SECURITY_DAEMON_REGISTRATION_EXCEPTION` const TerminationReasonCodeSelfBootstrapFailure TerminationReasonCode = `SELF_BOOTSTRAP_FAILURE` @@ -6056,11 +6292,11 @@ func (f *TerminationReasonCode) String() string { // Set raw string value and validate it against allowed values func (f *TerminationReasonCode) Set(v string) error { switch v { - case `ABUSE_DETECTED`, `ACCESS_TOKEN_FAILURE`, `ALLOCATION_TIMEOUT`, `ALLOCATION_TIMEOUT_NODE_DAEMON_NOT_READY`, `ALLOCATION_TIMEOUT_NO_HEALTHY_AND_WARMED_UP_CLUSTERS`, `ALLOCATION_TIMEOUT_NO_HEALTHY_CLUSTERS`, `ALLOCATION_TIMEOUT_NO_MATCHED_CLUSTERS`, `ALLOCATION_TIMEOUT_NO_READY_CLUSTERS`, `ALLOCATION_TIMEOUT_NO_UNALLOCATED_CLUSTERS`, `ALLOCATION_TIMEOUT_NO_WARMED_UP_CLUSTERS`, `ATTACH_PROJECT_FAILURE`, `AWS_AUTHORIZATION_FAILURE`, `AWS_INACCESSIBLE_KMS_KEY_FAILURE`, `AWS_INSTANCE_PROFILE_UPDATE_FAILURE`, `AWS_INSUFFICIENT_FREE_ADDRESSES_IN_SUBNET_FAILURE`, `AWS_INSUFFICIENT_INSTANCE_CAPACITY_FAILURE`, `AWS_INVALID_KEY_PAIR`, `AWS_INVALID_KMS_KEY_STATE`, `AWS_MAX_SPOT_INSTANCE_COUNT_EXCEEDED_FAILURE`, `AWS_REQUEST_LIMIT_EXCEEDED`, `AWS_RESOURCE_QUOTA_EXCEEDED`, `AWS_UNSUPPORTED_FAILURE`, `AZURE_BYOK_KEY_PERMISSION_FAILURE`, `AZURE_EPHEMERAL_DISK_FAILURE`, `AZURE_INVALID_DEPLOYMENT_TEMPLATE`, `AZURE_OPERATION_NOT_ALLOWED_EXCEPTION`, `AZURE_PACKED_DEPLOYMENT_PARTIAL_FAILURE`, `AZURE_QUOTA_EXCEEDED_EXCEPTION`, `AZURE_RESOURCE_MANAGER_THROTTLING`, `AZURE_RESOURCE_PROVIDER_THROTTLING`, `AZURE_UNEXPECTED_DEPLOYMENT_TEMPLATE_FAILURE`, `AZURE_VM_EXTENSION_FAILURE`, `AZURE_VNET_CONFIGURATION_FAILURE`, `BOOTSTRAP_TIMEOUT`, `BOOTSTRAP_TIMEOUT_CLOUD_PROVIDER_EXCEPTION`, `BOOTSTRAP_TIMEOUT_DUE_TO_MISCONFIG`, `BUDGET_POLICY_LIMIT_ENFORCEMENT_ACTIVATED`, `BUDGET_POLICY_RESOLUTION_FAILURE`, `CLOUD_ACCOUNT_SETUP_FAILURE`, `CLOUD_OPERATION_CANCELLED`, `CLOUD_PROVIDER_DISK_SETUP_FAILURE`, `CLOUD_PROVIDER_INSTANCE_NOT_LAUNCHED`, `CLOUD_PROVIDER_LAUNCH_FAILURE`, `CLOUD_PROVIDER_LAUNCH_FAILURE_DUE_TO_MISCONFIG`, `CLOUD_PROVIDER_RESOURCE_STOCKOUT`, `CLOUD_PROVIDER_RESOURCE_STOCKOUT_DUE_TO_MISCONFIG`, `CLOUD_PROVIDER_SHUTDOWN`, `CLUSTER_OPERATION_THROTTLED`, `CLUSTER_OPERATION_TIMEOUT`, `COMMUNICATION_LOST`, `CONTAINER_LAUNCH_FAILURE`, `CONTROL_PLANE_REQUEST_FAILURE`, `CONTROL_PLANE_REQUEST_FAILURE_DUE_TO_MISCONFIG`, `DATABASE_CONNECTION_FAILURE`, `DATA_ACCESS_CONFIG_CHANGED`, `DBFS_COMPONENT_UNHEALTHY`, `DISASTER_RECOVERY_REPLICATION`, `DNS_RESOLUTION_ERROR`, `DOCKER_CONTAINER_CREATION_EXCEPTION`, `DOCKER_IMAGE_PULL_FAILURE`, `DOCKER_IMAGE_TOO_LARGE_FOR_INSTANCE_EXCEPTION`, `DOCKER_INVALID_OS_EXCEPTION`, `DRIVER_EVICTION`, `DRIVER_LAUNCH_TIMEOUT`, `DRIVER_NODE_UNREACHABLE`, `DRIVER_OUT_OF_DISK`, `DRIVER_OUT_OF_MEMORY`, `DRIVER_POD_CREATION_FAILURE`, `DRIVER_UNEXPECTED_FAILURE`, `DRIVER_UNHEALTHY`, `DRIVER_UNREACHABLE`, `DRIVER_UNRESPONSIVE`, `DYNAMIC_SPARK_CONF_SIZE_EXCEEDED`, `EOS_SPARK_IMAGE`, `EXECUTION_COMPONENT_UNHEALTHY`, `EXECUTOR_POD_UNSCHEDULED`, `GCP_API_RATE_QUOTA_EXCEEDED`, `GCP_DENIED_BY_ORG_POLICY`, `GCP_FORBIDDEN`, `GCP_IAM_TIMEOUT`, `GCP_INACCESSIBLE_KMS_KEY_FAILURE`, `GCP_INSUFFICIENT_CAPACITY`, `GCP_IP_SPACE_EXHAUSTED`, `GCP_KMS_KEY_PERMISSION_DENIED`, `GCP_NOT_FOUND`, `GCP_QUOTA_EXCEEDED`, `GCP_RESOURCE_QUOTA_EXCEEDED`, `GCP_SERVICE_ACCOUNT_ACCESS_DENIED`, `GCP_SERVICE_ACCOUNT_DELETED`, `GCP_SERVICE_ACCOUNT_NOT_FOUND`, `GCP_SUBNET_NOT_READY`, `GCP_TRUSTED_IMAGE_PROJECTS_VIOLATED`, `GKE_BASED_CLUSTER_TERMINATION`, `GLOBAL_INIT_SCRIPT_FAILURE`, `HIVE_METASTORE_PROVISIONING_FAILURE`, `IMAGE_PULL_PERMISSION_DENIED`, `INACTIVITY`, `INIT_CONTAINER_NOT_FINISHED`, `INIT_SCRIPT_FAILURE`, `INSTANCE_POOL_CLUSTER_FAILURE`, `INSTANCE_POOL_MAX_CAPACITY_REACHED`, `INSTANCE_POOL_NOT_FOUND`, `INSTANCE_UNREACHABLE`, `INSTANCE_UNREACHABLE_DUE_TO_MISCONFIG`, `INTERNAL_CAPACITY_FAILURE`, `INTERNAL_ERROR`, `INVALID_ARGUMENT`, `INVALID_AWS_PARAMETER`, `INVALID_INSTANCE_PLACEMENT_PROTOCOL`, `INVALID_SPARK_IMAGE`, `INVALID_WORKER_IMAGE_FAILURE`, `IN_PENALTY_BOX`, `IP_EXHAUSTION_FAILURE`, `JOB_FINISHED`, `K8S_AUTOSCALING_FAILURE`, `K8S_DBR_CLUSTER_LAUNCH_TIMEOUT`, `LAZY_ALLOCATION_TIMEOUT`, `MAINTENANCE_MODE`, `METASTORE_COMPONENT_UNHEALTHY`, `NEPHOS_RESOURCE_MANAGEMENT`, `NETVISOR_SETUP_TIMEOUT`, `NETWORK_CHECK_CONTROL_PLANE_FAILURE`, `NETWORK_CHECK_DNS_SERVER_FAILURE`, `NETWORK_CHECK_METADATA_ENDPOINT_FAILURE`, `NETWORK_CHECK_MULTIPLE_COMPONENTS_FAILURE`, `NETWORK_CHECK_NIC_FAILURE`, `NETWORK_CHECK_STORAGE_FAILURE`, `NETWORK_CONFIGURATION_FAILURE`, `NFS_MOUNT_FAILURE`, `NO_MATCHED_K8S`, `NO_MATCHED_K8S_TESTING_TAG`, `NPIP_TUNNEL_SETUP_FAILURE`, `NPIP_TUNNEL_TOKEN_FAILURE`, `POD_ASSIGNMENT_FAILURE`, `POD_SCHEDULING_FAILURE`, `REQUEST_REJECTED`, `REQUEST_THROTTLED`, `RESOURCE_USAGE_BLOCKED`, `SECRET_CREATION_FAILURE`, `SECRET_PERMISSION_DENIED`, `SECRET_RESOLUTION_ERROR`, `SECURITY_DAEMON_REGISTRATION_EXCEPTION`, `SELF_BOOTSTRAP_FAILURE`, `SERVERLESS_LONG_RUNNING_TERMINATED`, `SKIPPED_SLOW_NODES`, `SLOW_IMAGE_DOWNLOAD`, `SPARK_ERROR`, `SPARK_IMAGE_DOWNLOAD_FAILURE`, `SPARK_IMAGE_DOWNLOAD_THROTTLED`, `SPARK_IMAGE_NOT_FOUND`, `SPARK_STARTUP_FAILURE`, `SPOT_INSTANCE_TERMINATION`, `SSH_BOOTSTRAP_FAILURE`, `STORAGE_DOWNLOAD_FAILURE`, `STORAGE_DOWNLOAD_FAILURE_DUE_TO_MISCONFIG`, `STORAGE_DOWNLOAD_FAILURE_SLOW`, `STORAGE_DOWNLOAD_FAILURE_THROTTLED`, `STS_CLIENT_SETUP_FAILURE`, `SUBNET_EXHAUSTED_FAILURE`, `TEMPORARILY_UNAVAILABLE`, `TRIAL_EXPIRED`, `UNEXPECTED_LAUNCH_FAILURE`, `UNEXPECTED_POD_RECREATION`, `UNKNOWN`, `UNSUPPORTED_INSTANCE_TYPE`, `UPDATE_INSTANCE_PROFILE_FAILURE`, `USER_INITIATED_VM_TERMINATION`, `USER_REQUEST`, `WORKER_SETUP_FAILURE`, `WORKSPACE_CANCELLED_ERROR`, `WORKSPACE_CONFIGURATION_ERROR`, `WORKSPACE_UPDATE`: + case `ABUSE_DETECTED`, `ACCESS_TOKEN_FAILURE`, `ALLOCATION_TIMEOUT`, `ALLOCATION_TIMEOUT_NODE_DAEMON_NOT_READY`, `ALLOCATION_TIMEOUT_NO_HEALTHY_AND_WARMED_UP_CLUSTERS`, `ALLOCATION_TIMEOUT_NO_HEALTHY_CLUSTERS`, `ALLOCATION_TIMEOUT_NO_MATCHED_CLUSTERS`, `ALLOCATION_TIMEOUT_NO_READY_CLUSTERS`, `ALLOCATION_TIMEOUT_NO_UNALLOCATED_CLUSTERS`, `ALLOCATION_TIMEOUT_NO_WARMED_UP_CLUSTERS`, `ATTACH_PROJECT_FAILURE`, `AWS_AUTHORIZATION_FAILURE`, `AWS_INACCESSIBLE_KMS_KEY_FAILURE`, `AWS_INSTANCE_PROFILE_UPDATE_FAILURE`, `AWS_INSUFFICIENT_FREE_ADDRESSES_IN_SUBNET_FAILURE`, `AWS_INSUFFICIENT_INSTANCE_CAPACITY_FAILURE`, `AWS_INVALID_KEY_PAIR`, `AWS_INVALID_KMS_KEY_STATE`, `AWS_MAX_SPOT_INSTANCE_COUNT_EXCEEDED_FAILURE`, `AWS_REQUEST_LIMIT_EXCEEDED`, `AWS_RESOURCE_QUOTA_EXCEEDED`, `AWS_UNSUPPORTED_FAILURE`, `AZURE_BYOK_KEY_PERMISSION_FAILURE`, `AZURE_EPHEMERAL_DISK_FAILURE`, `AZURE_INVALID_DEPLOYMENT_TEMPLATE`, `AZURE_OPERATION_NOT_ALLOWED_EXCEPTION`, `AZURE_PACKED_DEPLOYMENT_PARTIAL_FAILURE`, `AZURE_QUOTA_EXCEEDED_EXCEPTION`, `AZURE_RESOURCE_MANAGER_THROTTLING`, `AZURE_RESOURCE_PROVIDER_THROTTLING`, `AZURE_UNEXPECTED_DEPLOYMENT_TEMPLATE_FAILURE`, `AZURE_VM_EXTENSION_FAILURE`, `AZURE_VNET_CONFIGURATION_FAILURE`, `BOOTSTRAP_TIMEOUT`, `BOOTSTRAP_TIMEOUT_CLOUD_PROVIDER_EXCEPTION`, `BOOTSTRAP_TIMEOUT_DUE_TO_MISCONFIG`, `BUDGET_POLICY_LIMIT_ENFORCEMENT_ACTIVATED`, `BUDGET_POLICY_RESOLUTION_FAILURE`, `CLOUD_ACCOUNT_SETUP_FAILURE`, `CLOUD_OPERATION_CANCELLED`, `CLOUD_PROVIDER_DISK_SETUP_FAILURE`, `CLOUD_PROVIDER_INSTANCE_NOT_LAUNCHED`, `CLOUD_PROVIDER_LAUNCH_FAILURE`, `CLOUD_PROVIDER_LAUNCH_FAILURE_DUE_TO_MISCONFIG`, `CLOUD_PROVIDER_RESOURCE_STOCKOUT`, `CLOUD_PROVIDER_RESOURCE_STOCKOUT_DUE_TO_MISCONFIG`, `CLOUD_PROVIDER_SHUTDOWN`, `CLUSTER_OPERATION_THROTTLED`, `CLUSTER_OPERATION_TIMEOUT`, `COMMUNICATION_LOST`, `CONTAINER_LAUNCH_FAILURE`, `CONTROL_PLANE_REQUEST_FAILURE`, `CONTROL_PLANE_REQUEST_FAILURE_DUE_TO_MISCONFIG`, `DATABASE_CONNECTION_FAILURE`, `DATA_ACCESS_CONFIG_CHANGED`, `DBFS_COMPONENT_UNHEALTHY`, `DISASTER_RECOVERY_REPLICATION`, `DNS_RESOLUTION_ERROR`, `DOCKER_CONTAINER_CREATION_EXCEPTION`, `DOCKER_IMAGE_PULL_FAILURE`, `DOCKER_IMAGE_TOO_LARGE_FOR_INSTANCE_EXCEPTION`, `DOCKER_INVALID_OS_EXCEPTION`, `DRIVER_EVICTION`, `DRIVER_LAUNCH_TIMEOUT`, `DRIVER_NODE_UNREACHABLE`, `DRIVER_OUT_OF_DISK`, `DRIVER_OUT_OF_MEMORY`, `DRIVER_POD_CREATION_FAILURE`, `DRIVER_UNEXPECTED_FAILURE`, `DRIVER_UNHEALTHY`, `DRIVER_UNREACHABLE`, `DRIVER_UNRESPONSIVE`, `DYNAMIC_SPARK_CONF_SIZE_EXCEEDED`, `EOS_SPARK_IMAGE`, `EXECUTION_COMPONENT_UNHEALTHY`, `EXECUTOR_POD_UNSCHEDULED`, `GCP_API_RATE_QUOTA_EXCEEDED`, `GCP_DENIED_BY_ORG_POLICY`, `GCP_FORBIDDEN`, `GCP_IAM_TIMEOUT`, `GCP_INACCESSIBLE_KMS_KEY_FAILURE`, `GCP_INSUFFICIENT_CAPACITY`, `GCP_IP_SPACE_EXHAUSTED`, `GCP_KMS_KEY_PERMISSION_DENIED`, `GCP_NOT_FOUND`, `GCP_QUOTA_EXCEEDED`, `GCP_RESOURCE_QUOTA_EXCEEDED`, `GCP_SERVICE_ACCOUNT_ACCESS_DENIED`, `GCP_SERVICE_ACCOUNT_DELETED`, `GCP_SERVICE_ACCOUNT_NOT_FOUND`, `GCP_SUBNET_NOT_READY`, `GCP_TRUSTED_IMAGE_PROJECTS_VIOLATED`, `GKE_BASED_CLUSTER_TERMINATION`, `GLOBAL_INIT_SCRIPT_FAILURE`, `HIVE_METASTORE_PROVISIONING_FAILURE`, `IMAGE_PULL_PERMISSION_DENIED`, `INACTIVITY`, `INIT_CONTAINER_NOT_FINISHED`, `INIT_SCRIPT_FAILURE`, `INSTANCE_POOL_CLUSTER_FAILURE`, `INSTANCE_POOL_MAX_CAPACITY_REACHED`, `INSTANCE_POOL_NOT_FOUND`, `INSTANCE_UNREACHABLE`, `INSTANCE_UNREACHABLE_DUE_TO_MISCONFIG`, `INTERNAL_CAPACITY_FAILURE`, `INTERNAL_ERROR`, `INVALID_ARGUMENT`, `INVALID_AWS_PARAMETER`, `INVALID_INSTANCE_PLACEMENT_PROTOCOL`, `INVALID_SPARK_IMAGE`, `INVALID_WORKER_IMAGE_FAILURE`, `IN_PENALTY_BOX`, `IP_EXHAUSTION_FAILURE`, `JOB_FINISHED`, `K8S_AUTOSCALING_FAILURE`, `K8S_DBR_CLUSTER_LAUNCH_TIMEOUT`, `LAZY_ALLOCATION_TIMEOUT`, `MAINTENANCE_MODE`, `METASTORE_COMPONENT_UNHEALTHY`, `NEPHOS_RESOURCE_MANAGEMENT`, `NETVISOR_SETUP_TIMEOUT`, `NETWORK_CHECK_CONTROL_PLANE_FAILURE`, `NETWORK_CHECK_DNS_SERVER_FAILURE`, `NETWORK_CHECK_METADATA_ENDPOINT_FAILURE`, `NETWORK_CHECK_MULTIPLE_COMPONENTS_FAILURE`, `NETWORK_CHECK_NIC_FAILURE`, `NETWORK_CHECK_STORAGE_FAILURE`, `NETWORK_CONFIGURATION_FAILURE`, `NFS_MOUNT_FAILURE`, `NO_MATCHED_K8S`, `NO_MATCHED_K8S_TESTING_TAG`, `NPIP_TUNNEL_SETUP_FAILURE`, `NPIP_TUNNEL_TOKEN_FAILURE`, `POD_ASSIGNMENT_FAILURE`, `POD_SCHEDULING_FAILURE`, `REQUEST_REJECTED`, `REQUEST_THROTTLED`, `RESOURCE_USAGE_BLOCKED`, `SECRET_CREATION_FAILURE`, `SECRET_PERMISSION_DENIED`, `SECRET_RESOLUTION_ERROR`, `SECURITY_AGENTS_FAILED_INITIAL_VERIFICATION`, `SECURITY_DAEMON_REGISTRATION_EXCEPTION`, `SELF_BOOTSTRAP_FAILURE`, `SERVERLESS_LONG_RUNNING_TERMINATED`, `SKIPPED_SLOW_NODES`, `SLOW_IMAGE_DOWNLOAD`, `SPARK_ERROR`, `SPARK_IMAGE_DOWNLOAD_FAILURE`, `SPARK_IMAGE_DOWNLOAD_THROTTLED`, `SPARK_IMAGE_NOT_FOUND`, `SPARK_STARTUP_FAILURE`, `SPOT_INSTANCE_TERMINATION`, `SSH_BOOTSTRAP_FAILURE`, `STORAGE_DOWNLOAD_FAILURE`, `STORAGE_DOWNLOAD_FAILURE_DUE_TO_MISCONFIG`, `STORAGE_DOWNLOAD_FAILURE_SLOW`, `STORAGE_DOWNLOAD_FAILURE_THROTTLED`, `STS_CLIENT_SETUP_FAILURE`, `SUBNET_EXHAUSTED_FAILURE`, `TEMPORARILY_UNAVAILABLE`, `TRIAL_EXPIRED`, `UNEXPECTED_LAUNCH_FAILURE`, `UNEXPECTED_POD_RECREATION`, `UNKNOWN`, `UNSUPPORTED_INSTANCE_TYPE`, `UPDATE_INSTANCE_PROFILE_FAILURE`, `USER_INITIATED_VM_TERMINATION`, `USER_REQUEST`, `WORKER_SETUP_FAILURE`, `WORKSPACE_CANCELLED_ERROR`, `WORKSPACE_CONFIGURATION_ERROR`, `WORKSPACE_UPDATE`: *f = TerminationReasonCode(v) return nil default: - return fmt.Errorf(`value "%s" is not one of "ABUSE_DETECTED", "ACCESS_TOKEN_FAILURE", "ALLOCATION_TIMEOUT", "ALLOCATION_TIMEOUT_NODE_DAEMON_NOT_READY", "ALLOCATION_TIMEOUT_NO_HEALTHY_AND_WARMED_UP_CLUSTERS", "ALLOCATION_TIMEOUT_NO_HEALTHY_CLUSTERS", "ALLOCATION_TIMEOUT_NO_MATCHED_CLUSTERS", "ALLOCATION_TIMEOUT_NO_READY_CLUSTERS", "ALLOCATION_TIMEOUT_NO_UNALLOCATED_CLUSTERS", "ALLOCATION_TIMEOUT_NO_WARMED_UP_CLUSTERS", "ATTACH_PROJECT_FAILURE", "AWS_AUTHORIZATION_FAILURE", "AWS_INACCESSIBLE_KMS_KEY_FAILURE", "AWS_INSTANCE_PROFILE_UPDATE_FAILURE", "AWS_INSUFFICIENT_FREE_ADDRESSES_IN_SUBNET_FAILURE", "AWS_INSUFFICIENT_INSTANCE_CAPACITY_FAILURE", "AWS_INVALID_KEY_PAIR", "AWS_INVALID_KMS_KEY_STATE", "AWS_MAX_SPOT_INSTANCE_COUNT_EXCEEDED_FAILURE", "AWS_REQUEST_LIMIT_EXCEEDED", "AWS_RESOURCE_QUOTA_EXCEEDED", "AWS_UNSUPPORTED_FAILURE", "AZURE_BYOK_KEY_PERMISSION_FAILURE", "AZURE_EPHEMERAL_DISK_FAILURE", "AZURE_INVALID_DEPLOYMENT_TEMPLATE", "AZURE_OPERATION_NOT_ALLOWED_EXCEPTION", "AZURE_PACKED_DEPLOYMENT_PARTIAL_FAILURE", "AZURE_QUOTA_EXCEEDED_EXCEPTION", "AZURE_RESOURCE_MANAGER_THROTTLING", "AZURE_RESOURCE_PROVIDER_THROTTLING", "AZURE_UNEXPECTED_DEPLOYMENT_TEMPLATE_FAILURE", "AZURE_VM_EXTENSION_FAILURE", "AZURE_VNET_CONFIGURATION_FAILURE", "BOOTSTRAP_TIMEOUT", "BOOTSTRAP_TIMEOUT_CLOUD_PROVIDER_EXCEPTION", "BOOTSTRAP_TIMEOUT_DUE_TO_MISCONFIG", "BUDGET_POLICY_LIMIT_ENFORCEMENT_ACTIVATED", "BUDGET_POLICY_RESOLUTION_FAILURE", "CLOUD_ACCOUNT_SETUP_FAILURE", "CLOUD_OPERATION_CANCELLED", "CLOUD_PROVIDER_DISK_SETUP_FAILURE", "CLOUD_PROVIDER_INSTANCE_NOT_LAUNCHED", "CLOUD_PROVIDER_LAUNCH_FAILURE", "CLOUD_PROVIDER_LAUNCH_FAILURE_DUE_TO_MISCONFIG", "CLOUD_PROVIDER_RESOURCE_STOCKOUT", "CLOUD_PROVIDER_RESOURCE_STOCKOUT_DUE_TO_MISCONFIG", "CLOUD_PROVIDER_SHUTDOWN", "CLUSTER_OPERATION_THROTTLED", "CLUSTER_OPERATION_TIMEOUT", "COMMUNICATION_LOST", "CONTAINER_LAUNCH_FAILURE", "CONTROL_PLANE_REQUEST_FAILURE", "CONTROL_PLANE_REQUEST_FAILURE_DUE_TO_MISCONFIG", "DATABASE_CONNECTION_FAILURE", "DATA_ACCESS_CONFIG_CHANGED", "DBFS_COMPONENT_UNHEALTHY", "DISASTER_RECOVERY_REPLICATION", "DNS_RESOLUTION_ERROR", "DOCKER_CONTAINER_CREATION_EXCEPTION", "DOCKER_IMAGE_PULL_FAILURE", "DOCKER_IMAGE_TOO_LARGE_FOR_INSTANCE_EXCEPTION", "DOCKER_INVALID_OS_EXCEPTION", "DRIVER_EVICTION", "DRIVER_LAUNCH_TIMEOUT", "DRIVER_NODE_UNREACHABLE", "DRIVER_OUT_OF_DISK", "DRIVER_OUT_OF_MEMORY", "DRIVER_POD_CREATION_FAILURE", "DRIVER_UNEXPECTED_FAILURE", "DRIVER_UNHEALTHY", "DRIVER_UNREACHABLE", "DRIVER_UNRESPONSIVE", "DYNAMIC_SPARK_CONF_SIZE_EXCEEDED", "EOS_SPARK_IMAGE", "EXECUTION_COMPONENT_UNHEALTHY", "EXECUTOR_POD_UNSCHEDULED", "GCP_API_RATE_QUOTA_EXCEEDED", "GCP_DENIED_BY_ORG_POLICY", "GCP_FORBIDDEN", "GCP_IAM_TIMEOUT", "GCP_INACCESSIBLE_KMS_KEY_FAILURE", "GCP_INSUFFICIENT_CAPACITY", "GCP_IP_SPACE_EXHAUSTED", "GCP_KMS_KEY_PERMISSION_DENIED", "GCP_NOT_FOUND", "GCP_QUOTA_EXCEEDED", "GCP_RESOURCE_QUOTA_EXCEEDED", "GCP_SERVICE_ACCOUNT_ACCESS_DENIED", "GCP_SERVICE_ACCOUNT_DELETED", "GCP_SERVICE_ACCOUNT_NOT_FOUND", "GCP_SUBNET_NOT_READY", "GCP_TRUSTED_IMAGE_PROJECTS_VIOLATED", "GKE_BASED_CLUSTER_TERMINATION", "GLOBAL_INIT_SCRIPT_FAILURE", "HIVE_METASTORE_PROVISIONING_FAILURE", "IMAGE_PULL_PERMISSION_DENIED", "INACTIVITY", "INIT_CONTAINER_NOT_FINISHED", "INIT_SCRIPT_FAILURE", "INSTANCE_POOL_CLUSTER_FAILURE", "INSTANCE_POOL_MAX_CAPACITY_REACHED", "INSTANCE_POOL_NOT_FOUND", "INSTANCE_UNREACHABLE", "INSTANCE_UNREACHABLE_DUE_TO_MISCONFIG", "INTERNAL_CAPACITY_FAILURE", "INTERNAL_ERROR", "INVALID_ARGUMENT", "INVALID_AWS_PARAMETER", "INVALID_INSTANCE_PLACEMENT_PROTOCOL", "INVALID_SPARK_IMAGE", "INVALID_WORKER_IMAGE_FAILURE", "IN_PENALTY_BOX", "IP_EXHAUSTION_FAILURE", "JOB_FINISHED", "K8S_AUTOSCALING_FAILURE", "K8S_DBR_CLUSTER_LAUNCH_TIMEOUT", "LAZY_ALLOCATION_TIMEOUT", "MAINTENANCE_MODE", "METASTORE_COMPONENT_UNHEALTHY", "NEPHOS_RESOURCE_MANAGEMENT", "NETVISOR_SETUP_TIMEOUT", "NETWORK_CHECK_CONTROL_PLANE_FAILURE", "NETWORK_CHECK_DNS_SERVER_FAILURE", "NETWORK_CHECK_METADATA_ENDPOINT_FAILURE", "NETWORK_CHECK_MULTIPLE_COMPONENTS_FAILURE", "NETWORK_CHECK_NIC_FAILURE", "NETWORK_CHECK_STORAGE_FAILURE", "NETWORK_CONFIGURATION_FAILURE", "NFS_MOUNT_FAILURE", "NO_MATCHED_K8S", "NO_MATCHED_K8S_TESTING_TAG", "NPIP_TUNNEL_SETUP_FAILURE", "NPIP_TUNNEL_TOKEN_FAILURE", "POD_ASSIGNMENT_FAILURE", "POD_SCHEDULING_FAILURE", "REQUEST_REJECTED", "REQUEST_THROTTLED", "RESOURCE_USAGE_BLOCKED", "SECRET_CREATION_FAILURE", "SECRET_PERMISSION_DENIED", "SECRET_RESOLUTION_ERROR", "SECURITY_DAEMON_REGISTRATION_EXCEPTION", "SELF_BOOTSTRAP_FAILURE", "SERVERLESS_LONG_RUNNING_TERMINATED", "SKIPPED_SLOW_NODES", "SLOW_IMAGE_DOWNLOAD", "SPARK_ERROR", "SPARK_IMAGE_DOWNLOAD_FAILURE", "SPARK_IMAGE_DOWNLOAD_THROTTLED", "SPARK_IMAGE_NOT_FOUND", "SPARK_STARTUP_FAILURE", "SPOT_INSTANCE_TERMINATION", "SSH_BOOTSTRAP_FAILURE", "STORAGE_DOWNLOAD_FAILURE", "STORAGE_DOWNLOAD_FAILURE_DUE_TO_MISCONFIG", "STORAGE_DOWNLOAD_FAILURE_SLOW", "STORAGE_DOWNLOAD_FAILURE_THROTTLED", "STS_CLIENT_SETUP_FAILURE", "SUBNET_EXHAUSTED_FAILURE", "TEMPORARILY_UNAVAILABLE", "TRIAL_EXPIRED", "UNEXPECTED_LAUNCH_FAILURE", "UNEXPECTED_POD_RECREATION", "UNKNOWN", "UNSUPPORTED_INSTANCE_TYPE", "UPDATE_INSTANCE_PROFILE_FAILURE", "USER_INITIATED_VM_TERMINATION", "USER_REQUEST", "WORKER_SETUP_FAILURE", "WORKSPACE_CANCELLED_ERROR", "WORKSPACE_CONFIGURATION_ERROR", "WORKSPACE_UPDATE"`, v) + return fmt.Errorf(`value "%s" is not one of "ABUSE_DETECTED", "ACCESS_TOKEN_FAILURE", "ALLOCATION_TIMEOUT", "ALLOCATION_TIMEOUT_NODE_DAEMON_NOT_READY", "ALLOCATION_TIMEOUT_NO_HEALTHY_AND_WARMED_UP_CLUSTERS", "ALLOCATION_TIMEOUT_NO_HEALTHY_CLUSTERS", "ALLOCATION_TIMEOUT_NO_MATCHED_CLUSTERS", "ALLOCATION_TIMEOUT_NO_READY_CLUSTERS", "ALLOCATION_TIMEOUT_NO_UNALLOCATED_CLUSTERS", "ALLOCATION_TIMEOUT_NO_WARMED_UP_CLUSTERS", "ATTACH_PROJECT_FAILURE", "AWS_AUTHORIZATION_FAILURE", "AWS_INACCESSIBLE_KMS_KEY_FAILURE", "AWS_INSTANCE_PROFILE_UPDATE_FAILURE", "AWS_INSUFFICIENT_FREE_ADDRESSES_IN_SUBNET_FAILURE", "AWS_INSUFFICIENT_INSTANCE_CAPACITY_FAILURE", "AWS_INVALID_KEY_PAIR", "AWS_INVALID_KMS_KEY_STATE", "AWS_MAX_SPOT_INSTANCE_COUNT_EXCEEDED_FAILURE", "AWS_REQUEST_LIMIT_EXCEEDED", "AWS_RESOURCE_QUOTA_EXCEEDED", "AWS_UNSUPPORTED_FAILURE", "AZURE_BYOK_KEY_PERMISSION_FAILURE", "AZURE_EPHEMERAL_DISK_FAILURE", "AZURE_INVALID_DEPLOYMENT_TEMPLATE", "AZURE_OPERATION_NOT_ALLOWED_EXCEPTION", "AZURE_PACKED_DEPLOYMENT_PARTIAL_FAILURE", "AZURE_QUOTA_EXCEEDED_EXCEPTION", "AZURE_RESOURCE_MANAGER_THROTTLING", "AZURE_RESOURCE_PROVIDER_THROTTLING", "AZURE_UNEXPECTED_DEPLOYMENT_TEMPLATE_FAILURE", "AZURE_VM_EXTENSION_FAILURE", "AZURE_VNET_CONFIGURATION_FAILURE", "BOOTSTRAP_TIMEOUT", "BOOTSTRAP_TIMEOUT_CLOUD_PROVIDER_EXCEPTION", "BOOTSTRAP_TIMEOUT_DUE_TO_MISCONFIG", "BUDGET_POLICY_LIMIT_ENFORCEMENT_ACTIVATED", "BUDGET_POLICY_RESOLUTION_FAILURE", "CLOUD_ACCOUNT_SETUP_FAILURE", "CLOUD_OPERATION_CANCELLED", "CLOUD_PROVIDER_DISK_SETUP_FAILURE", "CLOUD_PROVIDER_INSTANCE_NOT_LAUNCHED", "CLOUD_PROVIDER_LAUNCH_FAILURE", "CLOUD_PROVIDER_LAUNCH_FAILURE_DUE_TO_MISCONFIG", "CLOUD_PROVIDER_RESOURCE_STOCKOUT", "CLOUD_PROVIDER_RESOURCE_STOCKOUT_DUE_TO_MISCONFIG", "CLOUD_PROVIDER_SHUTDOWN", "CLUSTER_OPERATION_THROTTLED", "CLUSTER_OPERATION_TIMEOUT", "COMMUNICATION_LOST", "CONTAINER_LAUNCH_FAILURE", "CONTROL_PLANE_REQUEST_FAILURE", "CONTROL_PLANE_REQUEST_FAILURE_DUE_TO_MISCONFIG", "DATABASE_CONNECTION_FAILURE", "DATA_ACCESS_CONFIG_CHANGED", "DBFS_COMPONENT_UNHEALTHY", "DISASTER_RECOVERY_REPLICATION", "DNS_RESOLUTION_ERROR", "DOCKER_CONTAINER_CREATION_EXCEPTION", "DOCKER_IMAGE_PULL_FAILURE", "DOCKER_IMAGE_TOO_LARGE_FOR_INSTANCE_EXCEPTION", "DOCKER_INVALID_OS_EXCEPTION", "DRIVER_EVICTION", "DRIVER_LAUNCH_TIMEOUT", "DRIVER_NODE_UNREACHABLE", "DRIVER_OUT_OF_DISK", "DRIVER_OUT_OF_MEMORY", "DRIVER_POD_CREATION_FAILURE", "DRIVER_UNEXPECTED_FAILURE", "DRIVER_UNHEALTHY", "DRIVER_UNREACHABLE", "DRIVER_UNRESPONSIVE", "DYNAMIC_SPARK_CONF_SIZE_EXCEEDED", "EOS_SPARK_IMAGE", "EXECUTION_COMPONENT_UNHEALTHY", "EXECUTOR_POD_UNSCHEDULED", "GCP_API_RATE_QUOTA_EXCEEDED", "GCP_DENIED_BY_ORG_POLICY", "GCP_FORBIDDEN", "GCP_IAM_TIMEOUT", "GCP_INACCESSIBLE_KMS_KEY_FAILURE", "GCP_INSUFFICIENT_CAPACITY", "GCP_IP_SPACE_EXHAUSTED", "GCP_KMS_KEY_PERMISSION_DENIED", "GCP_NOT_FOUND", "GCP_QUOTA_EXCEEDED", "GCP_RESOURCE_QUOTA_EXCEEDED", "GCP_SERVICE_ACCOUNT_ACCESS_DENIED", "GCP_SERVICE_ACCOUNT_DELETED", "GCP_SERVICE_ACCOUNT_NOT_FOUND", "GCP_SUBNET_NOT_READY", "GCP_TRUSTED_IMAGE_PROJECTS_VIOLATED", "GKE_BASED_CLUSTER_TERMINATION", "GLOBAL_INIT_SCRIPT_FAILURE", "HIVE_METASTORE_PROVISIONING_FAILURE", "IMAGE_PULL_PERMISSION_DENIED", "INACTIVITY", "INIT_CONTAINER_NOT_FINISHED", "INIT_SCRIPT_FAILURE", "INSTANCE_POOL_CLUSTER_FAILURE", "INSTANCE_POOL_MAX_CAPACITY_REACHED", "INSTANCE_POOL_NOT_FOUND", "INSTANCE_UNREACHABLE", "INSTANCE_UNREACHABLE_DUE_TO_MISCONFIG", "INTERNAL_CAPACITY_FAILURE", "INTERNAL_ERROR", "INVALID_ARGUMENT", "INVALID_AWS_PARAMETER", "INVALID_INSTANCE_PLACEMENT_PROTOCOL", "INVALID_SPARK_IMAGE", "INVALID_WORKER_IMAGE_FAILURE", "IN_PENALTY_BOX", "IP_EXHAUSTION_FAILURE", "JOB_FINISHED", "K8S_AUTOSCALING_FAILURE", "K8S_DBR_CLUSTER_LAUNCH_TIMEOUT", "LAZY_ALLOCATION_TIMEOUT", "MAINTENANCE_MODE", "METASTORE_COMPONENT_UNHEALTHY", "NEPHOS_RESOURCE_MANAGEMENT", "NETVISOR_SETUP_TIMEOUT", "NETWORK_CHECK_CONTROL_PLANE_FAILURE", "NETWORK_CHECK_DNS_SERVER_FAILURE", "NETWORK_CHECK_METADATA_ENDPOINT_FAILURE", "NETWORK_CHECK_MULTIPLE_COMPONENTS_FAILURE", "NETWORK_CHECK_NIC_FAILURE", "NETWORK_CHECK_STORAGE_FAILURE", "NETWORK_CONFIGURATION_FAILURE", "NFS_MOUNT_FAILURE", "NO_MATCHED_K8S", "NO_MATCHED_K8S_TESTING_TAG", "NPIP_TUNNEL_SETUP_FAILURE", "NPIP_TUNNEL_TOKEN_FAILURE", "POD_ASSIGNMENT_FAILURE", "POD_SCHEDULING_FAILURE", "REQUEST_REJECTED", "REQUEST_THROTTLED", "RESOURCE_USAGE_BLOCKED", "SECRET_CREATION_FAILURE", "SECRET_PERMISSION_DENIED", "SECRET_RESOLUTION_ERROR", "SECURITY_AGENTS_FAILED_INITIAL_VERIFICATION", "SECURITY_DAEMON_REGISTRATION_EXCEPTION", "SELF_BOOTSTRAP_FAILURE", "SERVERLESS_LONG_RUNNING_TERMINATED", "SKIPPED_SLOW_NODES", "SLOW_IMAGE_DOWNLOAD", "SPARK_ERROR", "SPARK_IMAGE_DOWNLOAD_FAILURE", "SPARK_IMAGE_DOWNLOAD_THROTTLED", "SPARK_IMAGE_NOT_FOUND", "SPARK_STARTUP_FAILURE", "SPOT_INSTANCE_TERMINATION", "SSH_BOOTSTRAP_FAILURE", "STORAGE_DOWNLOAD_FAILURE", "STORAGE_DOWNLOAD_FAILURE_DUE_TO_MISCONFIG", "STORAGE_DOWNLOAD_FAILURE_SLOW", "STORAGE_DOWNLOAD_FAILURE_THROTTLED", "STS_CLIENT_SETUP_FAILURE", "SUBNET_EXHAUSTED_FAILURE", "TEMPORARILY_UNAVAILABLE", "TRIAL_EXPIRED", "UNEXPECTED_LAUNCH_FAILURE", "UNEXPECTED_POD_RECREATION", "UNKNOWN", "UNSUPPORTED_INSTANCE_TYPE", "UPDATE_INSTANCE_PROFILE_FAILURE", "USER_INITIATED_VM_TERMINATION", "USER_REQUEST", "WORKER_SETUP_FAILURE", "WORKSPACE_CANCELLED_ERROR", "WORKSPACE_CONFIGURATION_ERROR", "WORKSPACE_UPDATE"`, v) } } @@ -6210,6 +6446,7 @@ func (f *TerminationReasonCode) Values() []TerminationReasonCode { TerminationReasonCodeSecretCreationFailure, TerminationReasonCodeSecretPermissionDenied, TerminationReasonCodeSecretResolutionError, + TerminationReasonCodeSecurityAgentsFailedInitialVerification, TerminationReasonCodeSecurityDaemonRegistrationException, TerminationReasonCodeSelfBootstrapFailure, TerminationReasonCodeServerlessLongRunningTerminated, @@ -6543,6 +6780,12 @@ func (s UpdateClusterResource) MarshalJSON() ([]byte, error) { type UpdateClusterResponse struct { } +type UpdateDefaultBaseEnvironmentRequest struct { + DefaultBaseEnvironment *DefaultBaseEnvironment `json:"default_base_environment,omitempty"` + + Id string `json:"-" url:"-"` +} + type UpdateResponse struct { } diff --git a/service/dashboards/api.go b/service/dashboards/api.go index 451a8720d..aad806cc6 100755 --- a/service/dashboards/api.go +++ b/service/dashboards/api.go @@ -1,6 +1,6 @@ // Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. -// These APIs allow you to manage Genie, Lakeview, Lakeview Embedded, etc. +// These APIs allow you to manage Genie, Lakeview, Lakeview Embedded, Query Execution, etc. package dashboards import ( @@ -33,6 +33,12 @@ type GenieInterface interface { // Deprecated: use [GenieAPIInterface.CreateMessage].Get() or [GenieAPIInterface.WaitGetMessageGenieCompleted] CreateMessageAndWait(ctx context.Context, genieCreateConversationMessageRequest GenieCreateConversationMessageRequest, options ...retries.Option[GenieMessage]) (*GenieMessage, error) + // Delete a conversation. + DeleteConversation(ctx context.Context, request GenieDeleteConversationRequest) error + + // Delete a conversation. + DeleteConversationBySpaceIdAndConversationId(ctx context.Context, spaceId string, conversationId string) error + // Execute the SQL for a message query attachment. Use this API when the query // attachment has expired and needs to be re-executed. ExecuteMessageAttachmentQuery(ctx context.Context, request GenieExecuteMessageAttachmentQueryRequest) (*GenieGetMessageQueryResultResponse, error) @@ -115,6 +121,12 @@ type GenieInterface interface { // Get details of a Genie Space. GetSpaceBySpaceId(ctx context.Context, spaceId string) (*GenieSpace, error) + // Get a list of conversations in a Genie Space. + ListConversations(ctx context.Context, request GenieListConversationsRequest) (*GenieListConversationsResponse, error) + + // Get a list of conversations in a Genie Space. + ListConversationsBySpaceId(ctx context.Context, spaceId string) (*GenieListConversationsResponse, error) + // Get list of Genie Spaces. ListSpaces(ctx context.Context, request GenieListSpacesRequest) (*GenieListSpacesResponse, error) @@ -128,6 +140,12 @@ type GenieInterface interface { // // Deprecated: use [GenieAPIInterface.StartConversation].Get() or [GenieAPIInterface.WaitGetMessageGenieCompleted] StartConversationAndWait(ctx context.Context, genieStartConversationMessageRequest GenieStartConversationMessageRequest, options ...retries.Option[GenieMessage]) (*GenieMessage, error) + + // Trash a Genie Space. + TrashSpace(ctx context.Context, request GenieTrashSpaceRequest) error + + // Trash a Genie Space. + TrashSpaceBySpaceId(ctx context.Context, spaceId string) error } func NewGenie(client *client.DatabricksClient) *GenieAPI { @@ -253,6 +271,14 @@ func (a *GenieAPI) CreateMessageAndWait(ctx context.Context, genieCreateConversa return wait.Get() } +// Delete a conversation. +func (a *GenieAPI) DeleteConversationBySpaceIdAndConversationId(ctx context.Context, spaceId string, conversationId string) error { + return a.genieImpl.DeleteConversation(ctx, GenieDeleteConversationRequest{ + SpaceId: spaceId, + ConversationId: conversationId, + }) +} + // After [Generating a Full Query Result // Download](:method:genie/getdownloadfullqueryresult) and successfully // receiving a `download_id`, use this API to poll the download progress. When @@ -324,6 +350,13 @@ func (a *GenieAPI) GetSpaceBySpaceId(ctx context.Context, spaceId string) (*Geni }) } +// Get a list of conversations in a Genie Space. +func (a *GenieAPI) ListConversationsBySpaceId(ctx context.Context, spaceId string) (*GenieListConversationsResponse, error) { + return a.genieImpl.ListConversations(ctx, GenieListConversationsRequest{ + SpaceId: spaceId, + }) +} + // Start a new conversation. func (a *GenieAPI) StartConversation(ctx context.Context, genieStartConversationMessageRequest GenieStartConversationMessageRequest) (*WaitGetMessageGenieCompleted[GenieStartConversationResponse], error) { genieStartConversationResponse, err := a.genieImpl.StartConversation(ctx, genieStartConversationMessageRequest) @@ -370,6 +403,13 @@ func (a *GenieAPI) StartConversationAndWait(ctx context.Context, genieStartConve return wait.Get() } +// Trash a Genie Space. +func (a *GenieAPI) TrashSpaceBySpaceId(ctx context.Context, spaceId string) error { + return a.genieImpl.TrashSpace(ctx, GenieTrashSpaceRequest{ + SpaceId: spaceId, + }) +} + type LakeviewInterface interface { // Create a draft dashboard. @@ -572,6 +612,12 @@ func (a *LakeviewAPI) UnpublishByDashboardId(ctx context.Context, dashboardId st type LakeviewEmbeddedInterface interface { + // Get the current published dashboard within an embedded context. + GetPublishedDashboardEmbedded(ctx context.Context, request GetPublishedDashboardEmbeddedRequest) error + + // Get the current published dashboard within an embedded context. + GetPublishedDashboardEmbeddedByDashboardId(ctx context.Context, dashboardId string) error + // Get a required authorization details and scopes of a published dashboard to // mint an OAuth token. The `authorization_details` can be enriched to apply // additional restriction. @@ -606,6 +652,13 @@ type LakeviewEmbeddedAPI struct { lakeviewEmbeddedImpl } +// Get the current published dashboard within an embedded context. +func (a *LakeviewEmbeddedAPI) GetPublishedDashboardEmbeddedByDashboardId(ctx context.Context, dashboardId string) error { + return a.lakeviewEmbeddedImpl.GetPublishedDashboardEmbedded(ctx, GetPublishedDashboardEmbeddedRequest{ + DashboardId: dashboardId, + }) +} + // Get a required authorization details and scopes of a published dashboard to // mint an OAuth token. The `authorization_details` can be enriched to apply // additional restriction. @@ -619,3 +672,28 @@ func (a *LakeviewEmbeddedAPI) GetPublishedDashboardTokenInfoByDashboardId(ctx co DashboardId: dashboardId, }) } + +type QueryExecutionInterface interface { + + // Cancel the results for the a query for a published, embedded dashboard. + CancelPublishedQueryExecution(ctx context.Context, request CancelPublishedQueryExecutionRequest) (*CancelQueryExecutionResponse, error) + + // Execute a query for a published dashboard. + ExecutePublishedDashboardQuery(ctx context.Context, request ExecutePublishedDashboardQueryRequest) error + + // Poll the results for the a query for a published, embedded dashboard. + PollPublishedQueryStatus(ctx context.Context, request PollPublishedQueryStatusRequest) (*PollQueryStatusResponse, error) +} + +func NewQueryExecution(client *client.DatabricksClient) *QueryExecutionAPI { + return &QueryExecutionAPI{ + queryExecutionImpl: queryExecutionImpl{ + client: client, + }, + } +} + +// Query execution APIs for AI / BI Dashboards +type QueryExecutionAPI struct { + queryExecutionImpl +} diff --git a/service/dashboards/impl.go b/service/dashboards/impl.go index 27dfa1d97..8e3ed64d3 100755 --- a/service/dashboards/impl.go +++ b/service/dashboards/impl.go @@ -28,6 +28,15 @@ func (a *genieImpl) CreateMessage(ctx context.Context, request GenieCreateConver return &genieMessage, err } +func (a *genieImpl) DeleteConversation(ctx context.Context, request GenieDeleteConversationRequest) error { + path := fmt.Sprintf("/api/2.0/genie/spaces/%v/conversations/%v", request.SpaceId, request.ConversationId) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) + return err +} + func (a *genieImpl) ExecuteMessageAttachmentQuery(ctx context.Context, request GenieExecuteMessageAttachmentQueryRequest) (*GenieGetMessageQueryResultResponse, error) { var genieGetMessageQueryResultResponse GenieGetMessageQueryResultResponse path := fmt.Sprintf("/api/2.0/genie/spaces/%v/conversations/%v/messages/%v/attachments/%v/execute-query", request.SpaceId, request.ConversationId, request.MessageId, request.AttachmentId) @@ -118,6 +127,16 @@ func (a *genieImpl) GetSpace(ctx context.Context, request GenieGetSpaceRequest) return &genieSpace, err } +func (a *genieImpl) ListConversations(ctx context.Context, request GenieListConversationsRequest) (*GenieListConversationsResponse, error) { + var genieListConversationsResponse GenieListConversationsResponse + path := fmt.Sprintf("/api/2.0/genie/spaces/%v/conversations", request.SpaceId) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &genieListConversationsResponse) + return &genieListConversationsResponse, err +} + func (a *genieImpl) ListSpaces(ctx context.Context, request GenieListSpacesRequest) (*GenieListSpacesResponse, error) { var genieListSpacesResponse GenieListSpacesResponse path := "/api/2.0/genie/spaces" @@ -139,6 +158,15 @@ func (a *genieImpl) StartConversation(ctx context.Context, request GenieStartCon return &genieStartConversationResponse, err } +func (a *genieImpl) TrashSpace(ctx context.Context, request GenieTrashSpaceRequest) error { + path := fmt.Sprintf("/api/2.0/genie/spaces/%v", request.SpaceId) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) + return err +} + // unexported type that holds implementations of just Lakeview API methods type lakeviewImpl struct { client *client.DatabricksClient @@ -178,22 +206,20 @@ func (a *lakeviewImpl) CreateSubscription(ctx context.Context, request CreateSub } func (a *lakeviewImpl) DeleteSchedule(ctx context.Context, request DeleteScheduleRequest) error { - var deleteScheduleResponse DeleteScheduleResponse path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/schedules/%v", request.DashboardId, request.ScheduleId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteScheduleResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } func (a *lakeviewImpl) DeleteSubscription(ctx context.Context, request DeleteSubscriptionRequest) error { - var deleteSubscriptionResponse DeleteSubscriptionResponse path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/schedules/%v/subscriptions/%v", request.DashboardId, request.ScheduleId, request.SubscriptionId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteSubscriptionResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -383,22 +409,20 @@ func (a *lakeviewImpl) Publish(ctx context.Context, request PublishRequest) (*Pu } func (a *lakeviewImpl) Trash(ctx context.Context, request TrashDashboardRequest) error { - var trashDashboardResponse TrashDashboardResponse path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v", request.DashboardId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &trashDashboardResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } func (a *lakeviewImpl) Unpublish(ctx context.Context, request UnpublishDashboardRequest) error { - var unpublishDashboardResponse UnpublishDashboardResponse path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/published", request.DashboardId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &unpublishDashboardResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -429,6 +453,15 @@ type lakeviewEmbeddedImpl struct { client *client.DatabricksClient } +func (a *lakeviewEmbeddedImpl) GetPublishedDashboardEmbedded(ctx context.Context, request GetPublishedDashboardEmbeddedRequest) error { + path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/published/embedded", request.DashboardId) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, nil) + return err +} + func (a *lakeviewEmbeddedImpl) GetPublishedDashboardTokenInfo(ctx context.Context, request GetPublishedDashboardTokenInfoRequest) (*GetPublishedDashboardTokenInfoResponse, error) { var getPublishedDashboardTokenInfoResponse GetPublishedDashboardTokenInfoResponse path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/published/tokeninfo", request.DashboardId) @@ -438,3 +471,38 @@ func (a *lakeviewEmbeddedImpl) GetPublishedDashboardTokenInfo(ctx context.Contex err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getPublishedDashboardTokenInfoResponse) return &getPublishedDashboardTokenInfoResponse, err } + +// unexported type that holds implementations of just QueryExecution API methods +type queryExecutionImpl struct { + client *client.DatabricksClient +} + +func (a *queryExecutionImpl) CancelPublishedQueryExecution(ctx context.Context, request CancelPublishedQueryExecutionRequest) (*CancelQueryExecutionResponse, error) { + var cancelQueryExecutionResponse CancelQueryExecutionResponse + path := "/api/2.0/lakeview-query/query/published" + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &cancelQueryExecutionResponse) + return &cancelQueryExecutionResponse, err +} + +func (a *queryExecutionImpl) ExecutePublishedDashboardQuery(ctx context.Context, request ExecutePublishedDashboardQueryRequest) error { + path := "/api/2.0/lakeview-query/query/published" + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) + return err +} + +func (a *queryExecutionImpl) PollPublishedQueryStatus(ctx context.Context, request PollPublishedQueryStatusRequest) (*PollQueryStatusResponse, error) { + var pollQueryStatusResponse PollQueryStatusResponse + path := "/api/2.0/lakeview-query/query/published" + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &pollQueryStatusResponse) + return &pollQueryStatusResponse, err +} diff --git a/service/dashboards/interface.go b/service/dashboards/interface.go index a1153efb1..67ea3237b 100755 --- a/service/dashboards/interface.go +++ b/service/dashboards/interface.go @@ -20,6 +20,9 @@ type GenieService interface { // to respond. CreateMessage(ctx context.Context, request GenieCreateConversationMessageRequest) (*GenieMessage, error) + // Delete a conversation. + DeleteConversation(ctx context.Context, request GenieDeleteConversationRequest) error + // Execute the SQL for a message query attachment. Use this API when the // query attachment has expired and needs to be re-executed. ExecuteMessageAttachmentQuery(ctx context.Context, request GenieExecuteMessageAttachmentQueryRequest) (*GenieGetMessageQueryResultResponse, error) @@ -69,11 +72,17 @@ type GenieService interface { // Get details of a Genie Space. GetSpace(ctx context.Context, request GenieGetSpaceRequest) (*GenieSpace, error) + // Get a list of conversations in a Genie Space. + ListConversations(ctx context.Context, request GenieListConversationsRequest) (*GenieListConversationsResponse, error) + // Get list of Genie Spaces. ListSpaces(ctx context.Context, request GenieListSpacesRequest) (*GenieListSpacesResponse, error) // Start a new conversation. StartConversation(ctx context.Context, request GenieStartConversationMessageRequest) (*GenieStartConversationResponse, error) + + // Trash a Genie Space. + TrashSpace(ctx context.Context, request GenieTrashSpaceRequest) error } // These APIs provide specific management operations for Lakeview dashboards. @@ -143,6 +152,9 @@ type LakeviewService interface { // Deprecated: Do not use this interface, it will be removed in a future version of the SDK. type LakeviewEmbeddedService interface { + // Get the current published dashboard within an embedded context. + GetPublishedDashboardEmbedded(ctx context.Context, request GetPublishedDashboardEmbeddedRequest) error + // Get a required authorization details and scopes of a published dashboard // to mint an OAuth token. The `authorization_details` can be enriched to // apply additional restriction. @@ -153,3 +165,18 @@ type LakeviewEmbeddedService interface { // object_full_path: "main.default.testdata" } ``` GetPublishedDashboardTokenInfo(ctx context.Context, request GetPublishedDashboardTokenInfoRequest) (*GetPublishedDashboardTokenInfoResponse, error) } + +// Query execution APIs for AI / BI Dashboards +// +// Deprecated: Do not use this interface, it will be removed in a future version of the SDK. +type QueryExecutionService interface { + + // Cancel the results for the a query for a published, embedded dashboard. + CancelPublishedQueryExecution(ctx context.Context, request CancelPublishedQueryExecutionRequest) (*CancelQueryExecutionResponse, error) + + // Execute a query for a published dashboard. + ExecutePublishedDashboardQuery(ctx context.Context, request ExecutePublishedDashboardQueryRequest) error + + // Poll the results for the a query for a published, embedded dashboard. + PollPublishedQueryStatus(ctx context.Context, request PollPublishedQueryStatusRequest) (*PollQueryStatusResponse, error) +} diff --git a/service/dashboards/model.go b/service/dashboards/model.go index fd6d8671a..16f0295b7 100755 --- a/service/dashboards/model.go +++ b/service/dashboards/model.go @@ -51,12 +51,35 @@ func (s AuthorizationDetailsGrantRule) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Create dashboard +type CancelPublishedQueryExecutionRequest struct { + DashboardName string `json:"-" url:"dashboard_name"` + + DashboardRevisionId string `json:"-" url:"dashboard_revision_id"` + // Example: + // EC0A..ChAB7WCEn_4Qo4vkLqEbXsxxEgh3Y2pbWw45WhoQXgZSQo9aS5q2ZvFcbvbx9CgA-PAEAQ + Tokens []string `json:"-" url:"tokens,omitempty"` +} + +type CancelQueryExecutionResponse struct { + Status []CancelQueryExecutionResponseStatus `json:"status,omitempty"` +} + +type CancelQueryExecutionResponseStatus struct { + // The token to poll for result asynchronously Example: + // EC0A..ChAB7WCEn_4Qo4vkLqEbXsxxEgh3Y2pbWw45WhoQXgZSQo9aS5q2ZvFcbvbx9CgA-PAEAQ + DataToken string `json:"data_token"` + // Represents an empty message, similar to google.protobuf.Empty, which is + // not available in the firm right now. + Pending *Empty `json:"pending,omitempty"` + // Represents an empty message, similar to google.protobuf.Empty, which is + // not available in the firm right now. + Success *Empty `json:"success,omitempty"` +} + type CreateDashboardRequest struct { Dashboard Dashboard `json:"dashboard"` } -// Create dashboard schedule type CreateScheduleRequest struct { // UUID identifying the dashboard to which the schedule belongs. DashboardId string `json:"-" url:"-"` @@ -64,7 +87,6 @@ type CreateScheduleRequest struct { Schedule Schedule `json:"schedule"` } -// Create schedule subscription type CreateSubscriptionRequest struct { // UUID identifying the dashboard to which the subscription belongs. DashboardId string `json:"-" url:"-"` @@ -167,7 +189,9 @@ func (f *DashboardView) Type() string { return "DashboardView" } -// Delete dashboard schedule +type DeleteConversationResponse struct { +} + type DeleteScheduleRequest struct { // UUID identifying the dashboard to which the schedule belongs. DashboardId string `json:"-" url:"-"` @@ -191,7 +215,6 @@ func (s DeleteScheduleRequest) MarshalJSON() ([]byte, error) { type DeleteScheduleResponse struct { } -// Delete schedule subscription type DeleteSubscriptionRequest struct { // UUID identifying the dashboard which the subscription belongs. DashboardId string `json:"-" url:"-"` @@ -217,6 +240,40 @@ func (s DeleteSubscriptionRequest) MarshalJSON() ([]byte, error) { type DeleteSubscriptionResponse struct { } +// Represents an empty message, similar to google.protobuf.Empty, which is not +// available in the firm right now. +type Empty struct { +} + +// Execute query request for published Dashboards. Since published dashboards +// have the option of running as the publisher, the datasets, warehouse_id are +// excluded from the request and instead read from the source (lakeview-config) +// via the additional parameters (dashboardName and dashboardRevisionId) +type ExecutePublishedDashboardQueryRequest struct { + // Dashboard name and revision_id is required to retrieve + // PublishedDatasetDataModel which contains the list of datasets, + // warehouse_id, and embedded_credentials + DashboardName string `json:"dashboard_name"` + + DashboardRevisionId string `json:"dashboard_revision_id"` + // A dashboard schedule can override the warehouse used as compute for + // processing the published dashboard queries + OverrideWarehouseId string `json:"override_warehouse_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ExecutePublishedDashboardQueryRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ExecutePublishedDashboardQueryRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ExecuteQueryResponse struct { +} + // Genie AI Response type GenieAttachment struct { // Attachment ID @@ -264,6 +321,14 @@ func (s GenieConversation) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type GenieConversationSummary struct { + ConversationId string `json:"conversation_id"` + + CreatedTimestamp int64 `json:"created_timestamp"` + + Title string `json:"title"` +} + type GenieCreateConversationMessageRequest struct { // User message content. Content string `json:"content"` @@ -273,7 +338,13 @@ type GenieCreateConversationMessageRequest struct { SpaceId string `json:"-" url:"-"` } -// Execute message attachment SQL query +type GenieDeleteConversationRequest struct { + // The ID of the conversation to delete. + ConversationId string `json:"-" url:"-"` + // The ID associated with the Genie space where the conversation is located. + SpaceId string `json:"-" url:"-"` +} + type GenieExecuteMessageAttachmentQueryRequest struct { // Attachment ID AttachmentId string `json:"-" url:"-"` @@ -285,7 +356,6 @@ type GenieExecuteMessageAttachmentQueryRequest struct { SpaceId string `json:"-" url:"-"` } -// [Deprecated] Execute SQL query in a conversation message type GenieExecuteMessageQueryRequest struct { // Conversation ID ConversationId string `json:"-" url:"-"` @@ -295,7 +365,6 @@ type GenieExecuteMessageQueryRequest struct { SpaceId string `json:"-" url:"-"` } -// Generate full query result download type GenieGenerateDownloadFullQueryResultRequest struct { // Attachment ID AttachmentId string `json:"-" url:"-"` @@ -323,7 +392,6 @@ func (s GenieGenerateDownloadFullQueryResultResponse) MarshalJSON() ([]byte, err return marshal.Marshal(s) } -// Get conversation message type GenieGetConversationMessageRequest struct { // The ID associated with the target conversation. ConversationId string `json:"-" url:"-"` @@ -335,7 +403,6 @@ type GenieGetConversationMessageRequest struct { SpaceId string `json:"-" url:"-"` } -// Get download full query result type GenieGetDownloadFullQueryResultRequest struct { // Attachment ID AttachmentId string `json:"-" url:"-"` @@ -356,7 +423,6 @@ type GenieGetDownloadFullQueryResultResponse struct { StatementResponse *sql.StatementResponse `json:"statement_response,omitempty"` } -// Get message attachment SQL query result type GenieGetMessageAttachmentQueryResultRequest struct { // Attachment ID AttachmentId string `json:"-" url:"-"` @@ -368,7 +434,6 @@ type GenieGetMessageAttachmentQueryResultRequest struct { SpaceId string `json:"-" url:"-"` } -// [Deprecated] Get conversation message SQL query result type GenieGetMessageQueryResultRequest struct { // Conversation ID ConversationId string `json:"-" url:"-"` @@ -384,7 +449,6 @@ type GenieGetMessageQueryResultResponse struct { StatementResponse *sql.StatementResponse `json:"statement_response,omitempty"` } -// [Deprecated] Get conversation message SQL query result type GenieGetQueryResultByAttachmentRequest struct { // Attachment ID AttachmentId string `json:"-" url:"-"` @@ -396,13 +460,47 @@ type GenieGetQueryResultByAttachmentRequest struct { SpaceId string `json:"-" url:"-"` } -// Get Genie Space type GenieGetSpaceRequest struct { // The ID associated with the Genie space SpaceId string `json:"-" url:"-"` } -// List Genie spaces +type GenieListConversationsRequest struct { + // Maximum number of conversations to return per page + PageSize int `json:"-" url:"page_size,omitempty"` + // Token to get the next page of results + PageToken string `json:"-" url:"page_token,omitempty"` + // The ID associated with the Genie space to list conversations from. + SpaceId string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *GenieListConversationsRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s GenieListConversationsRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type GenieListConversationsResponse struct { + // List of conversations in the Genie space + Conversations []GenieConversationSummary `json:"conversations,omitempty"` + // Token to get the next page of results + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *GenieListConversationsResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s GenieListConversationsResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type GenieListSpacesRequest struct { // Maximum number of spaces to return per page PageSize int `json:"-" url:"page_size,omitempty"` @@ -575,19 +673,29 @@ type GenieStartConversationResponse struct { MessageId string `json:"message_id"` } -// Get dashboard +type GenieTrashSpaceRequest struct { + // The ID associated with the Genie space to be trashed. + SpaceId string `json:"-" url:"-"` +} + type GetDashboardRequest struct { // UUID identifying the dashboard. DashboardId string `json:"-" url:"-"` } -// Get published dashboard +type GetPublishedDashboardEmbeddedRequest struct { + // UUID identifying the published dashboard. + DashboardId string `json:"-" url:"-"` +} + +type GetPublishedDashboardEmbeddedResponse struct { +} + type GetPublishedDashboardRequest struct { // UUID identifying the published dashboard. DashboardId string `json:"-" url:"-"` } -// Read an information of a published dashboard to mint an OAuth token. type GetPublishedDashboardTokenInfoRequest struct { // UUID identifying the published dashboard. DashboardId string `json:"-" url:"-"` @@ -630,7 +738,6 @@ func (s GetPublishedDashboardTokenInfoResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get dashboard schedule type GetScheduleRequest struct { // UUID identifying the dashboard to which the schedule belongs. DashboardId string `json:"-" url:"-"` @@ -638,7 +745,6 @@ type GetScheduleRequest struct { ScheduleId string `json:"-" url:"-"` } -// Get schedule subscription type GetSubscriptionRequest struct { // UUID identifying the dashboard which the subscription belongs. DashboardId string `json:"-" url:"-"` @@ -685,7 +791,6 @@ func (f *LifecycleState) Type() string { return "LifecycleState" } -// List dashboards type ListDashboardsRequest struct { // The number of dashboards to return per page. PageSize int `json:"-" url:"page_size,omitempty"` @@ -726,7 +831,6 @@ func (s ListDashboardsResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List dashboard schedules type ListSchedulesRequest struct { // UUID identifying the dashboard to which the schedules belongs. DashboardId string `json:"-" url:"-"` @@ -766,7 +870,6 @@ func (s ListSchedulesResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List schedule subscriptions type ListSubscriptionsRequest struct { // UUID identifying the dashboard which the subscriptions belongs. DashboardId string `json:"-" url:"-"` @@ -1133,6 +1236,29 @@ func (s MigrateDashboardRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type PendingStatus struct { + // The token to poll for result asynchronously Example: + // EC0A..ChAB7WCEn_4Qo4vkLqEbXsxxEgh3Y2pbWw45WhoQXgZSQo9aS5q2ZvFcbvbx9CgA-PAEAQ + DataToken string `json:"data_token"` +} + +type PollPublishedQueryStatusRequest struct { + DashboardName string `json:"-" url:"dashboard_name"` + + DashboardRevisionId string `json:"-" url:"dashboard_revision_id"` + // Example: + // EC0A..ChAB7WCEn_4Qo4vkLqEbXsxxEgh3Y2pbWw45WhoQXgZSQo9aS5q2ZvFcbvbx9CgA-PAEAQ + Tokens []string `json:"-" url:"tokens,omitempty"` +} + +type PollQueryStatusResponse struct { + Data []PollQueryStatusResponseData `json:"data,omitempty"` +} + +type PollQueryStatusResponseData struct { + Status QueryResponseStatus `json:"status"` +} + type PublishRequest struct { // UUID identifying the dashboard to be published. DashboardId string `json:"-" url:"-"` @@ -1176,6 +1302,34 @@ func (s PublishedDashboard) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type QueryResponseStatus struct { + // Represents an empty message, similar to google.protobuf.Empty, which is + // not available in the firm right now. + Canceled *Empty `json:"canceled,omitempty"` + // Represents an empty message, similar to google.protobuf.Empty, which is + // not available in the firm right now. + Closed *Empty `json:"closed,omitempty"` + + Pending *PendingStatus `json:"pending,omitempty"` + // The statement id in format(01eef5da-c56e-1f36-bafa-21906587d6ba) The + // statement_id should be identical to data_token in SuccessStatus and + // PendingStatus. This field is created for audit logging purpose to record + // the statement_id of all QueryResponseStatus. + StatementId string `json:"statement_id,omitempty"` + + Success *SuccessStatus `json:"success,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *QueryResponseStatus) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s QueryResponseStatus) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type Result struct { // If result is truncated IsTruncated bool `json:"is_truncated,omitempty"` @@ -1321,6 +1475,24 @@ type SubscriptionSubscriberUser struct { UserId int64 `json:"user_id"` } +type SuccessStatus struct { + // The token to poll for result asynchronously Example: + // EC0A..ChAB7WCEn_4Qo4vkLqEbXsxxEgh3Y2pbWw45WhoQXgZSQo9aS5q2ZvFcbvbx9CgA-PAEAQ + DataToken string `json:"data_token"` + // Whether the query result is truncated (either by byte limit or row limit) + Truncated bool `json:"truncated,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *SuccessStatus) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s SuccessStatus) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type TextAttachment struct { // AI generated message Content string `json:"content,omitempty"` @@ -1338,7 +1510,6 @@ func (s TextAttachment) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Trash dashboard type TrashDashboardRequest struct { // UUID identifying the dashboard. DashboardId string `json:"-" url:"-"` @@ -1347,7 +1518,9 @@ type TrashDashboardRequest struct { type TrashDashboardResponse struct { } -// Unpublish dashboard +type TrashSpaceResponse struct { +} + type UnpublishDashboardRequest struct { // UUID identifying the published dashboard. DashboardId string `json:"-" url:"-"` @@ -1356,14 +1529,12 @@ type UnpublishDashboardRequest struct { type UnpublishDashboardResponse struct { } -// Update dashboard type UpdateDashboardRequest struct { Dashboard Dashboard `json:"dashboard"` // UUID identifying the dashboard. DashboardId string `json:"-" url:"-"` } -// Update dashboard schedule type UpdateScheduleRequest struct { // UUID identifying the dashboard to which the schedule belongs. DashboardId string `json:"-" url:"-"` diff --git a/service/database/api.go b/service/database/api.go index d677c3773..555e5fa36 100755 --- a/service/database/api.go +++ b/service/database/api.go @@ -18,7 +18,12 @@ type DatabaseInterface interface { // Create a Database Instance. CreateDatabaseInstance(ctx context.Context, request CreateDatabaseInstanceRequest) (*DatabaseInstance, error) - // Create a Database Table. + // Create a role for a Database Instance. + CreateDatabaseInstanceRole(ctx context.Context, request CreateDatabaseInstanceRoleRequest) (*DatabaseInstanceRole, error) + + // Create a Database Table. Useful for registering pre-existing PG tables in UC. + // See CreateSyncedDatabaseTable for creating synced tables in PG from a source + // table in UC. CreateDatabaseTable(ctx context.Context, request CreateDatabaseTableRequest) (*DatabaseTable, error) // Create a Synced Database Table. @@ -36,6 +41,12 @@ type DatabaseInterface interface { // Delete a Database Instance. DeleteDatabaseInstanceByName(ctx context.Context, name string) error + // Deletes a role for a Database Instance. + DeleteDatabaseInstanceRole(ctx context.Context, request DeleteDatabaseInstanceRoleRequest) error + + // Deletes a role for a Database Instance. + DeleteDatabaseInstanceRoleByInstanceNameAndName(ctx context.Context, instanceName string, name string) error + // Delete a Database Table. DeleteDatabaseTable(ctx context.Context, request DeleteDatabaseTableRequest) error @@ -48,6 +59,9 @@ type DatabaseInterface interface { // Delete a Synced Database Table. DeleteSyncedDatabaseTableByName(ctx context.Context, name string) error + // Failover the primary node of a Database Instance to a secondary. + FailoverDatabaseInstance(ctx context.Context, request FailoverDatabaseInstanceRequest) (*DatabaseInstance, error) + // Find a Database Instance by uid. FindDatabaseInstanceByUid(ctx context.Context, request FindDatabaseInstanceByUidRequest) (*DatabaseInstance, error) @@ -66,6 +80,12 @@ type DatabaseInterface interface { // Get a Database Instance. GetDatabaseInstanceByName(ctx context.Context, name string) (*DatabaseInstance, error) + // Gets a role for a Database Instance. + GetDatabaseInstanceRole(ctx context.Context, request GetDatabaseInstanceRoleRequest) (*DatabaseInstanceRole, error) + + // Gets a role for a Database Instance. + GetDatabaseInstanceRoleByInstanceNameAndName(ctx context.Context, instanceName string, name string) (*DatabaseInstanceRole, error) + // Get a Database Table. GetDatabaseTable(ctx context.Context, request GetDatabaseTableRequest) (*DatabaseTable, error) @@ -78,6 +98,32 @@ type DatabaseInterface interface { // Get a Synced Database Table. GetSyncedDatabaseTableByName(ctx context.Context, name string) (*SyncedDatabaseTable, error) + // List all Database Catalogs within a Database Instance. + // + // This method is generated by Databricks SDK Code Generator. + ListDatabaseCatalogs(ctx context.Context, request ListDatabaseCatalogsRequest) listing.Iterator[DatabaseCatalog] + + // List all Database Catalogs within a Database Instance. + // + // This method is generated by Databricks SDK Code Generator. + ListDatabaseCatalogsAll(ctx context.Context, request ListDatabaseCatalogsRequest) ([]DatabaseCatalog, error) + + // List all Database Catalogs within a Database Instance. + ListDatabaseCatalogsByInstanceName(ctx context.Context, instanceName string) (*ListDatabaseCatalogsResponse, error) + + // START OF PG ROLE APIs Section + // + // This method is generated by Databricks SDK Code Generator. + ListDatabaseInstanceRoles(ctx context.Context, request ListDatabaseInstanceRolesRequest) listing.Iterator[DatabaseInstanceRole] + + // START OF PG ROLE APIs Section + // + // This method is generated by Databricks SDK Code Generator. + ListDatabaseInstanceRolesAll(ctx context.Context, request ListDatabaseInstanceRolesRequest) ([]DatabaseInstanceRole, error) + + // START OF PG ROLE APIs Section + ListDatabaseInstanceRolesByInstanceName(ctx context.Context, instanceName string) (*ListDatabaseInstanceRolesResponse, error) + // List Database Instances. // // This method is generated by Databricks SDK Code Generator. @@ -88,8 +134,27 @@ type DatabaseInterface interface { // This method is generated by Databricks SDK Code Generator. ListDatabaseInstancesAll(ctx context.Context, request ListDatabaseInstancesRequest) ([]DatabaseInstance, error) + // List all Synced Database Tables within a Database Instance. + // + // This method is generated by Databricks SDK Code Generator. + ListSyncedDatabaseTables(ctx context.Context, request ListSyncedDatabaseTablesRequest) listing.Iterator[SyncedDatabaseTable] + + // List all Synced Database Tables within a Database Instance. + // + // This method is generated by Databricks SDK Code Generator. + ListSyncedDatabaseTablesAll(ctx context.Context, request ListSyncedDatabaseTablesRequest) ([]SyncedDatabaseTable, error) + + // List all Synced Database Tables within a Database Instance. + ListSyncedDatabaseTablesByInstanceName(ctx context.Context, instanceName string) (*ListSyncedDatabaseTablesResponse, error) + + // Updated a Database Catalog. + UpdateDatabaseCatalog(ctx context.Context, request UpdateDatabaseCatalogRequest) (*DatabaseCatalog, error) + // Update a Database Instance. UpdateDatabaseInstance(ctx context.Context, request UpdateDatabaseInstanceRequest) (*DatabaseInstance, error) + + // Update a Synced Database Table. + UpdateSyncedDatabaseTable(ctx context.Context, request UpdateSyncedDatabaseTableRequest) (*SyncedDatabaseTable, error) } func NewDatabase(client *client.DatabricksClient) *DatabaseAPI { @@ -119,6 +184,14 @@ func (a *DatabaseAPI) DeleteDatabaseInstanceByName(ctx context.Context, name str }) } +// Deletes a role for a Database Instance. +func (a *DatabaseAPI) DeleteDatabaseInstanceRoleByInstanceNameAndName(ctx context.Context, instanceName string, name string) error { + return a.databaseImpl.DeleteDatabaseInstanceRole(ctx, DeleteDatabaseInstanceRoleRequest{ + InstanceName: instanceName, + Name: name, + }) +} + // Delete a Database Table. func (a *DatabaseAPI) DeleteDatabaseTableByName(ctx context.Context, name string) error { return a.databaseImpl.DeleteDatabaseTable(ctx, DeleteDatabaseTableRequest{ @@ -147,6 +220,14 @@ func (a *DatabaseAPI) GetDatabaseInstanceByName(ctx context.Context, name string }) } +// Gets a role for a Database Instance. +func (a *DatabaseAPI) GetDatabaseInstanceRoleByInstanceNameAndName(ctx context.Context, instanceName string, name string) (*DatabaseInstanceRole, error) { + return a.databaseImpl.GetDatabaseInstanceRole(ctx, GetDatabaseInstanceRoleRequest{ + InstanceName: instanceName, + Name: name, + }) +} + // Get a Database Table. func (a *DatabaseAPI) GetDatabaseTableByName(ctx context.Context, name string) (*DatabaseTable, error) { return a.databaseImpl.GetDatabaseTable(ctx, GetDatabaseTableRequest{ @@ -160,3 +241,24 @@ func (a *DatabaseAPI) GetSyncedDatabaseTableByName(ctx context.Context, name str Name: name, }) } + +// List all Database Catalogs within a Database Instance. +func (a *DatabaseAPI) ListDatabaseCatalogsByInstanceName(ctx context.Context, instanceName string) (*ListDatabaseCatalogsResponse, error) { + return a.databaseImpl.internalListDatabaseCatalogs(ctx, ListDatabaseCatalogsRequest{ + InstanceName: instanceName, + }) +} + +// START OF PG ROLE APIs Section +func (a *DatabaseAPI) ListDatabaseInstanceRolesByInstanceName(ctx context.Context, instanceName string) (*ListDatabaseInstanceRolesResponse, error) { + return a.databaseImpl.internalListDatabaseInstanceRoles(ctx, ListDatabaseInstanceRolesRequest{ + InstanceName: instanceName, + }) +} + +// List all Synced Database Tables within a Database Instance. +func (a *DatabaseAPI) ListSyncedDatabaseTablesByInstanceName(ctx context.Context, instanceName string) (*ListSyncedDatabaseTablesResponse, error) { + return a.databaseImpl.internalListSyncedDatabaseTables(ctx, ListSyncedDatabaseTablesRequest{ + InstanceName: instanceName, + }) +} diff --git a/service/database/impl.go b/service/database/impl.go index 6339731be..a8fc87e92 100755 --- a/service/database/impl.go +++ b/service/database/impl.go @@ -39,6 +39,17 @@ func (a *databaseImpl) CreateDatabaseInstance(ctx context.Context, request Creat return &databaseInstance, err } +func (a *databaseImpl) CreateDatabaseInstanceRole(ctx context.Context, request CreateDatabaseInstanceRoleRequest) (*DatabaseInstanceRole, error) { + var databaseInstanceRole DatabaseInstanceRole + path := fmt.Sprintf("/api/2.0/database/instances/%v/roles", request.InstanceName) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request.DatabaseInstanceRole, &databaseInstanceRole) + return &databaseInstanceRole, err +} + func (a *databaseImpl) CreateDatabaseTable(ctx context.Context, request CreateDatabaseTableRequest) (*DatabaseTable, error) { var databaseTable DatabaseTable path := "/api/2.0/database/tables" @@ -62,45 +73,61 @@ func (a *databaseImpl) CreateSyncedDatabaseTable(ctx context.Context, request Cr } func (a *databaseImpl) DeleteDatabaseCatalog(ctx context.Context, request DeleteDatabaseCatalogRequest) error { - var deleteDatabaseCatalogResponse DeleteDatabaseCatalogResponse path := fmt.Sprintf("/api/2.0/database/catalogs/%v", request.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteDatabaseCatalogResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } func (a *databaseImpl) DeleteDatabaseInstance(ctx context.Context, request DeleteDatabaseInstanceRequest) error { - var deleteDatabaseInstanceResponse DeleteDatabaseInstanceResponse path := fmt.Sprintf("/api/2.0/database/instances/%v", request.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteDatabaseInstanceResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) + return err +} + +func (a *databaseImpl) DeleteDatabaseInstanceRole(ctx context.Context, request DeleteDatabaseInstanceRoleRequest) error { + path := fmt.Sprintf("/api/2.0/database/instances/%v/roles/%v", request.InstanceName, request.Name) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } func (a *databaseImpl) DeleteDatabaseTable(ctx context.Context, request DeleteDatabaseTableRequest) error { - var deleteDatabaseTableResponse DeleteDatabaseTableResponse path := fmt.Sprintf("/api/2.0/database/tables/%v", request.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteDatabaseTableResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } func (a *databaseImpl) DeleteSyncedDatabaseTable(ctx context.Context, request DeleteSyncedDatabaseTableRequest) error { - var deleteSyncedDatabaseTableResponse DeleteSyncedDatabaseTableResponse path := fmt.Sprintf("/api/2.0/database/synced_tables/%v", request.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteSyncedDatabaseTableResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } +func (a *databaseImpl) FailoverDatabaseInstance(ctx context.Context, request FailoverDatabaseInstanceRequest) (*DatabaseInstance, error) { + var databaseInstance DatabaseInstance + path := fmt.Sprintf("/api/2.0/database/instances/%v/failover", request.Name) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &databaseInstance) + return &databaseInstance, err +} + func (a *databaseImpl) FindDatabaseInstanceByUid(ctx context.Context, request FindDatabaseInstanceByUidRequest) (*DatabaseInstance, error) { var databaseInstance DatabaseInstance path := "/api/2.0/database/instances:findByUid" @@ -142,6 +169,16 @@ func (a *databaseImpl) GetDatabaseInstance(ctx context.Context, request GetDatab return &databaseInstance, err } +func (a *databaseImpl) GetDatabaseInstanceRole(ctx context.Context, request GetDatabaseInstanceRoleRequest) (*DatabaseInstanceRole, error) { + var databaseInstanceRole DatabaseInstanceRole + path := fmt.Sprintf("/api/2.0/database/instances/%v/roles/%v", request.InstanceName, request.Name) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &databaseInstanceRole) + return &databaseInstanceRole, err +} + func (a *databaseImpl) GetDatabaseTable(ctx context.Context, request GetDatabaseTableRequest) (*DatabaseTable, error) { var databaseTable DatabaseTable path := fmt.Sprintf("/api/2.0/database/tables/%v", request.Name) @@ -162,6 +199,88 @@ func (a *databaseImpl) GetSyncedDatabaseTable(ctx context.Context, request GetSy return &syncedDatabaseTable, err } +// List all Database Catalogs within a Database Instance. +func (a *databaseImpl) ListDatabaseCatalogs(ctx context.Context, request ListDatabaseCatalogsRequest) listing.Iterator[DatabaseCatalog] { + + getNextPage := func(ctx context.Context, req ListDatabaseCatalogsRequest) (*ListDatabaseCatalogsResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.internalListDatabaseCatalogs(ctx, req) + } + getItems := func(resp *ListDatabaseCatalogsResponse) []DatabaseCatalog { + return resp.DatabaseCatalogs + } + getNextReq := func(resp *ListDatabaseCatalogsResponse) *ListDatabaseCatalogsRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// List all Database Catalogs within a Database Instance. +func (a *databaseImpl) ListDatabaseCatalogsAll(ctx context.Context, request ListDatabaseCatalogsRequest) ([]DatabaseCatalog, error) { + iterator := a.ListDatabaseCatalogs(ctx, request) + return listing.ToSlice[DatabaseCatalog](ctx, iterator) +} + +func (a *databaseImpl) internalListDatabaseCatalogs(ctx context.Context, request ListDatabaseCatalogsRequest) (*ListDatabaseCatalogsResponse, error) { + var listDatabaseCatalogsResponse ListDatabaseCatalogsResponse + path := fmt.Sprintf("/api/2.0/database/instances/%v/catalogs", request.InstanceName) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listDatabaseCatalogsResponse) + return &listDatabaseCatalogsResponse, err +} + +// START OF PG ROLE APIs Section +func (a *databaseImpl) ListDatabaseInstanceRoles(ctx context.Context, request ListDatabaseInstanceRolesRequest) listing.Iterator[DatabaseInstanceRole] { + + getNextPage := func(ctx context.Context, req ListDatabaseInstanceRolesRequest) (*ListDatabaseInstanceRolesResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.internalListDatabaseInstanceRoles(ctx, req) + } + getItems := func(resp *ListDatabaseInstanceRolesResponse) []DatabaseInstanceRole { + return resp.DatabaseInstanceRoles + } + getNextReq := func(resp *ListDatabaseInstanceRolesResponse) *ListDatabaseInstanceRolesRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// START OF PG ROLE APIs Section +func (a *databaseImpl) ListDatabaseInstanceRolesAll(ctx context.Context, request ListDatabaseInstanceRolesRequest) ([]DatabaseInstanceRole, error) { + iterator := a.ListDatabaseInstanceRoles(ctx, request) + return listing.ToSlice[DatabaseInstanceRole](ctx, iterator) +} + +func (a *databaseImpl) internalListDatabaseInstanceRoles(ctx context.Context, request ListDatabaseInstanceRolesRequest) (*ListDatabaseInstanceRolesResponse, error) { + var listDatabaseInstanceRolesResponse ListDatabaseInstanceRolesResponse + path := fmt.Sprintf("/api/2.0/database/instances/%v/roles", request.InstanceName) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listDatabaseInstanceRolesResponse) + return &listDatabaseInstanceRolesResponse, err +} + // List Database Instances. func (a *databaseImpl) ListDatabaseInstances(ctx context.Context, request ListDatabaseInstancesRequest) listing.Iterator[DatabaseInstance] { @@ -203,6 +322,61 @@ func (a *databaseImpl) internalListDatabaseInstances(ctx context.Context, reques return &listDatabaseInstancesResponse, err } +// List all Synced Database Tables within a Database Instance. +func (a *databaseImpl) ListSyncedDatabaseTables(ctx context.Context, request ListSyncedDatabaseTablesRequest) listing.Iterator[SyncedDatabaseTable] { + + getNextPage := func(ctx context.Context, req ListSyncedDatabaseTablesRequest) (*ListSyncedDatabaseTablesResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.internalListSyncedDatabaseTables(ctx, req) + } + getItems := func(resp *ListSyncedDatabaseTablesResponse) []SyncedDatabaseTable { + return resp.SyncedTables + } + getNextReq := func(resp *ListSyncedDatabaseTablesResponse) *ListSyncedDatabaseTablesRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// List all Synced Database Tables within a Database Instance. +func (a *databaseImpl) ListSyncedDatabaseTablesAll(ctx context.Context, request ListSyncedDatabaseTablesRequest) ([]SyncedDatabaseTable, error) { + iterator := a.ListSyncedDatabaseTables(ctx, request) + return listing.ToSlice[SyncedDatabaseTable](ctx, iterator) +} + +func (a *databaseImpl) internalListSyncedDatabaseTables(ctx context.Context, request ListSyncedDatabaseTablesRequest) (*ListSyncedDatabaseTablesResponse, error) { + var listSyncedDatabaseTablesResponse ListSyncedDatabaseTablesResponse + path := fmt.Sprintf("/api/2.0/database/instances/%v/synced_tables", request.InstanceName) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listSyncedDatabaseTablesResponse) + return &listSyncedDatabaseTablesResponse, err +} + +func (a *databaseImpl) UpdateDatabaseCatalog(ctx context.Context, request UpdateDatabaseCatalogRequest) (*DatabaseCatalog, error) { + var databaseCatalog DatabaseCatalog + path := fmt.Sprintf("/api/2.0/database/catalogs/%v", request.Name) + queryParams := make(map[string]any) + if request.UpdateMask != "" { + queryParams["update_mask"] = request.UpdateMask + } + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request.DatabaseCatalog, &databaseCatalog) + return &databaseCatalog, err +} + func (a *databaseImpl) UpdateDatabaseInstance(ctx context.Context, request UpdateDatabaseInstanceRequest) (*DatabaseInstance, error) { var databaseInstance DatabaseInstance path := fmt.Sprintf("/api/2.0/database/instances/%v", request.Name) @@ -216,3 +390,17 @@ func (a *databaseImpl) UpdateDatabaseInstance(ctx context.Context, request Updat err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request.DatabaseInstance, &databaseInstance) return &databaseInstance, err } + +func (a *databaseImpl) UpdateSyncedDatabaseTable(ctx context.Context, request UpdateSyncedDatabaseTableRequest) (*SyncedDatabaseTable, error) { + var syncedDatabaseTable SyncedDatabaseTable + path := fmt.Sprintf("/api/2.0/database/synced_tables/%v", request.Name) + queryParams := make(map[string]any) + if request.UpdateMask != "" { + queryParams["update_mask"] = request.UpdateMask + } + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request.SyncedTable, &syncedDatabaseTable) + return &syncedDatabaseTable, err +} diff --git a/service/database/interface.go b/service/database/interface.go index bba9c455a..7202343b3 100755 --- a/service/database/interface.go +++ b/service/database/interface.go @@ -17,7 +17,12 @@ type DatabaseService interface { // Create a Database Instance. CreateDatabaseInstance(ctx context.Context, request CreateDatabaseInstanceRequest) (*DatabaseInstance, error) - // Create a Database Table. + // Create a role for a Database Instance. + CreateDatabaseInstanceRole(ctx context.Context, request CreateDatabaseInstanceRoleRequest) (*DatabaseInstanceRole, error) + + // Create a Database Table. Useful for registering pre-existing PG tables in + // UC. See CreateSyncedDatabaseTable for creating synced tables in PG from a + // source table in UC. CreateDatabaseTable(ctx context.Context, request CreateDatabaseTableRequest) (*DatabaseTable, error) // Create a Synced Database Table. @@ -29,12 +34,18 @@ type DatabaseService interface { // Delete a Database Instance. DeleteDatabaseInstance(ctx context.Context, request DeleteDatabaseInstanceRequest) error + // Deletes a role for a Database Instance. + DeleteDatabaseInstanceRole(ctx context.Context, request DeleteDatabaseInstanceRoleRequest) error + // Delete a Database Table. DeleteDatabaseTable(ctx context.Context, request DeleteDatabaseTableRequest) error // Delete a Synced Database Table. DeleteSyncedDatabaseTable(ctx context.Context, request DeleteSyncedDatabaseTableRequest) error + // Failover the primary node of a Database Instance to a secondary. + FailoverDatabaseInstance(ctx context.Context, request FailoverDatabaseInstanceRequest) (*DatabaseInstance, error) + // Find a Database Instance by uid. FindDatabaseInstanceByUid(ctx context.Context, request FindDatabaseInstanceByUidRequest) (*DatabaseInstance, error) @@ -47,15 +58,33 @@ type DatabaseService interface { // Get a Database Instance. GetDatabaseInstance(ctx context.Context, request GetDatabaseInstanceRequest) (*DatabaseInstance, error) + // Gets a role for a Database Instance. + GetDatabaseInstanceRole(ctx context.Context, request GetDatabaseInstanceRoleRequest) (*DatabaseInstanceRole, error) + // Get a Database Table. GetDatabaseTable(ctx context.Context, request GetDatabaseTableRequest) (*DatabaseTable, error) // Get a Synced Database Table. GetSyncedDatabaseTable(ctx context.Context, request GetSyncedDatabaseTableRequest) (*SyncedDatabaseTable, error) + // List all Database Catalogs within a Database Instance. + ListDatabaseCatalogs(ctx context.Context, request ListDatabaseCatalogsRequest) (*ListDatabaseCatalogsResponse, error) + + // START OF PG ROLE APIs Section + ListDatabaseInstanceRoles(ctx context.Context, request ListDatabaseInstanceRolesRequest) (*ListDatabaseInstanceRolesResponse, error) + // List Database Instances. ListDatabaseInstances(ctx context.Context, request ListDatabaseInstancesRequest) (*ListDatabaseInstancesResponse, error) + // List all Synced Database Tables within a Database Instance. + ListSyncedDatabaseTables(ctx context.Context, request ListSyncedDatabaseTablesRequest) (*ListSyncedDatabaseTablesResponse, error) + + // Updated a Database Catalog. + UpdateDatabaseCatalog(ctx context.Context, request UpdateDatabaseCatalogRequest) (*DatabaseCatalog, error) + // Update a Database Instance. UpdateDatabaseInstance(ctx context.Context, request UpdateDatabaseInstanceRequest) (*DatabaseInstance, error) + + // Update a Synced Database Table. + UpdateSyncedDatabaseTable(ctx context.Context, request UpdateSyncedDatabaseTableRequest) (*SyncedDatabaseTable, error) } diff --git a/service/database/model.go b/service/database/model.go index c24a5eeb9..6fc9693b4 100755 --- a/service/database/model.go +++ b/service/database/model.go @@ -8,25 +8,28 @@ import ( "github.com/databricks/databricks-sdk-go/marshal" ) -// Create a Database Catalog type CreateDatabaseCatalogRequest struct { Catalog DatabaseCatalog `json:"catalog"` } -// Create a Database Instance type CreateDatabaseInstanceRequest struct { // A DatabaseInstance represents a logical Postgres instance, comprised of // both compute and storage. DatabaseInstance DatabaseInstance `json:"database_instance"` } -// Create a Database Table +type CreateDatabaseInstanceRoleRequest struct { + // A DatabaseInstanceRole represents a Postgres role in a database instance. + DatabaseInstanceRole DatabaseInstanceRole `json:"database_instance_role"` + + InstanceName string `json:"-" url:"-"` +} + type CreateDatabaseTableRequest struct { // Next field marker: 13 Table DatabaseTable `json:"table"` } -// Create a Synced Database Table type CreateSyncedDatabaseTableRequest struct { // Next field marker: 12 SyncedTable SyncedDatabaseTable `json:"synced_table"` @@ -75,22 +78,73 @@ func (s DatabaseCredential) MarshalJSON() ([]byte, error) { type DatabaseInstance struct { // The sku of the instance. Valid values are "CU_1", "CU_2", "CU_4", "CU_8". Capacity string `json:"capacity,omitempty"` + // The refs of the child instances. This is only available if the instance + // is parent instance. + ChildInstanceRefs []DatabaseInstanceRef `json:"child_instance_refs,omitempty"` // The timestamp when the instance was created. CreationTime string `json:"creation_time,omitempty"` // The email of the creator of the instance. Creator string `json:"creator,omitempty"` + // xref AIP-129. `enable_pg_native_login` is owned by the client, while + // `effective_enable_pg_native_login` is owned by the server. + // `enable_pg_native_login` will only be set in Create/Update response + // messages if and only if the user provides the field via the request. + // `effective_enable_pg_native_login` on the other hand will always bet set + // in all response messages (Create/Update/Get/List). + EffectiveEnablePgNativeLogin bool `json:"effective_enable_pg_native_login,omitempty"` + // xref AIP-129. `enable_readable_secondaries` is owned by the client, while + // `effective_enable_readable_secondaries` is owned by the server. + // `enable_readable_secondaries` will only be set in Create/Update response + // messages if and only if the user provides the field via the request. + // `effective_enable_readable_secondaries` on the other hand will always bet + // set in all response messages (Create/Update/Get/List). + EffectiveEnableReadableSecondaries bool `json:"effective_enable_readable_secondaries,omitempty"` + // xref AIP-129. `node_count` is owned by the client, while + // `effective_node_count` is owned by the server. `node_count` will only be + // set in Create/Update response messages if and only if the user provides + // the field via the request. `effective_node_count` on the other hand will + // always bet set in all response messages (Create/Update/Get/List). + EffectiveNodeCount int `json:"effective_node_count,omitempty"` + // xref AIP-129. `retention_window_in_days` is owned by the client, while + // `effective_retention_window_in_days` is owned by the server. + // `retention_window_in_days` will only be set in Create/Update response + // messages if and only if the user provides the field via the request. + // `effective_retention_window_in_days` on the other hand will always bet + // set in all response messages (Create/Update/Get/List). + EffectiveRetentionWindowInDays int `json:"effective_retention_window_in_days,omitempty"` // xref AIP-129. `stopped` is owned by the client, while `effective_stopped` // is owned by the server. `stopped` will only be set in Create/Update // response messages if and only if the user provides the field via the // request. `effective_stopped` on the other hand will always bet set in all // response messages (Create/Update/Get/List). EffectiveStopped bool `json:"effective_stopped,omitempty"` + // Whether the instance has PG native password login enabled. Defaults to + // true. + EnablePgNativeLogin bool `json:"enable_pg_native_login,omitempty"` + // Whether to enable secondaries to serve read-only traffic. Defaults to + // false. + EnableReadableSecondaries bool `json:"enable_readable_secondaries,omitempty"` // The name of the instance. This is the unique identifier for the instance. Name string `json:"name"` + // The number of nodes in the instance, composed of 1 primary and 0 or more + // secondaries. Defaults to 1 primary and 0 secondaries. + NodeCount int `json:"node_count,omitempty"` + // The ref of the parent instance. This is only available if the instance is + // child instance. Input: For specifying the parent instance to create a + // child instance. Optional. Output: Only populated if provided as input to + // create a child instance. + ParentInstanceRef *DatabaseInstanceRef `json:"parent_instance_ref,omitempty"` // The version of Postgres running on the instance. PgVersion string `json:"pg_version,omitempty"` + // The DNS endpoint to connect to the instance for read only access. This is + // only available if enable_readable_secondaries is true. + ReadOnlyDns string `json:"read_only_dns,omitempty"` // The DNS endpoint to connect to the instance for read+write access. ReadWriteDns string `json:"read_write_dns,omitempty"` + // The retention window for the instance. This is the time window in days + // for which the historical data is retained. The default value is 7 days. + // Valid values are 2 to 35 days. + RetentionWindowInDays int `json:"retention_window_in_days,omitempty"` // The current state of the instance. State DatabaseInstanceState `json:"state,omitempty"` // Whether the instance is stopped. @@ -109,6 +163,177 @@ func (s DatabaseInstance) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +// DatabaseInstanceRef is a reference to a database instance. It is used in the +// DatabaseInstance object to refer to the parent instance of an instance and to +// refer the child instances of an instance. To specify as a parent instance +// during creation of an instance, the lsn and branch_time fields are optional. +// If not specified, the child instance will be created from the latest lsn of +// the parent. If both lsn and branch_time are specified, the lsn will be used +// to create the child instance. +type DatabaseInstanceRef struct { + // Branch time of the ref database instance. For a parent ref instance, this + // is the point in time on the parent instance from which the instance was + // created. For a child ref instance, this is the point in time on the + // instance from which the child instance was created. Input: For specifying + // the point in time to create a child instance. Optional. Output: Only + // populated if provided as input to create a child instance. + BranchTime string `json:"branch_time,omitempty"` + // xref AIP-129. `lsn` is owned by the client, while `effective_lsn` is + // owned by the server. `lsn` will only be set in Create/Update response + // messages if and only if the user provides the field via the request. + // `effective_lsn` on the other hand will always bet set in all response + // messages (Create/Update/Get/List). For a parent ref instance, this is the + // LSN on the parent instance from which the instance was created. For a + // child ref instance, this is the LSN on the instance from which the child + // instance was created. + EffectiveLsn string `json:"effective_lsn,omitempty"` + // User-specified WAL LSN of the ref database instance. + // + // Input: For specifying the WAL LSN to create a child instance. Optional. + // Output: Only populated if provided as input to create a child instance. + Lsn string `json:"lsn,omitempty"` + // Name of the ref database instance. + Name string `json:"name,omitempty"` + // Id of the ref database instance. + Uid string `json:"uid,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *DatabaseInstanceRef) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s DatabaseInstanceRef) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// A DatabaseInstanceRole represents a Postgres role in a database instance. +type DatabaseInstanceRole struct { + // API-exposed Postgres role attributes + Attributes *DatabaseInstanceRoleAttributes `json:"attributes,omitempty"` + // The type of the role. + IdentityType DatabaseInstanceRoleIdentityType `json:"identity_type,omitempty"` + // An enum value for a standard role that this role is a member of. + MembershipRole DatabaseInstanceRoleMembershipRole `json:"membership_role,omitempty"` + // The name of the role. This is the unique identifier for the role in an + // instance. + Name string `json:"name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *DatabaseInstanceRole) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s DatabaseInstanceRole) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Attributes that can be granted to a Postgres role. We are only implementing a +// subset for now, see xref: +// https://www.postgresql.org/docs/16/sql-createrole.html The values follow +// Postgres keyword naming e.g. CREATEDB, BYPASSRLS, etc. which is why they +// don't include typical underscores between words. We were requested to make +// this a nested object/struct representation since these are knobs from an +// external spec. +type DatabaseInstanceRoleAttributes struct { + Bypassrls bool `json:"bypassrls,omitempty"` + + Createdb bool `json:"createdb,omitempty"` + + Createrole bool `json:"createrole,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *DatabaseInstanceRoleAttributes) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s DatabaseInstanceRoleAttributes) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type DatabaseInstanceRoleIdentityType string + +const DatabaseInstanceRoleIdentityTypeGroup DatabaseInstanceRoleIdentityType = `GROUP` + +const DatabaseInstanceRoleIdentityTypePgOnly DatabaseInstanceRoleIdentityType = `PG_ONLY` + +const DatabaseInstanceRoleIdentityTypeServicePrincipal DatabaseInstanceRoleIdentityType = `SERVICE_PRINCIPAL` + +const DatabaseInstanceRoleIdentityTypeUser DatabaseInstanceRoleIdentityType = `USER` + +// String representation for [fmt.Print] +func (f *DatabaseInstanceRoleIdentityType) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *DatabaseInstanceRoleIdentityType) Set(v string) error { + switch v { + case `GROUP`, `PG_ONLY`, `SERVICE_PRINCIPAL`, `USER`: + *f = DatabaseInstanceRoleIdentityType(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "GROUP", "PG_ONLY", "SERVICE_PRINCIPAL", "USER"`, v) + } +} + +// Values returns all possible values for DatabaseInstanceRoleIdentityType. +// +// There is no guarantee on the order of the values in the slice. +func (f *DatabaseInstanceRoleIdentityType) Values() []DatabaseInstanceRoleIdentityType { + return []DatabaseInstanceRoleIdentityType{ + DatabaseInstanceRoleIdentityTypeGroup, + DatabaseInstanceRoleIdentityTypePgOnly, + DatabaseInstanceRoleIdentityTypeServicePrincipal, + DatabaseInstanceRoleIdentityTypeUser, + } +} + +// Type always returns DatabaseInstanceRoleIdentityType to satisfy [pflag.Value] interface +func (f *DatabaseInstanceRoleIdentityType) Type() string { + return "DatabaseInstanceRoleIdentityType" +} + +// Roles that the DatabaseInstanceRole can be a member of. +type DatabaseInstanceRoleMembershipRole string + +const DatabaseInstanceRoleMembershipRoleDatabricksSuperuser DatabaseInstanceRoleMembershipRole = `DATABRICKS_SUPERUSER` + +// String representation for [fmt.Print] +func (f *DatabaseInstanceRoleMembershipRole) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *DatabaseInstanceRoleMembershipRole) Set(v string) error { + switch v { + case `DATABRICKS_SUPERUSER`: + *f = DatabaseInstanceRoleMembershipRole(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "DATABRICKS_SUPERUSER"`, v) + } +} + +// Values returns all possible values for DatabaseInstanceRoleMembershipRole. +// +// There is no guarantee on the order of the values in the slice. +func (f *DatabaseInstanceRoleMembershipRole) Values() []DatabaseInstanceRoleMembershipRole { + return []DatabaseInstanceRoleMembershipRole{ + DatabaseInstanceRoleMembershipRoleDatabricksSuperuser, + } +} + +// Type always returns DatabaseInstanceRoleMembershipRole to satisfy [pflag.Value] interface +func (f *DatabaseInstanceRoleMembershipRole) Type() string { + return "DatabaseInstanceRoleMembershipRole" +} + type DatabaseInstanceState string const DatabaseInstanceStateAvailable DatabaseInstanceState = `AVAILABLE` @@ -168,7 +393,6 @@ type DatabaseTable struct { // rejected). DatabaseInstanceName string `json:"database_instance_name,omitempty"` // Target Postgres database object (logical database) name for this table. - // This field is optional in all scenarios. // // When creating a table in a registered Postgres catalog, the target // Postgres database name is inferred to be that of the registered catalog. @@ -176,14 +400,14 @@ type DatabaseTable struct { // MUST match that of the registered catalog (or the request will be // rejected). // - // When creating a table in a standard catalog, the target database name is - // inferred to be that of the standard catalog. In this scenario, specifying - // this field will allow targeting an arbitrary postgres database. Note that - // this has implications for the `create_database_objects_is_missing` field - // in `spec`. + // When creating a table in a standard catalog, this field is required. In + // this scenario, specifying this field will allow targeting an arbitrary + // postgres database. LogicalDatabaseName string `json:"logical_database_name,omitempty"` // Full three-part (catalog, schema, table) name of the table. Name string `json:"name"` + // Data serving REST API URL for this table + TableServingUrl string `json:"table_serving_url,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -196,7 +420,6 @@ func (s DatabaseTable) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Delete a Database Catalog type DeleteDatabaseCatalogRequest struct { Name string `json:"-" url:"-"` } @@ -204,7 +427,6 @@ type DeleteDatabaseCatalogRequest struct { type DeleteDatabaseCatalogResponse struct { } -// Delete a Database Instance type DeleteDatabaseInstanceRequest struct { // By default, a instance cannot be deleted if it has descendant instances // created via PITR. If this flag is specified as true, all descendent @@ -236,7 +458,31 @@ func (s DeleteDatabaseInstanceRequest) MarshalJSON() ([]byte, error) { type DeleteDatabaseInstanceResponse struct { } -// Delete a Database Table +type DeleteDatabaseInstanceRoleRequest struct { + // This is the AIP standard name for the equivalent of Postgres' `IF EXISTS` + // option + AllowMissing bool `json:"-" url:"allow_missing,omitempty"` + + InstanceName string `json:"-" url:"-"` + + Name string `json:"-" url:"-"` + + ReassignOwnedTo string `json:"-" url:"reassign_owned_to,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *DeleteDatabaseInstanceRoleRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s DeleteDatabaseInstanceRoleRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type DeleteDatabaseInstanceRoleResponse struct { +} + type DeleteDatabaseTableRequest struct { Name string `json:"-" url:"-"` } @@ -244,7 +490,6 @@ type DeleteDatabaseTableRequest struct { type DeleteDatabaseTableResponse struct { } -// Delete a Synced Database Table type DeleteSyncedDatabaseTableRequest struct { Name string `json:"-" url:"-"` } @@ -252,7 +497,41 @@ type DeleteSyncedDatabaseTableRequest struct { type DeleteSyncedDatabaseTableResponse struct { } -// Find a Database Instance by uid +type DeltaTableSyncInfo struct { + // The timestamp when the above Delta version was committed in the source + // Delta table. Note: This is the Delta commit time, not the time the data + // was written to the synced table. + DeltaCommitTimestamp string `json:"delta_commit_timestamp,omitempty"` + // The Delta Lake commit version that was last successfully synced. + DeltaCommitVersion int64 `json:"delta_commit_version,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *DeltaTableSyncInfo) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s DeltaTableSyncInfo) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type FailoverDatabaseInstanceRequest struct { + FailoverTargetDatabaseInstanceName string `json:"failover_target_database_instance_name,omitempty"` + // Name of the instance to failover. + Name string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *FailoverDatabaseInstanceRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s FailoverDatabaseInstanceRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type FindDatabaseInstanceByUidRequest struct { // UID of the cluster to get. Uid string `json:"-" url:"uid,omitempty"` @@ -270,6 +549,10 @@ func (s FindDatabaseInstanceByUidRequest) MarshalJSON() ([]byte, error) { // Generates a credential that can be used to access database instances type GenerateDatabaseCredentialRequest struct { + // The returned token will be scoped to the union of instance_names and + // instances containing the specified UC tables, so instance_names is + // allowed to be empty. + Claims []RequestedClaims `json:"claims,omitempty"` // Instances to which the token will be scoped. InstanceNames []string `json:"instance_names,omitempty"` @@ -286,28 +569,101 @@ func (s GenerateDatabaseCredentialRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get a Database Catalog type GetDatabaseCatalogRequest struct { Name string `json:"-" url:"-"` } -// Get a Database Instance type GetDatabaseInstanceRequest struct { // Name of the cluster to get. Name string `json:"-" url:"-"` } -// Get a Database Table +type GetDatabaseInstanceRoleRequest struct { + InstanceName string `json:"-" url:"-"` + + Name string `json:"-" url:"-"` +} + type GetDatabaseTableRequest struct { Name string `json:"-" url:"-"` } -// Get a Synced Database Table type GetSyncedDatabaseTableRequest struct { Name string `json:"-" url:"-"` } -// List Database Instances +type ListDatabaseCatalogsRequest struct { + // Name of the instance to get database catalogs for. + InstanceName string `json:"-" url:"-"` + // Upper bound for items returned. + PageSize int `json:"-" url:"page_size,omitempty"` + // Pagination token to go to the next page of synced database tables. + // Requests first page if absent. + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListDatabaseCatalogsRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListDatabaseCatalogsRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListDatabaseCatalogsResponse struct { + DatabaseCatalogs []DatabaseCatalog `json:"database_catalogs,omitempty"` + // Pagination token to request the next page of database catalogs. + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListDatabaseCatalogsResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListDatabaseCatalogsResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListDatabaseInstanceRolesRequest struct { + InstanceName string `json:"-" url:"-"` + // Upper bound for items returned. + PageSize int `json:"-" url:"page_size,omitempty"` + // Pagination token to go to the next page of Database Instances. Requests + // first page if absent. + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListDatabaseInstanceRolesRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListDatabaseInstanceRolesRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListDatabaseInstanceRolesResponse struct { + // List of database instance roles. + DatabaseInstanceRoles []DatabaseInstanceRole `json:"database_instance_roles,omitempty"` + // Pagination token to request the next page of instances. + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListDatabaseInstanceRolesResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListDatabaseInstanceRolesResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type ListDatabaseInstancesRequest struct { // Upper bound for items returned. PageSize int `json:"-" url:"page_size,omitempty"` @@ -343,6 +699,43 @@ func (s ListDatabaseInstancesResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type ListSyncedDatabaseTablesRequest struct { + // Name of the instance to get synced tables for. + InstanceName string `json:"-" url:"-"` + // Upper bound for items returned. + PageSize int `json:"-" url:"page_size,omitempty"` + // Pagination token to go to the next page of synced database tables. + // Requests first page if absent. + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListSyncedDatabaseTablesRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListSyncedDatabaseTablesRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListSyncedDatabaseTablesResponse struct { + // Pagination token to request the next page of synced tables. + NextPageToken string `json:"next_page_token,omitempty"` + + SyncedTables []SyncedDatabaseTable `json:"synced_tables,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListSyncedDatabaseTablesResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListSyncedDatabaseTablesResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + // Custom fields that user can set for pipeline while creating // SyncedDatabaseTable. Note that other fields of pipeline are still inferred by // table def internally @@ -416,6 +809,64 @@ func (f *ProvisioningInfoState) Type() string { return "ProvisioningInfoState" } +type RequestedClaims struct { + // Might add WRITE in the future + PermissionSet RequestedClaimsPermissionSet `json:"permission_set,omitempty"` + + Resources []RequestedResource `json:"resources,omitempty"` +} + +// Might add WRITE in the future +type RequestedClaimsPermissionSet string + +const RequestedClaimsPermissionSetReadOnly RequestedClaimsPermissionSet = `READ_ONLY` + +// String representation for [fmt.Print] +func (f *RequestedClaimsPermissionSet) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *RequestedClaimsPermissionSet) Set(v string) error { + switch v { + case `READ_ONLY`: + *f = RequestedClaimsPermissionSet(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "READ_ONLY"`, v) + } +} + +// Values returns all possible values for RequestedClaimsPermissionSet. +// +// There is no guarantee on the order of the values in the slice. +func (f *RequestedClaimsPermissionSet) Values() []RequestedClaimsPermissionSet { + return []RequestedClaimsPermissionSet{ + RequestedClaimsPermissionSetReadOnly, + } +} + +// Type always returns RequestedClaimsPermissionSet to satisfy [pflag.Value] interface +func (f *RequestedClaimsPermissionSet) Type() string { + return "RequestedClaimsPermissionSet" +} + +type RequestedResource struct { + TableName string `json:"table_name,omitempty"` + + UnspecifiedResourceName string `json:"unspecified_resource_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *RequestedResource) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s RequestedResource) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + // Next field marker: 12 type SyncedDatabaseTable struct { // Synced Table data synchronization status @@ -428,7 +879,6 @@ type SyncedDatabaseTable struct { // the request will be rejected). DatabaseInstanceName string `json:"database_instance_name,omitempty"` // Target Postgres database object (logical database) name for this table. - // This field is optional in all scenarios. // // When creating a synced table in a registered Postgres catalog, the target // Postgres database name is inferred to be that of the registered catalog. @@ -436,15 +886,17 @@ type SyncedDatabaseTable struct { // MUST match that of the registered catalog (or the request will be // rejected). // - // When creating a synced table in a standard catalog, the target database - // name is inferred to be that of the standard catalog. In this scenario, - // specifying this field will allow targeting an arbitrary postgres - // database. + // When creating a synced table in a standard catalog, this field is + // required. In this scenario, specifying this field will allow targeting an + // arbitrary postgres database. Note that this has implications for the + // `create_database_objects_is_missing` field in `spec`. LogicalDatabaseName string `json:"logical_database_name,omitempty"` // Full three-part (catalog, schema, table) name of the table. Name string `json:"name"` // Specification of a synced database table. Spec *SyncedTableSpec `json:"spec,omitempty"` + // Data serving REST API URL for this table + TableServingUrl string `json:"table_serving_url,omitempty"` // The provisioning state of the synced table entity in Unity Catalog. This // is distinct from the state of the data synchronization pipeline (i.e. the // table may be in "ACTIVE" but the pipeline may be in "PROVISIONING" as it @@ -467,12 +919,12 @@ func (s SyncedDatabaseTable) MarshalJSON() ([]byte, error) { type SyncedTableContinuousUpdateStatus struct { // Progress of the initial data synchronization. InitialPipelineSyncProgress *SyncedTablePipelineProgress `json:"initial_pipeline_sync_progress,omitempty"` - // The last source table Delta version that was synced to the synced table. - // Note that this Delta version may not be completely synced to the synced - // table yet. + // The last source table Delta version that was successfully synced to the + // synced table. LastProcessedCommitVersion int64 `json:"last_processed_commit_version,omitempty"` - // The timestamp of the last time any data was synchronized from the source - // table to the synced table. + // The end timestamp of the last time any data was synchronized from the + // source table to the synced table. This is when the data is available in + // the synced table. Timestamp string `json:"timestamp,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -489,14 +941,14 @@ func (s SyncedTableContinuousUpdateStatus) MarshalJSON() ([]byte, error) { // Detailed status of a synced table. Shown if the synced table is in the // OFFLINE_FAILED or the SYNCED_PIPELINE_FAILED state. type SyncedTableFailedStatus struct { - // The last source table Delta version that was synced to the synced table. - // Note that this Delta version may only be partially synced to the synced - // table. Only populated if the table is still synced and available for - // serving. + // The last source table Delta version that was successfully synced to the + // synced table. The last source table Delta version that was synced to the + // synced table. Only populated if the table is still synced and available + // for serving. LastProcessedCommitVersion int64 `json:"last_processed_commit_version,omitempty"` - // The timestamp of the last time any data was synchronized from the source - // table to the synced table. Only populated if the table is still synced - // and available for serving. + // The end timestamp of the last time any data was synchronized from the + // source table to the synced table. Only populated if the table is still + // synced and available for serving. Timestamp string `json:"timestamp,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -536,6 +988,28 @@ func (s SyncedTablePipelineProgress) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type SyncedTablePosition struct { + DeltaTableSyncInfo *DeltaTableSyncInfo `json:"delta_table_sync_info,omitempty"` + // The end timestamp of the most recent successful synchronization. This is + // the time when the data is available in the synced table. + SyncEndTimestamp string `json:"sync_end_timestamp,omitempty"` + // The starting timestamp of the most recent successful synchronization from + // the source table to the destination (synced) table. Note this is the + // starting timestamp of the sync operation, not the end time. E.g., for a + // batch, this is the time when the sync operation started. + SyncStartTimestamp string `json:"sync_start_timestamp,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *SyncedTablePosition) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s SyncedTablePosition) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + // Detailed status of a synced table. Shown if the synced table is in the // PROVISIONING_PIPELINE_RESOURCES or the PROVISIONING_INITIAL_SNAPSHOT state. type SyncedTableProvisioningStatus struct { @@ -695,6 +1169,20 @@ type SyncedTableStatus struct { // Detailed status of a synced table. Shown if the synced table is in the // OFFLINE_FAILED or the SYNCED_PIPELINE_FAILED state. FailedStatus *SyncedTableFailedStatus `json:"failed_status,omitempty"` + // Summary of the last successful synchronization from source to + // destination. + // + // Will always be present if there has been a successful sync. Even if the + // most recent syncs have failed. + // + // Limitation: The only exception is if the synced table is doing a FULL + // REFRESH, then the last sync information will not be available until the + // full refresh is complete. This limitation will be addressed in a future + // version. + // + // This top-level field is a convenience for consumers who want easy access + // to last sync information without having to traverse detailed_status. + LastSync *SyncedTablePosition `json:"last_sync,omitempty"` // A text description of the current state of the synced table. Message string `json:"message,omitempty"` // ID of the associated pipeline. The pipeline ID may have been provided by @@ -723,12 +1211,12 @@ func (s SyncedTableStatus) MarshalJSON() ([]byte, error) { // Detailed status of a synced table. Shown if the synced table is in the // SYNCED_TRIGGERED_UPDATE or the SYNCED_NO_PENDING_UPDATE state. type SyncedTableTriggeredUpdateStatus struct { - // The last source table Delta version that was synced to the synced table. - // Note that this Delta version may not be completely synced to the synced - // table yet. + // The last source table Delta version that was successfully synced to the + // synced table. LastProcessedCommitVersion int64 `json:"last_processed_commit_version,omitempty"` - // The timestamp of the last time any data was synchronized from the source - // table to the synced table. + // The end timestamp of the last time any data was synchronized from the + // source table to the synced table. This is when the data is available in + // the synced table. Timestamp string `json:"timestamp,omitempty"` // Progress of the active data synchronization pipeline. TriggeredUpdateProgress *SyncedTablePipelineProgress `json:"triggered_update_progress,omitempty"` @@ -744,7 +1232,14 @@ func (s SyncedTableTriggeredUpdateStatus) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Update a Database Instance +type UpdateDatabaseCatalogRequest struct { + DatabaseCatalog DatabaseCatalog `json:"database_catalog"` + // The name of the catalog in UC. + Name string `json:"-" url:"-"` + // The list of fields to update. Setting this field is not yet supported. + UpdateMask string `json:"-" url:"update_mask"` +} + type UpdateDatabaseInstanceRequest struct { // A DatabaseInstance represents a logical Postgres instance, comprised of // both compute and storage. @@ -754,3 +1249,12 @@ type UpdateDatabaseInstanceRequest struct { // The list of fields to update. UpdateMask string `json:"-" url:"update_mask"` } + +type UpdateSyncedDatabaseTableRequest struct { + // Full three-part (catalog, schema, table) name of the table. + Name string `json:"-" url:"-"` + // Next field marker: 12 + SyncedTable SyncedDatabaseTable `json:"synced_table"` + // The list of fields to update. Setting this field is not yet supported. + UpdateMask string `json:"-" url:"update_mask"` +} diff --git a/service/files/impl.go b/service/files/impl.go index 936b620ba..5bf3c6a5b 100755 --- a/service/files/impl.go +++ b/service/files/impl.go @@ -20,24 +20,22 @@ type dbfsImpl struct { } func (a *dbfsImpl) AddBlock(ctx context.Context, request AddBlock) error { - var addBlockResponse AddBlockResponse path := "/api/2.0/dbfs/add-block" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &addBlockResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } func (a *dbfsImpl) Close(ctx context.Context, request Close) error { - var closeResponse CloseResponse path := "/api/2.0/dbfs/close" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &closeResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } @@ -53,13 +51,12 @@ func (a *dbfsImpl) Create(ctx context.Context, request Create) (*CreateResponse, } func (a *dbfsImpl) Delete(ctx context.Context, request Delete) error { - var deleteResponse DeleteResponse path := "/api/2.0/dbfs/delete" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } @@ -129,35 +126,32 @@ func (a *dbfsImpl) internalList(ctx context.Context, request ListDbfsRequest) (* } func (a *dbfsImpl) Mkdirs(ctx context.Context, request MkDirs) error { - var mkDirsResponse MkDirsResponse path := "/api/2.0/dbfs/mkdirs" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &mkDirsResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } func (a *dbfsImpl) Move(ctx context.Context, request Move) error { - var moveResponse MoveResponse path := "/api/2.0/dbfs/move" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &moveResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } func (a *dbfsImpl) Put(ctx context.Context, request Put) error { - var putResponse PutResponse path := "/api/2.0/dbfs/put" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &putResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } @@ -177,29 +171,26 @@ type filesImpl struct { } func (a *filesImpl) CreateDirectory(ctx context.Context, request CreateDirectoryRequest) error { - var createDirectoryResponse CreateDirectoryResponse path := fmt.Sprintf("/api/2.0/fs/directories%v", httpclient.EncodeMultiSegmentPathParameter(request.DirectoryPath)) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, nil, &createDirectoryResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, nil, nil) return err } func (a *filesImpl) Delete(ctx context.Context, request DeleteFileRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/fs/files%v", httpclient.EncodeMultiSegmentPathParameter(request.FilePath)) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } func (a *filesImpl) DeleteDirectory(ctx context.Context, request DeleteDirectoryRequest) error { - var deleteDirectoryResponse DeleteDirectoryResponse path := fmt.Sprintf("/api/2.0/fs/directories%v", httpclient.EncodeMultiSegmentPathParameter(request.DirectoryPath)) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteDirectoryResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -214,11 +205,10 @@ func (a *filesImpl) Download(ctx context.Context, request DownloadRequest) (*Dow } func (a *filesImpl) GetDirectoryMetadata(ctx context.Context, request GetDirectoryMetadataRequest) error { - var getDirectoryMetadataResponse GetDirectoryMetadataResponse path := fmt.Sprintf("/api/2.0/fs/directories%v", httpclient.EncodeMultiSegmentPathParameter(request.DirectoryPath)) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodHead, path, headers, queryParams, request, &getDirectoryMetadataResponse) + err := a.client.Do(ctx, http.MethodHead, path, headers, queryParams, request, nil) return err } @@ -275,7 +265,6 @@ func (a *filesImpl) internalListDirectoryContents(ctx context.Context, request L } func (a *filesImpl) Upload(ctx context.Context, request UploadRequest) error { - var uploadResponse UploadResponse path := fmt.Sprintf("/api/2.0/fs/files%v", httpclient.EncodeMultiSegmentPathParameter(request.FilePath)) queryParams := make(map[string]any) if request.Overwrite != false || slices.Contains(request.ForceSendFields, "Overwrite") { @@ -283,6 +272,6 @@ func (a *filesImpl) Upload(ctx context.Context, request UploadRequest) error { } headers := make(map[string]string) headers["Content-Type"] = "application/octet-stream" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request.Contents, &uploadResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request.Contents, nil) return err } diff --git a/service/files/model.go b/service/files/model.go index 3c406ade5..b8c35f0ec 100755 --- a/service/files/model.go +++ b/service/files/model.go @@ -44,7 +44,6 @@ func (s Create) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Create a directory type CreateDirectoryRequest struct { // The absolute path of a directory. DirectoryPath string `json:"-" url:"-"` @@ -88,7 +87,6 @@ func (s Delete) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Delete a directory type DeleteDirectoryRequest struct { // The absolute path of a directory. DirectoryPath string `json:"-" url:"-"` @@ -97,7 +95,6 @@ type DeleteDirectoryRequest struct { type DeleteDirectoryResponse struct { } -// Delete a file type DeleteFileRequest struct { // The absolute path of the file. FilePath string `json:"-" url:"-"` @@ -130,7 +127,6 @@ func (s DirectoryEntry) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Download a file type DownloadRequest struct { // The absolute path of the file. FilePath string `json:"-" url:"-"` @@ -178,7 +174,6 @@ func (s FileInfo) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get directory metadata type GetDirectoryMetadataRequest struct { // The absolute path of a directory. DirectoryPath string `json:"-" url:"-"` @@ -187,7 +182,6 @@ type GetDirectoryMetadataRequest struct { type GetDirectoryMetadataResponse struct { } -// Get file metadata type GetMetadataRequest struct { // The absolute path of the file. FilePath string `json:"-" url:"-"` @@ -212,21 +206,18 @@ func (s GetMetadataResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get the information of a file or directory type GetStatusRequest struct { // The path of the file or directory. The path should be the absolute DBFS // path. Path string `json:"-" url:"path"` } -// List directory contents or file details type ListDbfsRequest struct { // The path of the file or directory. The path should be the absolute DBFS // path. Path string `json:"-" url:"path"` } -// List directory contents type ListDirectoryContentsRequest struct { // The absolute path of a directory. DirectoryPath string `json:"-" url:"-"` @@ -327,7 +318,6 @@ func (s Put) MarshalJSON() ([]byte, error) { type PutResponse struct { } -// Get the contents of a file type ReadDbfsRequest struct { // The number of bytes to read starting from the offset. This has a limit of // 1 MB, and a default value of 0.5 MB. @@ -367,7 +357,6 @@ func (s ReadResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Upload a file type UploadRequest struct { Contents io.ReadCloser `json:"-"` // The absolute path of the file. diff --git a/service/iam/impl.go b/service/iam/impl.go index 812150b64..9565b03a9 100755 --- a/service/iam/impl.go +++ b/service/iam/impl.go @@ -116,11 +116,10 @@ func (a *accountGroupsImpl) Create(ctx context.Context, request Group) (*Group, } func (a *accountGroupsImpl) Delete(ctx context.Context, request DeleteAccountGroupRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/Groups/%v", a.client.ConfiguredAccountID(), request.Id) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -186,22 +185,20 @@ func (a *accountGroupsImpl) internalList(ctx context.Context, request ListAccoun } func (a *accountGroupsImpl) Patch(ctx context.Context, request PartialUpdate) error { - var patchResponse PatchResponse path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/Groups/%v", a.client.ConfiguredAccountID(), request.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &patchResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, nil) return err } func (a *accountGroupsImpl) Update(ctx context.Context, request Group) error { - var updateResponse UpdateResponse path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/Groups/%v", a.client.ConfiguredAccountID(), request.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &updateResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, nil) return err } @@ -222,11 +219,10 @@ func (a *accountServicePrincipalsImpl) Create(ctx context.Context, request Servi } func (a *accountServicePrincipalsImpl) Delete(ctx context.Context, request DeleteAccountServicePrincipalRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/ServicePrincipals/%v", a.client.ConfiguredAccountID(), request.Id) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -292,22 +288,20 @@ func (a *accountServicePrincipalsImpl) internalList(ctx context.Context, request } func (a *accountServicePrincipalsImpl) Patch(ctx context.Context, request PartialUpdate) error { - var patchResponse PatchResponse path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/ServicePrincipals/%v", a.client.ConfiguredAccountID(), request.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &patchResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, nil) return err } func (a *accountServicePrincipalsImpl) Update(ctx context.Context, request ServicePrincipal) error { - var updateResponse UpdateResponse path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/ServicePrincipals/%v", a.client.ConfiguredAccountID(), request.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &updateResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, nil) return err } @@ -328,11 +322,10 @@ func (a *accountUsersImpl) Create(ctx context.Context, request User) (*User, err } func (a *accountUsersImpl) Delete(ctx context.Context, request DeleteAccountUserRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/Users/%v", a.client.ConfiguredAccountID(), request.Id) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -398,22 +391,20 @@ func (a *accountUsersImpl) internalList(ctx context.Context, request ListAccount } func (a *accountUsersImpl) Patch(ctx context.Context, request PartialUpdate) error { - var patchResponse PatchResponse path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/Users/%v", a.client.ConfiguredAccountID(), request.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &patchResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, nil) return err } func (a *accountUsersImpl) Update(ctx context.Context, request User) error { - var updateResponse UpdateResponse path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/Users/%v", a.client.ConfiguredAccountID(), request.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &updateResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, nil) return err } @@ -449,11 +440,10 @@ func (a *groupsImpl) Create(ctx context.Context, request Group) (*Group, error) } func (a *groupsImpl) Delete(ctx context.Context, request DeleteGroupRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/preview/scim/v2/Groups/%v", request.Id) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -519,22 +509,20 @@ func (a *groupsImpl) internalList(ctx context.Context, request ListGroupsRequest } func (a *groupsImpl) Patch(ctx context.Context, request PartialUpdate) error { - var patchResponse PatchResponse path := fmt.Sprintf("/api/2.0/preview/scim/v2/Groups/%v", request.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &patchResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, nil) return err } func (a *groupsImpl) Update(ctx context.Context, request Group) error { - var updateResponse UpdateResponse path := fmt.Sprintf("/api/2.0/preview/scim/v2/Groups/%v", request.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &updateResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, nil) return err } @@ -618,11 +606,10 @@ func (a *servicePrincipalsImpl) Create(ctx context.Context, request ServicePrinc } func (a *servicePrincipalsImpl) Delete(ctx context.Context, request DeleteServicePrincipalRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/preview/scim/v2/ServicePrincipals/%v", request.Id) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -688,22 +675,20 @@ func (a *servicePrincipalsImpl) internalList(ctx context.Context, request ListSe } func (a *servicePrincipalsImpl) Patch(ctx context.Context, request PartialUpdate) error { - var patchResponse PatchResponse path := fmt.Sprintf("/api/2.0/preview/scim/v2/ServicePrincipals/%v", request.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &patchResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, nil) return err } func (a *servicePrincipalsImpl) Update(ctx context.Context, request ServicePrincipal) error { - var updateResponse UpdateResponse path := fmt.Sprintf("/api/2.0/preview/scim/v2/ServicePrincipals/%v", request.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &updateResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, nil) return err } @@ -724,11 +709,10 @@ func (a *usersImpl) Create(ctx context.Context, request User) (*User, error) { } func (a *usersImpl) Delete(ctx context.Context, request DeleteUserRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/preview/scim/v2/Users/%v", request.Id) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -814,12 +798,11 @@ func (a *usersImpl) internalList(ctx context.Context, request ListUsersRequest) } func (a *usersImpl) Patch(ctx context.Context, request PartialUpdate) error { - var patchResponse PatchResponse path := fmt.Sprintf("/api/2.0/preview/scim/v2/Users/%v", request.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &patchResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, nil) return err } @@ -835,12 +818,11 @@ func (a *usersImpl) SetPermissions(ctx context.Context, request PasswordPermissi } func (a *usersImpl) Update(ctx context.Context, request User) error { - var updateResponse UpdateResponse path := fmt.Sprintf("/api/2.0/preview/scim/v2/Users/%v", request.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &updateResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, nil) return err } @@ -861,12 +843,11 @@ type workspaceAssignmentImpl struct { } func (a *workspaceAssignmentImpl) Delete(ctx context.Context, request DeleteWorkspaceAssignmentRequest) error { - var deleteWorkspacePermissionAssignmentResponse DeleteWorkspacePermissionAssignmentResponse path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v/permissionassignments/principals/%v", a.client.ConfiguredAccountID(), request.WorkspaceId, request.PrincipalId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteWorkspacePermissionAssignmentResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } diff --git a/service/iam/model.go b/service/iam/model.go index 97fb292cd..919a1292f 100755 --- a/service/iam/model.go +++ b/service/iam/model.go @@ -69,7 +69,6 @@ func (s Actor) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Check access policy to a resource type CheckPolicyRequest struct { Actor Actor `json:"-" url:"actor"` @@ -129,25 +128,21 @@ type ConsistencyToken struct { Value string `json:"value"` } -// Delete a group. type DeleteAccountGroupRequest struct { // Unique ID for a group in the Databricks account. Id string `json:"-" url:"-"` } -// Delete a service principal. type DeleteAccountServicePrincipalRequest struct { // Unique ID for a service principal in the Databricks account. Id string `json:"-" url:"-"` } -// Delete a user. type DeleteAccountUserRequest struct { // Unique ID for a user in the Databricks account. Id string `json:"-" url:"-"` } -// Delete a group. type DeleteGroupRequest struct { // Unique ID for a group in the Databricks workspace. Id string `json:"-" url:"-"` @@ -156,19 +151,16 @@ type DeleteGroupRequest struct { type DeleteResponse struct { } -// Delete a service principal. type DeleteServicePrincipalRequest struct { // Unique ID for a service principal in the Databricks workspace. Id string `json:"-" url:"-"` } -// Delete a user. type DeleteUserRequest struct { // Unique ID for a user in the Databricks workspace. Id string `json:"-" url:"-"` } -// Delete permissions assignment type DeleteWorkspaceAssignmentRequest struct { // The ID of the user, service principal, or group. PrincipalId int64 `json:"-" url:"-"` @@ -179,19 +171,16 @@ type DeleteWorkspaceAssignmentRequest struct { type DeleteWorkspacePermissionAssignmentResponse struct { } -// Get group details. type GetAccountGroupRequest struct { // Unique ID for a group in the Databricks account. Id string `json:"-" url:"-"` } -// Get service principal details. type GetAccountServicePrincipalRequest struct { // Unique ID for a service principal in the Databricks account. Id string `json:"-" url:"-"` } -// Get user details. type GetAccountUserRequest struct { // Comma-separated list of attributes to return in response. Attributes string `json:"-" url:"attributes,omitempty"` @@ -228,7 +217,6 @@ func (s GetAccountUserRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get assignable roles for a resource type GetAssignableRolesForResourceRequest struct { // The resource name for which assignable roles will be listed. // @@ -244,7 +232,6 @@ type GetAssignableRolesForResourceResponse struct { Roles []Role `json:"roles,omitempty"` } -// Get group details. type GetGroupRequest struct { // Unique ID for a group in the Databricks workspace. Id string `json:"-" url:"-"` @@ -255,7 +242,6 @@ type GetPasswordPermissionLevelsResponse struct { PermissionLevels []PasswordPermissionsDescription `json:"permission_levels,omitempty"` } -// Get object permission levels type GetPermissionLevelsRequest struct { RequestObjectId string `json:"-" url:"-"` // The type of the request object. Can be one of the following: alerts, @@ -271,7 +257,6 @@ type GetPermissionLevelsResponse struct { PermissionLevels []PermissionsDescription `json:"permission_levels,omitempty"` } -// Get object permissions type GetPermissionRequest struct { // The id of the request object. RequestObjectId string `json:"-" url:"-"` @@ -283,7 +268,6 @@ type GetPermissionRequest struct { RequestObjectType string `json:"-" url:"-"` } -// Get a rule set type GetRuleSetRequest struct { // Etag used for versioning. The response is at least as fresh as the eTag // provided. Etag is used for optimistic concurrency control as a way to @@ -311,7 +295,6 @@ type GetRuleSetRequest struct { Name string `json:"-" url:"name"` } -// Get service principal details. type GetServicePrincipalRequest struct { // Unique ID for a service principal in the Databricks workspace. Id string `json:"-" url:"-"` @@ -354,7 +337,6 @@ func (f *GetSortOrder) Type() string { return "GetSortOrder" } -// Get user details. type GetUserRequest struct { // Comma-separated list of attributes to return in response. Attributes string `json:"-" url:"attributes,omitempty"` @@ -391,7 +373,6 @@ func (s GetUserRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List workspace permissions type GetWorkspaceAssignmentRequest struct { // The workspace ID. WorkspaceId int64 `json:"-" url:"-"` @@ -476,7 +457,6 @@ func (f *GroupSchema) Type() string { return "GroupSchema" } -// List group details. type ListAccountGroupsRequest struct { // Comma-separated list of attributes to return in response. Attributes string `json:"-" url:"attributes,omitempty"` @@ -510,7 +490,6 @@ func (s ListAccountGroupsRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List service principals. type ListAccountServicePrincipalsRequest struct { // Comma-separated list of attributes to return in response. Attributes string `json:"-" url:"attributes,omitempty"` @@ -544,7 +523,6 @@ func (s ListAccountServicePrincipalsRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List users. type ListAccountUsersRequest struct { // Comma-separated list of attributes to return in response. Attributes string `json:"-" url:"attributes,omitempty"` @@ -579,7 +557,6 @@ func (s ListAccountUsersRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List group details. type ListGroupsRequest struct { // Comma-separated list of attributes to return in response. Attributes string `json:"-" url:"attributes,omitempty"` @@ -695,7 +672,6 @@ func (s ListServicePrincipalResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List service principals. type ListServicePrincipalsRequest struct { // Comma-separated list of attributes to return in response. Attributes string `json:"-" url:"attributes,omitempty"` @@ -766,7 +742,6 @@ func (f *ListSortOrder) Type() string { return "ListSortOrder" } -// List users. type ListUsersRequest struct { // Comma-separated list of attributes to return in response. Attributes string `json:"-" url:"attributes,omitempty"` @@ -825,7 +800,6 @@ func (s ListUsersResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get permission assignments type ListWorkspaceAssignmentRequest struct { // The workspace ID for the account. WorkspaceId int64 `json:"-" url:"-"` diff --git a/service/jobs/impl.go b/service/jobs/impl.go index c3f28e947..6910f21cd 100755 --- a/service/jobs/impl.go +++ b/service/jobs/impl.go @@ -18,22 +18,20 @@ type jobsImpl struct { } func (a *jobsImpl) CancelAllRuns(ctx context.Context, request CancelAllRuns) error { - var cancelAllRunsResponse CancelAllRunsResponse path := "/api/2.2/jobs/runs/cancel-all" queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &cancelAllRunsResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } func (a *jobsImpl) CancelRun(ctx context.Context, request CancelRun) error { - var cancelRunResponse CancelRunResponse path := "/api/2.2/jobs/runs/cancel" queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &cancelRunResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } @@ -49,22 +47,20 @@ func (a *jobsImpl) Create(ctx context.Context, request CreateJob) (*CreateRespon } func (a *jobsImpl) Delete(ctx context.Context, request DeleteJob) error { - var deleteResponse DeleteResponse path := "/api/2.2/jobs/delete" queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } func (a *jobsImpl) DeleteRun(ctx context.Context, request DeleteRun) error { - var deleteRunResponse DeleteRunResponse path := "/api/2.2/jobs/runs/delete" queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &deleteRunResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } @@ -222,12 +218,11 @@ func (a *jobsImpl) RepairRun(ctx context.Context, request RepairRun) (*RepairRun } func (a *jobsImpl) Reset(ctx context.Context, request ResetJob) error { - var resetResponse ResetResponse path := "/api/2.2/jobs/reset" queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &resetResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } @@ -265,12 +260,11 @@ func (a *jobsImpl) Submit(ctx context.Context, request SubmitRun) (*SubmitRunRes } func (a *jobsImpl) Update(ctx context.Context, request UpdateJob) error { - var updateResponse UpdateResponse path := "/api/2.2/jobs/update" queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &updateResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } diff --git a/service/jobs/model.go b/service/jobs/model.go index 5430b2905..93d2abdb4 100755 --- a/service/jobs/model.go +++ b/service/jobs/model.go @@ -652,6 +652,9 @@ type Continuous struct { // Indicate whether the continuous execution of the job is paused or not. // Defaults to UNPAUSED. PauseStatus PauseStatus `json:"pause_status,omitempty"` + // Indicate whether the continuous job is applying task level retries or + // not. Defaults to NEVER. + TaskRetryMode TaskRetryMode `json:"task_retry_mode,omitempty"` } type CreateJob struct { @@ -1205,7 +1208,6 @@ type ExportRunOutput struct { Views []ViewItem `json:"views,omitempty"` } -// Export and retrieve a job run type ExportRunRequest struct { // The canonical identifier for the run. This field is required. RunId int64 `json:"-" url:"run_id"` @@ -1410,7 +1412,6 @@ func (s GenAiComputeTask) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get job permission levels type GetJobPermissionLevelsRequest struct { // The job for which to get or manage permissions. JobId string `json:"-" url:"-"` @@ -1421,13 +1422,11 @@ type GetJobPermissionLevelsResponse struct { PermissionLevels []JobPermissionsDescription `json:"permission_levels,omitempty"` } -// Get job permissions type GetJobPermissionsRequest struct { // The job for which to get or manage permissions. JobId string `json:"-" url:"-"` } -// Get a single job type GetJobRequest struct { // The canonical identifier of the job to retrieve information about. This // field is required. @@ -1447,7 +1446,6 @@ func (s GetJobRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get job policy compliance type GetPolicyComplianceRequest struct { // The ID of the job whose compliance status you are requesting. JobId int64 `json:"-" url:"job_id"` @@ -1477,13 +1475,11 @@ func (s GetPolicyComplianceResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get the output for a single run type GetRunOutputRequest struct { // The canonical identifier for the run. RunId int64 `json:"-" url:"run_id"` } -// Get a single job run type GetRunRequest struct { // Whether to include the repair history in the response. IncludeHistory bool `json:"-" url:"include_history,omitempty"` @@ -2423,7 +2419,6 @@ func (s ListJobComplianceForPolicyResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List job policy compliance type ListJobComplianceRequest struct { // Use this field to specify the maximum number of results to be returned by // the server. The server may further constrain the maximum number of @@ -2446,7 +2441,6 @@ func (s ListJobComplianceRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List jobs type ListJobsRequest struct { // Whether to include task and cluster details in the response. Note that // only the first 100 elements will be shown. Use :method:jobs/get to @@ -2501,7 +2495,6 @@ func (s ListJobsResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List job runs type ListRunsRequest struct { // If active_only is `true`, only active runs are included in the results; // otherwise, lists both active and completed runs. An active run is a run @@ -2578,6 +2571,77 @@ func (s ListRunsResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type ModelTriggerConfiguration struct { + // Aliases of the model versions to monitor. Can only be used in conjunction + // with condition MODEL_ALIAS_SET. + Aliases []string `json:"aliases,omitempty"` + // The condition based on which to trigger a job run. + Condition ModelTriggerConfigurationCondition `json:"condition"` + // If set, the trigger starts a run only after the specified amount of time + // has passed since the last time the trigger fired. The minimum allowed + // value is 60 seconds. + MinTimeBetweenTriggersSeconds int `json:"min_time_between_triggers_seconds,omitempty"` + // Name of the securable to monitor ("mycatalog.myschema.mymodel" in the + // case of model-level triggers, "mycatalog.myschema" in the case of + // schema-level triggers) or empty in the case of metastore-level triggers. + SecurableName string `json:"securable_name,omitempty"` + // If set, the trigger starts a run only after no model updates have + // occurred for the specified time and can be used to wait for a series of + // model updates before triggering a run. The minimum allowed value is 60 + // seconds. + WaitAfterLastChangeSeconds int `json:"wait_after_last_change_seconds,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ModelTriggerConfiguration) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ModelTriggerConfiguration) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ModelTriggerConfigurationCondition string + +const ModelTriggerConfigurationConditionModelAliasSet ModelTriggerConfigurationCondition = `MODEL_ALIAS_SET` + +const ModelTriggerConfigurationConditionModelCreated ModelTriggerConfigurationCondition = `MODEL_CREATED` + +const ModelTriggerConfigurationConditionModelVersionReady ModelTriggerConfigurationCondition = `MODEL_VERSION_READY` + +// String representation for [fmt.Print] +func (f *ModelTriggerConfigurationCondition) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *ModelTriggerConfigurationCondition) Set(v string) error { + switch v { + case `MODEL_ALIAS_SET`, `MODEL_CREATED`, `MODEL_VERSION_READY`: + *f = ModelTriggerConfigurationCondition(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "MODEL_ALIAS_SET", "MODEL_CREATED", "MODEL_VERSION_READY"`, v) + } +} + +// Values returns all possible values for ModelTriggerConfigurationCondition. +// +// There is no guarantee on the order of the values in the slice. +func (f *ModelTriggerConfigurationCondition) Values() []ModelTriggerConfigurationCondition { + return []ModelTriggerConfigurationCondition{ + ModelTriggerConfigurationConditionModelAliasSet, + ModelTriggerConfigurationConditionModelCreated, + ModelTriggerConfigurationConditionModelVersionReady, + } +} + +// Type always returns ModelTriggerConfigurationCondition to satisfy [pflag.Value] interface +func (f *ModelTriggerConfigurationCondition) Type() string { + return "ModelTriggerConfigurationCondition" +} + type NotebookOutput struct { // The value passed to // [dbutils.notebook.exit()](/notebooks/notebook-workflows.html#notebook-workflows-exit). @@ -5497,6 +5561,48 @@ func (s TaskNotificationSettings) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +// task retry mode of the continuous job * NEVER: The failed task will not be +// retried. * ON_FAILURE: Retry a failed task if at least one other task in the +// job is still running its first attempt. When this condition is no longer met +// or the retry limit is reached, the job run is cancelled and a new run is +// started. +type TaskRetryMode string + +const TaskRetryModeNever TaskRetryMode = `NEVER` + +const TaskRetryModeOnFailure TaskRetryMode = `ON_FAILURE` + +// String representation for [fmt.Print] +func (f *TaskRetryMode) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *TaskRetryMode) Set(v string) error { + switch v { + case `NEVER`, `ON_FAILURE`: + *f = TaskRetryMode(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "NEVER", "ON_FAILURE"`, v) + } +} + +// Values returns all possible values for TaskRetryMode. +// +// There is no guarantee on the order of the values in the slice. +func (f *TaskRetryMode) Values() []TaskRetryMode { + return []TaskRetryMode{ + TaskRetryModeNever, + TaskRetryModeOnFailure, + } +} + +// Type always returns TaskRetryMode to satisfy [pflag.Value] interface +func (f *TaskRetryMode) Type() string { + return "TaskRetryMode" +} + // The code indicates why the run was terminated. Additional codes might be // introduced in future releases. * `SUCCESS`: The run was completed // successfully. * `SUCCESS_WITH_FAILURES`: The run was completed successfully @@ -5848,6 +5954,8 @@ func (s TriggerInfo) MarshalJSON() ([]byte, error) { type TriggerSettings struct { // File arrival trigger settings. FileArrival *FileArrivalTriggerConfiguration `json:"file_arrival,omitempty"` + + Model *ModelTriggerConfiguration `json:"model,omitempty"` // Whether this trigger is paused or not. PauseStatus PauseStatus `json:"pause_status,omitempty"` // Periodic trigger settings. diff --git a/service/marketplace/impl.go b/service/marketplace/impl.go index 805daa16c..9cbc27cb6 100755 --- a/service/marketplace/impl.go +++ b/service/marketplace/impl.go @@ -124,12 +124,11 @@ func (a *consumerInstallationsImpl) Create(ctx context.Context, request CreateIn } func (a *consumerInstallationsImpl) Delete(ctx context.Context, request DeleteInstallationRequest) error { - var deleteInstallationResponse DeleteInstallationResponse path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v/installations/%v", request.ListingId, request.InstallationId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteInstallationResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -491,12 +490,11 @@ func (a *providerExchangeFiltersImpl) Create(ctx context.Context, request Create } func (a *providerExchangeFiltersImpl) Delete(ctx context.Context, request DeleteExchangeFilterRequest) error { - var deleteExchangeFilterResponse DeleteExchangeFilterResponse path := fmt.Sprintf("/api/2.0/marketplace-exchange/filters/%v", request.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteExchangeFilterResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -580,22 +578,20 @@ func (a *providerExchangesImpl) Create(ctx context.Context, request CreateExchan } func (a *providerExchangesImpl) Delete(ctx context.Context, request DeleteExchangeRequest) error { - var deleteExchangeResponse DeleteExchangeResponse path := fmt.Sprintf("/api/2.0/marketplace-exchange/exchanges/%v", request.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteExchangeResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } func (a *providerExchangesImpl) DeleteListingFromExchange(ctx context.Context, request RemoveExchangeForListingRequest) error { - var removeExchangeForListingResponse RemoveExchangeForListingResponse path := fmt.Sprintf("/api/2.0/marketplace-exchange/exchanges-for-listing/%v", request.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &removeExchangeForListingResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -760,12 +756,11 @@ func (a *providerFilesImpl) Create(ctx context.Context, request CreateFileReques } func (a *providerFilesImpl) Delete(ctx context.Context, request DeleteFileRequest) error { - var deleteFileResponse DeleteFileResponse path := fmt.Sprintf("/api/2.0/marketplace-provider/files/%v", request.FileId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteFileResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -837,12 +832,11 @@ func (a *providerListingsImpl) Create(ctx context.Context, request CreateListing } func (a *providerListingsImpl) Delete(ctx context.Context, request DeleteListingRequest) error { - var deleteListingResponse DeleteListingResponse path := fmt.Sprintf("/api/2.0/marketplace-provider/listings/%v", request.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteListingResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -1030,12 +1024,11 @@ func (a *providerProvidersImpl) Create(ctx context.Context, request CreateProvid } func (a *providerProvidersImpl) Delete(ctx context.Context, request DeleteProviderRequest) error { - var deleteProviderResponse DeleteProviderResponse path := fmt.Sprintf("/api/2.0/marketplace-provider/providers/%v", request.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteProviderResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } diff --git a/service/marketplace/model.go b/service/marketplace/model.go index 34c468304..e1029c7ed 100755 --- a/service/marketplace/model.go +++ b/service/marketplace/model.go @@ -70,7 +70,6 @@ func (f *AssetType) Type() string { return "AssetType" } -// Get one batch of listings. One may specify up to 50 IDs per request. type BatchGetListingsRequest struct { Ids []string `json:"-" url:"ids,omitempty"` } @@ -79,7 +78,6 @@ type BatchGetListingsResponse struct { Listings []Listing `json:"listings,omitempty"` } -// Get one batch of providers. One may specify up to 50 IDs per request. type BatchGetProvidersRequest struct { Ids []string `json:"-" url:"ids,omitempty"` } @@ -489,7 +487,6 @@ type DataRefreshInfo struct { Unit DataRefresh `json:"unit"` } -// Delete an exchange filter type DeleteExchangeFilterRequest struct { Id string `json:"-" url:"-"` } @@ -497,7 +494,6 @@ type DeleteExchangeFilterRequest struct { type DeleteExchangeFilterResponse struct { } -// Delete an exchange type DeleteExchangeRequest struct { Id string `json:"-" url:"-"` } @@ -505,7 +501,6 @@ type DeleteExchangeRequest struct { type DeleteExchangeResponse struct { } -// Delete a file type DeleteFileRequest struct { FileId string `json:"-" url:"-"` } @@ -513,7 +508,6 @@ type DeleteFileRequest struct { type DeleteFileResponse struct { } -// Uninstall from a listing type DeleteInstallationRequest struct { InstallationId string `json:"-" url:"-"` @@ -523,7 +517,6 @@ type DeleteInstallationRequest struct { type DeleteInstallationResponse struct { } -// Delete a listing type DeleteListingRequest struct { Id string `json:"-" url:"-"` } @@ -531,7 +524,6 @@ type DeleteListingRequest struct { type DeleteListingResponse struct { } -// Delete provider type DeleteProviderRequest struct { Id string `json:"-" url:"-"` } @@ -865,7 +857,6 @@ func (f *FulfillmentType) Type() string { return "FulfillmentType" } -// Get an exchange type GetExchangeRequest struct { Id string `json:"-" url:"-"` } @@ -874,7 +865,6 @@ type GetExchangeResponse struct { Exchange *Exchange `json:"exchange,omitempty"` } -// Get a file type GetFileRequest struct { FileId string `json:"-" url:"-"` } @@ -898,7 +888,6 @@ func (s GetLatestVersionProviderAnalyticsDashboardResponse) MarshalJSON() ([]byt return marshal.Marshal(s) } -// Get listing content metadata type GetListingContentMetadataRequest struct { ListingId string `json:"-" url:"-"` @@ -933,7 +922,6 @@ func (s GetListingContentMetadataResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get listing type GetListingRequest struct { Id string `json:"-" url:"-"` } @@ -942,7 +930,6 @@ type GetListingResponse struct { Listing *Listing `json:"listing,omitempty"` } -// List listings type GetListingsRequest struct { PageSize int `json:"-" url:"page_size,omitempty"` @@ -975,7 +962,6 @@ func (s GetListingsResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get the personalization request for a listing type GetPersonalizationRequestRequest struct { ListingId string `json:"-" url:"-"` } @@ -984,7 +970,6 @@ type GetPersonalizationRequestResponse struct { PersonalizationRequests []PersonalizationRequest `json:"personalization_requests,omitempty"` } -// Get a provider type GetProviderRequest struct { Id string `json:"-" url:"-"` } @@ -1072,7 +1057,6 @@ func (f *InstallationStatus) Type() string { return "InstallationStatus" } -// List all installations type ListAllInstallationsRequest struct { PageSize int `json:"-" url:"page_size,omitempty"` @@ -1105,7 +1089,6 @@ func (s ListAllInstallationsResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List all personalization requests type ListAllPersonalizationRequestsRequest struct { PageSize int `json:"-" url:"page_size,omitempty"` @@ -1138,7 +1121,6 @@ func (s ListAllPersonalizationRequestsResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List exchange filters type ListExchangeFiltersRequest struct { ExchangeId string `json:"-" url:"exchange_id"` @@ -1173,7 +1155,6 @@ func (s ListExchangeFiltersResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List exchanges for listing type ListExchangesForListingRequest struct { ListingId string `json:"-" url:"listing_id"` @@ -1208,7 +1189,6 @@ func (s ListExchangesForListingResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List exchanges type ListExchangesRequest struct { PageSize int `json:"-" url:"page_size,omitempty"` @@ -1241,7 +1221,6 @@ func (s ListExchangesResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List files type ListFilesRequest struct { FileParent FileParent `json:"-" url:"file_parent"` @@ -1276,7 +1255,6 @@ func (s ListFilesResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List all listing fulfillments type ListFulfillmentsRequest struct { ListingId string `json:"-" url:"-"` @@ -1311,7 +1289,6 @@ func (s ListFulfillmentsResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List installations for a listing type ListInstallationsRequest struct { ListingId string `json:"-" url:"-"` @@ -1346,7 +1323,6 @@ func (s ListInstallationsResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List listings for exchange type ListListingsForExchangeRequest struct { ExchangeId string `json:"-" url:"exchange_id"` @@ -1381,7 +1357,6 @@ func (s ListListingsForExchangeResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List listings type ListListingsRequest struct { // Matches any of the following asset types Assets []AssetType `json:"-" url:"assets,omitempty"` @@ -1448,7 +1423,6 @@ func (s ListProviderAnalyticsDashboardResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List providers type ListProvidersRequest struct { IsFeatured bool `json:"-" url:"is_featured,omitempty"` @@ -1980,7 +1954,6 @@ func (s RegionInfo) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Remove an exchange for listing type RemoveExchangeForListingRequest struct { Id string `json:"-" url:"-"` } @@ -2002,7 +1975,6 @@ type RepoInstallation struct { RepoPath string `json:"repo_path"` } -// Search listings type SearchListingsRequest struct { // Matches any of the following asset types Assets []AssetType `json:"-" url:"assets,omitempty"` diff --git a/service/ml/api.go b/service/ml/api.go index 607663a5a..bcd3c9b58 100755 --- a/service/ml/api.go +++ b/service/ml/api.go @@ -1,6 +1,6 @@ // Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. -// These APIs allow you to manage Experiments, Feature Store, Forecasting, Model Registry, etc. +// These APIs allow you to manage Experiments, Feature Store, Forecasting, Materialized Features, Model Registry, etc. package ml import ( @@ -95,6 +95,9 @@ type ExperimentsInterface interface { // Get a logged model. GetLoggedModelByModelId(ctx context.Context, modelId string) (*GetLoggedModelResponse, error) + // Batch endpoint for getting logged models from a list of model IDs + GetLoggedModels(ctx context.Context, request GetLoggedModelsRequest) (*GetLoggedModelsRequestResponse, error) + // Gets the permission levels that a user can have on an object. GetPermissionLevels(ctx context.Context, request GetExperimentPermissionLevelsRequest) (*GetExperimentPermissionLevelsResponse, error) @@ -564,6 +567,94 @@ func (a *ForecastingAPI) GetExperimentByExperimentId(ctx context.Context, experi }) } +type MaterializedFeaturesInterface interface { + + // Creates a FeatureTag. + CreateFeatureTag(ctx context.Context, request CreateFeatureTagRequest) (*FeatureTag, error) + + // Deletes a FeatureTag. + DeleteFeatureTag(ctx context.Context, request DeleteFeatureTagRequest) error + + // Deletes a FeatureTag. + DeleteFeatureTagByTableNameAndFeatureNameAndKey(ctx context.Context, tableName string, featureName string, key string) error + + // Get Feature Lineage. + GetFeatureLineage(ctx context.Context, request GetFeatureLineageRequest) (*FeatureLineage, error) + + // Get Feature Lineage. + GetFeatureLineageByTableNameAndFeatureName(ctx context.Context, tableName string, featureName string) (*FeatureLineage, error) + + // Gets a FeatureTag. + GetFeatureTag(ctx context.Context, request GetFeatureTagRequest) (*FeatureTag, error) + + // Gets a FeatureTag. + GetFeatureTagByTableNameAndFeatureNameAndKey(ctx context.Context, tableName string, featureName string, key string) (*FeatureTag, error) + + // Lists FeatureTags. + // + // This method is generated by Databricks SDK Code Generator. + ListFeatureTags(ctx context.Context, request ListFeatureTagsRequest) listing.Iterator[FeatureTag] + + // Lists FeatureTags. + // + // This method is generated by Databricks SDK Code Generator. + ListFeatureTagsAll(ctx context.Context, request ListFeatureTagsRequest) ([]FeatureTag, error) + + // Lists FeatureTags. + ListFeatureTagsByTableNameAndFeatureName(ctx context.Context, tableName string, featureName string) (*ListFeatureTagsResponse, error) + + // Updates a FeatureTag. + UpdateFeatureTag(ctx context.Context, request UpdateFeatureTagRequest) (*FeatureTag, error) +} + +func NewMaterializedFeatures(client *client.DatabricksClient) *MaterializedFeaturesAPI { + return &MaterializedFeaturesAPI{ + materializedFeaturesImpl: materializedFeaturesImpl{ + client: client, + }, + } +} + +// Materialized Features are columns in tables and views that can be directly +// used as features to train and serve ML models. +type MaterializedFeaturesAPI struct { + materializedFeaturesImpl +} + +// Deletes a FeatureTag. +func (a *MaterializedFeaturesAPI) DeleteFeatureTagByTableNameAndFeatureNameAndKey(ctx context.Context, tableName string, featureName string, key string) error { + return a.materializedFeaturesImpl.DeleteFeatureTag(ctx, DeleteFeatureTagRequest{ + TableName: tableName, + FeatureName: featureName, + Key: key, + }) +} + +// Get Feature Lineage. +func (a *MaterializedFeaturesAPI) GetFeatureLineageByTableNameAndFeatureName(ctx context.Context, tableName string, featureName string) (*FeatureLineage, error) { + return a.materializedFeaturesImpl.GetFeatureLineage(ctx, GetFeatureLineageRequest{ + TableName: tableName, + FeatureName: featureName, + }) +} + +// Gets a FeatureTag. +func (a *MaterializedFeaturesAPI) GetFeatureTagByTableNameAndFeatureNameAndKey(ctx context.Context, tableName string, featureName string, key string) (*FeatureTag, error) { + return a.materializedFeaturesImpl.GetFeatureTag(ctx, GetFeatureTagRequest{ + TableName: tableName, + FeatureName: featureName, + Key: key, + }) +} + +// Lists FeatureTags. +func (a *MaterializedFeaturesAPI) ListFeatureTagsByTableNameAndFeatureName(ctx context.Context, tableName string, featureName string) (*ListFeatureTagsResponse, error) { + return a.materializedFeaturesImpl.internalListFeatureTags(ctx, ListFeatureTagsRequest{ + TableName: tableName, + FeatureName: featureName, + }) +} + type ModelRegistryInterface interface { // Approves a model version stage transition request. diff --git a/service/ml/impl.go b/service/ml/impl.go index 0f88594d1..c2e75089b 100755 --- a/service/ml/impl.go +++ b/service/ml/impl.go @@ -10,6 +10,7 @@ import ( "github.com/databricks/databricks-sdk-go/client" "github.com/databricks/databricks-sdk-go/listing" "github.com/databricks/databricks-sdk-go/useragent" + "golang.org/x/exp/slices" ) // unexported type that holds implementations of just Experiments API methods @@ -51,44 +52,40 @@ func (a *experimentsImpl) CreateRun(ctx context.Context, request CreateRun) (*Cr } func (a *experimentsImpl) DeleteExperiment(ctx context.Context, request DeleteExperiment) error { - var deleteExperimentResponse DeleteExperimentResponse path := "/api/2.0/mlflow/experiments/delete" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &deleteExperimentResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } func (a *experimentsImpl) DeleteLoggedModel(ctx context.Context, request DeleteLoggedModelRequest) error { - var deleteLoggedModelResponse DeleteLoggedModelResponse path := fmt.Sprintf("/api/2.0/mlflow/logged-models/%v", request.ModelId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteLoggedModelResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } func (a *experimentsImpl) DeleteLoggedModelTag(ctx context.Context, request DeleteLoggedModelTagRequest) error { - var deleteLoggedModelTagResponse DeleteLoggedModelTagResponse path := fmt.Sprintf("/api/2.0/mlflow/logged-models/%v/tags/%v", request.ModelId, request.TagKey) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteLoggedModelTagResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } func (a *experimentsImpl) DeleteRun(ctx context.Context, request DeleteRun) error { - var deleteRunResponse DeleteRunResponse path := "/api/2.0/mlflow/runs/delete" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &deleteRunResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } @@ -104,13 +101,12 @@ func (a *experimentsImpl) DeleteRuns(ctx context.Context, request DeleteRuns) (* } func (a *experimentsImpl) DeleteTag(ctx context.Context, request DeleteTag) error { - var deleteTagResponse DeleteTagResponse path := "/api/2.0/mlflow/runs/delete-tag" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &deleteTagResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } @@ -196,6 +192,16 @@ func (a *experimentsImpl) GetLoggedModel(ctx context.Context, request GetLoggedM return &getLoggedModelResponse, err } +func (a *experimentsImpl) GetLoggedModels(ctx context.Context, request GetLoggedModelsRequest) (*GetLoggedModelsRequestResponse, error) { + var getLoggedModelsRequestResponse GetLoggedModelsRequestResponse + path := "/api/2.0/mlflow/logged-models:batchGet" + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getLoggedModelsRequestResponse) + return &getLoggedModelsRequestResponse, err +} + func (a *experimentsImpl) GetPermissionLevels(ctx context.Context, request GetExperimentPermissionLevelsRequest) (*GetExperimentPermissionLevelsResponse, error) { var getExperimentPermissionLevelsResponse GetExperimentPermissionLevelsResponse path := fmt.Sprintf("/api/2.0/permissions/experiments/%v/permissionLevels", request.ExperimentId) @@ -319,101 +325,92 @@ func (a *experimentsImpl) internalListExperiments(ctx context.Context, request L } func (a *experimentsImpl) LogBatch(ctx context.Context, request LogBatch) error { - var logBatchResponse LogBatchResponse path := "/api/2.0/mlflow/runs/log-batch" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &logBatchResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } func (a *experimentsImpl) LogInputs(ctx context.Context, request LogInputs) error { - var logInputsResponse LogInputsResponse path := "/api/2.0/mlflow/runs/log-inputs" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &logInputsResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } func (a *experimentsImpl) LogLoggedModelParams(ctx context.Context, request LogLoggedModelParamsRequest) error { - var logLoggedModelParamsRequestResponse LogLoggedModelParamsRequestResponse path := fmt.Sprintf("/api/2.0/mlflow/logged-models/%v/params", request.ModelId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &logLoggedModelParamsRequestResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } func (a *experimentsImpl) LogMetric(ctx context.Context, request LogMetric) error { - var logMetricResponse LogMetricResponse path := "/api/2.0/mlflow/runs/log-metric" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &logMetricResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } func (a *experimentsImpl) LogModel(ctx context.Context, request LogModel) error { - var logModelResponse LogModelResponse path := "/api/2.0/mlflow/runs/log-model" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &logModelResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } func (a *experimentsImpl) LogOutputs(ctx context.Context, request LogOutputsRequest) error { - var logOutputsResponse LogOutputsResponse path := "/api/2.0/mlflow/runs/outputs" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &logOutputsResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } func (a *experimentsImpl) LogParam(ctx context.Context, request LogParam) error { - var logParamResponse LogParamResponse path := "/api/2.0/mlflow/runs/log-parameter" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &logParamResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } func (a *experimentsImpl) RestoreExperiment(ctx context.Context, request RestoreExperiment) error { - var restoreExperimentResponse RestoreExperimentResponse path := "/api/2.0/mlflow/experiments/restore" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &restoreExperimentResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } func (a *experimentsImpl) RestoreRun(ctx context.Context, request RestoreRun) error { - var restoreRunResponse RestoreRunResponse path := "/api/2.0/mlflow/runs/restore" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &restoreRunResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } @@ -528,24 +525,22 @@ func (a *experimentsImpl) internalSearchRuns(ctx context.Context, request Search } func (a *experimentsImpl) SetExperimentTag(ctx context.Context, request SetExperimentTag) error { - var setExperimentTagResponse SetExperimentTagResponse path := "/api/2.0/mlflow/experiments/set-experiment-tag" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &setExperimentTagResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } func (a *experimentsImpl) SetLoggedModelTags(ctx context.Context, request SetLoggedModelTagsRequest) error { - var setLoggedModelTagsResponse SetLoggedModelTagsResponse path := fmt.Sprintf("/api/2.0/mlflow/logged-models/%v/tags", request.ModelId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &setLoggedModelTagsResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, nil) return err } @@ -561,24 +556,22 @@ func (a *experimentsImpl) SetPermissions(ctx context.Context, request Experiment } func (a *experimentsImpl) SetTag(ctx context.Context, request SetTag) error { - var setTagResponse SetTagResponse path := "/api/2.0/mlflow/runs/set-tag" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &setTagResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } func (a *experimentsImpl) UpdateExperiment(ctx context.Context, request UpdateExperiment) error { - var updateExperimentResponse UpdateExperimentResponse path := "/api/2.0/mlflow/experiments/update" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &updateExperimentResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } @@ -621,12 +614,11 @@ func (a *featureStoreImpl) CreateOnlineStore(ctx context.Context, request Create } func (a *featureStoreImpl) DeleteOnlineStore(ctx context.Context, request DeleteOnlineStoreRequest) error { - var deleteOnlineStoreResponse DeleteOnlineStoreResponse path := fmt.Sprintf("/api/2.0/feature-store/online-stores/%v", request.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteOnlineStoreResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -732,6 +724,106 @@ func (a *forecastingImpl) GetExperiment(ctx context.Context, request GetForecast return &forecastingExperiment, err } +// unexported type that holds implementations of just MaterializedFeatures API methods +type materializedFeaturesImpl struct { + client *client.DatabricksClient +} + +func (a *materializedFeaturesImpl) CreateFeatureTag(ctx context.Context, request CreateFeatureTagRequest) (*FeatureTag, error) { + var featureTag FeatureTag + path := fmt.Sprintf("/api/2.0/feature-store/feature-tables/%v/features/%v/tags", request.TableName, request.FeatureName) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request.FeatureTag, &featureTag) + return &featureTag, err +} + +func (a *materializedFeaturesImpl) DeleteFeatureTag(ctx context.Context, request DeleteFeatureTagRequest) error { + path := fmt.Sprintf("/api/2.0/feature-store/feature-tables/%v/features/%v/tags/%v", request.TableName, request.FeatureName, request.Key) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) + return err +} + +func (a *materializedFeaturesImpl) GetFeatureLineage(ctx context.Context, request GetFeatureLineageRequest) (*FeatureLineage, error) { + var featureLineage FeatureLineage + path := fmt.Sprintf("/api/2.0/feature-store/feature-tables/%v/features/%v/lineage", request.TableName, request.FeatureName) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &featureLineage) + return &featureLineage, err +} + +func (a *materializedFeaturesImpl) GetFeatureTag(ctx context.Context, request GetFeatureTagRequest) (*FeatureTag, error) { + var featureTag FeatureTag + path := fmt.Sprintf("/api/2.0/feature-store/feature-tables/%v/features/%v/tags/%v", request.TableName, request.FeatureName, request.Key) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &featureTag) + return &featureTag, err +} + +// Lists FeatureTags. +func (a *materializedFeaturesImpl) ListFeatureTags(ctx context.Context, request ListFeatureTagsRequest) listing.Iterator[FeatureTag] { + + getNextPage := func(ctx context.Context, req ListFeatureTagsRequest) (*ListFeatureTagsResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.internalListFeatureTags(ctx, req) + } + getItems := func(resp *ListFeatureTagsResponse) []FeatureTag { + return resp.FeatureTags + } + getNextReq := func(resp *ListFeatureTagsResponse) *ListFeatureTagsRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// Lists FeatureTags. +func (a *materializedFeaturesImpl) ListFeatureTagsAll(ctx context.Context, request ListFeatureTagsRequest) ([]FeatureTag, error) { + iterator := a.ListFeatureTags(ctx, request) + return listing.ToSlice[FeatureTag](ctx, iterator) +} + +func (a *materializedFeaturesImpl) internalListFeatureTags(ctx context.Context, request ListFeatureTagsRequest) (*ListFeatureTagsResponse, error) { + var listFeatureTagsResponse ListFeatureTagsResponse + path := fmt.Sprintf("/api/2.0/feature-store/feature-tables/%v/features/%v/tags", request.TableName, request.FeatureName) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listFeatureTagsResponse) + return &listFeatureTagsResponse, err +} + +func (a *materializedFeaturesImpl) UpdateFeatureTag(ctx context.Context, request UpdateFeatureTagRequest) (*FeatureTag, error) { + var featureTag FeatureTag + path := fmt.Sprintf("/api/2.0/feature-store/feature-tables/%v/features/%v/tags/%v", request.TableName, request.FeatureName, request.Key) + queryParams := make(map[string]any) + if request.UpdateMask != "" || slices.Contains(request.ForceSendFields, "UpdateMask") { + queryParams["update_mask"] = request.UpdateMask + } + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request.FeatureTag, &featureTag) + return &featureTag, err +} + // unexported type that holds implementations of just ModelRegistry API methods type modelRegistryImpl struct { client *client.DatabricksClient @@ -804,72 +896,65 @@ func (a *modelRegistryImpl) CreateWebhook(ctx context.Context, request CreateReg } func (a *modelRegistryImpl) DeleteComment(ctx context.Context, request DeleteCommentRequest) error { - var deleteCommentResponse DeleteCommentResponse path := "/api/2.0/mlflow/comments/delete" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteCommentResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } func (a *modelRegistryImpl) DeleteModel(ctx context.Context, request DeleteModelRequest) error { - var deleteModelResponse DeleteModelResponse path := "/api/2.0/mlflow/registered-models/delete" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteModelResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } func (a *modelRegistryImpl) DeleteModelTag(ctx context.Context, request DeleteModelTagRequest) error { - var deleteModelTagResponse DeleteModelTagResponse path := "/api/2.0/mlflow/registered-models/delete-tag" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteModelTagResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } func (a *modelRegistryImpl) DeleteModelVersion(ctx context.Context, request DeleteModelVersionRequest) error { - var deleteModelVersionResponse DeleteModelVersionResponse path := "/api/2.0/mlflow/model-versions/delete" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteModelVersionResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } func (a *modelRegistryImpl) DeleteModelVersionTag(ctx context.Context, request DeleteModelVersionTagRequest) error { - var deleteModelVersionTagResponse DeleteModelVersionTagResponse path := "/api/2.0/mlflow/model-versions/delete-tag" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteModelVersionTagResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } func (a *modelRegistryImpl) DeleteTransitionRequest(ctx context.Context, request DeleteTransitionRequestRequest) error { - var deleteTransitionRequestResponse DeleteTransitionRequestResponse path := "/api/2.0/mlflow/transition-requests/delete" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteTransitionRequestResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } func (a *modelRegistryImpl) DeleteWebhook(ctx context.Context, request DeleteWebhookRequest) error { - var deleteWebhookResponse DeleteWebhookResponse path := "/api/2.0/mlflow/registry-webhooks/delete" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteWebhookResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -1187,24 +1272,22 @@ func (a *modelRegistryImpl) internalSearchModels(ctx context.Context, request Se } func (a *modelRegistryImpl) SetModelTag(ctx context.Context, request SetModelTagRequest) error { - var setModelTagResponse SetModelTagResponse path := "/api/2.0/mlflow/registered-models/set-tag" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &setModelTagResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } func (a *modelRegistryImpl) SetModelVersionTag(ctx context.Context, request SetModelVersionTagRequest) error { - var setModelVersionTagResponse SetModelVersionTagResponse path := "/api/2.0/mlflow/model-versions/set-tag" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &setModelVersionTagResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } @@ -1253,24 +1336,22 @@ func (a *modelRegistryImpl) UpdateComment(ctx context.Context, request UpdateCom } func (a *modelRegistryImpl) UpdateModel(ctx context.Context, request UpdateModelRequest) error { - var updateModelResponse UpdateModelResponse path := "/api/2.0/mlflow/registered-models/update" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateModelResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, nil) return err } func (a *modelRegistryImpl) UpdateModelVersion(ctx context.Context, request UpdateModelVersionRequest) error { - var updateModelVersionResponse UpdateModelVersionResponse path := "/api/2.0/mlflow/model-versions/update" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateModelVersionResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, nil) return err } @@ -1286,12 +1367,11 @@ func (a *modelRegistryImpl) UpdatePermissions(ctx context.Context, request Regis } func (a *modelRegistryImpl) UpdateWebhook(ctx context.Context, request UpdateRegistryWebhook) error { - var updateWebhookResponse UpdateWebhookResponse path := "/api/2.0/mlflow/registry-webhooks/update" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateWebhookResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, nil) return err } diff --git a/service/ml/interface.go b/service/ml/interface.go index 43764fc19..613951cb8 100755 --- a/service/ml/interface.go +++ b/service/ml/interface.go @@ -85,6 +85,9 @@ type ExperimentsService interface { // Get a logged model. GetLoggedModel(ctx context.Context, request GetLoggedModelRequest) (*GetLoggedModelResponse, error) + // Batch endpoint for getting logged models from a list of model IDs + GetLoggedModels(ctx context.Context, request GetLoggedModelsRequest) (*GetLoggedModelsRequestResponse, error) + // Gets the permission levels that a user can have on an object. GetPermissionLevels(ctx context.Context, request GetExperimentPermissionLevelsRequest) (*GetExperimentPermissionLevelsResponse, error) @@ -295,6 +298,31 @@ type ForecastingService interface { GetExperiment(ctx context.Context, request GetForecastingExperimentRequest) (*ForecastingExperiment, error) } +// Materialized Features are columns in tables and views that can be directly +// used as features to train and serve ML models. +// +// Deprecated: Do not use this interface, it will be removed in a future version of the SDK. +type MaterializedFeaturesService interface { + + // Creates a FeatureTag. + CreateFeatureTag(ctx context.Context, request CreateFeatureTagRequest) (*FeatureTag, error) + + // Deletes a FeatureTag. + DeleteFeatureTag(ctx context.Context, request DeleteFeatureTagRequest) error + + // Get Feature Lineage. + GetFeatureLineage(ctx context.Context, request GetFeatureLineageRequest) (*FeatureLineage, error) + + // Gets a FeatureTag. + GetFeatureTag(ctx context.Context, request GetFeatureTagRequest) (*FeatureTag, error) + + // Lists FeatureTags. + ListFeatureTags(ctx context.Context, request ListFeatureTagsRequest) (*ListFeatureTagsResponse, error) + + // Updates a FeatureTag. + UpdateFeatureTag(ctx context.Context, request UpdateFeatureTagRequest) (*FeatureTag, error) +} + // Note: This API reference documents APIs for the Workspace Model Registry. // Databricks recommends using [Models in Unity // Catalog](/api/workspace/registeredmodels) instead. Models in Unity Catalog diff --git a/service/ml/model.go b/service/ml/model.go index a395d2f87..865cfe06a 100755 --- a/service/ml/model.go +++ b/service/ml/model.go @@ -355,6 +355,14 @@ func (s CreateExperimentResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type CreateFeatureTagRequest struct { + FeatureName string `json:"-" url:"-"` + // Represents a tag on a feature in a feature table. + FeatureTag FeatureTag `json:"feature_tag"` + + TableName string `json:"-" url:"-"` +} + type CreateForecastingExperimentRequest struct { // The column in the training table used to customize weights for each time // series. @@ -528,7 +536,6 @@ type CreateModelVersionResponse struct { ModelVersion *ModelVersion `json:"model_version,omitempty"` } -// Create an Online Feature Store type CreateOnlineStoreRequest struct { // An OnlineStore is a logical database instance that stores and serves // features online. @@ -713,7 +720,6 @@ type DatasetInput struct { Tags []InputTag `json:"tags,omitempty"` } -// Delete a comment type DeleteCommentRequest struct { // Unique identifier of an activity Id string `json:"-" url:"id"` @@ -730,7 +736,18 @@ type DeleteExperiment struct { type DeleteExperimentResponse struct { } -// Delete a logged model +type DeleteFeatureTagRequest struct { + // The name of the feature within the feature table. + FeatureName string `json:"-" url:"-"` + // The key of the tag to delete. + Key string `json:"-" url:"-"` + // The name of the feature table. + TableName string `json:"-" url:"-"` +} + +type DeleteFeatureTagResponse struct { +} + type DeleteLoggedModelRequest struct { // The ID of the logged model to delete. ModelId string `json:"-" url:"-"` @@ -739,7 +756,6 @@ type DeleteLoggedModelRequest struct { type DeleteLoggedModelResponse struct { } -// Delete a tag on a logged model type DeleteLoggedModelTagRequest struct { // The ID of the logged model to delete the tag from. ModelId string `json:"-" url:"-"` @@ -750,7 +766,6 @@ type DeleteLoggedModelTagRequest struct { type DeleteLoggedModelTagResponse struct { } -// Delete a model type DeleteModelRequest struct { // Registered model unique name identifier. Name string `json:"-" url:"name"` @@ -759,7 +774,6 @@ type DeleteModelRequest struct { type DeleteModelResponse struct { } -// Delete a model tag type DeleteModelTagRequest struct { // Name of the tag. The name must be an exact match; wild-card deletion is // not supported. Maximum size is 250 bytes. @@ -771,7 +785,6 @@ type DeleteModelTagRequest struct { type DeleteModelTagResponse struct { } -// Delete a model version. type DeleteModelVersionRequest struct { // Name of the registered model Name string `json:"-" url:"name"` @@ -782,7 +795,6 @@ type DeleteModelVersionRequest struct { type DeleteModelVersionResponse struct { } -// Delete a model version tag type DeleteModelVersionTagRequest struct { // Name of the tag. The name must be an exact match; wild-card deletion is // not supported. Maximum size is 250 bytes. @@ -796,7 +808,6 @@ type DeleteModelVersionTagRequest struct { type DeleteModelVersionTagResponse struct { } -// Delete an Online Feature Store type DeleteOnlineStoreRequest struct { // Name of the online store to delete. Name string `json:"-" url:"-"` @@ -860,7 +871,6 @@ type DeleteTag struct { type DeleteTagResponse struct { } -// Delete a transition request type DeleteTransitionRequestRequest struct { // User-provided comment on the action. Comment string `json:"-" url:"comment,omitempty"` @@ -940,7 +950,6 @@ func (f *DeleteTransitionRequestStage) Type() string { return "DeleteTransitionRequestStage" } -// Delete a webhook type DeleteWebhookRequest struct { // Webhook ID required to delete a registry webhook. Id string `json:"-" url:"id,omitempty"` @@ -1149,6 +1158,81 @@ func (s ExperimentTag) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type FeatureLineage struct { + // List of feature specs that contain this feature. + FeatureSpecs []FeatureLineageFeatureSpec `json:"feature_specs,omitempty"` + // List of Unity Catalog models that were trained on this feature. + Models []FeatureLineageModel `json:"models,omitempty"` + // List of online features that use this feature as source. + OnlineFeatures []FeatureLineageOnlineFeature `json:"online_features,omitempty"` +} + +type FeatureLineageFeatureSpec struct { + // The full name of the feature spec in Unity Catalog. + Name string `json:"name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *FeatureLineageFeatureSpec) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s FeatureLineageFeatureSpec) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type FeatureLineageModel struct { + // The full name of the model in Unity Catalog. + Name string `json:"name,omitempty"` + // The version of the model. + Version int64 `json:"version,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *FeatureLineageModel) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s FeatureLineageModel) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type FeatureLineageOnlineFeature struct { + // The name of the online feature (column name). + FeatureName string `json:"feature_name,omitempty"` + // The full name of the online table in Unity Catalog. + TableName string `json:"table_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *FeatureLineageOnlineFeature) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s FeatureLineageOnlineFeature) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Represents a tag on a feature in a feature table. +type FeatureTag struct { + Key string `json:"key,omitempty"` + + Value string `json:"value,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *FeatureTag) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s FeatureTag) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + // Metadata of a single artifact file or directory. type FileInfo struct { // The size in bytes of the file. Unset for directories. @@ -1250,7 +1334,6 @@ func (f *ForecastingExperimentState) Type() string { return "ForecastingExperimentState" } -// Get an experiment by name type GetByNameRequest struct { // Name of the associated experiment. ExperimentName string `json:"-" url:"experiment_name"` @@ -1261,7 +1344,6 @@ type GetExperimentByNameResponse struct { Experiment *Experiment `json:"experiment,omitempty"` } -// Get experiment permission levels type GetExperimentPermissionLevelsRequest struct { // The experiment for which to get or manage permissions. ExperimentId string `json:"-" url:"-"` @@ -1272,13 +1354,11 @@ type GetExperimentPermissionLevelsResponse struct { PermissionLevels []ExperimentPermissionsDescription `json:"permission_levels,omitempty"` } -// Get experiment permissions type GetExperimentPermissionsRequest struct { // The experiment for which to get or manage permissions. ExperimentId string `json:"-" url:"-"` } -// Get an experiment type GetExperimentRequest struct { // ID of the associated experiment. ExperimentId string `json:"-" url:"experiment_id"` @@ -1289,13 +1369,26 @@ type GetExperimentResponse struct { Experiment *Experiment `json:"experiment,omitempty"` } -// Get a forecasting experiment +type GetFeatureLineageRequest struct { + // The name of the feature. + FeatureName string `json:"-" url:"-"` + // The full name of the feature table in Unity Catalog. + TableName string `json:"-" url:"-"` +} + +type GetFeatureTagRequest struct { + FeatureName string `json:"-" url:"-"` + + Key string `json:"-" url:"-"` + + TableName string `json:"-" url:"-"` +} + type GetForecastingExperimentRequest struct { // The unique ID of a forecasting experiment ExperimentId string `json:"-" url:"-"` } -// Get metric history for a run type GetHistoryRequest struct { // Maximum number of Metric records to return per paginated request. Default // is set to 25,000. If set higher than 25,000, a request Exception will be @@ -1336,7 +1429,6 @@ type GetLatestVersionsResponse struct { ModelVersions []ModelVersion `json:"model_versions,omitempty"` } -// Get a logged model type GetLoggedModelRequest struct { // The ID of the logged model to retrieve. ModelId string `json:"-" url:"-"` @@ -1347,6 +1439,16 @@ type GetLoggedModelResponse struct { Model *LoggedModel `json:"model,omitempty"` } +type GetLoggedModelsRequest struct { + // The IDs of the logged models to retrieve. Max threshold is 100. + ModelIds []string `json:"-" url:"model_ids,omitempty"` +} + +type GetLoggedModelsRequestResponse struct { + // The retrieved logged models. + Models []LoggedModel `json:"models,omitempty"` +} + type GetMetricHistoryResponse struct { // All logged values for this metric if `max_results` is not specified in // the request or if the total count of metrics returned is less than the @@ -1369,7 +1471,6 @@ func (s GetMetricHistoryResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get model type GetModelRequest struct { // Registered model unique name identifier. Name string `json:"-" url:"name"` @@ -1379,7 +1480,6 @@ type GetModelResponse struct { RegisteredModelDatabricks *ModelDatabricks `json:"registered_model_databricks,omitempty"` } -// Get a model version URI type GetModelVersionDownloadUriRequest struct { // Name of the registered model Name string `json:"-" url:"name"` @@ -1402,7 +1502,6 @@ func (s GetModelVersionDownloadUriResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get a model version type GetModelVersionRequest struct { // Name of the registered model Name string `json:"-" url:"name"` @@ -1414,13 +1513,11 @@ type GetModelVersionResponse struct { ModelVersion *ModelVersion `json:"model_version,omitempty"` } -// Get an Online Feature Store type GetOnlineStoreRequest struct { // Name of the online store to get. Name string `json:"-" url:"-"` } -// Get registered model permission levels type GetRegisteredModelPermissionLevelsRequest struct { // The registered model for which to get or manage permissions. RegisteredModelId string `json:"-" url:"-"` @@ -1431,13 +1528,11 @@ type GetRegisteredModelPermissionLevelsResponse struct { PermissionLevels []RegisteredModelPermissionsDescription `json:"permission_levels,omitempty"` } -// Get registered model permissions type GetRegisteredModelPermissionsRequest struct { // The registered model for which to get or manage permissions. RegisteredModelId string `json:"-" url:"-"` } -// Get a run type GetRunRequest struct { // ID of the run to fetch. Must be provided. RunId string `json:"-" url:"run_id"` @@ -1565,7 +1660,6 @@ func (s JobSpecWithoutSecret) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List artifacts type ListArtifactsRequest struct { // The token indicating the page of artifact results to fetch. `page_token` // is not supported when listing artifacts in UC Volumes. A maximum of 1000 @@ -1613,7 +1707,6 @@ func (s ListArtifactsResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List experiments type ListExperimentsRequest struct { // Maximum number of experiments desired. If `max_results` is unspecified, // return all experiments. If `max_results` is too large, it'll be @@ -1657,7 +1750,43 @@ func (s ListExperimentsResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List models +type ListFeatureTagsRequest struct { + FeatureName string `json:"-" url:"-"` + // The maximum number of results to return. + PageSize int `json:"-" url:"page_size,omitempty"` + // Pagination token to go to the next page based on a previous query. + PageToken string `json:"-" url:"page_token,omitempty"` + + TableName string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListFeatureTagsRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListFeatureTagsRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Response message for ListFeatureTag. +type ListFeatureTagsResponse struct { + FeatureTags []FeatureTag `json:"feature_tags,omitempty"` + // Pagination token to request the next page of results for this query. + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListFeatureTagsResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListFeatureTagsResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type ListModelsRequest struct { // Maximum number of registered models desired. Max threshold is 1000. MaxResults int `json:"-" url:"max_results,omitempty"` @@ -1692,7 +1821,6 @@ func (s ListModelsResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List Online Feature Stores type ListOnlineStoresRequest struct { // The maximum number of results to return. Defaults to 100 if not // specified. @@ -1745,7 +1873,6 @@ func (s ListRegistryWebhooks) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List transition requests type ListTransitionRequestsRequest struct { // Name of the model. Name string `json:"-" url:"name"` @@ -1758,7 +1885,6 @@ type ListTransitionRequestsResponse struct { Requests []Activity `json:"requests,omitempty"` } -// List registry webhooks type ListWebhooksRequest struct { // If `events` is specified, any webhook with one or more of the specified // trigger events is included in the output. If `events` is not specified, @@ -3291,7 +3417,6 @@ func (s SearchLoggedModelsResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Searches model versions type SearchModelVersionsRequest struct { // String filter condition, like "name='my-model-name'". Must be a single // boolean condition, with string values wrapped in single quotes. @@ -3335,7 +3460,6 @@ func (s SearchModelVersionsResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Search models type SearchModelsRequest struct { // String filter condition, like "name LIKE 'my-model-name'". Interpreted in // the backend automatically as "name LIKE '%my-model-name%'". Single @@ -3763,6 +3887,28 @@ func (s UpdateExperiment) MarshalJSON() ([]byte, error) { type UpdateExperimentResponse struct { } +type UpdateFeatureTagRequest struct { + FeatureName string `json:"-" url:"-"` + // Represents a tag on a feature in a feature table. + FeatureTag FeatureTag `json:"feature_tag"` + + Key string `json:"-" url:"-"` + + TableName string `json:"-" url:"-"` + // The list of fields to update. + UpdateMask string `json:"-" url:"update_mask,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *UpdateFeatureTagRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s UpdateFeatureTagRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type UpdateModelRequest struct { // If provided, updates the description for this `registered_model`. Description string `json:"description,omitempty"` @@ -3805,7 +3951,6 @@ func (s UpdateModelVersionRequest) MarshalJSON() ([]byte, error) { type UpdateModelVersionResponse struct { } -// Update an Online Feature Store type UpdateOnlineStoreRequest struct { // The name of the online store. This is the unique identifier for the // online store. diff --git a/service/oauth2/impl.go b/service/oauth2/impl.go index 0a3876bc6..e56ac0d99 100755 --- a/service/oauth2/impl.go +++ b/service/oauth2/impl.go @@ -33,12 +33,11 @@ func (a *accountFederationPolicyImpl) Create(ctx context.Context, request Create } func (a *accountFederationPolicyImpl) Delete(ctx context.Context, request DeleteAccountFederationPolicyRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/accounts/%v/federationPolicies/%v", a.client.ConfiguredAccountID(), request.PolicyId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -124,12 +123,11 @@ func (a *customAppIntegrationImpl) Create(ctx context.Context, request CreateCus } func (a *customAppIntegrationImpl) Delete(ctx context.Context, request DeleteCustomAppIntegrationRequest) error { - var deleteCustomAppIntegrationOutput DeleteCustomAppIntegrationOutput path := fmt.Sprintf("/api/2.0/accounts/%v/oauth2/custom-app-integrations/%v", a.client.ConfiguredAccountID(), request.IntegrationId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteCustomAppIntegrationOutput) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -187,13 +185,12 @@ func (a *customAppIntegrationImpl) internalList(ctx context.Context, request Lis } func (a *customAppIntegrationImpl) Update(ctx context.Context, request UpdateCustomAppIntegration) error { - var updateCustomAppIntegrationOutput UpdateCustomAppIntegrationOutput path := fmt.Sprintf("/api/2.0/accounts/%v/oauth2/custom-app-integrations/%v", a.client.ConfiguredAccountID(), request.IntegrationId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateCustomAppIntegrationOutput) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, nil) return err } @@ -260,12 +257,11 @@ func (a *publishedAppIntegrationImpl) Create(ctx context.Context, request Create } func (a *publishedAppIntegrationImpl) Delete(ctx context.Context, request DeletePublishedAppIntegrationRequest) error { - var deletePublishedAppIntegrationOutput DeletePublishedAppIntegrationOutput path := fmt.Sprintf("/api/2.0/accounts/%v/oauth2/published-app-integrations/%v", a.client.ConfiguredAccountID(), request.IntegrationId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deletePublishedAppIntegrationOutput) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -323,13 +319,12 @@ func (a *publishedAppIntegrationImpl) internalList(ctx context.Context, request } func (a *publishedAppIntegrationImpl) Update(ctx context.Context, request UpdatePublishedAppIntegration) error { - var updatePublishedAppIntegrationOutput UpdatePublishedAppIntegrationOutput path := fmt.Sprintf("/api/2.0/accounts/%v/oauth2/published-app-integrations/%v", a.client.ConfiguredAccountID(), request.IntegrationId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updatePublishedAppIntegrationOutput) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, nil) return err } @@ -353,12 +348,11 @@ func (a *servicePrincipalFederationPolicyImpl) Create(ctx context.Context, reque } func (a *servicePrincipalFederationPolicyImpl) Delete(ctx context.Context, request DeleteServicePrincipalFederationPolicyRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/accounts/%v/servicePrincipals/%v/federationPolicies/%v", a.client.ConfiguredAccountID(), request.ServicePrincipalId, request.PolicyId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -444,11 +438,10 @@ func (a *servicePrincipalSecretsImpl) Create(ctx context.Context, request Create } func (a *servicePrincipalSecretsImpl) Delete(ctx context.Context, request DeleteServicePrincipalSecretRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/accounts/%v/servicePrincipals/%v/credentials/secrets/%v", a.client.ConfiguredAccountID(), request.ServicePrincipalId, request.SecretId) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } diff --git a/service/oauth2/model.go b/service/oauth2/model.go index d8ddc772a..f38057216 100755 --- a/service/oauth2/model.go +++ b/service/oauth2/model.go @@ -6,7 +6,6 @@ import ( "github.com/databricks/databricks-sdk-go/marshal" ) -// Create account federation policy type CreateAccountFederationPolicyRequest struct { Policy FederationPolicy `json:"policy"` // The identifier for the federation policy. The identifier must contain @@ -107,7 +106,6 @@ func (s CreatePublishedAppIntegrationOutput) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Create service principal federation policy type CreateServicePrincipalFederationPolicyRequest struct { Policy FederationPolicy `json:"policy"` // The identifier for the federation policy. The identifier must contain @@ -174,7 +172,6 @@ func (s CreateServicePrincipalSecretResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Delete account federation policy type DeleteAccountFederationPolicyRequest struct { // The identifier for the federation policy. PolicyId string `json:"-" url:"-"` @@ -183,7 +180,6 @@ type DeleteAccountFederationPolicyRequest struct { type DeleteCustomAppIntegrationOutput struct { } -// Delete Custom OAuth App Integration type DeleteCustomAppIntegrationRequest struct { IntegrationId string `json:"-" url:"-"` } @@ -191,7 +187,6 @@ type DeleteCustomAppIntegrationRequest struct { type DeletePublishedAppIntegrationOutput struct { } -// Delete Published OAuth App Integration type DeletePublishedAppIntegrationRequest struct { IntegrationId string `json:"-" url:"-"` } @@ -199,7 +194,6 @@ type DeletePublishedAppIntegrationRequest struct { type DeleteResponse struct { } -// Delete service principal federation policy type DeleteServicePrincipalFederationPolicyRequest struct { // The identifier for the federation policy. PolicyId string `json:"-" url:"-"` @@ -207,7 +201,6 @@ type DeleteServicePrincipalFederationPolicyRequest struct { ServicePrincipalId int64 `json:"-" url:"-"` } -// Delete service principal secret type DeleteServicePrincipalSecretRequest struct { // The secret ID. SecretId string `json:"-" url:"-"` @@ -252,7 +245,6 @@ func (s FederationPolicy) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get account federation policy type GetAccountFederationPolicyRequest struct { // The identifier for the federation policy. PolicyId string `json:"-" url:"-"` @@ -296,7 +288,6 @@ func (s GetCustomAppIntegrationOutput) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get OAuth Custom App Integration type GetCustomAppIntegrationRequest struct { // The OAuth app integration ID. IntegrationId string `json:"-" url:"-"` @@ -344,7 +335,6 @@ func (s GetPublishedAppIntegrationOutput) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get OAuth Published App Integration type GetPublishedAppIntegrationRequest struct { IntegrationId string `json:"-" url:"-"` } @@ -384,7 +374,6 @@ func (s GetPublishedAppsOutput) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get service principal federation policy type GetServicePrincipalFederationPolicyRequest struct { // The identifier for the federation policy. PolicyId string `json:"-" url:"-"` @@ -392,7 +381,6 @@ type GetServicePrincipalFederationPolicyRequest struct { ServicePrincipalId int64 `json:"-" url:"-"` } -// List account federation policies type ListAccountFederationPoliciesRequest struct { PageSize int `json:"-" url:"page_size,omitempty"` @@ -409,7 +397,6 @@ func (s ListAccountFederationPoliciesRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get custom oauth app integrations type ListCustomAppIntegrationsRequest struct { IncludeCreatorUsername bool `json:"-" url:"include_creator_username,omitempty"` @@ -444,7 +431,6 @@ func (s ListFederationPoliciesResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get all the published OAuth apps type ListOAuthPublishedAppsRequest struct { // The max number of OAuth published apps to return in one page. PageSize int `json:"-" url:"page_size,omitempty"` @@ -462,7 +448,6 @@ func (s ListOAuthPublishedAppsRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get published oauth app integrations type ListPublishedAppIntegrationsRequest struct { PageSize int `json:"-" url:"page_size,omitempty"` @@ -479,7 +464,6 @@ func (s ListPublishedAppIntegrationsRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List service principal federation policies type ListServicePrincipalFederationPoliciesRequest struct { PageSize int `json:"-" url:"page_size,omitempty"` @@ -498,7 +482,6 @@ func (s ListServicePrincipalFederationPoliciesRequest) MarshalJSON() ([]byte, er return marshal.Marshal(s) } -// List service principal secrets type ListServicePrincipalSecretsRequest struct { // An opaque page token which was the `next_page_token` in the response of // the previous request to list the secrets for this service principal. @@ -659,7 +642,6 @@ func (s TokenAccessPolicy) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Update account federation policy type UpdateAccountFederationPolicyRequest struct { Policy FederationPolicy `json:"policy"` // The identifier for the federation policy. @@ -712,7 +694,6 @@ type UpdatePublishedAppIntegration struct { type UpdatePublishedAppIntegrationOutput struct { } -// Update service principal federation policy type UpdateServicePrincipalFederationPolicyRequest struct { Policy FederationPolicy `json:"policy"` // The identifier for the federation policy. diff --git a/service/pipelines/impl.go b/service/pipelines/impl.go index b00bd9651..1147be7b8 100755 --- a/service/pipelines/impl.go +++ b/service/pipelines/impl.go @@ -29,12 +29,11 @@ func (a *pipelinesImpl) Create(ctx context.Context, request CreatePipeline) (*Cr } func (a *pipelinesImpl) Delete(ctx context.Context, request DeletePipelineRequest) error { - var deletePipelineResponse DeletePipelineResponse path := fmt.Sprintf("/api/2.0/pipelines/%v", request.PipelineId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deletePipelineResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -193,23 +192,21 @@ func (a *pipelinesImpl) StartUpdate(ctx context.Context, request StartUpdate) (* } func (a *pipelinesImpl) Stop(ctx context.Context, request StopRequest) error { - var stopPipelineResponse StopPipelineResponse path := fmt.Sprintf("/api/2.0/pipelines/%v/stop", request.PipelineId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, &stopPipelineResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, nil) return err } func (a *pipelinesImpl) Update(ctx context.Context, request EditPipeline) error { - var editPipelineResponse EditPipelineResponse path := fmt.Sprintf("/api/2.0/pipelines/%v", request.PipelineId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &editPipelineResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, nil) return err } diff --git a/service/pipelines/model.go b/service/pipelines/model.go index 5f2a24c03..b20187950 100755 --- a/service/pipelines/model.go +++ b/service/pipelines/model.go @@ -206,7 +206,6 @@ func (f *DayOfWeek) Type() string { return "DayOfWeek" } -// Delete a pipeline type DeletePipelineRequest struct { PipelineId string `json:"-" url:"-"` } @@ -451,7 +450,6 @@ type Filters struct { Include []string `json:"include,omitempty"` } -// Get pipeline permission levels type GetPipelinePermissionLevelsRequest struct { // The pipeline for which to get or manage permissions. PipelineId string `json:"-" url:"-"` @@ -462,13 +460,11 @@ type GetPipelinePermissionLevelsResponse struct { PermissionLevels []PipelinePermissionsDescription `json:"permission_levels,omitempty"` } -// Get pipeline permissions type GetPipelinePermissionsRequest struct { // The pipeline for which to get or manage permissions. PipelineId string `json:"-" url:"-"` } -// Get a pipeline type GetPipelineRequest struct { PipelineId string `json:"-" url:"-"` } @@ -550,7 +546,6 @@ func (f *GetPipelineResponseHealth) Type() string { return "GetPipelineResponseHealth" } -// Get a pipeline update type GetUpdateRequest struct { // The ID of the pipeline. PipelineId string `json:"-" url:"-"` @@ -608,6 +603,12 @@ type IngestionPipelineDefinition struct { // to communicate with the source. This is used with connectors for // applications like Salesforce, Workday, and so on. ConnectionName string `json:"connection_name,omitempty"` + // Immutable. If set to true, the pipeline will ingest tables from the UC + // foreign catalogs directly without the need to specify a UC connection or + // ingestion gateway. The `source_catalog` fields in objects of + // IngestionConfig are interpreted as the UC foreign catalogs to ingest + // from. + IngestFromUcForeignCatalog bool `json:"ingest_from_uc_foreign_catalog,omitempty"` // Immutable. Identifier for the gateway that is used by this ingestion // pipeline to communicate with the source database. This is used with // connectors to databases like SQL Server. @@ -634,6 +635,45 @@ func (s IngestionPipelineDefinition) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +// Configurations that are only applicable for query-based ingestion connectors. +type IngestionPipelineDefinitionTableSpecificConfigQueryBasedConnectorConfig struct { + // The names of the monotonically increasing columns in the source table + // that are used to enable the table to be read and ingested incrementally + // through structured streaming. The columns are allowed to have repeated + // values but have to be non-decreasing. If the source data is merged into + // the destination (e.g., using SCD Type 1 or Type 2), these columns will + // implicitly define the `sequence_by` behavior. You can still explicitly + // set `sequence_by` to override this default. + CursorColumns []string `json:"cursor_columns,omitempty"` + // Specifies a SQL WHERE condition that specifies that the source row has + // been deleted. This is sometimes referred to as "soft-deletes". For + // example: "Operation = 'DELETE'" or "is_deleted = true". This field is + // orthogonal to `hard_deletion_sync_interval_in_seconds`, one for + // soft-deletes and the other for hard-deletes. See also the + // hard_deletion_sync_min_interval_in_seconds field for handling of "hard + // deletes" where the source rows are physically removed from the table. + DeletionCondition string `json:"deletion_condition,omitempty"` + // Specifies the minimum interval (in seconds) between snapshots on primary + // keys for detecting and synchronizing hard deletions—i.e., rows that + // have been physically removed from the source table. This interval acts as + // a lower bound. If ingestion runs less frequently than this value, hard + // deletion synchronization will align with the actual ingestion frequency + // instead of happening more often. If not set, hard deletion + // synchronization via snapshots is disabled. This field is mutable and can + // be updated without triggering a full snapshot. + HardDeletionSyncMinIntervalInSeconds int64 `json:"hard_deletion_sync_min_interval_in_seconds,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *IngestionPipelineDefinitionTableSpecificConfigQueryBasedConnectorConfig) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s IngestionPipelineDefinitionTableSpecificConfigQueryBasedConnectorConfig) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type IngestionSourceType string const IngestionSourceTypeDynamics365 IngestionSourceType = `DYNAMICS365` @@ -704,7 +744,6 @@ func (f *IngestionSourceType) Type() string { return "IngestionSourceType" } -// List pipeline events type ListPipelineEventsRequest struct { // Criteria to select a subset of results, expressed using a SQL-like // syntax. The supported filters are: 1. level='INFO' (or WARN or ERROR) 2. @@ -760,7 +799,6 @@ func (s ListPipelineEventsResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List pipelines type ListPipelinesRequest struct { // Select a subset of results based on the specified criteria. The supported // filters are: @@ -812,7 +850,6 @@ func (s ListPipelinesResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List pipeline updates type ListUpdatesRequest struct { // Max number of entries to return in a single page. MaxResults int `json:"-" url:"max_results,omitempty"` @@ -1867,7 +1904,6 @@ func (s StartUpdateResponse) MarshalJSON() ([]byte, error) { type StopPipelineResponse struct { } -// Stop a pipeline type StopRequest struct { PipelineId string `json:"-" url:"-"` } @@ -1918,6 +1954,9 @@ type TableSpecificConfig struct { IncludeColumns []string `json:"include_columns,omitempty"` // The primary key of the table used to apply changes. PrimaryKeys []string `json:"primary_keys,omitempty"` + // Configurations that are only applicable for query-based ingestion + // connectors. + QueryBasedConnectorConfig *IngestionPipelineDefinitionTableSpecificConfigQueryBasedConnectorConfig `json:"query_based_connector_config,omitempty"` // If true, formula fields defined in the table are included in the // ingestion. This setting is only valid for the Salesforce connector SalesforceIncludeFormulaFields bool `json:"salesforce_include_formula_fields,omitempty"` @@ -1942,6 +1981,8 @@ func (s TableSpecificConfig) MarshalJSON() ([]byte, error) { // The SCD type to use to ingest the table. type TableSpecificConfigScdType string +const TableSpecificConfigScdTypeAppendOnly TableSpecificConfigScdType = `APPEND_ONLY` + const TableSpecificConfigScdTypeScdType1 TableSpecificConfigScdType = `SCD_TYPE_1` const TableSpecificConfigScdTypeScdType2 TableSpecificConfigScdType = `SCD_TYPE_2` @@ -1954,11 +1995,11 @@ func (f *TableSpecificConfigScdType) String() string { // Set raw string value and validate it against allowed values func (f *TableSpecificConfigScdType) Set(v string) error { switch v { - case `SCD_TYPE_1`, `SCD_TYPE_2`: + case `APPEND_ONLY`, `SCD_TYPE_1`, `SCD_TYPE_2`: *f = TableSpecificConfigScdType(v) return nil default: - return fmt.Errorf(`value "%s" is not one of "SCD_TYPE_1", "SCD_TYPE_2"`, v) + return fmt.Errorf(`value "%s" is not one of "APPEND_ONLY", "SCD_TYPE_1", "SCD_TYPE_2"`, v) } } @@ -1967,6 +2008,7 @@ func (f *TableSpecificConfigScdType) Set(v string) error { // There is no guarantee on the order of the values in the slice. func (f *TableSpecificConfigScdType) Values() []TableSpecificConfigScdType { return []TableSpecificConfigScdType{ + TableSpecificConfigScdTypeAppendOnly, TableSpecificConfigScdTypeScdType1, TableSpecificConfigScdTypeScdType2, } diff --git a/service/pkg.go b/service/pkg.go index 4a6ca200f..17e51d187 100644 --- a/service/pkg.go +++ b/service/pkg.go @@ -106,8 +106,12 @@ // // - [ml.ExperimentsAPI]: Experiments are the primary unit of organization in MLflow; all MLflow runs belong to an experiment. // +// - [catalog.ExternalLineageAPI]: External Lineage APIs enable defining and managing lineage relationships between Databricks objects and external systems. +// // - [catalog.ExternalLocationsAPI]: An external location is an object that combines a cloud storage path with a storage credential that authorizes access to the cloud storage path. // +// - [catalog.ExternalMetadataAPI]: External Metadata objects enable customers to register and manage metadata about external systems within Unity Catalog. +// // - [ml.FeatureStoreAPI]: A feature store is a centralized repository that enables data scientists to find and share features. // // - [oauth2.AccountFederationPolicyAPI]: These APIs manage account federation policies. @@ -152,6 +156,8 @@ // // - [billing.LogDeliveryAPI]: These APIs manage log delivery configurations for this account. // +// - [ml.MaterializedFeaturesAPI]: Materialized Features are columns in tables and views that can be directly used as features to train and serve ML models. +// // - [catalog.AccountMetastoreAssignmentsAPI]: These APIs manage metastore assignments to a workspace. // // - [catalog.MetastoresAPI]: A metastore is the top-level container of objects in Unity Catalog. @@ -216,6 +222,8 @@ // // - [sql.QueriesLegacyAPI]: These endpoints are used for CRUD operations on query definitions. // +// - [dashboards.QueryExecutionAPI]: Query execution APIs for AI / BI Dashboards. +// // - [sql.QueryHistoryAPI]: A service responsible for storing and retrieving the list of queries run against SQL endpoints and serverless compute. // // - [sql.QueryVisualizationsAPI]: This is an evolving API that facilitates the addition and removal of visualizations from existing queries in the Databricks Workspace. @@ -374,8 +382,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 @@ -399,7 +407,9 @@ var ( _ *settings.EnhancedSecurityMonitoringAPI = nil _ *settings.EsmEnablementAccountAPI = nil _ *ml.ExperimentsAPI = nil + _ *catalog.ExternalLineageAPI = nil _ *catalog.ExternalLocationsAPI = nil + _ *catalog.ExternalMetadataAPI = nil _ *ml.FeatureStoreAPI = nil _ *oauth2.AccountFederationPolicyAPI = nil _ *files.FilesAPI = nil @@ -422,6 +432,7 @@ var ( _ *settings.LlmProxyPartnerPoweredEnforceAPI = nil _ *settings.LlmProxyPartnerPoweredWorkspaceAPI = nil _ *billing.LogDeliveryAPI = nil + _ *ml.MaterializedFeaturesAPI = nil _ *catalog.AccountMetastoreAssignmentsAPI = nil _ *catalog.MetastoresAPI = nil _ *catalog.AccountMetastoresAPI = nil @@ -454,6 +465,7 @@ var ( _ *catalog.QualityMonitorsAPI = nil _ *sql.QueriesAPI = nil _ *sql.QueriesLegacyAPI = nil + _ *dashboards.QueryExecutionAPI = nil _ *sql.QueryHistoryAPI = nil _ *sql.QueryVisualizationsAPI = nil _ *sql.QueryVisualizationsLegacyAPI = nil diff --git a/service/provisioning/impl.go b/service/provisioning/impl.go index 00fe68611..d69309f8e 100755 --- a/service/provisioning/impl.go +++ b/service/provisioning/impl.go @@ -27,12 +27,11 @@ func (a *credentialsImpl) Create(ctx context.Context, request CreateCredentialRe } func (a *credentialsImpl) Delete(ctx context.Context, request DeleteCredentialRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/accounts/%v/credentials/%v", a.client.ConfiguredAccountID(), request.CredentialsId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -73,12 +72,11 @@ func (a *encryptionKeysImpl) Create(ctx context.Context, request CreateCustomerM } func (a *encryptionKeysImpl) Delete(ctx context.Context, request DeleteEncryptionKeyRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/accounts/%v/customer-managed-keys/%v", a.client.ConfiguredAccountID(), request.CustomerManagedKeyId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -119,12 +117,11 @@ func (a *networksImpl) Create(ctx context.Context, request CreateNetworkRequest) } func (a *networksImpl) Delete(ctx context.Context, request DeleteNetworkRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/accounts/%v/networks/%v", a.client.ConfiguredAccountID(), request.NetworkId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -165,12 +162,11 @@ func (a *privateAccessImpl) Create(ctx context.Context, request UpsertPrivateAcc } func (a *privateAccessImpl) Delete(ctx context.Context, request DeletePrivateAccesRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/accounts/%v/private-access-settings/%v", a.client.ConfiguredAccountID(), request.PrivateAccessSettingsId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -195,13 +191,12 @@ func (a *privateAccessImpl) List(ctx context.Context) ([]PrivateAccessSettings, } func (a *privateAccessImpl) Replace(ctx context.Context, request UpsertPrivateAccessSettingsRequest) error { - var replaceResponse ReplaceResponse path := fmt.Sprintf("/api/2.0/accounts/%v/private-access-settings/%v", a.client.ConfiguredAccountID(), request.PrivateAccessSettingsId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &replaceResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, nil) return err } @@ -222,12 +217,11 @@ func (a *storageImpl) Create(ctx context.Context, request CreateStorageConfigura } func (a *storageImpl) Delete(ctx context.Context, request DeleteStorageRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/accounts/%v/storage-configurations/%v", a.client.ConfiguredAccountID(), request.StorageConfigurationId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -268,12 +262,11 @@ func (a *vpcEndpointsImpl) Create(ctx context.Context, request CreateVpcEndpoint } func (a *vpcEndpointsImpl) Delete(ctx context.Context, request DeleteVpcEndpointRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/accounts/%v/vpc-endpoints/%v", a.client.ConfiguredAccountID(), request.VpcEndpointId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -314,12 +307,11 @@ func (a *workspacesImpl) Create(ctx context.Context, request CreateWorkspaceRequ } func (a *workspacesImpl) Delete(ctx context.Context, request DeleteWorkspaceRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v", a.client.ConfiguredAccountID(), request.WorkspaceId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -344,12 +336,11 @@ func (a *workspacesImpl) List(ctx context.Context) ([]Workspace, error) { } func (a *workspacesImpl) Update(ctx context.Context, request UpdateWorkspaceRequest) error { - var updateResponse UpdateResponse path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v", a.client.ConfiguredAccountID(), request.WorkspaceId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, nil) return err } diff --git a/service/provisioning/model.go b/service/provisioning/model.go index 56a274570..7f0e5b9ef 100755 --- a/service/provisioning/model.go +++ b/service/provisioning/model.go @@ -369,25 +369,21 @@ func (s CustomerManagedKey) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Delete credential configuration type DeleteCredentialRequest struct { // Databricks Account API credential configuration ID CredentialsId string `json:"-" url:"-"` } -// Delete encryption key configuration type DeleteEncryptionKeyRequest struct { // Databricks encryption key configuration ID. CustomerManagedKeyId string `json:"-" url:"-"` } -// Delete a network configuration type DeleteNetworkRequest struct { // Databricks Account API network configuration ID. NetworkId string `json:"-" url:"-"` } -// Delete a private access settings object type DeletePrivateAccesRequest struct { // Databricks Account API private access settings ID. PrivateAccessSettingsId string `json:"-" url:"-"` @@ -396,19 +392,16 @@ type DeletePrivateAccesRequest struct { type DeleteResponse struct { } -// Delete storage configuration type DeleteStorageRequest struct { // Databricks Account API storage configuration ID. StorageConfigurationId string `json:"-" url:"-"` } -// Delete VPC endpoint configuration type DeleteVpcEndpointRequest struct { // Databricks VPC endpoint ID. VpcEndpointId string `json:"-" url:"-"` } -// Delete a workspace type DeleteWorkspaceRequest struct { // Workspace ID. WorkspaceId int64 `json:"-" url:"-"` @@ -621,43 +614,36 @@ func (s GcpVpcEndpointInfo) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get credential configuration type GetCredentialRequest struct { // Databricks Account API credential configuration ID CredentialsId string `json:"-" url:"-"` } -// Get encryption key configuration type GetEncryptionKeyRequest struct { // Databricks encryption key configuration ID. CustomerManagedKeyId string `json:"-" url:"-"` } -// Get a network configuration type GetNetworkRequest struct { // Databricks Account API network configuration ID. NetworkId string `json:"-" url:"-"` } -// Get a private access settings object type GetPrivateAccesRequest struct { // Databricks Account API private access settings ID. PrivateAccessSettingsId string `json:"-" url:"-"` } -// Get storage configuration type GetStorageRequest struct { // Databricks Account API storage configuration ID. StorageConfigurationId string `json:"-" url:"-"` } -// Get a VPC endpoint configuration type GetVpcEndpointRequest struct { // Databricks VPC endpoint ID. VpcEndpointId string `json:"-" url:"-"` } -// Get a workspace type GetWorkspaceRequest struct { // Workspace ID. WorkspaceId int64 `json:"-" url:"-"` diff --git a/service/qualitymonitorv2/impl.go b/service/qualitymonitorv2/impl.go index 4c38620b5..d98977e5a 100755 --- a/service/qualitymonitorv2/impl.go +++ b/service/qualitymonitorv2/impl.go @@ -29,12 +29,11 @@ func (a *qualityMonitorV2Impl) CreateQualityMonitor(ctx context.Context, request } func (a *qualityMonitorV2Impl) DeleteQualityMonitor(ctx context.Context, request DeleteQualityMonitorRequest) error { - var deleteQualityMonitorResponse DeleteQualityMonitorResponse path := fmt.Sprintf("/api/2.0/quality-monitors/%v/%v", request.ObjectType, request.ObjectId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteQualityMonitorResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } diff --git a/service/qualitymonitorv2/model.go b/service/qualitymonitorv2/model.go index 17bd86443..4f668a4d5 100755 --- a/service/qualitymonitorv2/model.go +++ b/service/qualitymonitorv2/model.go @@ -81,12 +81,10 @@ func (f *AnomalyDetectionRunStatus) Type() string { return "AnomalyDetectionRunStatus" } -// Create a quality monitor type CreateQualityMonitorRequest struct { QualityMonitor QualityMonitor `json:"quality_monitor"` } -// Delete a quality monitor type DeleteQualityMonitorRequest struct { // The uuid of the request object. For example, schema id. ObjectId string `json:"-" url:"-"` @@ -97,7 +95,6 @@ type DeleteQualityMonitorRequest struct { type DeleteQualityMonitorResponse struct { } -// Read a quality monitor type GetQualityMonitorRequest struct { // The uuid of the request object. For example, schema id. ObjectId string `json:"-" url:"-"` @@ -105,7 +102,6 @@ type GetQualityMonitorRequest struct { ObjectType string `json:"-" url:"-"` } -// List quality monitors type ListQualityMonitorRequest struct { PageSize int `json:"-" url:"page_size,omitempty"` @@ -146,7 +142,6 @@ type QualityMonitor struct { ObjectType string `json:"object_type"` } -// Update a quality monitor type UpdateQualityMonitorRequest struct { // The uuid of the request object. For example, schema id. ObjectId string `json:"-" url:"-"` diff --git a/service/serving/impl.go b/service/serving/impl.go index b4fa2f11f..df36a738b 100755 --- a/service/serving/impl.go +++ b/service/serving/impl.go @@ -54,11 +54,10 @@ func (a *servingEndpointsImpl) CreateProvisionedThroughputEndpoint(ctx context.C } func (a *servingEndpointsImpl) Delete(ctx context.Context, request DeleteServingEndpointRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/serving-endpoints/%v", request.Name) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } diff --git a/service/serving/model.go b/service/serving/model.go index cd3cf0053..598df3faf 100755 --- a/service/serving/model.go +++ b/service/serving/model.go @@ -458,7 +458,6 @@ func (s BearerTokenAuth) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get build logs for a served model type BuildLogsRequest struct { // The name of the serving endpoint that the served model belongs to. This // field is required. @@ -592,6 +591,8 @@ type CreateServingEndpoint struct { BudgetPolicyId string `json:"budget_policy_id,omitempty"` // The core config of the serving endpoint. Config *EndpointCoreConfigInput `json:"config,omitempty"` + + Description string `json:"description,omitempty"` // The name of the serving endpoint. This field is required and must be // unique across a Databricks workspace. An endpoint name can consist of // alphanumeric characters, dashes, and underscores. @@ -687,7 +688,6 @@ type DataframeSplitInput struct { type DeleteResponse struct { } -// Delete a serving endpoint type DeleteServingEndpointRequest struct { Name string `json:"-" url:"-"` } @@ -946,7 +946,6 @@ type EndpointTags struct { Tags []EndpointTag `json:"tags,omitempty"` } -// Get metrics of a serving endpoint type ExportMetricsRequest struct { // The name of the serving endpoint to retrieve metrics for. This field is // required. @@ -1172,7 +1171,6 @@ func (s FoundationModel) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get the schema for a serving endpoint type GetOpenApiRequest struct { // The name of the serving endpoint that the served model belongs to. This // field is required. @@ -1183,7 +1181,6 @@ type GetOpenApiResponse struct { Contents io.ReadCloser `json:"-"` } -// Get serving endpoint permission levels type GetServingEndpointPermissionLevelsRequest struct { // The serving endpoint for which to get or manage permissions. ServingEndpointId string `json:"-" url:"-"` @@ -1194,13 +1191,11 @@ type GetServingEndpointPermissionLevelsResponse struct { PermissionLevels []ServingEndpointPermissionsDescription `json:"permission_levels,omitempty"` } -// Get serving endpoint permissions type GetServingEndpointPermissionsRequest struct { // The serving endpoint for which to get or manage permissions. ServingEndpointId string `json:"-" url:"-"` } -// Get a single serving endpoint type GetServingEndpointRequest struct { // The name of the serving endpoint. This field is required. Name string `json:"-" url:"-"` @@ -1258,7 +1253,6 @@ type ListEndpointsResponse struct { Endpoints []ServingEndpoint `json:"endpoints,omitempty"` } -// Get the latest logs for a served model type LogsRequest struct { // The name of the serving endpoint that the served model belongs to. This // field is required. @@ -1713,11 +1707,22 @@ func (f *RateLimitRenewalPeriod) Type() string { } type Route struct { + ServedEntityName string `json:"served_entity_name,omitempty"` // The name of the served model this route configures traffic for. - ServedModelName string `json:"served_model_name"` + ServedModelName string `json:"served_model_name,omitempty"` // The percentage of endpoint traffic to send to this route. It must be an // integer between 0 and 100 inclusive. TrafficPercentage int `json:"traffic_percentage"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *Route) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s Route) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) } type ServedEntityInput struct { diff --git a/service/settings/impl.go b/service/settings/impl.go index eab1eff62..9c0c0f821 100755 --- a/service/settings/impl.go +++ b/service/settings/impl.go @@ -29,11 +29,10 @@ func (a *accountIpAccessListsImpl) Create(ctx context.Context, request CreateIpA } func (a *accountIpAccessListsImpl) Delete(ctx context.Context, request DeleteAccountIpAccessListRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/accounts/%v/ip-access-lists/%v", a.client.ConfiguredAccountID(), request.IpAccessListId) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -84,22 +83,20 @@ func (a *accountIpAccessListsImpl) internalList(ctx context.Context) (*GetIpAcce } func (a *accountIpAccessListsImpl) Replace(ctx context.Context, request ReplaceIpAccessList) error { - var replaceResponse ReplaceResponse path := fmt.Sprintf("/api/2.0/accounts/%v/ip-access-lists/%v", a.client.ConfiguredAccountID(), request.IpAccessListId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &replaceResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, nil) return err } func (a *accountIpAccessListsImpl) Update(ctx context.Context, request UpdateIpAccessList) error { - var updateResponse UpdateResponse path := fmt.Sprintf("/api/2.0/accounts/%v/ip-access-lists/%v", a.client.ConfiguredAccountID(), request.IpAccessListId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, nil) return err } @@ -637,11 +634,10 @@ func (a *ipAccessListsImpl) Create(ctx context.Context, request CreateIpAccessLi } func (a *ipAccessListsImpl) Delete(ctx context.Context, request DeleteIpAccessListRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/ip-access-lists/%v", request.IpAccessListId) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -692,22 +688,20 @@ func (a *ipAccessListsImpl) internalList(ctx context.Context) (*ListIpAccessList } func (a *ipAccessListsImpl) Replace(ctx context.Context, request ReplaceIpAccessList) error { - var replaceResponse ReplaceResponse path := fmt.Sprintf("/api/2.0/ip-access-lists/%v", request.IpAccessListId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &replaceResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, nil) return err } func (a *ipAccessListsImpl) Update(ctx context.Context, request UpdateIpAccessList) error { - var updateResponse UpdateResponse path := fmt.Sprintf("/api/2.0/ip-access-lists/%v", request.IpAccessListId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, nil) return err } @@ -827,12 +821,11 @@ func (a *networkConnectivityImpl) CreatePrivateEndpointRule(ctx context.Context, } func (a *networkConnectivityImpl) DeleteNetworkConnectivityConfiguration(ctx context.Context, request DeleteNetworkConnectivityConfigurationRequest) error { - var deleteNetworkConnectivityConfigurationResponse DeleteNetworkConnectivityConfigurationResponse path := fmt.Sprintf("/api/2.0/accounts/%v/network-connectivity-configs/%v", a.client.ConfiguredAccountID(), request.NetworkConnectivityConfigId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteNetworkConnectivityConfigurationResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -979,12 +972,11 @@ func (a *networkPoliciesImpl) CreateNetworkPolicyRpc(ctx context.Context, reques } func (a *networkPoliciesImpl) DeleteNetworkPolicyRpc(ctx context.Context, request DeleteNetworkPolicyRequest) error { - var deleteNetworkPolicyRpcResponse DeleteNetworkPolicyRpcResponse path := fmt.Sprintf("/api/2.0/accounts/%v/network-policies/%v", a.client.ConfiguredAccountID(), request.NetworkPolicyId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteNetworkPolicyRpcResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -1067,12 +1059,11 @@ func (a *notificationDestinationsImpl) Create(ctx context.Context, request Creat } func (a *notificationDestinationsImpl) Delete(ctx context.Context, request DeleteNotificationDestinationRequest) error { - var empty Empty path := fmt.Sprintf("/api/2.0/notification-destinations/%v", request.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &empty) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -1268,11 +1259,10 @@ func (a *tokenManagementImpl) CreateOboToken(ctx context.Context, request Create } func (a *tokenManagementImpl) Delete(ctx context.Context, request DeleteTokenManagementRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/token-management/tokens/%v", request.TokenId) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -1380,13 +1370,12 @@ func (a *tokensImpl) Create(ctx context.Context, request CreateTokenRequest) (*C } func (a *tokensImpl) Delete(ctx context.Context, request RevokeTokenRequest) error { - var revokeTokenResponse RevokeTokenResponse path := "/api/2.0/token/delete" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &revokeTokenResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } @@ -1442,12 +1431,11 @@ func (a *workspaceConfImpl) GetStatus(ctx context.Context, request GetStatusRequ } func (a *workspaceConfImpl) SetStatus(ctx context.Context, request WorkspaceConf) error { - var setStatusResponse SetStatusResponse path := "/api/2.0/workspace-conf" queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &setStatusResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, nil) return err } diff --git a/service/settings/model.go b/service/settings/model.go index 6e83773e2..760387cd2 100755 --- a/service/settings/model.go +++ b/service/settings/model.go @@ -536,7 +536,6 @@ type CreateIpAccessListResponse struct { IpAccessList *IpAccessListInfo `json:"ip_access_list,omitempty"` } -// Create a network connectivity configuration type CreateNetworkConnectivityConfigRequest struct { // Properties of the new network connectivity configuration. NetworkConnectivityConfig CreateNetworkConnectivityConfiguration `json:"network_connectivity_config"` @@ -555,7 +554,6 @@ type CreateNetworkConnectivityConfiguration struct { Region string `json:"region"` } -// Create a network policy type CreateNetworkPolicyRequest struct { NetworkPolicy AccountNetworkPolicy `json:"network_policy"` } @@ -654,7 +652,6 @@ func (s CreatePrivateEndpointRule) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Create a private endpoint rule type CreatePrivateEndpointRuleRequest struct { // Your Network Connectivity Configuration ID. NetworkConnectivityConfigId string `json:"-" url:"-"` @@ -928,7 +925,6 @@ func (s DefaultNamespaceSetting) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Delete the account IP access toggle setting type DeleteAccountIpAccessEnableRequest 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 @@ -962,13 +958,11 @@ type DeleteAccountIpAccessEnableResponse struct { Etag string `json:"etag"` } -// Delete access list type DeleteAccountIpAccessListRequest struct { // The ID for the corresponding IP access list 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 @@ -1002,7 +996,6 @@ type DeleteAibiDashboardEmbeddingAccessPolicySettingResponse struct { 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 @@ -1036,7 +1029,6 @@ type DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse struct { Etag string `json:"etag"` } -// Delete the Dashboard Email Subscriptions setting type DeleteDashboardEmailSubscriptionsRequest 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 @@ -1070,7 +1062,6 @@ type DeleteDashboardEmailSubscriptionsResponse struct { 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 // provided. This is used for optimistic concurrency control as a way to @@ -1104,7 +1095,6 @@ type DeleteDefaultNamespaceSettingResponse struct { Etag string `json:"etag"` } -// Delete Legacy Access Disablement Status type DeleteDisableLegacyAccessRequest 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 @@ -1138,7 +1128,6 @@ type DeleteDisableLegacyAccessResponse struct { Etag string `json:"etag"` } -// Delete the disable legacy DBFS setting type DeleteDisableLegacyDbfsRequest 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 @@ -1172,7 +1161,6 @@ type DeleteDisableLegacyDbfsResponse struct { Etag string `json:"etag"` } -// Delete the disable legacy features setting type DeleteDisableLegacyFeaturesRequest 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 @@ -1206,13 +1194,11 @@ type DeleteDisableLegacyFeaturesResponse struct { Etag string `json:"etag"` } -// Delete access list type DeleteIpAccessListRequest struct { // The ID for the corresponding IP access list IpAccessListId string `json:"-" url:"-"` } -// Delete the enable partner powered AI features workspace setting type DeleteLlmProxyPartnerPoweredWorkspaceRequest 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 @@ -1246,7 +1232,6 @@ type DeleteLlmProxyPartnerPoweredWorkspaceResponse struct { Etag string `json:"etag"` } -// Delete a network connectivity configuration type DeleteNetworkConnectivityConfigurationRequest struct { // Your Network Connectivity Configuration ID. NetworkConnectivityConfigId string `json:"-" url:"-"` @@ -1255,7 +1240,6 @@ type DeleteNetworkConnectivityConfigurationRequest struct { type DeleteNetworkConnectivityConfigurationResponse struct { } -// Delete a network policy type DeleteNetworkPolicyRequest struct { // The unique identifier of the network policy to delete. NetworkPolicyId string `json:"-" url:"-"` @@ -1264,12 +1248,10 @@ type DeleteNetworkPolicyRequest struct { type DeleteNetworkPolicyRpcResponse struct { } -// Delete a notification destination type DeleteNotificationDestinationRequest struct { Id string `json:"-" url:"-"` } -// Delete Personal Compute setting type DeletePersonalComputeSettingRequest 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 @@ -1303,7 +1285,6 @@ type DeletePersonalComputeSettingResponse struct { Etag string `json:"etag"` } -// Delete a private endpoint rule type DeletePrivateEndpointRuleRequest struct { // Your Network Connectvity Configuration ID. NetworkConnectivityConfigId string `json:"-" url:"-"` @@ -1314,7 +1295,6 @@ type DeletePrivateEndpointRuleRequest struct { type DeleteResponse struct { } -// Delete the restrict workspace admins setting type DeleteRestrictWorkspaceAdminsSettingRequest 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 @@ -1348,7 +1328,6 @@ type DeleteRestrictWorkspaceAdminsSettingResponse struct { Etag string `json:"etag"` } -// Delete the SQL Results Download setting type DeleteSqlResultsDownloadRequest 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 @@ -1382,7 +1361,6 @@ type DeleteSqlResultsDownloadResponse struct { Etag string `json:"etag"` } -// Delete a token type DeleteTokenManagementRequest struct { // The ID of the token to revoke. TokenId string `json:"-" url:"-"` @@ -2366,7 +2344,6 @@ func (s GenericWebhookConfig) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get the account IP access toggle setting type GetAccountIpAccessEnableRequest 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 @@ -2388,13 +2365,11 @@ func (s GetAccountIpAccessEnableRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get IP access list type GetAccountIpAccessListRequest struct { // The ID for the corresponding IP access list IpAccessListId string `json:"-" url:"-"` } -// Retrieve the AI/BI dashboard embedding access policy type GetAibiDashboardEmbeddingAccessPolicySettingRequest 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 @@ -2416,7 +2391,6 @@ func (s GetAibiDashboardEmbeddingAccessPolicySettingRequest) MarshalJSON() ([]by return marshal.Marshal(s) } -// Retrieve the list of domains approved to host embedded AI/BI dashboards type GetAibiDashboardEmbeddingApprovedDomainsSettingRequest 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 @@ -2438,7 +2412,6 @@ func (s GetAibiDashboardEmbeddingApprovedDomainsSettingRequest) MarshalJSON() ([ return marshal.Marshal(s) } -// Get the automatic cluster update setting type GetAutomaticClusterUpdateSettingRequest 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 @@ -2460,7 +2433,6 @@ func (s GetAutomaticClusterUpdateSettingRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get the compliance security profile setting type GetComplianceSecurityProfileSettingRequest 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 @@ -2482,7 +2454,6 @@ func (s GetComplianceSecurityProfileSettingRequest) MarshalJSON() ([]byte, error return marshal.Marshal(s) } -// Get the compliance security profile setting for new workspaces type GetCspEnablementAccountSettingRequest 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 @@ -2504,7 +2475,6 @@ func (s GetCspEnablementAccountSettingRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get the Dashboard Email Subscriptions setting type GetDashboardEmailSubscriptionsRequest 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 @@ -2526,7 +2496,6 @@ func (s GetDashboardEmailSubscriptionsRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get the default namespace setting type GetDefaultNamespaceSettingRequest 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 @@ -2548,7 +2517,6 @@ func (s GetDefaultNamespaceSettingRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Retrieve Legacy Access Disablement Status type GetDisableLegacyAccessRequest 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 @@ -2570,7 +2538,6 @@ func (s GetDisableLegacyAccessRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get the disable legacy DBFS setting type GetDisableLegacyDbfsRequest 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 @@ -2592,7 +2559,6 @@ func (s GetDisableLegacyDbfsRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get the disable legacy features setting type GetDisableLegacyFeaturesRequest 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 @@ -2614,7 +2580,6 @@ func (s GetDisableLegacyFeaturesRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get the enhanced security monitoring setting type GetEnhancedSecurityMonitoringSettingRequest 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 @@ -2636,7 +2601,6 @@ func (s GetEnhancedSecurityMonitoringSettingRequest) MarshalJSON() ([]byte, erro return marshal.Marshal(s) } -// Get the enhanced security monitoring setting for new workspaces type GetEsmEnablementAccountSettingRequest 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 @@ -2658,7 +2622,6 @@ func (s GetEsmEnablementAccountSettingRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get access list type GetIpAccessListRequest struct { // The ID for the corresponding IP access list IpAccessListId string `json:"-" url:"-"` @@ -2674,7 +2637,6 @@ type GetIpAccessListsResponse struct { IpAccessLists []IpAccessListInfo `json:"ip_access_lists,omitempty"` } -// Get the enable partner powered AI features account setting type GetLlmProxyPartnerPoweredAccountRequest 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 @@ -2696,7 +2658,6 @@ func (s GetLlmProxyPartnerPoweredAccountRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get the enforcement status of partner powered AI features account setting type GetLlmProxyPartnerPoweredEnforceRequest 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 @@ -2718,7 +2679,6 @@ func (s GetLlmProxyPartnerPoweredEnforceRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get the enable partner powered AI features workspace setting type GetLlmProxyPartnerPoweredWorkspaceRequest 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 @@ -2740,24 +2700,20 @@ func (s GetLlmProxyPartnerPoweredWorkspaceRequest) MarshalJSON() ([]byte, error) return marshal.Marshal(s) } -// Get a network connectivity configuration type GetNetworkConnectivityConfigurationRequest struct { // Your Network Connectivity Configuration ID. NetworkConnectivityConfigId string `json:"-" url:"-"` } -// Get a network policy type GetNetworkPolicyRequest struct { // The unique identifier of the network policy to retrieve. NetworkPolicyId string `json:"-" url:"-"` } -// Get a notification destination type GetNotificationDestinationRequest struct { Id string `json:"-" url:"-"` } -// Get Personal Compute setting type GetPersonalComputeSettingRequest 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 @@ -2779,7 +2735,6 @@ func (s GetPersonalComputeSettingRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Gets a private endpoint rule type GetPrivateEndpointRuleRequest struct { // Your Network Connectvity Configuration ID. NetworkConnectivityConfigId string `json:"-" url:"-"` @@ -2787,7 +2742,6 @@ type GetPrivateEndpointRuleRequest struct { PrivateEndpointRuleId string `json:"-" url:"-"` } -// Get the restrict workspace admins setting type GetRestrictWorkspaceAdminsSettingRequest 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 @@ -2809,7 +2763,6 @@ func (s GetRestrictWorkspaceAdminsSettingRequest) MarshalJSON() ([]byte, error) return marshal.Marshal(s) } -// Get the SQL Results Download setting type GetSqlResultsDownloadRequest 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 @@ -2831,12 +2784,10 @@ func (s GetSqlResultsDownloadRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Check configuration status type GetStatusRequest struct { Keys string `json:"-" url:"keys"` } -// Get token info type GetTokenManagementRequest struct { // The ID of the token to get. TokenId string `json:"-" url:"-"` @@ -2852,7 +2803,6 @@ type GetTokenResponse struct { TokenInfo *TokenInfo `json:"token_info,omitempty"` } -// Get workspace network option type GetWorkspaceNetworkOptionRequest struct { // The workspace ID. WorkspaceId int64 `json:"-" url:"-"` @@ -2902,7 +2852,6 @@ type ListIpAccessListResponse struct { IpAccessLists []IpAccessListInfo `json:"ip_access_lists,omitempty"` } -// List network connectivity configurations type ListNetworkConnectivityConfigurationsRequest struct { // Pagination token to go to next page based on previous query. PageToken string `json:"-" url:"page_token,omitempty"` @@ -2936,7 +2885,6 @@ func (s ListNetworkConnectivityConfigurationsResponse) MarshalJSON() ([]byte, er return marshal.Marshal(s) } -// List network policies type ListNetworkPoliciesRequest struct { // Pagination token to go to next page based on previous query. PageToken string `json:"-" url:"page_token,omitempty"` @@ -2970,7 +2918,6 @@ func (s ListNetworkPoliciesResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List notification destinations type ListNotificationDestinationsRequest struct { PageSize int64 `json:"-" url:"page_size,omitempty"` @@ -3024,7 +2971,6 @@ func (s ListNotificationDestinationsResult) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List private endpoint rules type ListPrivateEndpointRulesRequest struct { // Your Network Connectvity Configuration ID. NetworkConnectivityConfigId string `json:"-" url:"-"` @@ -3065,7 +3011,6 @@ type ListPublicTokensResponse struct { TokenInfos []PublicTokenInfo `json:"token_infos,omitempty"` } -// List all tokens type ListTokenManagementRequest struct { // User ID of the user that created the token. CreatedById int64 `json:"-" url:"created_by_id,omitempty"` @@ -4550,7 +4495,6 @@ type UpdateLlmProxyPartnerPoweredWorkspaceRequest struct { Setting LlmProxyPartnerPoweredWorkspace `json:"setting"` } -// Update a private endpoint rule type UpdateNccPrivateEndpointRuleRequest struct { // The ID of a network connectivity configuration, which is the parent // resource of this private endpoint rule object. @@ -4569,7 +4513,6 @@ type UpdateNccPrivateEndpointRuleRequest struct { UpdateMask string `json:"-" url:"update_mask"` } -// Update a network policy type UpdateNetworkPolicyRequest struct { NetworkPolicy AccountNetworkPolicy `json:"network_policy"` // The unique identifier for the network policy. @@ -4695,7 +4638,6 @@ type UpdateSqlResultsDownloadRequest struct { Setting SqlResultsDownload `json:"setting"` } -// Update workspace network option type UpdateWorkspaceNetworkOptionRequest struct { // The workspace ID. WorkspaceId int64 `json:"-" url:"-"` diff --git a/service/sharing/impl.go b/service/sharing/impl.go index c5dc9ca0a..203666228 100755 --- a/service/sharing/impl.go +++ b/service/sharing/impl.go @@ -30,11 +30,10 @@ func (a *providersImpl) Create(ctx context.Context, request CreateProvider) (*Pr } func (a *providersImpl) Delete(ctx context.Context, request DeleteProviderRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.1/unity-catalog/providers/%v", request.Name) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -171,12 +170,11 @@ type recipientActivationImpl struct { } func (a *recipientActivationImpl) GetActivationUrlInfo(ctx context.Context, request GetActivationUrlInfoRequest) error { - var getActivationUrlInfoResponse GetActivationUrlInfoResponse path := fmt.Sprintf("/api/2.1/unity-catalog/public/data_sharing_activation_info/%v", request.ActivationUrl) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getActivationUrlInfoResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, nil) return err } @@ -207,12 +205,11 @@ func (a *recipientFederationPoliciesImpl) Create(ctx context.Context, request Cr } func (a *recipientFederationPoliciesImpl) Delete(ctx context.Context, request DeleteFederationPolicyRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/data-sharing/recipients/%v/federation-policies/%v", request.RecipientName, request.Name) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -302,11 +299,10 @@ func (a *recipientsImpl) Create(ctx context.Context, request CreateRecipient) (* } func (a *recipientsImpl) Delete(ctx context.Context, request DeleteRecipientRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.1/unity-catalog/recipients/%v", request.Name) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -418,11 +414,10 @@ func (a *sharesImpl) Create(ctx context.Context, request CreateShare) (*ShareInf } func (a *sharesImpl) Delete(ctx context.Context, request DeleteShareRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.1/unity-catalog/shares/%v", request.Name) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } diff --git a/service/sharing/model.go b/service/sharing/model.go index f88285200..07288264b 100755 --- a/service/sharing/model.go +++ b/service/sharing/model.go @@ -152,7 +152,6 @@ func (f *ColumnTypeName) Type() string { return "ColumnTypeName" } -// Create recipient federation policy type CreateFederationPolicyRequest struct { Policy FederationPolicy `json:"policy"` // Name of the recipient. This is the name of the recipient for which the @@ -239,7 +238,6 @@ func (s CreateShare) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Delete recipient federation policy type DeleteFederationPolicyRequest struct { // Name of the policy. This is the name of the policy to be deleted. Name string `json:"-" url:"-"` @@ -248,13 +246,11 @@ type DeleteFederationPolicyRequest struct { RecipientName string `json:"-" url:"-"` } -// Delete a provider type DeleteProviderRequest struct { // Name of the provider. Name string `json:"-" url:"-"` } -// Delete a share recipient type DeleteRecipientRequest struct { // Name of the recipient. Name string `json:"-" url:"-"` @@ -263,7 +259,6 @@ type DeleteRecipientRequest struct { type DeleteResponse struct { } -// Delete a share type DeleteShareRequest struct { // The name of the share. Name string `json:"-" url:"-"` @@ -511,7 +506,6 @@ func (f *FunctionParameterType) Type() string { return "FunctionParameterType" } -// Get a share activation URL type GetActivationUrlInfoRequest struct { // The one time activation url. It also accepts activation token. ActivationUrl string `json:"-" url:"-"` @@ -520,7 +514,6 @@ type GetActivationUrlInfoRequest struct { type GetActivationUrlInfoResponse struct { } -// Get recipient federation policy type GetFederationPolicyRequest struct { // Name of the policy. This is the name of the policy to be retrieved. Name string `json:"-" url:"-"` @@ -529,13 +522,11 @@ type GetFederationPolicyRequest struct { RecipientName string `json:"-" url:"-"` } -// Get a provider type GetProviderRequest struct { // Name of the provider. Name string `json:"-" url:"-"` } -// Get a share recipient type GetRecipientRequest struct { // Name of the recipient. Name string `json:"-" url:"-"` @@ -579,7 +570,6 @@ func (s GetSharePermissionsResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get a share type GetShareRequest struct { // Query for data to include in the share. IncludeSharedData bool `json:"-" url:"include_shared_data,omitempty"` @@ -602,7 +592,6 @@ type IpAccessList struct { AllowedIpAddresses []string `json:"allowed_ip_addresses,omitempty"` } -// List recipient federation policies type ListFederationPoliciesRequest struct { MaxResults int `json:"-" url:"max_results,omitempty"` @@ -638,7 +627,6 @@ func (s ListFederationPoliciesResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List assets by provider share type ListProviderShareAssetsRequest struct { // Maximum number of functions to return. FunctionMaxResults int `json:"-" url:"function_max_results,omitempty"` @@ -696,7 +684,6 @@ func (s ListProviderSharesResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List providers type ListProvidersRequest struct { // If not provided, all providers will be returned. If no providers exist // with this ID, no results will be returned. @@ -744,7 +731,6 @@ func (s ListProvidersResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List share recipients type ListRecipientsRequest struct { // If not provided, all recipients will be returned. If no recipients exist // with this ID, no results will be returned. @@ -792,7 +778,6 @@ func (s ListRecipientsResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List shares by Provider type ListSharesRequest struct { // Maximum number of shares to return. - when set to 0, the page length is // set to a server configured value (recommended); - when set to a value @@ -1151,8 +1136,12 @@ func (f *Privilege) Type() string { } type PrivilegeAssignment struct { - // The principal (user email address or group name). + // The principal (user email address or group name). For deleted principals, + // `principal` is empty while `principal_id` is populated. Principal string `json:"principal,omitempty"` + // Unique identifier of the principal. For active principals, both + // `principal` and `principal_id` are present. + PrincipalId int64 `json:"principal_id,omitempty"` // The privileges assigned to the principal. Privileges []Privilege `json:"privileges,omitempty"` @@ -1357,7 +1346,6 @@ func (s RegisteredModelAlias) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get an access token type RetrieveTokenRequest struct { // The one time activation url. It also accepts activation token. ActivationUrl string `json:"-" url:"-"` @@ -1434,7 +1422,6 @@ func (s ShareInfo) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get recipient share permissions type SharePermissionsRequest struct { // Maximum number of permissions to return. - when set to 0, the page length // is set to a server configured value (recommended); - when set to a value @@ -1871,7 +1858,6 @@ func (f *TableInternalAttributesSharedTableType) Type() string { return "TableInternalAttributesSharedTableType" } -// Update recipient federation policy type UpdateFederationPolicyRequest struct { // Name of the policy. This is the name of the current name of the policy. Name string `json:"-" url:"-"` diff --git a/service/sql/api.go b/service/sql/api.go index 25cb58346..4c5539109 100755 --- a/service/sql/api.go +++ b/service/sql/api.go @@ -213,24 +213,6 @@ type AlertsLegacyInterface interface { // [Learn more]: https://docs.databricks.com/en/sql/dbsql-api-latest.html List(ctx context.Context) ([]LegacyAlert, error) - // LegacyAlertNameToIdMap calls [AlertsLegacyAPI.List] and creates a map of results with [LegacyAlert].Name as key and [LegacyAlert].Id as value. - // - // Returns an error if there's more than one [LegacyAlert] with the same .Name. - // - // Note: All [LegacyAlert] instances are loaded into memory before creating a map. - // - // This method is generated by Databricks SDK Code Generator. - LegacyAlertNameToIdMap(ctx context.Context) (map[string]string, error) - - // GetByName calls [AlertsLegacyAPI.LegacyAlertNameToIdMap] and returns a single [LegacyAlert]. - // - // Returns an error if there's more than one [LegacyAlert] with the same .Name. - // - // Note: All [LegacyAlert] instances are loaded into memory before returning matching by name. - // - // This method is generated by Databricks SDK Code Generator. - GetByName(ctx context.Context, name string) (*LegacyAlert, error) - // Updates an alert. // // **Note**: A new version of the Databricks SQL API is now available. Please @@ -288,59 +270,6 @@ func (a *AlertsLegacyAPI) GetByAlertId(ctx context.Context, alertId string) (*Le }) } -// LegacyAlertNameToIdMap calls [AlertsLegacyAPI.List] and creates a map of results with [LegacyAlert].Name as key and [LegacyAlert].Id as value. -// -// Returns an error if there's more than one [LegacyAlert] with the same .Name. -// -// Note: All [LegacyAlert] instances are loaded into memory before creating a map. -// -// This method is generated by Databricks SDK Code Generator. -func (a *AlertsLegacyAPI) LegacyAlertNameToIdMap(ctx context.Context) (map[string]string, error) { - ctx = useragent.InContext(ctx, "sdk-feature", "name-to-id") - mapping := map[string]string{} - result, err := a.List(ctx) - if err != nil { - return nil, err - } - for _, v := range result { - key := v.Name - _, duplicate := mapping[key] - if duplicate { - return nil, fmt.Errorf("duplicate .Name: %s", key) - } - mapping[key] = v.Id - } - return mapping, nil -} - -// GetByName calls [AlertsLegacyAPI.LegacyAlertNameToIdMap] and returns a single [LegacyAlert]. -// -// Returns an error if there's more than one [LegacyAlert] with the same .Name. -// -// Note: All [LegacyAlert] instances are loaded into memory before returning matching by name. -// -// This method is generated by Databricks SDK Code Generator. -func (a *AlertsLegacyAPI) GetByName(ctx context.Context, name string) (*LegacyAlert, error) { - ctx = useragent.InContext(ctx, "sdk-feature", "get-by-name") - result, err := a.List(ctx) - if err != nil { - return nil, err - } - tmp := map[string][]LegacyAlert{} - for _, v := range result { - key := v.Name - tmp[key] = append(tmp[key], v) - } - alternatives, ok := tmp[name] - if !ok || len(alternatives) == 0 { - return nil, fmt.Errorf("LegacyAlert named '%s' does not exist", name) - } - if len(alternatives) > 1 { - return nil, fmt.Errorf("there are %d instances of LegacyAlert named '%s'", len(alternatives), name) - } - return &alternatives[0], nil -} - type AlertsV2Interface interface { // Create Alert @@ -478,17 +407,17 @@ func (a *AlertsV2API) TrashAlertById(ctx context.Context, id string) error { type DashboardWidgetsInterface interface { - // Add widget to a dashboard + // Adds a widget to a dashboard Create(ctx context.Context, request CreateWidget) (*Widget, error) - // Remove widget + // Removes a widget from a dashboard Delete(ctx context.Context, request DeleteDashboardWidgetRequest) error - // Remove widget + // Removes a widget from a dashboard DeleteById(ctx context.Context, id string) error - // Update existing widget - Update(ctx context.Context, request CreateWidget) (*Widget, error) + // Updates an existing widget + Update(ctx context.Context, request UpdateWidgetRequest) (*Widget, error) } func NewDashboardWidgets(client *client.DatabricksClient) *DashboardWidgetsAPI { @@ -506,7 +435,7 @@ type DashboardWidgetsAPI struct { dashboardWidgetsImpl } -// Remove widget +// Removes a widget from a dashboard func (a *DashboardWidgetsAPI) DeleteById(ctx context.Context, id string) error { return a.dashboardWidgetsImpl.Delete(ctx, DeleteDashboardWidgetRequest{ Id: id, @@ -515,7 +444,10 @@ func (a *DashboardWidgetsAPI) DeleteById(ctx context.Context, id string) error { type DashboardsInterface interface { - // Create a dashboard object. + // Creates a new dashboard object. Only the name parameter is required in the + // POST request JSON body. Other fields can be included when duplicating + // dashboards with this API. Databricks does not recommend designing dashboards + // exclusively using this API.', Create(ctx context.Context, request DashboardPostContent) (*Dashboard, error) // Moves a dashboard to the trash. Trashed dashboards do not appear in list @@ -550,24 +482,6 @@ type DashboardsInterface interface { // This method is generated by Databricks SDK Code Generator. ListAll(ctx context.Context, request ListDashboardsRequest) ([]Dashboard, error) - // DashboardNameToIdMap calls [DashboardsAPI.ListAll] and creates a map of results with [Dashboard].Name as key and [Dashboard].Id as value. - // - // Returns an error if there's more than one [Dashboard] with the same .Name. - // - // Note: All [Dashboard] instances are loaded into memory before creating a map. - // - // This method is generated by Databricks SDK Code Generator. - DashboardNameToIdMap(ctx context.Context, request ListDashboardsRequest) (map[string]string, error) - - // GetByName calls [DashboardsAPI.DashboardNameToIdMap] and returns a single [Dashboard]. - // - // Returns an error if there's more than one [Dashboard] with the same .Name. - // - // Note: All [Dashboard] instances are loaded into memory before returning matching by name. - // - // This method is generated by Databricks SDK Code Generator. - GetByName(ctx context.Context, name string) (*Dashboard, error) - // A restored dashboard appears in list views and searches and can be shared. Restore(ctx context.Context, request RestoreDashboardRequest) error @@ -612,59 +526,6 @@ func (a *DashboardsAPI) GetByDashboardId(ctx context.Context, dashboardId string }) } -// DashboardNameToIdMap calls [DashboardsAPI.ListAll] and creates a map of results with [Dashboard].Name as key and [Dashboard].Id as value. -// -// Returns an error if there's more than one [Dashboard] with the same .Name. -// -// Note: All [Dashboard] instances are loaded into memory before creating a map. -// -// This method is generated by Databricks SDK Code Generator. -func (a *DashboardsAPI) DashboardNameToIdMap(ctx context.Context, request ListDashboardsRequest) (map[string]string, error) { - ctx = useragent.InContext(ctx, "sdk-feature", "name-to-id") - mapping := map[string]string{} - result, err := a.ListAll(ctx, request) - if err != nil { - return nil, err - } - for _, v := range result { - key := v.Name - _, duplicate := mapping[key] - if duplicate { - return nil, fmt.Errorf("duplicate .Name: %s", key) - } - mapping[key] = v.Id - } - return mapping, nil -} - -// GetByName calls [DashboardsAPI.DashboardNameToIdMap] and returns a single [Dashboard]. -// -// Returns an error if there's more than one [Dashboard] with the same .Name. -// -// Note: All [Dashboard] instances are loaded into memory before returning matching by name. -// -// This method is generated by Databricks SDK Code Generator. -func (a *DashboardsAPI) GetByName(ctx context.Context, name string) (*Dashboard, error) { - ctx = useragent.InContext(ctx, "sdk-feature", "get-by-name") - result, err := a.ListAll(ctx, ListDashboardsRequest{}) - if err != nil { - return nil, err - } - tmp := map[string][]Dashboard{} - for _, v := range result { - key := v.Name - tmp[key] = append(tmp[key], v) - } - alternatives, ok := tmp[name] - if !ok || len(alternatives) == 0 { - return nil, fmt.Errorf("Dashboard named '%s' does not exist", name) - } - if len(alternatives) > 1 { - return nil, fmt.Errorf("there are %d instances of Dashboard named '%s'", len(alternatives), name) - } - return &alternatives[0], nil -} - type DataSourcesInterface interface { // Retrieves a full list of SQL warehouses available in this workspace. All @@ -676,24 +537,6 @@ type DataSourcesInterface interface { // // [Learn more]: https://docs.databricks.com/en/sql/dbsql-api-latest.html List(ctx context.Context) ([]DataSource, error) - - // DataSourceNameToIdMap calls [DataSourcesAPI.List] and creates a map of results with [DataSource].Name as key and [DataSource].Id as value. - // - // Returns an error if there's more than one [DataSource] with the same .Name. - // - // Note: All [DataSource] instances are loaded into memory before creating a map. - // - // This method is generated by Databricks SDK Code Generator. - DataSourceNameToIdMap(ctx context.Context) (map[string]string, error) - - // GetByName calls [DataSourcesAPI.DataSourceNameToIdMap] and returns a single [DataSource]. - // - // Returns an error if there's more than one [DataSource] with the same .Name. - // - // Note: All [DataSource] instances are loaded into memory before returning matching by name. - // - // This method is generated by Databricks SDK Code Generator. - GetByName(ctx context.Context, name string) (*DataSource, error) } func NewDataSources(client *client.DatabricksClient) *DataSourcesAPI { @@ -723,59 +566,6 @@ type DataSourcesAPI struct { dataSourcesImpl } -// DataSourceNameToIdMap calls [DataSourcesAPI.List] and creates a map of results with [DataSource].Name as key and [DataSource].Id as value. -// -// Returns an error if there's more than one [DataSource] with the same .Name. -// -// Note: All [DataSource] instances are loaded into memory before creating a map. -// -// This method is generated by Databricks SDK Code Generator. -func (a *DataSourcesAPI) DataSourceNameToIdMap(ctx context.Context) (map[string]string, error) { - ctx = useragent.InContext(ctx, "sdk-feature", "name-to-id") - mapping := map[string]string{} - result, err := a.List(ctx) - if err != nil { - return nil, err - } - for _, v := range result { - key := v.Name - _, duplicate := mapping[key] - if duplicate { - return nil, fmt.Errorf("duplicate .Name: %s", key) - } - mapping[key] = v.Id - } - return mapping, nil -} - -// GetByName calls [DataSourcesAPI.DataSourceNameToIdMap] and returns a single [DataSource]. -// -// Returns an error if there's more than one [DataSource] with the same .Name. -// -// Note: All [DataSource] instances are loaded into memory before returning matching by name. -// -// This method is generated by Databricks SDK Code Generator. -func (a *DataSourcesAPI) GetByName(ctx context.Context, name string) (*DataSource, error) { - ctx = useragent.InContext(ctx, "sdk-feature", "get-by-name") - result, err := a.List(ctx) - if err != nil { - return nil, err - } - tmp := map[string][]DataSource{} - for _, v := range result { - key := v.Name - tmp[key] = append(tmp[key], v) - } - alternatives, ok := tmp[name] - if !ok || len(alternatives) == 0 { - return nil, fmt.Errorf("DataSource named '%s' does not exist", name) - } - if len(alternatives) > 1 { - return nil, fmt.Errorf("there are %d instances of DataSource named '%s'", len(alternatives), name) - } - return &alternatives[0], nil -} - type DbsqlPermissionsInterface interface { // Gets a JSON representation of the access control list (ACL) for a specified @@ -1109,24 +899,6 @@ type QueriesLegacyInterface interface { // This method is generated by Databricks SDK Code Generator. ListAll(ctx context.Context, request ListQueriesLegacyRequest) ([]LegacyQuery, error) - // LegacyQueryNameToIdMap calls [QueriesLegacyAPI.ListAll] and creates a map of results with [LegacyQuery].Name as key and [LegacyQuery].Id as value. - // - // Returns an error if there's more than one [LegacyQuery] with the same .Name. - // - // Note: All [LegacyQuery] instances are loaded into memory before creating a map. - // - // This method is generated by Databricks SDK Code Generator. - LegacyQueryNameToIdMap(ctx context.Context, request ListQueriesLegacyRequest) (map[string]string, error) - - // GetByName calls [QueriesLegacyAPI.LegacyQueryNameToIdMap] and returns a single [LegacyQuery]. - // - // Returns an error if there's more than one [LegacyQuery] with the same .Name. - // - // Note: All [LegacyQuery] instances are loaded into memory before returning matching by name. - // - // This method is generated by Databricks SDK Code Generator. - GetByName(ctx context.Context, name string) (*LegacyQuery, error) - // Restore a query that has been moved to the trash. A restored query appears in // list views and searches. You can use restored queries for alerts. // @@ -1195,59 +967,6 @@ func (a *QueriesLegacyAPI) GetByQueryId(ctx context.Context, queryId string) (*L }) } -// LegacyQueryNameToIdMap calls [QueriesLegacyAPI.ListAll] and creates a map of results with [LegacyQuery].Name as key and [LegacyQuery].Id as value. -// -// Returns an error if there's more than one [LegacyQuery] with the same .Name. -// -// Note: All [LegacyQuery] instances are loaded into memory before creating a map. -// -// This method is generated by Databricks SDK Code Generator. -func (a *QueriesLegacyAPI) LegacyQueryNameToIdMap(ctx context.Context, request ListQueriesLegacyRequest) (map[string]string, error) { - ctx = useragent.InContext(ctx, "sdk-feature", "name-to-id") - mapping := map[string]string{} - result, err := a.ListAll(ctx, request) - if err != nil { - return nil, err - } - for _, v := range result { - key := v.Name - _, duplicate := mapping[key] - if duplicate { - return nil, fmt.Errorf("duplicate .Name: %s", key) - } - mapping[key] = v.Id - } - return mapping, nil -} - -// GetByName calls [QueriesLegacyAPI.LegacyQueryNameToIdMap] and returns a single [LegacyQuery]. -// -// Returns an error if there's more than one [LegacyQuery] with the same .Name. -// -// Note: All [LegacyQuery] instances are loaded into memory before returning matching by name. -// -// This method is generated by Databricks SDK Code Generator. -func (a *QueriesLegacyAPI) GetByName(ctx context.Context, name string) (*LegacyQuery, error) { - ctx = useragent.InContext(ctx, "sdk-feature", "get-by-name") - result, err := a.ListAll(ctx, ListQueriesLegacyRequest{}) - if err != nil { - return nil, err - } - tmp := map[string][]LegacyQuery{} - for _, v := range result { - key := v.Name - tmp[key] = append(tmp[key], v) - } - alternatives, ok := tmp[name] - if !ok || len(alternatives) == 0 { - return nil, fmt.Errorf("LegacyQuery named '%s' does not exist", name) - } - if len(alternatives) > 1 { - return nil, fmt.Errorf("there are %d instances of LegacyQuery named '%s'", len(alternatives), name) - } - return &alternatives[0], nil -} - type QueryHistoryInterface interface { // List the history of queries through SQL warehouses, and serverless compute. diff --git a/service/sql/impl.go b/service/sql/impl.go index 97071ebd9..b003fa853 100755 --- a/service/sql/impl.go +++ b/service/sql/impl.go @@ -29,12 +29,11 @@ func (a *alertsImpl) Create(ctx context.Context, request CreateAlertRequest) (*A } func (a *alertsImpl) Delete(ctx context.Context, request TrashAlertRequest) error { - var empty Empty path := fmt.Sprintf("/api/2.0/sql/alerts/%v", request.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &empty) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -121,12 +120,11 @@ func (a *alertsLegacyImpl) Create(ctx context.Context, request CreateAlert) (*Le } func (a *alertsLegacyImpl) Delete(ctx context.Context, request DeleteAlertsLegacyRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/preview/sql/alerts/%v", request.AlertId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -151,13 +149,12 @@ func (a *alertsLegacyImpl) List(ctx context.Context) ([]LegacyAlert, error) { } func (a *alertsLegacyImpl) Update(ctx context.Context, request EditAlert) error { - var updateResponse UpdateResponse path := fmt.Sprintf("/api/2.0/preview/sql/alerts/%v", request.AlertId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &updateResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, nil) return err } @@ -229,12 +226,11 @@ func (a *alertsV2Impl) internalListAlerts(ctx context.Context, request ListAlert } func (a *alertsV2Impl) TrashAlert(ctx context.Context, request TrashAlertV2Request) error { - var empty Empty path := fmt.Sprintf("/api/2.0/alerts/%v", request.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &empty) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -269,16 +265,15 @@ func (a *dashboardWidgetsImpl) Create(ctx context.Context, request CreateWidget) } func (a *dashboardWidgetsImpl) Delete(ctx context.Context, request DeleteDashboardWidgetRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/preview/sql/widgets/%v", request.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } -func (a *dashboardWidgetsImpl) Update(ctx context.Context, request CreateWidget) (*Widget, error) { +func (a *dashboardWidgetsImpl) Update(ctx context.Context, request UpdateWidgetRequest) (*Widget, error) { var widget Widget path := fmt.Sprintf("/api/2.0/preview/sql/widgets/%v", request.Id) queryParams := make(map[string]any) @@ -306,12 +301,11 @@ func (a *dashboardsImpl) Create(ctx context.Context, request DashboardPostConten } func (a *dashboardsImpl) Delete(ctx context.Context, request DeleteDashboardRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/preview/sql/dashboards/%v", request.DashboardId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -352,12 +346,7 @@ func (a *dashboardsImpl) List(ctx context.Context, request ListDashboardsRequest getNextPage, getItems, getNextReq) - dedupedIterator := listing.NewDedupeIterator[Dashboard, string]( - iterator, - func(item Dashboard) string { - return item.Id - }) - return dedupedIterator + return iterator } // Fetch a paginated list of dashboard objects. @@ -381,12 +370,11 @@ func (a *dashboardsImpl) internalList(ctx context.Context, request ListDashboard } func (a *dashboardsImpl) Restore(ctx context.Context, request RestoreDashboardRequest) error { - var restoreResponse RestoreResponse path := fmt.Sprintf("/api/2.0/preview/sql/dashboards/trash/%v", request.DashboardId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, &restoreResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, nil) return err } @@ -470,12 +458,11 @@ func (a *queriesImpl) Create(ctx context.Context, request CreateQueryRequest) (* } func (a *queriesImpl) Delete(ctx context.Context, request TrashQueryRequest) error { - var empty Empty path := fmt.Sprintf("/api/2.0/sql/queries/%v", request.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &empty) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -603,12 +590,11 @@ func (a *queriesLegacyImpl) Create(ctx context.Context, request QueryPostContent } func (a *queriesLegacyImpl) Delete(ctx context.Context, request DeleteQueriesLegacyRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/preview/sql/queries/%v", request.QueryId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -655,12 +641,7 @@ func (a *queriesLegacyImpl) List(ctx context.Context, request ListQueriesLegacyR getNextPage, getItems, getNextReq) - dedupedIterator := listing.NewDedupeIterator[LegacyQuery, string]( - iterator, - func(item LegacyQuery) string { - return item.Id - }) - return dedupedIterator + return iterator } // Gets a list of queries. Optionally, this list can be filtered by a search @@ -690,12 +671,11 @@ func (a *queriesLegacyImpl) internalList(ctx context.Context, request ListQuerie } func (a *queriesLegacyImpl) Restore(ctx context.Context, request RestoreQueriesLegacyRequest) error { - var restoreResponse RestoreResponse path := fmt.Sprintf("/api/2.0/preview/sql/queries/trash/%v", request.QueryId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, &restoreResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, nil) return err } @@ -742,12 +722,11 @@ func (a *queryVisualizationsImpl) Create(ctx context.Context, request CreateVisu } func (a *queryVisualizationsImpl) Delete(ctx context.Context, request DeleteVisualizationRequest) error { - var empty Empty path := fmt.Sprintf("/api/2.0/sql/visualizations/%v", request.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &empty) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -779,12 +758,11 @@ func (a *queryVisualizationsLegacyImpl) Create(ctx context.Context, request Crea } func (a *queryVisualizationsLegacyImpl) Delete(ctx context.Context, request DeleteQueryVisualizationsLegacyRequest) error { - var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/preview/sql/visualizations/%v", request.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -820,11 +798,10 @@ type statementExecutionImpl struct { } func (a *statementExecutionImpl) CancelExecution(ctx context.Context, request CancelExecutionRequest) error { - var cancelExecutionResponse CancelExecutionResponse path := fmt.Sprintf("/api/2.0/sql/statements/%v/cancel", request.StatementId) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, &cancelExecutionResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, nil) return err } @@ -876,23 +853,21 @@ func (a *warehousesImpl) Create(ctx context.Context, request CreateWarehouseRequ } func (a *warehousesImpl) Delete(ctx context.Context, request DeleteWarehouseRequest) error { - var deleteWarehouseResponse DeleteWarehouseResponse path := fmt.Sprintf("/api/2.0/sql/warehouses/%v", request.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteWarehouseResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } func (a *warehousesImpl) Edit(ctx context.Context, request EditWarehouseRequest) error { - var editWarehouseResponse EditWarehouseResponse path := fmt.Sprintf("/api/2.0/sql/warehouses/%v/edit", request.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &editWarehouseResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } @@ -983,33 +958,30 @@ func (a *warehousesImpl) SetPermissions(ctx context.Context, request WarehousePe } func (a *warehousesImpl) SetWorkspaceWarehouseConfig(ctx context.Context, request SetWorkspaceWarehouseConfigRequest) error { - var setWorkspaceWarehouseConfigResponse SetWorkspaceWarehouseConfigResponse path := "/api/2.0/sql/config/warehouses" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &setWorkspaceWarehouseConfigResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, nil) return err } func (a *warehousesImpl) Start(ctx context.Context, request StartRequest) error { - var startWarehouseResponse StartWarehouseResponse path := fmt.Sprintf("/api/2.0/sql/warehouses/%v/start", request.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, &startWarehouseResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, nil) return err } func (a *warehousesImpl) Stop(ctx context.Context, request StopRequest) error { - var stopWarehouseResponse StopWarehouseResponse path := fmt.Sprintf("/api/2.0/sql/warehouses/%v/stop", request.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, &stopWarehouseResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, nil) return err } diff --git a/service/sql/interface.go b/service/sql/interface.go index 868910284..1e7059f7a 100755 --- a/service/sql/interface.go +++ b/service/sql/interface.go @@ -125,14 +125,14 @@ type AlertsV2Service interface { // Deprecated: Do not use this interface, it will be removed in a future version of the SDK. type DashboardWidgetsService interface { - // Add widget to a dashboard + // Adds a widget to a dashboard Create(ctx context.Context, request CreateWidget) (*Widget, error) - // Remove widget + // Removes a widget from a dashboard Delete(ctx context.Context, request DeleteDashboardWidgetRequest) error - // Update existing widget - Update(ctx context.Context, request CreateWidget) (*Widget, error) + // Updates an existing widget + Update(ctx context.Context, request UpdateWidgetRequest) (*Widget, error) } // In general, there is little need to modify dashboards using the API. However, @@ -145,7 +145,10 @@ type DashboardWidgetsService interface { // Deprecated: Do not use this interface, it will be removed in a future version of the SDK. type DashboardsService interface { - // Create a dashboard object. + // Creates a new dashboard object. Only the name parameter is required in + // the POST request JSON body. Other fields can be included when duplicating + // dashboards with this API. Databricks does not recommend designing + // dashboards exclusively using this API.', Create(ctx context.Context, request DashboardPostContent) (*Dashboard, error) // Moves a dashboard to the trash. Trashed dashboards do not appear in list diff --git a/service/sql/model.go b/service/sql/model.go index 73688a0db..0bb0537df 100755 --- a/service/sql/model.go +++ b/service/sql/model.go @@ -634,7 +634,6 @@ func (s BaseChunkInfo) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Cancel statement execution type CancelExecutionRequest struct { // The statement ID is returned upon successfully submitting a SQL // statement, and is a required reference for all subsequent calls. @@ -1011,7 +1010,6 @@ func (s CreateAlertRequestAlert) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Create an alert type CreateAlertV2Request struct { Alert AlertV2 `json:"alert"` } @@ -1266,8 +1264,6 @@ func (s CreateWarehouseResponse) MarshalJSON() ([]byte, error) { type CreateWidget struct { // Dashboard ID returned by :method:dashboards/create. DashboardId string `json:"dashboard_id"` - // Widget ID returned by :method:dashboardwidgets/create - Id string `json:"-" url:"-"` Options WidgetOptions `json:"options"` // If this is a textbox widget, the application displays this text. This @@ -1688,42 +1684,35 @@ func (f *DateValueDynamicDate) Type() string { return "DateValueDynamicDate" } -// Delete an alert type DeleteAlertsLegacyRequest struct { AlertId string `json:"-" url:"-"` } -// Remove a dashboard type DeleteDashboardRequest struct { DashboardId string `json:"-" url:"-"` } -// Remove widget type DeleteDashboardWidgetRequest struct { // Widget ID returned by :method:dashboardwidgets/create Id string `json:"-" url:"-"` } -// Delete a query type DeleteQueriesLegacyRequest struct { QueryId string `json:"-" url:"-"` } -// Remove visualization type DeleteQueryVisualizationsLegacyRequest struct { - // Widget ID returned by :method:queryvizualisations/create + // Widget ID returned by :method:queryvisualizations/create Id string `json:"-" url:"-"` } type DeleteResponse struct { } -// Remove a visualization type DeleteVisualizationRequest struct { Id string `json:"-" url:"-"` } -// Delete a warehouse type DeleteWarehouseRequest struct { // Required. Id of the SQL warehouse. Id string `json:"-" url:"-"` @@ -2438,27 +2427,22 @@ func (f *Format) Type() string { return "Format" } -// Get an alert type GetAlertRequest struct { Id string `json:"-" url:"-"` } -// Get an alert type GetAlertV2Request struct { Id string `json:"-" url:"-"` } -// Get an alert type GetAlertsLegacyRequest struct { AlertId string `json:"-" url:"-"` } -// Retrieve a definition type GetDashboardRequest struct { DashboardId string `json:"-" url:"-"` } -// Get object ACL type GetDbsqlPermissionRequest struct { // Object ID. An ACL is returned for the object with this UUID. ObjectId string `json:"-" url:"-"` @@ -2466,12 +2450,10 @@ type GetDbsqlPermissionRequest struct { ObjectType ObjectTypePlural `json:"-" url:"-"` } -// Get a query definition. type GetQueriesLegacyRequest struct { QueryId string `json:"-" url:"-"` } -// Get a query type GetQueryRequest struct { Id string `json:"-" url:"-"` } @@ -2494,14 +2476,12 @@ func (s GetResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get status, manifest, and result first chunk type GetStatementRequest struct { // The statement ID is returned upon successfully submitting a SQL // statement, and is a required reference for all subsequent calls. StatementId string `json:"-" url:"-"` } -// Get result chunk by index type GetStatementResultChunkNRequest struct { ChunkIndex int `json:"-" url:"-"` // The statement ID is returned upon successfully submitting a SQL @@ -2509,7 +2489,6 @@ type GetStatementResultChunkNRequest struct { StatementId string `json:"-" url:"-"` } -// Get SQL warehouse permission levels type GetWarehousePermissionLevelsRequest struct { // The SQL warehouse for which to get or manage permissions. WarehouseId string `json:"-" url:"-"` @@ -2520,13 +2499,11 @@ type GetWarehousePermissionLevelsResponse struct { PermissionLevels []WarehousePermissionsDescription `json:"permission_levels,omitempty"` } -// Get SQL warehouse permissions type GetWarehousePermissionsRequest struct { // The SQL warehouse for which to get or manage permissions. WarehouseId string `json:"-" url:"-"` } -// Get warehouse info type GetWarehouseRequest struct { // Required. Id of the SQL warehouse. Id string `json:"-" url:"-"` @@ -2780,9 +2757,6 @@ func (s LegacyAlert) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// State of the alert. Possible values are: `unknown` (yet to be evaluated), -// `triggered` (evaluated and fulfilled trigger conditions), or `ok` (evaluated -// and did not fulfill trigger conditions). type LegacyAlertState string const LegacyAlertStateOk LegacyAlertState = `ok` @@ -2978,7 +2952,6 @@ func (f *LifecycleState) Type() string { return "LifecycleState" } -// List alerts type ListAlertsRequest struct { PageSize int `json:"-" url:"page_size,omitempty"` @@ -3065,7 +3038,6 @@ func (s ListAlertsResponseAlert) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List alerts type ListAlertsV2Request struct { PageSize int `json:"-" url:"page_size,omitempty"` @@ -3098,7 +3070,6 @@ func (s ListAlertsV2Response) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get dashboard objects type ListDashboardsRequest struct { // Name of dashboard attribute to order by. Order ListOrder `json:"-" url:"order,omitempty"` @@ -3157,7 +3128,6 @@ func (f *ListOrder) Type() string { return "ListOrder" } -// Get a list of queries type ListQueriesLegacyRequest struct { // Name of query attribute to order by. Default sort order is ascending. // Append a dash (`-`) to order descending instead. @@ -3192,7 +3162,6 @@ func (s ListQueriesLegacyRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List queries type ListQueriesRequest struct { PageSize int `json:"-" url:"page_size,omitempty"` @@ -3228,7 +3197,6 @@ func (s ListQueriesResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List Queries type ListQueryHistoryRequest struct { // An optional filter object to limit query history results. Accepts // parameters such as user IDs, endpoint IDs, and statuses to narrow the @@ -3342,7 +3310,6 @@ func (s ListResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List visualizations on a query type ListVisualizationsForQueryRequest struct { Id string `json:"-" url:"-"` @@ -3377,7 +3344,6 @@ func (s ListVisualizationsForQueryResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List warehouses type ListWarehousesRequest struct { // Service Principal which will be used to fetch the list of warehouses. If // not specified, the user from the session header is used. @@ -3541,7 +3507,6 @@ func (s OdbcParams) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// The singular form of the type of object which can be owned. type OwnableObjectType string const OwnableObjectTypeAlert OwnableObjectType = `alert` @@ -3613,7 +3578,6 @@ func (s Parameter) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Parameters can have several different types. type ParameterType string const ParameterTypeDatetime ParameterType = `datetime` @@ -4304,12 +4268,10 @@ type RepeatedEndpointConfPairs struct { ConfigurationPairs []EndpointConfPair `json:"configuration_pairs,omitempty"` } -// Restore a dashboard type RestoreDashboardRequest struct { DashboardId string `json:"-" url:"-"` } -// Restore a query type RestoreQueriesLegacyRequest struct { QueryId string `json:"-" url:"-"` } @@ -4438,9 +4400,6 @@ func (f *RunAsMode) Type() string { return "RunAsMode" } -// Sets the **Run as** role for the object. Must be set to one of `"viewer"` -// (signifying "run as viewer" behavior) or `"owner"` (signifying "run as owner" -// behavior) type RunAsRole string const RunAsRoleOwner RunAsRole = `owner` @@ -4755,7 +4714,6 @@ func (f *SpotInstancePolicy) Type() string { return "SpotInstancePolicy" } -// Start a warehouse type StartRequest struct { // Required. Id of the SQL warehouse. Id string `json:"-" url:"-"` @@ -4984,7 +4942,6 @@ func (f *Status) Type() string { return "Status" } -// Stop a warehouse type StopRequest struct { // Required. Id of the SQL warehouse. Id string `json:"-" url:"-"` @@ -5434,7 +5391,6 @@ func (s TransferOwnershipObjectId) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Transfer object ownership type TransferOwnershipRequest struct { // Email address for the new owner, who must exist in the workspace. NewOwner string `json:"new_owner,omitempty"` @@ -5454,17 +5410,14 @@ func (s TransferOwnershipRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Delete an alert type TrashAlertRequest struct { Id string `json:"-" url:"-"` } -// Delete an alert type TrashAlertV2Request struct { Id string `json:"-" url:"-"` } -// Delete a query type TrashQueryRequest struct { Id string `json:"-" url:"-"` } @@ -5540,7 +5493,6 @@ func (s UpdateAlertRequestAlert) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Update an alert type UpdateAlertV2Request struct { Alert AlertV2 `json:"alert"` // UUID identifying the alert. @@ -5675,6 +5627,33 @@ func (s UpdateVisualizationRequestVisualization) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type UpdateWidgetRequest struct { + // Dashboard ID returned by :method:dashboards/create. + DashboardId string `json:"dashboard_id"` + // Widget ID returned by :method:dashboardwidgets/create + Id string `json:"-" url:"-"` + + Options WidgetOptions `json:"options"` + // If this is a textbox widget, the application displays this text. This + // field is ignored if the widget contains a visualization in the + // `visualization` field. + Text string `json:"text,omitempty"` + // Query Vizualization ID returned by :method:queryvisualizations/create. + VisualizationId string `json:"visualization_id,omitempty"` + // Width of a widget + Width int `json:"width"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *UpdateWidgetRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s UpdateWidgetRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type User struct { Email string `json:"email,omitempty"` diff --git a/service/vectorsearch/impl.go b/service/vectorsearch/impl.go index 057774168..dfbc05884 100755 --- a/service/vectorsearch/impl.go +++ b/service/vectorsearch/impl.go @@ -29,12 +29,11 @@ func (a *vectorSearchEndpointsImpl) CreateEndpoint(ctx context.Context, request } func (a *vectorSearchEndpointsImpl) DeleteEndpoint(ctx context.Context, request DeleteEndpointRequest) error { - var deleteEndpointResponse DeleteEndpointResponse path := fmt.Sprintf("/api/2.0/vector-search/endpoints/%v", request.EndpointName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteEndpointResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -138,12 +137,11 @@ func (a *vectorSearchIndexesImpl) DeleteDataVectorIndex(ctx context.Context, req } func (a *vectorSearchIndexesImpl) DeleteIndex(ctx context.Context, request DeleteIndexRequest) error { - var deleteIndexResponse DeleteIndexResponse path := fmt.Sprintf("/api/2.0/vector-search/indexes/%v", request.IndexName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteIndexResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -232,12 +230,11 @@ func (a *vectorSearchIndexesImpl) ScanIndex(ctx context.Context, request ScanVec } func (a *vectorSearchIndexesImpl) SyncIndex(ctx context.Context, request SyncIndexRequest) error { - var syncIndexResponse SyncIndexResponse path := fmt.Sprintf("/api/2.0/vector-search/indexes/%v/sync", request.IndexName) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, &syncIndexResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, nil) return err } diff --git a/service/vectorsearch/model.go b/service/vectorsearch/model.go index 659691755..b6db9114a 100755 --- a/service/vectorsearch/model.go +++ b/service/vectorsearch/model.go @@ -138,7 +138,6 @@ func (f *DeleteDataStatus) Type() string { return "DeleteDataStatus" } -// Delete data from index type DeleteDataVectorIndexRequest struct { // Name of the vector index where data is to be deleted. Must be a Direct // Vector Access Index. @@ -154,7 +153,6 @@ type DeleteDataVectorIndexResponse struct { Status DeleteDataStatus `json:"status,omitempty"` } -// Delete an endpoint type DeleteEndpointRequest struct { // Name of the vector search endpoint EndpointName string `json:"-" url:"-"` @@ -163,7 +161,6 @@ type DeleteEndpointRequest struct { type DeleteEndpointResponse struct { } -// Delete an index type DeleteIndexRequest struct { // Name of the index IndexName string `json:"-" url:"-"` @@ -178,6 +175,8 @@ type DeltaSyncVectorIndexSpecRequest struct { // index. The primary key column and embedding source column or embedding // vector column are always synced. ColumnsToSync []string `json:"columns_to_sync,omitempty"` + // The budget policy id applied to the vector search index + EffectiveBudgetPolicyId string `json:"effective_budget_policy_id,omitempty"` // The columns that contain the embedding source. EmbeddingSourceColumns []EmbeddingSourceColumn `json:"embedding_source_columns,omitempty"` // The columns that contain the embedding vectors. @@ -208,6 +207,8 @@ func (s DeltaSyncVectorIndexSpecRequest) MarshalJSON() ([]byte, error) { } type DeltaSyncVectorIndexSpecResponse struct { + // The budget policy id applied to the vector search index + EffectiveBudgetPolicyId string `json:"effective_budget_policy_id,omitempty"` // The columns that contain the embedding source. EmbeddingSourceColumns []EmbeddingSourceColumn `json:"embedding_source_columns,omitempty"` // The columns that contain the embedding vectors. @@ -425,16 +426,30 @@ func (f *EndpointType) Type() string { return "EndpointType" } -// Get an endpoint type GetEndpointRequest struct { // Name of the endpoint EndpointName string `json:"-" url:"-"` } -// Get an index type GetIndexRequest struct { + // If true, the URL returned for the index is guaranteed to be compatible + // with the reranker. Currently this means we return the CP URL regardless + // of how the index is being accessed. If not set or set to false, the URL + // may still be compatible with the reranker depending on what URL we + // return. + EnsureRerankerCompatible bool `json:"-" url:"ensure_reranker_compatible,omitempty"` // Name of the index IndexName string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *GetIndexRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s GetIndexRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) } type ListEndpointResponse struct { @@ -455,7 +470,6 @@ func (s ListEndpointResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List all endpoints type ListEndpointsRequest struct { // Token for pagination PageToken string `json:"-" url:"page_token,omitempty"` @@ -471,7 +485,6 @@ func (s ListEndpointsRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List indexes type ListIndexesRequest struct { // Name of the endpoint EndpointName string `json:"-" url:"endpoint_name"` @@ -675,6 +688,8 @@ type QueryVectorIndexRequest struct { // Query vector. Required for Direct Vector Access Index and Delta Sync // Index using self-managed vectors. QueryVector []float64 `json:"query_vector,omitempty"` + + Reranker *RerankerConfig `json:"reranker,omitempty"` // Threshold for the approximate nearest neighbor search. Defaults to 0.0. ScoreThreshold float64 `json:"score_threshold,omitempty"` @@ -711,6 +726,26 @@ func (s QueryVectorIndexResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type RerankerConfig struct { + Model string `json:"model,omitempty"` + + Parameters *RerankerConfigRerankerParameters `json:"parameters,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *RerankerConfig) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s RerankerConfig) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type RerankerConfigRerankerParameters struct { + ColumnsToRerank []string `json:"columns_to_rerank,omitempty"` +} + // Data returned in the query result. type ResultData struct { // Data rows returned in the query. @@ -789,7 +824,6 @@ type Struct struct { Fields []MapStringValueEntry `json:"fields,omitempty"` } -// Synchronize an index type SyncIndexRequest struct { // Name of the vector index to synchronize. Must be a Delta Sync Index. IndexName string `json:"-" url:"-"` diff --git a/service/workspace/impl.go b/service/workspace/impl.go index 35b49ee8e..8ee4c119f 100755 --- a/service/workspace/impl.go +++ b/service/workspace/impl.go @@ -29,12 +29,11 @@ func (a *gitCredentialsImpl) Create(ctx context.Context, request CreateCredentia } func (a *gitCredentialsImpl) Delete(ctx context.Context, request DeleteCredentialsRequest) error { - var deleteCredentialsResponse DeleteCredentialsResponse path := fmt.Sprintf("/api/2.0/git-credentials/%v", request.CredentialId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteCredentialsResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -87,13 +86,12 @@ func (a *gitCredentialsImpl) internalList(ctx context.Context) (*ListCredentials } func (a *gitCredentialsImpl) Update(ctx context.Context, request UpdateCredentialsRequest) error { - var updateCredentialsResponse UpdateCredentialsResponse path := fmt.Sprintf("/api/2.0/git-credentials/%v", request.CredentialId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateCredentialsResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, nil) return err } @@ -114,12 +112,11 @@ func (a *reposImpl) Create(ctx context.Context, request CreateRepoRequest) (*Cre } func (a *reposImpl) Delete(ctx context.Context, request DeleteRepoRequest) error { - var deleteRepoResponse DeleteRepoResponse path := fmt.Sprintf("/api/2.0/repos/%v", request.RepoId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteRepoResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) return err } @@ -208,13 +205,12 @@ func (a *reposImpl) SetPermissions(ctx context.Context, request RepoPermissionsR } func (a *reposImpl) Update(ctx context.Context, request UpdateRepoRequest) error { - var updateRepoResponse UpdateRepoResponse path := fmt.Sprintf("/api/2.0/repos/%v", request.RepoId) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateRepoResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, nil) return err } @@ -235,46 +231,42 @@ type secretsImpl struct { } func (a *secretsImpl) CreateScope(ctx context.Context, request CreateScope) error { - var createScopeResponse CreateScopeResponse path := "/api/2.0/secrets/scopes/create" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createScopeResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } func (a *secretsImpl) DeleteAcl(ctx context.Context, request DeleteAcl) error { - var deleteAclResponse DeleteAclResponse path := "/api/2.0/secrets/acls/delete" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &deleteAclResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } func (a *secretsImpl) DeleteScope(ctx context.Context, request DeleteScope) error { - var deleteScopeResponse DeleteScopeResponse path := "/api/2.0/secrets/scopes/delete" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &deleteScopeResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } func (a *secretsImpl) DeleteSecret(ctx context.Context, request DeleteSecret) error { - var deleteSecretResponse DeleteSecretResponse path := "/api/2.0/secrets/delete" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &deleteSecretResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } @@ -435,24 +427,22 @@ func (a *secretsImpl) internalListSecrets(ctx context.Context, request ListSecre } func (a *secretsImpl) PutAcl(ctx context.Context, request PutAcl) error { - var putAclResponse PutAclResponse path := "/api/2.0/secrets/acls/put" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &putAclResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } func (a *secretsImpl) PutSecret(ctx context.Context, request PutSecret) error { - var putSecretResponse PutSecretResponse path := "/api/2.0/secrets/put" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &putSecretResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } @@ -462,13 +452,12 @@ type workspaceImpl struct { } func (a *workspaceImpl) Delete(ctx context.Context, request Delete) error { - var deleteResponse DeleteResponse path := "/api/2.0/workspace/delete" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } @@ -513,13 +502,12 @@ func (a *workspaceImpl) GetStatus(ctx context.Context, request GetStatusRequest) } func (a *workspaceImpl) Import(ctx context.Context, request Import) error { - var importResponse ImportResponse path := "/api/2.0/workspace/import" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &importResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } @@ -563,13 +551,12 @@ func (a *workspaceImpl) internalList(ctx context.Context, request ListWorkspaceR } func (a *workspaceImpl) Mkdirs(ctx context.Context, request Mkdirs) error { - var mkdirsResponse MkdirsResponse path := "/api/2.0/workspace/mkdirs" queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &mkdirsResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) return err } diff --git a/service/workspace/model.go b/service/workspace/model.go index 39c8a5969..c4064487e 100755 --- a/service/workspace/model.go +++ b/service/workspace/model.go @@ -246,7 +246,6 @@ type DeleteAcl struct { type DeleteAclResponse struct { } -// Delete a credential type DeleteCredentialsRequest struct { // The ID for the corresponding credential to access. CredentialId int64 `json:"-" url:"-"` @@ -255,7 +254,6 @@ type DeleteCredentialsRequest struct { type DeleteCredentialsResponse struct { } -// Delete a repo type DeleteRepoRequest struct { // The ID for the corresponding repo to delete. RepoId int64 `json:"-" url:"-"` @@ -338,7 +336,6 @@ func (f *ExportFormat) Type() string { return "ExportFormat" } -// Export a workspace object type ExportRequest struct { // This specifies the format of the exported file. By default, this is // `SOURCE`. @@ -380,7 +377,6 @@ func (s ExportResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get secret ACL details type GetAclRequest struct { // The principal to fetch ACL information for. Principal string `json:"-" url:"principal"` @@ -388,7 +384,6 @@ type GetAclRequest struct { Scope string `json:"-" url:"scope"` } -// Get a credential entry type GetCredentialsRequest struct { // The ID for the corresponding credential to access. CredentialId int64 `json:"-" url:"-"` @@ -414,7 +409,6 @@ func (s GetCredentialsResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get repo permission levels type GetRepoPermissionLevelsRequest struct { // The repo for which to get or manage permissions. RepoId string `json:"-" url:"-"` @@ -425,13 +419,11 @@ type GetRepoPermissionLevelsResponse struct { PermissionLevels []RepoPermissionsDescription `json:"permission_levels,omitempty"` } -// Get repo permissions type GetRepoPermissionsRequest struct { // The repo for which to get or manage permissions. RepoId string `json:"-" url:"-"` } -// Get a repo type GetRepoRequest struct { // ID of the Git folder (repo) object in the workspace. RepoId int64 `json:"-" url:"-"` @@ -464,7 +456,6 @@ func (s GetRepoResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get a secret type GetSecretRequest struct { // The key to fetch secret for. Key string `json:"-" url:"key"` @@ -489,13 +480,11 @@ func (s GetSecretResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get status type GetStatusRequest struct { // The absolute path of the notebook or directory. Path string `json:"-" url:"path"` } -// Get workspace object permission levels type GetWorkspaceObjectPermissionLevelsRequest struct { // The workspace object for which to get or manage permissions. WorkspaceObjectId string `json:"-" url:"-"` @@ -508,7 +497,6 @@ type GetWorkspaceObjectPermissionLevelsResponse struct { PermissionLevels []WorkspaceObjectPermissionsDescription `json:"permission_levels,omitempty"` } -// Get workspace object permissions type GetWorkspaceObjectPermissionsRequest struct { // The workspace object for which to get or manage permissions. WorkspaceObjectId string `json:"-" url:"-"` @@ -659,7 +647,6 @@ func (f *Language) Type() string { return "Language" } -// Lists ACLs type ListAclsRequest struct { // The name of the scope to fetch ACL information from. Scope string `json:"-" url:"scope"` @@ -675,7 +662,6 @@ type ListCredentialsResponse struct { Credentials []CredentialInfo `json:"credentials,omitempty"` } -// Get repos type ListReposRequest struct { // Token used to get the next page of results. If not specified, returns the // first page of results as well as a next page token if there are more @@ -725,7 +711,6 @@ type ListScopesResponse struct { Scopes []SecretScope `json:"scopes,omitempty"` } -// List secret keys type ListSecretsRequest struct { // The name of the scope to list secrets within. Scope string `json:"-" url:"scope"` @@ -736,7 +721,6 @@ type ListSecretsResponse struct { Secrets []SecretMetadata `json:"secrets,omitempty"` } -// List contents type ListWorkspaceRequest struct { // UTC timestamp in milliseconds NotebooksModifiedAfter int64 `json:"-" url:"notebooks_modified_after,omitempty"` diff --git a/workspace_client.go b/workspace_client.go index be28fbe4f..a6f408b70 100755 --- a/workspace_client.go +++ b/workspace_client.go @@ -284,6 +284,16 @@ type WorkspaceClient struct { // objects such as folders, notebooks, and libraries. Experiments ml.ExperimentsInterface + // External Lineage APIs enable defining and managing lineage relationships + // between Databricks objects and external systems. These APIs allow users + // to capture data flows connecting Databricks tables, models, and file + // paths with external metadata objects. + // + // With these APIs, users can create, update, delete, and list lineage + // relationships with support for column-level mappings and custom + // properties. + ExternalLineage catalog.ExternalLineageInterface + // An external location is an object that combines a cloud storage path with // a storage credential that authorizes access to the cloud storage path. // Each external location is subject to Unity Catalog access-control @@ -299,6 +309,15 @@ type WorkspaceClient struct { // with the **CREATE_EXTERNAL_LOCATION** privilege. ExternalLocations catalog.ExternalLocationsInterface + // External Metadata objects enable customers to register and manage + // metadata about external systems within Unity Catalog. + // + // These APIs provide a standardized way to create, update, retrieve, list, + // and delete external metadata objects. Fine-grained authorization ensures + // that only users with appropriate permissions can view and manage external + // metadata objects. + ExternalMetadata catalog.ExternalMetadataInterface + // A feature store is a centralized repository that enables data scientists // to find and share features. Using a feature store also ensures that the // code used to compute feature values is the same during model training and @@ -491,6 +510,10 @@ type WorkspaceClient struct { // of the uninstalled library appears as Uninstall pending restart. Libraries compute.LibrariesInterface + // Materialized Features are columns in tables and views that can be + // directly used as features to train and serve ML models. + MaterializedFeatures ml.MaterializedFeaturesInterface + // A metastore is the top-level container of objects in Unity Catalog. It // stores data assets (tables and views) and the permissions that govern // access to them. Databricks account admins can create metastores and @@ -697,6 +720,9 @@ type WorkspaceClient struct { // [Learn more]: https://docs.databricks.com/en/sql/dbsql-api-latest.html QueriesLegacy sql.QueriesLegacyInterface + // Query execution APIs for AI / BI Dashboards + QueryExecution dashboards.QueryExecutionInterface + // A service responsible for storing and retrieving the list of queries run // against SQL endpoints and serverless compute. QueryHistory sql.QueryHistoryInterface @@ -1235,7 +1261,9 @@ func NewWorkspaceClient(c ...*Config) (*WorkspaceClient, error) { Dbfs: files.NewDbfs(databricksClient), DbsqlPermissions: sql.NewDbsqlPermissions(databricksClient), Experiments: ml.NewExperiments(databricksClient), + ExternalLineage: catalog.NewExternalLineage(databricksClient), ExternalLocations: catalog.NewExternalLocations(databricksClient), + ExternalMetadata: catalog.NewExternalMetadata(databricksClient), FeatureStore: ml.NewFeatureStore(databricksClient), Files: files.NewFiles(databricksClient), Functions: catalog.NewFunctions(databricksClient), @@ -1251,6 +1279,7 @@ func NewWorkspaceClient(c ...*Config) (*WorkspaceClient, error) { Lakeview: dashboards.NewLakeview(databricksClient), LakeviewEmbedded: dashboards.NewLakeviewEmbedded(databricksClient), Libraries: compute.NewLibraries(databricksClient), + MaterializedFeatures: ml.NewMaterializedFeatures(databricksClient), Metastores: catalog.NewMetastores(databricksClient), ModelRegistry: ml.NewModelRegistry(databricksClient), ModelVersions: catalog.NewModelVersions(databricksClient), @@ -1274,6 +1303,7 @@ func NewWorkspaceClient(c ...*Config) (*WorkspaceClient, error) { QualityMonitors: catalog.NewQualityMonitors(databricksClient), Queries: sql.NewQueries(databricksClient), QueriesLegacy: sql.NewQueriesLegacy(databricksClient), + QueryExecution: dashboards.NewQueryExecution(databricksClient), QueryHistory: sql.NewQueryHistory(databricksClient), QueryVisualizations: sql.NewQueryVisualizations(databricksClient), QueryVisualizationsLegacy: sql.NewQueryVisualizationsLegacy(databricksClient),