From 20c50e5315bcb20aa6b794bf740abf658057b66a Mon Sep 17 00:00:00 2001 From: Tanmay Rustagi Date: Thu, 8 May 2025 20:44:28 +0200 Subject: [PATCH] [Internal] Generate SDK to latest OpenAPI spec --- .codegen/_openapi_sha | 2 +- NEXT_CHANGELOG.md | 22 + experimental/mocks/mock_workspace_client.go | 42 + .../mock_database_instances_interface.go | 1079 +++++++++++++++++ .../service/iam/mock_permissions_interface.go | 32 +- .../mock_serving_endpoints_interface.go | 266 ++++ .../mock_account_settings_interface.go | 94 ++ ...proxy_partner_powered_account_interface.go | 214 ++++ ...proxy_partner_powered_enforce_interface.go | 214 ++++ ...oxy_partner_powered_workspace_interface.go | 214 ++++ .../settings/mock_settings_interface.go | 47 + service/catalog/api.go | 121 +- service/catalog/impl.go | 168 ++- service/catalog/interface.go | 42 + service/catalog/model.go | 392 +++++- service/compute/model.go | 36 +- service/dashboards/model.go | 16 +- service/iam/api.go | 81 +- service/iam/impl.go | 4 +- service/iam/interface.go | 81 +- service/iam/model.go | 51 +- service/jobs/model.go | 61 +- service/pipelines/model.go | 82 +- service/pkg.go | 12 + service/serving/api.go | 118 ++ service/serving/impl.go | 22 + service/serving/interface.go | 11 + service/serving/model.go | 68 ++ service/settings/api.go | 160 ++- service/settings/impl.go | 88 ++ service/settings/interface.go | 55 + service/settings/model.go | 253 ++++ service/sql/impl.go | 7 +- service/sql/model.go | 8 +- service/vectorsearch/model.go | 31 +- workspace_client.go | 85 +- 36 files changed, 3971 insertions(+), 308 deletions(-) create mode 100644 experimental/mocks/service/catalog/mock_database_instances_interface.go create mode 100644 experimental/mocks/service/settings/mock_llm_proxy_partner_powered_account_interface.go create mode 100644 experimental/mocks/service/settings/mock_llm_proxy_partner_powered_enforce_interface.go create mode 100644 experimental/mocks/service/settings/mock_llm_proxy_partner_powered_workspace_interface.go diff --git a/.codegen/_openapi_sha b/.codegen/_openapi_sha index 3b0b1fdac..d59c4602a 100644 --- a/.codegen/_openapi_sha +++ b/.codegen/_openapi_sha @@ -1 +1 @@ -d4c86c045ee9d0410a41ef07e8ae708673b95fa1 \ No newline at end of file +cea12a23bf66d223b10058f3dd8dac2385228242 \ No newline at end of file diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md index 9c0031211..0c48f29ad 100644 --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -11,3 +11,25 @@ ### Internal Changes ### API Changes +* Added [w.DatabaseInstances](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#DatabaseInstancesAPI) workspace-level service. +* Added [w.LlmProxyPartnerPoweredAccount](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/settings#LlmProxyPartnerPoweredAccountAPI) workspace-level service, [w.LlmProxyPartnerPoweredEnforce](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/settings#LlmProxyPartnerPoweredEnforceAPI) workspace-level service and [w.LlmProxyPartnerPoweredWorkspace](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/settings#LlmProxyPartnerPoweredWorkspaceAPI) workspace-level service. +* Added `CreateProvisionedThroughputEndpoint` and `UpdateProvisionedThroughputEndpointConfig` methods for [w.ServingEndpoints](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/serving#ServingEndpointsAPI) workspace-level service. +* Added `CatalogName` field for [catalog.EnableRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#EnableRequest). +* Added `SourceType` field for [pipelines.IngestionPipelineDefinition](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/pipelines#IngestionPipelineDefinition). +* Added `Glob` field for [pipelines.PipelineLibrary](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/pipelines#PipelineLibrary). +* Added `DescribeQueryInvalidSqlError`, `DescribeQueryTimeout`, `DescribeQueryUnexpectedFailure`, `InvalidSqlMultipleDatasetReferencesException`, `InvalidSqlMultipleStatementsException` and `InvalidSqlUnknownTableException` enum values for [dashboards.MessageErrorType](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/dashboards#MessageErrorType). +* Added `CanCreate` and `CanMonitorOnly` enum values for [iam.PermissionLevel](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/iam#PermissionLevel). +* Added `SuccessWithFailures` enum value for [jobs.TerminationCodeCode](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#TerminationCodeCode). +* Added `InfrastructureMaintenance` enum value for [pipelines.StartUpdateCause](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/pipelines#StartUpdateCause). +* Added `InfrastructureMaintenance` enum value for [pipelines.UpdateInfoCause](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/pipelines#UpdateInfoCause). +* [Breaking] Changed `CreateAlert` and `UpdateAlert` methods for [w.AlertsV2](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/sql#AlertsV2API) workspace-level service with new required argument order. +* [Breaking] Changed `Set` method for [w.Permissions](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/iam#PermissionsAPI) workspace-level service . New request type is [iam.SetObjectPermissions](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/iam#SetObjectPermissions). +* [Breaking] Changed `Update` method for [w.Permissions](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/iam#PermissionsAPI) workspace-level service . New request type is [iam.UpdateObjectPermissions](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/iam#UpdateObjectPermissions). +* Changed `Schema` and `State` fields for [catalog.SystemSchemaInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#SystemSchemaInfo) to be required. +* [Breaking] Changed `State` field for [catalog.SystemSchemaInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#SystemSchemaInfo) to type `string`. +* [Breaking] Changed `Alert` field for [sql.CreateAlertV2Request](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/sql#CreateAlertV2Request) to be required. +* [Breaking] Changed `Alert` field for [sql.UpdateAlertV2Request](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/sql#UpdateAlertV2Request) to be required. +* [Breaking] Removed `NodeTypeFlexibility` field for [compute.EditInstancePool](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/compute#EditInstancePool). +* [Breaking] Removed `NodeTypeFlexibility` field for [compute.GetInstancePool](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/compute#GetInstancePool). +* [Breaking] Removed `NodeTypeFlexibility` field for [compute.InstancePoolAndStats](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/compute#InstancePoolAndStats). +* [Breaking] Removed `Available`, `DisableInitialized`, `EnableCompleted`, `EnableInitialized` and `Unavailable` enum values for [catalog.SystemSchemaInfoState](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#SystemSchemaInfoState). diff --git a/experimental/mocks/mock_workspace_client.go b/experimental/mocks/mock_workspace_client.go index fc96bd2a4..bc8d86416 100755 --- a/experimental/mocks/mock_workspace_client.go +++ b/experimental/mocks/mock_workspace_client.go @@ -67,6 +67,7 @@ func NewMockWorkspaceClient(t interface { DashboardWidgets: sql.NewMockDashboardWidgetsInterface(t), Dashboards: sql.NewMockDashboardsInterface(t), DataSources: sql.NewMockDataSourcesInterface(t), + DatabaseInstances: catalog.NewMockDatabaseInstancesInterface(t), Dbfs: files.NewMockDbfsInterface(t), DbsqlPermissions: sql.NewMockDbsqlPermissionsInterface(t), Experiments: ml.NewMockExperimentsInterface(t), @@ -144,6 +145,12 @@ func NewMockWorkspaceClient(t interface { }, } + mockllmProxyPartnerPoweredAccount := settings.NewMockLlmProxyPartnerPoweredAccountInterface(t) + mockaccountSettingsAPI.On("LlmProxyPartnerPoweredAccount").Return(mockllmProxyPartnerPoweredAccount).Maybe() + + mockllmProxyPartnerPoweredEnforce := settings.NewMockLlmProxyPartnerPoweredEnforceInterface(t) + mockaccountSettingsAPI.On("LlmProxyPartnerPoweredEnforce").Return(mockllmProxyPartnerPoweredEnforce).Maybe() + mocksettingsAPI := cli.GetMockSettingsAPI() mockaibiDashboardEmbeddingAccessPolicy := settings.NewMockAibiDashboardEmbeddingAccessPolicyInterface(t) @@ -179,6 +186,9 @@ func NewMockWorkspaceClient(t interface { mockenhancedSecurityMonitoring := settings.NewMockEnhancedSecurityMonitoringInterface(t) mocksettingsAPI.On("EnhancedSecurityMonitoring").Return(mockenhancedSecurityMonitoring).Maybe() + mockllmProxyPartnerPoweredWorkspace := settings.NewMockLlmProxyPartnerPoweredWorkspaceInterface(t) + mocksettingsAPI.On("LlmProxyPartnerPoweredWorkspace").Return(mockllmProxyPartnerPoweredWorkspace).Maybe() + mockrestrictWorkspaceAdmins := settings.NewMockRestrictWorkspaceAdminsInterface(t) mocksettingsAPI.On("RestrictWorkspaceAdmins").Return(mockrestrictWorkspaceAdmins).Maybe() @@ -273,6 +283,30 @@ func (m *MockWorkspaceClient) GetMockEnhancedSecurityMonitoringAPI() *settings.M return api } +func (m *MockWorkspaceClient) GetMockLlmProxyPartnerPoweredAccountAPI() *settings.MockLlmProxyPartnerPoweredAccountInterface { + api, ok := m.GetMockAccountSettingsAPI().LlmProxyPartnerPoweredAccount().(*settings.MockLlmProxyPartnerPoweredAccountInterface) + if !ok { + panic(fmt.Sprintf("expected LlmProxyPartnerPoweredAccount to be *settings.MockLlmProxyPartnerPoweredAccountInterface, actual was %T", m.GetMockAccountSettingsAPI().LlmProxyPartnerPoweredAccount())) + } + return api +} + +func (m *MockWorkspaceClient) GetMockLlmProxyPartnerPoweredEnforceAPI() *settings.MockLlmProxyPartnerPoweredEnforceInterface { + api, ok := m.GetMockAccountSettingsAPI().LlmProxyPartnerPoweredEnforce().(*settings.MockLlmProxyPartnerPoweredEnforceInterface) + if !ok { + panic(fmt.Sprintf("expected LlmProxyPartnerPoweredEnforce to be *settings.MockLlmProxyPartnerPoweredEnforceInterface, actual was %T", m.GetMockAccountSettingsAPI().LlmProxyPartnerPoweredEnforce())) + } + return api +} + +func (m *MockWorkspaceClient) GetMockLlmProxyPartnerPoweredWorkspaceAPI() *settings.MockLlmProxyPartnerPoweredWorkspaceInterface { + api, ok := m.GetMockSettingsAPI().LlmProxyPartnerPoweredWorkspace().(*settings.MockLlmProxyPartnerPoweredWorkspaceInterface) + if !ok { + panic(fmt.Sprintf("expected LlmProxyPartnerPoweredWorkspace to be *settings.MockLlmProxyPartnerPoweredWorkspaceInterface, actual was %T", m.GetMockSettingsAPI().LlmProxyPartnerPoweredWorkspace())) + } + return api +} + func (m *MockWorkspaceClient) GetMockRestrictWorkspaceAdminsAPI() *settings.MockRestrictWorkspaceAdminsInterface { api, ok := m.GetMockSettingsAPI().RestrictWorkspaceAdmins().(*settings.MockRestrictWorkspaceAdminsInterface) if !ok { @@ -489,6 +523,14 @@ func (m *MockWorkspaceClient) GetMockDataSourcesAPI() *sql.MockDataSourcesInterf return api } +func (m *MockWorkspaceClient) GetMockDatabaseInstancesAPI() *catalog.MockDatabaseInstancesInterface { + api, ok := m.WorkspaceClient.DatabaseInstances.(*catalog.MockDatabaseInstancesInterface) + if !ok { + panic(fmt.Sprintf("expected DatabaseInstances to be *catalog.MockDatabaseInstancesInterface, actual was %T", m.WorkspaceClient.DatabaseInstances)) + } + return api +} + func (m *MockWorkspaceClient) GetMockDbfsAPI() *files.MockDbfsInterface { api, ok := m.WorkspaceClient.Dbfs.(*files.MockDbfsInterface) if !ok { diff --git a/experimental/mocks/service/catalog/mock_database_instances_interface.go b/experimental/mocks/service/catalog/mock_database_instances_interface.go new file mode 100644 index 000000000..be4400d53 --- /dev/null +++ b/experimental/mocks/service/catalog/mock_database_instances_interface.go @@ -0,0 +1,1079 @@ +// 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" +) + +// MockDatabaseInstancesInterface is an autogenerated mock type for the DatabaseInstancesInterface type +type MockDatabaseInstancesInterface struct { + mock.Mock +} + +type MockDatabaseInstancesInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *MockDatabaseInstancesInterface) EXPECT() *MockDatabaseInstancesInterface_Expecter { + return &MockDatabaseInstancesInterface_Expecter{mock: &_m.Mock} +} + +// CreateDatabaseCatalog provides a mock function with given fields: ctx, request +func (_m *MockDatabaseInstancesInterface) CreateDatabaseCatalog(ctx context.Context, request catalog.CreateDatabaseCatalogRequest) (*catalog.DatabaseCatalog, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for CreateDatabaseCatalog") + } + + var r0 *catalog.DatabaseCatalog + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, catalog.CreateDatabaseCatalogRequest) (*catalog.DatabaseCatalog, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, catalog.CreateDatabaseCatalogRequest) *catalog.DatabaseCatalog); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*catalog.DatabaseCatalog) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, catalog.CreateDatabaseCatalogRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockDatabaseInstancesInterface_CreateDatabaseCatalog_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateDatabaseCatalog' +type MockDatabaseInstancesInterface_CreateDatabaseCatalog_Call struct { + *mock.Call +} + +// CreateDatabaseCatalog is a helper method to define mock.On call +// - ctx context.Context +// - request catalog.CreateDatabaseCatalogRequest +func (_e *MockDatabaseInstancesInterface_Expecter) CreateDatabaseCatalog(ctx interface{}, request interface{}) *MockDatabaseInstancesInterface_CreateDatabaseCatalog_Call { + return &MockDatabaseInstancesInterface_CreateDatabaseCatalog_Call{Call: _e.mock.On("CreateDatabaseCatalog", ctx, request)} +} + +func (_c *MockDatabaseInstancesInterface_CreateDatabaseCatalog_Call) Run(run func(ctx context.Context, request catalog.CreateDatabaseCatalogRequest)) *MockDatabaseInstancesInterface_CreateDatabaseCatalog_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(catalog.CreateDatabaseCatalogRequest)) + }) + return _c +} + +func (_c *MockDatabaseInstancesInterface_CreateDatabaseCatalog_Call) Return(_a0 *catalog.DatabaseCatalog, _a1 error) *MockDatabaseInstancesInterface_CreateDatabaseCatalog_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockDatabaseInstancesInterface_CreateDatabaseCatalog_Call) RunAndReturn(run func(context.Context, catalog.CreateDatabaseCatalogRequest) (*catalog.DatabaseCatalog, error)) *MockDatabaseInstancesInterface_CreateDatabaseCatalog_Call { + _c.Call.Return(run) + return _c +} + +// CreateDatabaseInstance provides a mock function with given fields: ctx, request +func (_m *MockDatabaseInstancesInterface) CreateDatabaseInstance(ctx context.Context, request catalog.CreateDatabaseInstanceRequest) (*catalog.DatabaseInstance, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for CreateDatabaseInstance") + } + + var r0 *catalog.DatabaseInstance + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, catalog.CreateDatabaseInstanceRequest) (*catalog.DatabaseInstance, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, catalog.CreateDatabaseInstanceRequest) *catalog.DatabaseInstance); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*catalog.DatabaseInstance) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, catalog.CreateDatabaseInstanceRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockDatabaseInstancesInterface_CreateDatabaseInstance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateDatabaseInstance' +type MockDatabaseInstancesInterface_CreateDatabaseInstance_Call struct { + *mock.Call +} + +// CreateDatabaseInstance is a helper method to define mock.On call +// - ctx context.Context +// - request catalog.CreateDatabaseInstanceRequest +func (_e *MockDatabaseInstancesInterface_Expecter) CreateDatabaseInstance(ctx interface{}, request interface{}) *MockDatabaseInstancesInterface_CreateDatabaseInstance_Call { + return &MockDatabaseInstancesInterface_CreateDatabaseInstance_Call{Call: _e.mock.On("CreateDatabaseInstance", ctx, request)} +} + +func (_c *MockDatabaseInstancesInterface_CreateDatabaseInstance_Call) Run(run func(ctx context.Context, request catalog.CreateDatabaseInstanceRequest)) *MockDatabaseInstancesInterface_CreateDatabaseInstance_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(catalog.CreateDatabaseInstanceRequest)) + }) + return _c +} + +func (_c *MockDatabaseInstancesInterface_CreateDatabaseInstance_Call) Return(_a0 *catalog.DatabaseInstance, _a1 error) *MockDatabaseInstancesInterface_CreateDatabaseInstance_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockDatabaseInstancesInterface_CreateDatabaseInstance_Call) RunAndReturn(run func(context.Context, catalog.CreateDatabaseInstanceRequest) (*catalog.DatabaseInstance, error)) *MockDatabaseInstancesInterface_CreateDatabaseInstance_Call { + _c.Call.Return(run) + return _c +} + +// CreateSyncedDatabaseTable provides a mock function with given fields: ctx, request +func (_m *MockDatabaseInstancesInterface) CreateSyncedDatabaseTable(ctx context.Context, request catalog.CreateSyncedDatabaseTableRequest) (*catalog.SyncedDatabaseTable, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for CreateSyncedDatabaseTable") + } + + var r0 *catalog.SyncedDatabaseTable + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, catalog.CreateSyncedDatabaseTableRequest) (*catalog.SyncedDatabaseTable, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, catalog.CreateSyncedDatabaseTableRequest) *catalog.SyncedDatabaseTable); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*catalog.SyncedDatabaseTable) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, catalog.CreateSyncedDatabaseTableRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockDatabaseInstancesInterface_CreateSyncedDatabaseTable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateSyncedDatabaseTable' +type MockDatabaseInstancesInterface_CreateSyncedDatabaseTable_Call struct { + *mock.Call +} + +// CreateSyncedDatabaseTable is a helper method to define mock.On call +// - ctx context.Context +// - request catalog.CreateSyncedDatabaseTableRequest +func (_e *MockDatabaseInstancesInterface_Expecter) CreateSyncedDatabaseTable(ctx interface{}, request interface{}) *MockDatabaseInstancesInterface_CreateSyncedDatabaseTable_Call { + return &MockDatabaseInstancesInterface_CreateSyncedDatabaseTable_Call{Call: _e.mock.On("CreateSyncedDatabaseTable", ctx, request)} +} + +func (_c *MockDatabaseInstancesInterface_CreateSyncedDatabaseTable_Call) Run(run func(ctx context.Context, request catalog.CreateSyncedDatabaseTableRequest)) *MockDatabaseInstancesInterface_CreateSyncedDatabaseTable_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(catalog.CreateSyncedDatabaseTableRequest)) + }) + return _c +} + +func (_c *MockDatabaseInstancesInterface_CreateSyncedDatabaseTable_Call) Return(_a0 *catalog.SyncedDatabaseTable, _a1 error) *MockDatabaseInstancesInterface_CreateSyncedDatabaseTable_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockDatabaseInstancesInterface_CreateSyncedDatabaseTable_Call) RunAndReturn(run func(context.Context, catalog.CreateSyncedDatabaseTableRequest) (*catalog.SyncedDatabaseTable, error)) *MockDatabaseInstancesInterface_CreateSyncedDatabaseTable_Call { + _c.Call.Return(run) + return _c +} + +// DeleteDatabaseCatalog provides a mock function with given fields: ctx, request +func (_m *MockDatabaseInstancesInterface) DeleteDatabaseCatalog(ctx context.Context, request catalog.DeleteDatabaseCatalogRequest) error { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for DeleteDatabaseCatalog") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, catalog.DeleteDatabaseCatalogRequest) error); ok { + r0 = rf(ctx, request) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockDatabaseInstancesInterface_DeleteDatabaseCatalog_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteDatabaseCatalog' +type MockDatabaseInstancesInterface_DeleteDatabaseCatalog_Call struct { + *mock.Call +} + +// DeleteDatabaseCatalog is a helper method to define mock.On call +// - ctx context.Context +// - request catalog.DeleteDatabaseCatalogRequest +func (_e *MockDatabaseInstancesInterface_Expecter) DeleteDatabaseCatalog(ctx interface{}, request interface{}) *MockDatabaseInstancesInterface_DeleteDatabaseCatalog_Call { + return &MockDatabaseInstancesInterface_DeleteDatabaseCatalog_Call{Call: _e.mock.On("DeleteDatabaseCatalog", ctx, request)} +} + +func (_c *MockDatabaseInstancesInterface_DeleteDatabaseCatalog_Call) Run(run func(ctx context.Context, request catalog.DeleteDatabaseCatalogRequest)) *MockDatabaseInstancesInterface_DeleteDatabaseCatalog_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(catalog.DeleteDatabaseCatalogRequest)) + }) + return _c +} + +func (_c *MockDatabaseInstancesInterface_DeleteDatabaseCatalog_Call) Return(_a0 error) *MockDatabaseInstancesInterface_DeleteDatabaseCatalog_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockDatabaseInstancesInterface_DeleteDatabaseCatalog_Call) RunAndReturn(run func(context.Context, catalog.DeleteDatabaseCatalogRequest) error) *MockDatabaseInstancesInterface_DeleteDatabaseCatalog_Call { + _c.Call.Return(run) + return _c +} + +// DeleteDatabaseCatalogByName provides a mock function with given fields: ctx, name +func (_m *MockDatabaseInstancesInterface) DeleteDatabaseCatalogByName(ctx context.Context, name string) error { + ret := _m.Called(ctx, name) + + if len(ret) == 0 { + panic("no return value specified for DeleteDatabaseCatalogByName") + } + + 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 +} + +// MockDatabaseInstancesInterface_DeleteDatabaseCatalogByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteDatabaseCatalogByName' +type MockDatabaseInstancesInterface_DeleteDatabaseCatalogByName_Call struct { + *mock.Call +} + +// DeleteDatabaseCatalogByName is a helper method to define mock.On call +// - ctx context.Context +// - name string +func (_e *MockDatabaseInstancesInterface_Expecter) DeleteDatabaseCatalogByName(ctx interface{}, name interface{}) *MockDatabaseInstancesInterface_DeleteDatabaseCatalogByName_Call { + return &MockDatabaseInstancesInterface_DeleteDatabaseCatalogByName_Call{Call: _e.mock.On("DeleteDatabaseCatalogByName", ctx, name)} +} + +func (_c *MockDatabaseInstancesInterface_DeleteDatabaseCatalogByName_Call) Run(run func(ctx context.Context, name string)) *MockDatabaseInstancesInterface_DeleteDatabaseCatalogByName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockDatabaseInstancesInterface_DeleteDatabaseCatalogByName_Call) Return(_a0 error) *MockDatabaseInstancesInterface_DeleteDatabaseCatalogByName_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockDatabaseInstancesInterface_DeleteDatabaseCatalogByName_Call) RunAndReturn(run func(context.Context, string) error) *MockDatabaseInstancesInterface_DeleteDatabaseCatalogByName_Call { + _c.Call.Return(run) + return _c +} + +// DeleteDatabaseInstance provides a mock function with given fields: ctx, request +func (_m *MockDatabaseInstancesInterface) DeleteDatabaseInstance(ctx context.Context, request catalog.DeleteDatabaseInstanceRequest) error { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for DeleteDatabaseInstance") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, catalog.DeleteDatabaseInstanceRequest) error); ok { + r0 = rf(ctx, request) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockDatabaseInstancesInterface_DeleteDatabaseInstance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteDatabaseInstance' +type MockDatabaseInstancesInterface_DeleteDatabaseInstance_Call struct { + *mock.Call +} + +// DeleteDatabaseInstance is a helper method to define mock.On call +// - ctx context.Context +// - request catalog.DeleteDatabaseInstanceRequest +func (_e *MockDatabaseInstancesInterface_Expecter) DeleteDatabaseInstance(ctx interface{}, request interface{}) *MockDatabaseInstancesInterface_DeleteDatabaseInstance_Call { + return &MockDatabaseInstancesInterface_DeleteDatabaseInstance_Call{Call: _e.mock.On("DeleteDatabaseInstance", ctx, request)} +} + +func (_c *MockDatabaseInstancesInterface_DeleteDatabaseInstance_Call) Run(run func(ctx context.Context, request catalog.DeleteDatabaseInstanceRequest)) *MockDatabaseInstancesInterface_DeleteDatabaseInstance_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(catalog.DeleteDatabaseInstanceRequest)) + }) + return _c +} + +func (_c *MockDatabaseInstancesInterface_DeleteDatabaseInstance_Call) Return(_a0 error) *MockDatabaseInstancesInterface_DeleteDatabaseInstance_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockDatabaseInstancesInterface_DeleteDatabaseInstance_Call) RunAndReturn(run func(context.Context, catalog.DeleteDatabaseInstanceRequest) error) *MockDatabaseInstancesInterface_DeleteDatabaseInstance_Call { + _c.Call.Return(run) + return _c +} + +// DeleteDatabaseInstanceByName provides a mock function with given fields: ctx, name +func (_m *MockDatabaseInstancesInterface) DeleteDatabaseInstanceByName(ctx context.Context, name string) error { + ret := _m.Called(ctx, name) + + if len(ret) == 0 { + panic("no return value specified for DeleteDatabaseInstanceByName") + } + + 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 +} + +// MockDatabaseInstancesInterface_DeleteDatabaseInstanceByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteDatabaseInstanceByName' +type MockDatabaseInstancesInterface_DeleteDatabaseInstanceByName_Call struct { + *mock.Call +} + +// DeleteDatabaseInstanceByName is a helper method to define mock.On call +// - ctx context.Context +// - name string +func (_e *MockDatabaseInstancesInterface_Expecter) DeleteDatabaseInstanceByName(ctx interface{}, name interface{}) *MockDatabaseInstancesInterface_DeleteDatabaseInstanceByName_Call { + return &MockDatabaseInstancesInterface_DeleteDatabaseInstanceByName_Call{Call: _e.mock.On("DeleteDatabaseInstanceByName", ctx, name)} +} + +func (_c *MockDatabaseInstancesInterface_DeleteDatabaseInstanceByName_Call) Run(run func(ctx context.Context, name string)) *MockDatabaseInstancesInterface_DeleteDatabaseInstanceByName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockDatabaseInstancesInterface_DeleteDatabaseInstanceByName_Call) Return(_a0 error) *MockDatabaseInstancesInterface_DeleteDatabaseInstanceByName_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockDatabaseInstancesInterface_DeleteDatabaseInstanceByName_Call) RunAndReturn(run func(context.Context, string) error) *MockDatabaseInstancesInterface_DeleteDatabaseInstanceByName_Call { + _c.Call.Return(run) + return _c +} + +// DeleteSyncedDatabaseTable provides a mock function with given fields: ctx, request +func (_m *MockDatabaseInstancesInterface) DeleteSyncedDatabaseTable(ctx context.Context, request catalog.DeleteSyncedDatabaseTableRequest) error { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for DeleteSyncedDatabaseTable") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, catalog.DeleteSyncedDatabaseTableRequest) error); ok { + r0 = rf(ctx, request) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockDatabaseInstancesInterface_DeleteSyncedDatabaseTable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteSyncedDatabaseTable' +type MockDatabaseInstancesInterface_DeleteSyncedDatabaseTable_Call struct { + *mock.Call +} + +// DeleteSyncedDatabaseTable is a helper method to define mock.On call +// - ctx context.Context +// - request catalog.DeleteSyncedDatabaseTableRequest +func (_e *MockDatabaseInstancesInterface_Expecter) DeleteSyncedDatabaseTable(ctx interface{}, request interface{}) *MockDatabaseInstancesInterface_DeleteSyncedDatabaseTable_Call { + return &MockDatabaseInstancesInterface_DeleteSyncedDatabaseTable_Call{Call: _e.mock.On("DeleteSyncedDatabaseTable", ctx, request)} +} + +func (_c *MockDatabaseInstancesInterface_DeleteSyncedDatabaseTable_Call) Run(run func(ctx context.Context, request catalog.DeleteSyncedDatabaseTableRequest)) *MockDatabaseInstancesInterface_DeleteSyncedDatabaseTable_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(catalog.DeleteSyncedDatabaseTableRequest)) + }) + return _c +} + +func (_c *MockDatabaseInstancesInterface_DeleteSyncedDatabaseTable_Call) Return(_a0 error) *MockDatabaseInstancesInterface_DeleteSyncedDatabaseTable_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockDatabaseInstancesInterface_DeleteSyncedDatabaseTable_Call) RunAndReturn(run func(context.Context, catalog.DeleteSyncedDatabaseTableRequest) error) *MockDatabaseInstancesInterface_DeleteSyncedDatabaseTable_Call { + _c.Call.Return(run) + return _c +} + +// DeleteSyncedDatabaseTableByName provides a mock function with given fields: ctx, name +func (_m *MockDatabaseInstancesInterface) DeleteSyncedDatabaseTableByName(ctx context.Context, name string) error { + ret := _m.Called(ctx, name) + + if len(ret) == 0 { + panic("no return value specified for DeleteSyncedDatabaseTableByName") + } + + 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 +} + +// MockDatabaseInstancesInterface_DeleteSyncedDatabaseTableByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteSyncedDatabaseTableByName' +type MockDatabaseInstancesInterface_DeleteSyncedDatabaseTableByName_Call struct { + *mock.Call +} + +// DeleteSyncedDatabaseTableByName is a helper method to define mock.On call +// - ctx context.Context +// - name string +func (_e *MockDatabaseInstancesInterface_Expecter) DeleteSyncedDatabaseTableByName(ctx interface{}, name interface{}) *MockDatabaseInstancesInterface_DeleteSyncedDatabaseTableByName_Call { + return &MockDatabaseInstancesInterface_DeleteSyncedDatabaseTableByName_Call{Call: _e.mock.On("DeleteSyncedDatabaseTableByName", ctx, name)} +} + +func (_c *MockDatabaseInstancesInterface_DeleteSyncedDatabaseTableByName_Call) Run(run func(ctx context.Context, name string)) *MockDatabaseInstancesInterface_DeleteSyncedDatabaseTableByName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockDatabaseInstancesInterface_DeleteSyncedDatabaseTableByName_Call) Return(_a0 error) *MockDatabaseInstancesInterface_DeleteSyncedDatabaseTableByName_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockDatabaseInstancesInterface_DeleteSyncedDatabaseTableByName_Call) RunAndReturn(run func(context.Context, string) error) *MockDatabaseInstancesInterface_DeleteSyncedDatabaseTableByName_Call { + _c.Call.Return(run) + return _c +} + +// FindDatabaseInstanceByUid provides a mock function with given fields: ctx, request +func (_m *MockDatabaseInstancesInterface) FindDatabaseInstanceByUid(ctx context.Context, request catalog.FindDatabaseInstanceByUidRequest) (*catalog.DatabaseInstance, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for FindDatabaseInstanceByUid") + } + + var r0 *catalog.DatabaseInstance + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, catalog.FindDatabaseInstanceByUidRequest) (*catalog.DatabaseInstance, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, catalog.FindDatabaseInstanceByUidRequest) *catalog.DatabaseInstance); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*catalog.DatabaseInstance) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, catalog.FindDatabaseInstanceByUidRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockDatabaseInstancesInterface_FindDatabaseInstanceByUid_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindDatabaseInstanceByUid' +type MockDatabaseInstancesInterface_FindDatabaseInstanceByUid_Call struct { + *mock.Call +} + +// FindDatabaseInstanceByUid is a helper method to define mock.On call +// - ctx context.Context +// - request catalog.FindDatabaseInstanceByUidRequest +func (_e *MockDatabaseInstancesInterface_Expecter) FindDatabaseInstanceByUid(ctx interface{}, request interface{}) *MockDatabaseInstancesInterface_FindDatabaseInstanceByUid_Call { + return &MockDatabaseInstancesInterface_FindDatabaseInstanceByUid_Call{Call: _e.mock.On("FindDatabaseInstanceByUid", ctx, request)} +} + +func (_c *MockDatabaseInstancesInterface_FindDatabaseInstanceByUid_Call) Run(run func(ctx context.Context, request catalog.FindDatabaseInstanceByUidRequest)) *MockDatabaseInstancesInterface_FindDatabaseInstanceByUid_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(catalog.FindDatabaseInstanceByUidRequest)) + }) + return _c +} + +func (_c *MockDatabaseInstancesInterface_FindDatabaseInstanceByUid_Call) Return(_a0 *catalog.DatabaseInstance, _a1 error) *MockDatabaseInstancesInterface_FindDatabaseInstanceByUid_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockDatabaseInstancesInterface_FindDatabaseInstanceByUid_Call) RunAndReturn(run func(context.Context, catalog.FindDatabaseInstanceByUidRequest) (*catalog.DatabaseInstance, error)) *MockDatabaseInstancesInterface_FindDatabaseInstanceByUid_Call { + _c.Call.Return(run) + return _c +} + +// GetDatabaseCatalog provides a mock function with given fields: ctx, request +func (_m *MockDatabaseInstancesInterface) GetDatabaseCatalog(ctx context.Context, request catalog.GetDatabaseCatalogRequest) (*catalog.DatabaseCatalog, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for GetDatabaseCatalog") + } + + var r0 *catalog.DatabaseCatalog + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, catalog.GetDatabaseCatalogRequest) (*catalog.DatabaseCatalog, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, catalog.GetDatabaseCatalogRequest) *catalog.DatabaseCatalog); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*catalog.DatabaseCatalog) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, catalog.GetDatabaseCatalogRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockDatabaseInstancesInterface_GetDatabaseCatalog_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDatabaseCatalog' +type MockDatabaseInstancesInterface_GetDatabaseCatalog_Call struct { + *mock.Call +} + +// GetDatabaseCatalog is a helper method to define mock.On call +// - ctx context.Context +// - request catalog.GetDatabaseCatalogRequest +func (_e *MockDatabaseInstancesInterface_Expecter) GetDatabaseCatalog(ctx interface{}, request interface{}) *MockDatabaseInstancesInterface_GetDatabaseCatalog_Call { + return &MockDatabaseInstancesInterface_GetDatabaseCatalog_Call{Call: _e.mock.On("GetDatabaseCatalog", ctx, request)} +} + +func (_c *MockDatabaseInstancesInterface_GetDatabaseCatalog_Call) Run(run func(ctx context.Context, request catalog.GetDatabaseCatalogRequest)) *MockDatabaseInstancesInterface_GetDatabaseCatalog_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(catalog.GetDatabaseCatalogRequest)) + }) + return _c +} + +func (_c *MockDatabaseInstancesInterface_GetDatabaseCatalog_Call) Return(_a0 *catalog.DatabaseCatalog, _a1 error) *MockDatabaseInstancesInterface_GetDatabaseCatalog_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockDatabaseInstancesInterface_GetDatabaseCatalog_Call) RunAndReturn(run func(context.Context, catalog.GetDatabaseCatalogRequest) (*catalog.DatabaseCatalog, error)) *MockDatabaseInstancesInterface_GetDatabaseCatalog_Call { + _c.Call.Return(run) + return _c +} + +// GetDatabaseCatalogByName provides a mock function with given fields: ctx, name +func (_m *MockDatabaseInstancesInterface) GetDatabaseCatalogByName(ctx context.Context, name string) (*catalog.DatabaseCatalog, error) { + ret := _m.Called(ctx, name) + + if len(ret) == 0 { + panic("no return value specified for GetDatabaseCatalogByName") + } + + var r0 *catalog.DatabaseCatalog + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*catalog.DatabaseCatalog, error)); ok { + return rf(ctx, name) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *catalog.DatabaseCatalog); ok { + r0 = rf(ctx, name) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*catalog.DatabaseCatalog) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, name) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockDatabaseInstancesInterface_GetDatabaseCatalogByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDatabaseCatalogByName' +type MockDatabaseInstancesInterface_GetDatabaseCatalogByName_Call struct { + *mock.Call +} + +// GetDatabaseCatalogByName is a helper method to define mock.On call +// - ctx context.Context +// - name string +func (_e *MockDatabaseInstancesInterface_Expecter) GetDatabaseCatalogByName(ctx interface{}, name interface{}) *MockDatabaseInstancesInterface_GetDatabaseCatalogByName_Call { + return &MockDatabaseInstancesInterface_GetDatabaseCatalogByName_Call{Call: _e.mock.On("GetDatabaseCatalogByName", ctx, name)} +} + +func (_c *MockDatabaseInstancesInterface_GetDatabaseCatalogByName_Call) Run(run func(ctx context.Context, name string)) *MockDatabaseInstancesInterface_GetDatabaseCatalogByName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockDatabaseInstancesInterface_GetDatabaseCatalogByName_Call) Return(_a0 *catalog.DatabaseCatalog, _a1 error) *MockDatabaseInstancesInterface_GetDatabaseCatalogByName_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockDatabaseInstancesInterface_GetDatabaseCatalogByName_Call) RunAndReturn(run func(context.Context, string) (*catalog.DatabaseCatalog, error)) *MockDatabaseInstancesInterface_GetDatabaseCatalogByName_Call { + _c.Call.Return(run) + return _c +} + +// GetDatabaseInstance provides a mock function with given fields: ctx, request +func (_m *MockDatabaseInstancesInterface) GetDatabaseInstance(ctx context.Context, request catalog.GetDatabaseInstanceRequest) (*catalog.DatabaseInstance, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for GetDatabaseInstance") + } + + var r0 *catalog.DatabaseInstance + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, catalog.GetDatabaseInstanceRequest) (*catalog.DatabaseInstance, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, catalog.GetDatabaseInstanceRequest) *catalog.DatabaseInstance); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*catalog.DatabaseInstance) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, catalog.GetDatabaseInstanceRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockDatabaseInstancesInterface_GetDatabaseInstance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDatabaseInstance' +type MockDatabaseInstancesInterface_GetDatabaseInstance_Call struct { + *mock.Call +} + +// GetDatabaseInstance is a helper method to define mock.On call +// - ctx context.Context +// - request catalog.GetDatabaseInstanceRequest +func (_e *MockDatabaseInstancesInterface_Expecter) GetDatabaseInstance(ctx interface{}, request interface{}) *MockDatabaseInstancesInterface_GetDatabaseInstance_Call { + return &MockDatabaseInstancesInterface_GetDatabaseInstance_Call{Call: _e.mock.On("GetDatabaseInstance", ctx, request)} +} + +func (_c *MockDatabaseInstancesInterface_GetDatabaseInstance_Call) Run(run func(ctx context.Context, request catalog.GetDatabaseInstanceRequest)) *MockDatabaseInstancesInterface_GetDatabaseInstance_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(catalog.GetDatabaseInstanceRequest)) + }) + return _c +} + +func (_c *MockDatabaseInstancesInterface_GetDatabaseInstance_Call) Return(_a0 *catalog.DatabaseInstance, _a1 error) *MockDatabaseInstancesInterface_GetDatabaseInstance_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockDatabaseInstancesInterface_GetDatabaseInstance_Call) RunAndReturn(run func(context.Context, catalog.GetDatabaseInstanceRequest) (*catalog.DatabaseInstance, error)) *MockDatabaseInstancesInterface_GetDatabaseInstance_Call { + _c.Call.Return(run) + return _c +} + +// GetDatabaseInstanceByName provides a mock function with given fields: ctx, name +func (_m *MockDatabaseInstancesInterface) GetDatabaseInstanceByName(ctx context.Context, name string) (*catalog.DatabaseInstance, error) { + ret := _m.Called(ctx, name) + + if len(ret) == 0 { + panic("no return value specified for GetDatabaseInstanceByName") + } + + var r0 *catalog.DatabaseInstance + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*catalog.DatabaseInstance, error)); ok { + return rf(ctx, name) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *catalog.DatabaseInstance); ok { + r0 = rf(ctx, name) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*catalog.DatabaseInstance) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, name) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockDatabaseInstancesInterface_GetDatabaseInstanceByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDatabaseInstanceByName' +type MockDatabaseInstancesInterface_GetDatabaseInstanceByName_Call struct { + *mock.Call +} + +// GetDatabaseInstanceByName is a helper method to define mock.On call +// - ctx context.Context +// - name string +func (_e *MockDatabaseInstancesInterface_Expecter) GetDatabaseInstanceByName(ctx interface{}, name interface{}) *MockDatabaseInstancesInterface_GetDatabaseInstanceByName_Call { + return &MockDatabaseInstancesInterface_GetDatabaseInstanceByName_Call{Call: _e.mock.On("GetDatabaseInstanceByName", ctx, name)} +} + +func (_c *MockDatabaseInstancesInterface_GetDatabaseInstanceByName_Call) Run(run func(ctx context.Context, name string)) *MockDatabaseInstancesInterface_GetDatabaseInstanceByName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockDatabaseInstancesInterface_GetDatabaseInstanceByName_Call) Return(_a0 *catalog.DatabaseInstance, _a1 error) *MockDatabaseInstancesInterface_GetDatabaseInstanceByName_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockDatabaseInstancesInterface_GetDatabaseInstanceByName_Call) RunAndReturn(run func(context.Context, string) (*catalog.DatabaseInstance, error)) *MockDatabaseInstancesInterface_GetDatabaseInstanceByName_Call { + _c.Call.Return(run) + return _c +} + +// GetSyncedDatabaseTable provides a mock function with given fields: ctx, request +func (_m *MockDatabaseInstancesInterface) GetSyncedDatabaseTable(ctx context.Context, request catalog.GetSyncedDatabaseTableRequest) (*catalog.SyncedDatabaseTable, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for GetSyncedDatabaseTable") + } + + var r0 *catalog.SyncedDatabaseTable + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, catalog.GetSyncedDatabaseTableRequest) (*catalog.SyncedDatabaseTable, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, catalog.GetSyncedDatabaseTableRequest) *catalog.SyncedDatabaseTable); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*catalog.SyncedDatabaseTable) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, catalog.GetSyncedDatabaseTableRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockDatabaseInstancesInterface_GetSyncedDatabaseTable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSyncedDatabaseTable' +type MockDatabaseInstancesInterface_GetSyncedDatabaseTable_Call struct { + *mock.Call +} + +// GetSyncedDatabaseTable is a helper method to define mock.On call +// - ctx context.Context +// - request catalog.GetSyncedDatabaseTableRequest +func (_e *MockDatabaseInstancesInterface_Expecter) GetSyncedDatabaseTable(ctx interface{}, request interface{}) *MockDatabaseInstancesInterface_GetSyncedDatabaseTable_Call { + return &MockDatabaseInstancesInterface_GetSyncedDatabaseTable_Call{Call: _e.mock.On("GetSyncedDatabaseTable", ctx, request)} +} + +func (_c *MockDatabaseInstancesInterface_GetSyncedDatabaseTable_Call) Run(run func(ctx context.Context, request catalog.GetSyncedDatabaseTableRequest)) *MockDatabaseInstancesInterface_GetSyncedDatabaseTable_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(catalog.GetSyncedDatabaseTableRequest)) + }) + return _c +} + +func (_c *MockDatabaseInstancesInterface_GetSyncedDatabaseTable_Call) Return(_a0 *catalog.SyncedDatabaseTable, _a1 error) *MockDatabaseInstancesInterface_GetSyncedDatabaseTable_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockDatabaseInstancesInterface_GetSyncedDatabaseTable_Call) RunAndReturn(run func(context.Context, catalog.GetSyncedDatabaseTableRequest) (*catalog.SyncedDatabaseTable, error)) *MockDatabaseInstancesInterface_GetSyncedDatabaseTable_Call { + _c.Call.Return(run) + return _c +} + +// GetSyncedDatabaseTableByName provides a mock function with given fields: ctx, name +func (_m *MockDatabaseInstancesInterface) GetSyncedDatabaseTableByName(ctx context.Context, name string) (*catalog.SyncedDatabaseTable, error) { + ret := _m.Called(ctx, name) + + if len(ret) == 0 { + panic("no return value specified for GetSyncedDatabaseTableByName") + } + + var r0 *catalog.SyncedDatabaseTable + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*catalog.SyncedDatabaseTable, error)); ok { + return rf(ctx, name) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *catalog.SyncedDatabaseTable); ok { + r0 = rf(ctx, name) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*catalog.SyncedDatabaseTable) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, name) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockDatabaseInstancesInterface_GetSyncedDatabaseTableByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSyncedDatabaseTableByName' +type MockDatabaseInstancesInterface_GetSyncedDatabaseTableByName_Call struct { + *mock.Call +} + +// GetSyncedDatabaseTableByName is a helper method to define mock.On call +// - ctx context.Context +// - name string +func (_e *MockDatabaseInstancesInterface_Expecter) GetSyncedDatabaseTableByName(ctx interface{}, name interface{}) *MockDatabaseInstancesInterface_GetSyncedDatabaseTableByName_Call { + return &MockDatabaseInstancesInterface_GetSyncedDatabaseTableByName_Call{Call: _e.mock.On("GetSyncedDatabaseTableByName", ctx, name)} +} + +func (_c *MockDatabaseInstancesInterface_GetSyncedDatabaseTableByName_Call) Run(run func(ctx context.Context, name string)) *MockDatabaseInstancesInterface_GetSyncedDatabaseTableByName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockDatabaseInstancesInterface_GetSyncedDatabaseTableByName_Call) Return(_a0 *catalog.SyncedDatabaseTable, _a1 error) *MockDatabaseInstancesInterface_GetSyncedDatabaseTableByName_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockDatabaseInstancesInterface_GetSyncedDatabaseTableByName_Call) RunAndReturn(run func(context.Context, string) (*catalog.SyncedDatabaseTable, error)) *MockDatabaseInstancesInterface_GetSyncedDatabaseTableByName_Call { + _c.Call.Return(run) + return _c +} + +// ListDatabaseInstances provides a mock function with given fields: ctx, request +func (_m *MockDatabaseInstancesInterface) ListDatabaseInstances(ctx context.Context, request catalog.ListDatabaseInstancesRequest) listing.Iterator[catalog.DatabaseInstance] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListDatabaseInstances") + } + + var r0 listing.Iterator[catalog.DatabaseInstance] + if rf, ok := ret.Get(0).(func(context.Context, catalog.ListDatabaseInstancesRequest) listing.Iterator[catalog.DatabaseInstance]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[catalog.DatabaseInstance]) + } + } + + return r0 +} + +// MockDatabaseInstancesInterface_ListDatabaseInstances_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListDatabaseInstances' +type MockDatabaseInstancesInterface_ListDatabaseInstances_Call struct { + *mock.Call +} + +// ListDatabaseInstances is a helper method to define mock.On call +// - ctx context.Context +// - request catalog.ListDatabaseInstancesRequest +func (_e *MockDatabaseInstancesInterface_Expecter) ListDatabaseInstances(ctx interface{}, request interface{}) *MockDatabaseInstancesInterface_ListDatabaseInstances_Call { + return &MockDatabaseInstancesInterface_ListDatabaseInstances_Call{Call: _e.mock.On("ListDatabaseInstances", ctx, request)} +} + +func (_c *MockDatabaseInstancesInterface_ListDatabaseInstances_Call) Run(run func(ctx context.Context, request catalog.ListDatabaseInstancesRequest)) *MockDatabaseInstancesInterface_ListDatabaseInstances_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(catalog.ListDatabaseInstancesRequest)) + }) + return _c +} + +func (_c *MockDatabaseInstancesInterface_ListDatabaseInstances_Call) Return(_a0 listing.Iterator[catalog.DatabaseInstance]) *MockDatabaseInstancesInterface_ListDatabaseInstances_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockDatabaseInstancesInterface_ListDatabaseInstances_Call) RunAndReturn(run func(context.Context, catalog.ListDatabaseInstancesRequest) listing.Iterator[catalog.DatabaseInstance]) *MockDatabaseInstancesInterface_ListDatabaseInstances_Call { + _c.Call.Return(run) + return _c +} + +// ListDatabaseInstancesAll provides a mock function with given fields: ctx, request +func (_m *MockDatabaseInstancesInterface) ListDatabaseInstancesAll(ctx context.Context, request catalog.ListDatabaseInstancesRequest) ([]catalog.DatabaseInstance, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListDatabaseInstancesAll") + } + + var r0 []catalog.DatabaseInstance + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, catalog.ListDatabaseInstancesRequest) ([]catalog.DatabaseInstance, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, catalog.ListDatabaseInstancesRequest) []catalog.DatabaseInstance); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]catalog.DatabaseInstance) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, catalog.ListDatabaseInstancesRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockDatabaseInstancesInterface_ListDatabaseInstancesAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListDatabaseInstancesAll' +type MockDatabaseInstancesInterface_ListDatabaseInstancesAll_Call struct { + *mock.Call +} + +// ListDatabaseInstancesAll is a helper method to define mock.On call +// - ctx context.Context +// - request catalog.ListDatabaseInstancesRequest +func (_e *MockDatabaseInstancesInterface_Expecter) ListDatabaseInstancesAll(ctx interface{}, request interface{}) *MockDatabaseInstancesInterface_ListDatabaseInstancesAll_Call { + return &MockDatabaseInstancesInterface_ListDatabaseInstancesAll_Call{Call: _e.mock.On("ListDatabaseInstancesAll", ctx, request)} +} + +func (_c *MockDatabaseInstancesInterface_ListDatabaseInstancesAll_Call) Run(run func(ctx context.Context, request catalog.ListDatabaseInstancesRequest)) *MockDatabaseInstancesInterface_ListDatabaseInstancesAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(catalog.ListDatabaseInstancesRequest)) + }) + return _c +} + +func (_c *MockDatabaseInstancesInterface_ListDatabaseInstancesAll_Call) Return(_a0 []catalog.DatabaseInstance, _a1 error) *MockDatabaseInstancesInterface_ListDatabaseInstancesAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockDatabaseInstancesInterface_ListDatabaseInstancesAll_Call) RunAndReturn(run func(context.Context, catalog.ListDatabaseInstancesRequest) ([]catalog.DatabaseInstance, error)) *MockDatabaseInstancesInterface_ListDatabaseInstancesAll_Call { + _c.Call.Return(run) + return _c +} + +// UpdateDatabaseInstance provides a mock function with given fields: ctx, request +func (_m *MockDatabaseInstancesInterface) UpdateDatabaseInstance(ctx context.Context, request catalog.UpdateDatabaseInstanceRequest) (*catalog.DatabaseInstance, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for UpdateDatabaseInstance") + } + + var r0 *catalog.DatabaseInstance + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, catalog.UpdateDatabaseInstanceRequest) (*catalog.DatabaseInstance, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, catalog.UpdateDatabaseInstanceRequest) *catalog.DatabaseInstance); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*catalog.DatabaseInstance) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, catalog.UpdateDatabaseInstanceRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockDatabaseInstancesInterface_UpdateDatabaseInstance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateDatabaseInstance' +type MockDatabaseInstancesInterface_UpdateDatabaseInstance_Call struct { + *mock.Call +} + +// UpdateDatabaseInstance is a helper method to define mock.On call +// - ctx context.Context +// - request catalog.UpdateDatabaseInstanceRequest +func (_e *MockDatabaseInstancesInterface_Expecter) UpdateDatabaseInstance(ctx interface{}, request interface{}) *MockDatabaseInstancesInterface_UpdateDatabaseInstance_Call { + return &MockDatabaseInstancesInterface_UpdateDatabaseInstance_Call{Call: _e.mock.On("UpdateDatabaseInstance", ctx, request)} +} + +func (_c *MockDatabaseInstancesInterface_UpdateDatabaseInstance_Call) Run(run func(ctx context.Context, request catalog.UpdateDatabaseInstanceRequest)) *MockDatabaseInstancesInterface_UpdateDatabaseInstance_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(catalog.UpdateDatabaseInstanceRequest)) + }) + return _c +} + +func (_c *MockDatabaseInstancesInterface_UpdateDatabaseInstance_Call) Return(_a0 *catalog.DatabaseInstance, _a1 error) *MockDatabaseInstancesInterface_UpdateDatabaseInstance_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockDatabaseInstancesInterface_UpdateDatabaseInstance_Call) RunAndReturn(run func(context.Context, catalog.UpdateDatabaseInstanceRequest) (*catalog.DatabaseInstance, error)) *MockDatabaseInstancesInterface_UpdateDatabaseInstance_Call { + _c.Call.Return(run) + return _c +} + +// NewMockDatabaseInstancesInterface creates a new instance of MockDatabaseInstancesInterface. 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 NewMockDatabaseInstancesInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *MockDatabaseInstancesInterface { + mock := &MockDatabaseInstancesInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/experimental/mocks/service/iam/mock_permissions_interface.go b/experimental/mocks/service/iam/mock_permissions_interface.go index 1ebb04ec8..7eb60443b 100644 --- a/experimental/mocks/service/iam/mock_permissions_interface.go +++ b/experimental/mocks/service/iam/mock_permissions_interface.go @@ -261,7 +261,7 @@ func (_c *MockPermissionsInterface_GetPermissionLevelsByRequestObjectTypeAndRequ } // Set provides a mock function with given fields: ctx, request -func (_m *MockPermissionsInterface) Set(ctx context.Context, request iam.PermissionsRequest) (*iam.ObjectPermissions, error) { +func (_m *MockPermissionsInterface) Set(ctx context.Context, request iam.SetObjectPermissions) (*iam.ObjectPermissions, error) { ret := _m.Called(ctx, request) if len(ret) == 0 { @@ -270,10 +270,10 @@ func (_m *MockPermissionsInterface) Set(ctx context.Context, request iam.Permiss var r0 *iam.ObjectPermissions var r1 error - if rf, ok := ret.Get(0).(func(context.Context, iam.PermissionsRequest) (*iam.ObjectPermissions, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, iam.SetObjectPermissions) (*iam.ObjectPermissions, error)); ok { return rf(ctx, request) } - if rf, ok := ret.Get(0).(func(context.Context, iam.PermissionsRequest) *iam.ObjectPermissions); ok { + if rf, ok := ret.Get(0).(func(context.Context, iam.SetObjectPermissions) *iam.ObjectPermissions); ok { r0 = rf(ctx, request) } else { if ret.Get(0) != nil { @@ -281,7 +281,7 @@ func (_m *MockPermissionsInterface) Set(ctx context.Context, request iam.Permiss } } - if rf, ok := ret.Get(1).(func(context.Context, iam.PermissionsRequest) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, iam.SetObjectPermissions) error); ok { r1 = rf(ctx, request) } else { r1 = ret.Error(1) @@ -297,14 +297,14 @@ type MockPermissionsInterface_Set_Call struct { // Set is a helper method to define mock.On call // - ctx context.Context -// - request iam.PermissionsRequest +// - request iam.SetObjectPermissions func (_e *MockPermissionsInterface_Expecter) Set(ctx interface{}, request interface{}) *MockPermissionsInterface_Set_Call { return &MockPermissionsInterface_Set_Call{Call: _e.mock.On("Set", ctx, request)} } -func (_c *MockPermissionsInterface_Set_Call) Run(run func(ctx context.Context, request iam.PermissionsRequest)) *MockPermissionsInterface_Set_Call { +func (_c *MockPermissionsInterface_Set_Call) Run(run func(ctx context.Context, request iam.SetObjectPermissions)) *MockPermissionsInterface_Set_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(iam.PermissionsRequest)) + run(args[0].(context.Context), args[1].(iam.SetObjectPermissions)) }) return _c } @@ -314,13 +314,13 @@ func (_c *MockPermissionsInterface_Set_Call) Return(_a0 *iam.ObjectPermissions, return _c } -func (_c *MockPermissionsInterface_Set_Call) RunAndReturn(run func(context.Context, iam.PermissionsRequest) (*iam.ObjectPermissions, error)) *MockPermissionsInterface_Set_Call { +func (_c *MockPermissionsInterface_Set_Call) RunAndReturn(run func(context.Context, iam.SetObjectPermissions) (*iam.ObjectPermissions, error)) *MockPermissionsInterface_Set_Call { _c.Call.Return(run) return _c } // Update provides a mock function with given fields: ctx, request -func (_m *MockPermissionsInterface) Update(ctx context.Context, request iam.PermissionsRequest) (*iam.ObjectPermissions, error) { +func (_m *MockPermissionsInterface) Update(ctx context.Context, request iam.UpdateObjectPermissions) (*iam.ObjectPermissions, error) { ret := _m.Called(ctx, request) if len(ret) == 0 { @@ -329,10 +329,10 @@ func (_m *MockPermissionsInterface) Update(ctx context.Context, request iam.Perm var r0 *iam.ObjectPermissions var r1 error - if rf, ok := ret.Get(0).(func(context.Context, iam.PermissionsRequest) (*iam.ObjectPermissions, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, iam.UpdateObjectPermissions) (*iam.ObjectPermissions, error)); ok { return rf(ctx, request) } - if rf, ok := ret.Get(0).(func(context.Context, iam.PermissionsRequest) *iam.ObjectPermissions); ok { + if rf, ok := ret.Get(0).(func(context.Context, iam.UpdateObjectPermissions) *iam.ObjectPermissions); ok { r0 = rf(ctx, request) } else { if ret.Get(0) != nil { @@ -340,7 +340,7 @@ func (_m *MockPermissionsInterface) Update(ctx context.Context, request iam.Perm } } - if rf, ok := ret.Get(1).(func(context.Context, iam.PermissionsRequest) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, iam.UpdateObjectPermissions) error); ok { r1 = rf(ctx, request) } else { r1 = ret.Error(1) @@ -356,14 +356,14 @@ type MockPermissionsInterface_Update_Call struct { // Update is a helper method to define mock.On call // - ctx context.Context -// - request iam.PermissionsRequest +// - request iam.UpdateObjectPermissions func (_e *MockPermissionsInterface_Expecter) Update(ctx interface{}, request interface{}) *MockPermissionsInterface_Update_Call { return &MockPermissionsInterface_Update_Call{Call: _e.mock.On("Update", ctx, request)} } -func (_c *MockPermissionsInterface_Update_Call) Run(run func(ctx context.Context, request iam.PermissionsRequest)) *MockPermissionsInterface_Update_Call { +func (_c *MockPermissionsInterface_Update_Call) Run(run func(ctx context.Context, request iam.UpdateObjectPermissions)) *MockPermissionsInterface_Update_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(iam.PermissionsRequest)) + run(args[0].(context.Context), args[1].(iam.UpdateObjectPermissions)) }) return _c } @@ -373,7 +373,7 @@ func (_c *MockPermissionsInterface_Update_Call) Return(_a0 *iam.ObjectPermission return _c } -func (_c *MockPermissionsInterface_Update_Call) RunAndReturn(run func(context.Context, iam.PermissionsRequest) (*iam.ObjectPermissions, error)) *MockPermissionsInterface_Update_Call { +func (_c *MockPermissionsInterface_Update_Call) RunAndReturn(run func(context.Context, iam.UpdateObjectPermissions) (*iam.ObjectPermissions, error)) *MockPermissionsInterface_Update_Call { _c.Call.Return(run) return _c } diff --git a/experimental/mocks/service/serving/mock_serving_endpoints_interface.go b/experimental/mocks/service/serving/mock_serving_endpoints_interface.go index 47c8bde06..35c847173 100644 --- a/experimental/mocks/service/serving/mock_serving_endpoints_interface.go +++ b/experimental/mocks/service/serving/mock_serving_endpoints_interface.go @@ -280,6 +280,139 @@ func (_c *MockServingEndpointsInterface_CreateAndWait_Call) RunAndReturn(run fun return _c } +// CreateProvisionedThroughputEndpoint provides a mock function with given fields: ctx, createPtEndpointRequest +func (_m *MockServingEndpointsInterface) CreateProvisionedThroughputEndpoint(ctx context.Context, createPtEndpointRequest serving.CreatePtEndpointRequest) (*serving.WaitGetServingEndpointNotUpdating[serving.ServingEndpointDetailed], error) { + ret := _m.Called(ctx, createPtEndpointRequest) + + if len(ret) == 0 { + panic("no return value specified for CreateProvisionedThroughputEndpoint") + } + + var r0 *serving.WaitGetServingEndpointNotUpdating[serving.ServingEndpointDetailed] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, serving.CreatePtEndpointRequest) (*serving.WaitGetServingEndpointNotUpdating[serving.ServingEndpointDetailed], error)); ok { + return rf(ctx, createPtEndpointRequest) + } + if rf, ok := ret.Get(0).(func(context.Context, serving.CreatePtEndpointRequest) *serving.WaitGetServingEndpointNotUpdating[serving.ServingEndpointDetailed]); ok { + r0 = rf(ctx, createPtEndpointRequest) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*serving.WaitGetServingEndpointNotUpdating[serving.ServingEndpointDetailed]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, serving.CreatePtEndpointRequest) error); ok { + r1 = rf(ctx, createPtEndpointRequest) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockServingEndpointsInterface_CreateProvisionedThroughputEndpoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateProvisionedThroughputEndpoint' +type MockServingEndpointsInterface_CreateProvisionedThroughputEndpoint_Call struct { + *mock.Call +} + +// CreateProvisionedThroughputEndpoint is a helper method to define mock.On call +// - ctx context.Context +// - createPtEndpointRequest serving.CreatePtEndpointRequest +func (_e *MockServingEndpointsInterface_Expecter) CreateProvisionedThroughputEndpoint(ctx interface{}, createPtEndpointRequest interface{}) *MockServingEndpointsInterface_CreateProvisionedThroughputEndpoint_Call { + return &MockServingEndpointsInterface_CreateProvisionedThroughputEndpoint_Call{Call: _e.mock.On("CreateProvisionedThroughputEndpoint", ctx, createPtEndpointRequest)} +} + +func (_c *MockServingEndpointsInterface_CreateProvisionedThroughputEndpoint_Call) Run(run func(ctx context.Context, createPtEndpointRequest serving.CreatePtEndpointRequest)) *MockServingEndpointsInterface_CreateProvisionedThroughputEndpoint_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(serving.CreatePtEndpointRequest)) + }) + return _c +} + +func (_c *MockServingEndpointsInterface_CreateProvisionedThroughputEndpoint_Call) Return(_a0 *serving.WaitGetServingEndpointNotUpdating[serving.ServingEndpointDetailed], _a1 error) *MockServingEndpointsInterface_CreateProvisionedThroughputEndpoint_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockServingEndpointsInterface_CreateProvisionedThroughputEndpoint_Call) RunAndReturn(run func(context.Context, serving.CreatePtEndpointRequest) (*serving.WaitGetServingEndpointNotUpdating[serving.ServingEndpointDetailed], error)) *MockServingEndpointsInterface_CreateProvisionedThroughputEndpoint_Call { + _c.Call.Return(run) + return _c +} + +// CreateProvisionedThroughputEndpointAndWait provides a mock function with given fields: ctx, createPtEndpointRequest, options +func (_m *MockServingEndpointsInterface) CreateProvisionedThroughputEndpointAndWait(ctx context.Context, createPtEndpointRequest serving.CreatePtEndpointRequest, options ...retries.Option[serving.ServingEndpointDetailed]) (*serving.ServingEndpointDetailed, error) { + _va := make([]interface{}, len(options)) + for _i := range options { + _va[_i] = options[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, createPtEndpointRequest) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for CreateProvisionedThroughputEndpointAndWait") + } + + var r0 *serving.ServingEndpointDetailed + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, serving.CreatePtEndpointRequest, ...retries.Option[serving.ServingEndpointDetailed]) (*serving.ServingEndpointDetailed, error)); ok { + return rf(ctx, createPtEndpointRequest, options...) + } + if rf, ok := ret.Get(0).(func(context.Context, serving.CreatePtEndpointRequest, ...retries.Option[serving.ServingEndpointDetailed]) *serving.ServingEndpointDetailed); ok { + r0 = rf(ctx, createPtEndpointRequest, options...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*serving.ServingEndpointDetailed) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, serving.CreatePtEndpointRequest, ...retries.Option[serving.ServingEndpointDetailed]) error); ok { + r1 = rf(ctx, createPtEndpointRequest, options...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockServingEndpointsInterface_CreateProvisionedThroughputEndpointAndWait_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateProvisionedThroughputEndpointAndWait' +type MockServingEndpointsInterface_CreateProvisionedThroughputEndpointAndWait_Call struct { + *mock.Call +} + +// CreateProvisionedThroughputEndpointAndWait is a helper method to define mock.On call +// - ctx context.Context +// - createPtEndpointRequest serving.CreatePtEndpointRequest +// - options ...retries.Option[serving.ServingEndpointDetailed] +func (_e *MockServingEndpointsInterface_Expecter) CreateProvisionedThroughputEndpointAndWait(ctx interface{}, createPtEndpointRequest interface{}, options ...interface{}) *MockServingEndpointsInterface_CreateProvisionedThroughputEndpointAndWait_Call { + return &MockServingEndpointsInterface_CreateProvisionedThroughputEndpointAndWait_Call{Call: _e.mock.On("CreateProvisionedThroughputEndpointAndWait", + append([]interface{}{ctx, createPtEndpointRequest}, options...)...)} +} + +func (_c *MockServingEndpointsInterface_CreateProvisionedThroughputEndpointAndWait_Call) Run(run func(ctx context.Context, createPtEndpointRequest serving.CreatePtEndpointRequest, options ...retries.Option[serving.ServingEndpointDetailed])) *MockServingEndpointsInterface_CreateProvisionedThroughputEndpointAndWait_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]retries.Option[serving.ServingEndpointDetailed], len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(retries.Option[serving.ServingEndpointDetailed]) + } + } + run(args[0].(context.Context), args[1].(serving.CreatePtEndpointRequest), variadicArgs...) + }) + return _c +} + +func (_c *MockServingEndpointsInterface_CreateProvisionedThroughputEndpointAndWait_Call) Return(_a0 *serving.ServingEndpointDetailed, _a1 error) *MockServingEndpointsInterface_CreateProvisionedThroughputEndpointAndWait_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockServingEndpointsInterface_CreateProvisionedThroughputEndpointAndWait_Call) RunAndReturn(run func(context.Context, serving.CreatePtEndpointRequest, ...retries.Option[serving.ServingEndpointDetailed]) (*serving.ServingEndpointDetailed, error)) *MockServingEndpointsInterface_CreateProvisionedThroughputEndpointAndWait_Call { + _c.Call.Return(run) + return _c +} + // Delete provides a mock function with given fields: ctx, request func (_m *MockServingEndpointsInterface) Delete(ctx context.Context, request serving.DeleteServingEndpointRequest) error { ret := _m.Called(ctx, request) @@ -1735,6 +1868,139 @@ func (_c *MockServingEndpointsInterface_UpdatePermissions_Call) RunAndReturn(run return _c } +// UpdateProvisionedThroughputEndpointConfig provides a mock function with given fields: ctx, updateProvisionedThroughputEndpointConfigRequest +func (_m *MockServingEndpointsInterface) UpdateProvisionedThroughputEndpointConfig(ctx context.Context, updateProvisionedThroughputEndpointConfigRequest serving.UpdateProvisionedThroughputEndpointConfigRequest) (*serving.WaitGetServingEndpointNotUpdating[serving.ServingEndpointDetailed], error) { + ret := _m.Called(ctx, updateProvisionedThroughputEndpointConfigRequest) + + if len(ret) == 0 { + panic("no return value specified for UpdateProvisionedThroughputEndpointConfig") + } + + var r0 *serving.WaitGetServingEndpointNotUpdating[serving.ServingEndpointDetailed] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, serving.UpdateProvisionedThroughputEndpointConfigRequest) (*serving.WaitGetServingEndpointNotUpdating[serving.ServingEndpointDetailed], error)); ok { + return rf(ctx, updateProvisionedThroughputEndpointConfigRequest) + } + if rf, ok := ret.Get(0).(func(context.Context, serving.UpdateProvisionedThroughputEndpointConfigRequest) *serving.WaitGetServingEndpointNotUpdating[serving.ServingEndpointDetailed]); ok { + r0 = rf(ctx, updateProvisionedThroughputEndpointConfigRequest) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*serving.WaitGetServingEndpointNotUpdating[serving.ServingEndpointDetailed]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, serving.UpdateProvisionedThroughputEndpointConfigRequest) error); ok { + r1 = rf(ctx, updateProvisionedThroughputEndpointConfigRequest) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockServingEndpointsInterface_UpdateProvisionedThroughputEndpointConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateProvisionedThroughputEndpointConfig' +type MockServingEndpointsInterface_UpdateProvisionedThroughputEndpointConfig_Call struct { + *mock.Call +} + +// UpdateProvisionedThroughputEndpointConfig is a helper method to define mock.On call +// - ctx context.Context +// - updateProvisionedThroughputEndpointConfigRequest serving.UpdateProvisionedThroughputEndpointConfigRequest +func (_e *MockServingEndpointsInterface_Expecter) UpdateProvisionedThroughputEndpointConfig(ctx interface{}, updateProvisionedThroughputEndpointConfigRequest interface{}) *MockServingEndpointsInterface_UpdateProvisionedThroughputEndpointConfig_Call { + return &MockServingEndpointsInterface_UpdateProvisionedThroughputEndpointConfig_Call{Call: _e.mock.On("UpdateProvisionedThroughputEndpointConfig", ctx, updateProvisionedThroughputEndpointConfigRequest)} +} + +func (_c *MockServingEndpointsInterface_UpdateProvisionedThroughputEndpointConfig_Call) Run(run func(ctx context.Context, updateProvisionedThroughputEndpointConfigRequest serving.UpdateProvisionedThroughputEndpointConfigRequest)) *MockServingEndpointsInterface_UpdateProvisionedThroughputEndpointConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(serving.UpdateProvisionedThroughputEndpointConfigRequest)) + }) + return _c +} + +func (_c *MockServingEndpointsInterface_UpdateProvisionedThroughputEndpointConfig_Call) Return(_a0 *serving.WaitGetServingEndpointNotUpdating[serving.ServingEndpointDetailed], _a1 error) *MockServingEndpointsInterface_UpdateProvisionedThroughputEndpointConfig_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockServingEndpointsInterface_UpdateProvisionedThroughputEndpointConfig_Call) RunAndReturn(run func(context.Context, serving.UpdateProvisionedThroughputEndpointConfigRequest) (*serving.WaitGetServingEndpointNotUpdating[serving.ServingEndpointDetailed], error)) *MockServingEndpointsInterface_UpdateProvisionedThroughputEndpointConfig_Call { + _c.Call.Return(run) + return _c +} + +// UpdateProvisionedThroughputEndpointConfigAndWait provides a mock function with given fields: ctx, updateProvisionedThroughputEndpointConfigRequest, options +func (_m *MockServingEndpointsInterface) UpdateProvisionedThroughputEndpointConfigAndWait(ctx context.Context, updateProvisionedThroughputEndpointConfigRequest serving.UpdateProvisionedThroughputEndpointConfigRequest, options ...retries.Option[serving.ServingEndpointDetailed]) (*serving.ServingEndpointDetailed, error) { + _va := make([]interface{}, len(options)) + for _i := range options { + _va[_i] = options[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, updateProvisionedThroughputEndpointConfigRequest) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for UpdateProvisionedThroughputEndpointConfigAndWait") + } + + var r0 *serving.ServingEndpointDetailed + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, serving.UpdateProvisionedThroughputEndpointConfigRequest, ...retries.Option[serving.ServingEndpointDetailed]) (*serving.ServingEndpointDetailed, error)); ok { + return rf(ctx, updateProvisionedThroughputEndpointConfigRequest, options...) + } + if rf, ok := ret.Get(0).(func(context.Context, serving.UpdateProvisionedThroughputEndpointConfigRequest, ...retries.Option[serving.ServingEndpointDetailed]) *serving.ServingEndpointDetailed); ok { + r0 = rf(ctx, updateProvisionedThroughputEndpointConfigRequest, options...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*serving.ServingEndpointDetailed) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, serving.UpdateProvisionedThroughputEndpointConfigRequest, ...retries.Option[serving.ServingEndpointDetailed]) error); ok { + r1 = rf(ctx, updateProvisionedThroughputEndpointConfigRequest, options...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockServingEndpointsInterface_UpdateProvisionedThroughputEndpointConfigAndWait_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateProvisionedThroughputEndpointConfigAndWait' +type MockServingEndpointsInterface_UpdateProvisionedThroughputEndpointConfigAndWait_Call struct { + *mock.Call +} + +// UpdateProvisionedThroughputEndpointConfigAndWait is a helper method to define mock.On call +// - ctx context.Context +// - updateProvisionedThroughputEndpointConfigRequest serving.UpdateProvisionedThroughputEndpointConfigRequest +// - options ...retries.Option[serving.ServingEndpointDetailed] +func (_e *MockServingEndpointsInterface_Expecter) UpdateProvisionedThroughputEndpointConfigAndWait(ctx interface{}, updateProvisionedThroughputEndpointConfigRequest interface{}, options ...interface{}) *MockServingEndpointsInterface_UpdateProvisionedThroughputEndpointConfigAndWait_Call { + return &MockServingEndpointsInterface_UpdateProvisionedThroughputEndpointConfigAndWait_Call{Call: _e.mock.On("UpdateProvisionedThroughputEndpointConfigAndWait", + append([]interface{}{ctx, updateProvisionedThroughputEndpointConfigRequest}, options...)...)} +} + +func (_c *MockServingEndpointsInterface_UpdateProvisionedThroughputEndpointConfigAndWait_Call) Run(run func(ctx context.Context, updateProvisionedThroughputEndpointConfigRequest serving.UpdateProvisionedThroughputEndpointConfigRequest, options ...retries.Option[serving.ServingEndpointDetailed])) *MockServingEndpointsInterface_UpdateProvisionedThroughputEndpointConfigAndWait_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]retries.Option[serving.ServingEndpointDetailed], len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(retries.Option[serving.ServingEndpointDetailed]) + } + } + run(args[0].(context.Context), args[1].(serving.UpdateProvisionedThroughputEndpointConfigRequest), variadicArgs...) + }) + return _c +} + +func (_c *MockServingEndpointsInterface_UpdateProvisionedThroughputEndpointConfigAndWait_Call) Return(_a0 *serving.ServingEndpointDetailed, _a1 error) *MockServingEndpointsInterface_UpdateProvisionedThroughputEndpointConfigAndWait_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockServingEndpointsInterface_UpdateProvisionedThroughputEndpointConfigAndWait_Call) RunAndReturn(run func(context.Context, serving.UpdateProvisionedThroughputEndpointConfigRequest, ...retries.Option[serving.ServingEndpointDetailed]) (*serving.ServingEndpointDetailed, error)) *MockServingEndpointsInterface_UpdateProvisionedThroughputEndpointConfigAndWait_Call { + _c.Call.Return(run) + return _c +} + // WaitGetServingEndpointNotUpdating provides a mock function with given fields: ctx, name, timeout, callback func (_m *MockServingEndpointsInterface) WaitGetServingEndpointNotUpdating(ctx context.Context, name string, timeout time.Duration, callback func(*serving.ServingEndpointDetailed)) (*serving.ServingEndpointDetailed, error) { ret := _m.Called(ctx, name, timeout, callback) diff --git a/experimental/mocks/service/settings/mock_account_settings_interface.go b/experimental/mocks/service/settings/mock_account_settings_interface.go index 0939459c2..4f0c45143 100644 --- a/experimental/mocks/service/settings/mock_account_settings_interface.go +++ b/experimental/mocks/service/settings/mock_account_settings_interface.go @@ -208,6 +208,100 @@ func (_c *MockAccountSettingsInterface_EsmEnablementAccount_Call) RunAndReturn(r return _c } +// LlmProxyPartnerPoweredAccount provides a mock function with no fields +func (_m *MockAccountSettingsInterface) LlmProxyPartnerPoweredAccount() settings.LlmProxyPartnerPoweredAccountInterface { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for LlmProxyPartnerPoweredAccount") + } + + var r0 settings.LlmProxyPartnerPoweredAccountInterface + if rf, ok := ret.Get(0).(func() settings.LlmProxyPartnerPoweredAccountInterface); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(settings.LlmProxyPartnerPoweredAccountInterface) + } + } + + return r0 +} + +// MockAccountSettingsInterface_LlmProxyPartnerPoweredAccount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LlmProxyPartnerPoweredAccount' +type MockAccountSettingsInterface_LlmProxyPartnerPoweredAccount_Call struct { + *mock.Call +} + +// LlmProxyPartnerPoweredAccount is a helper method to define mock.On call +func (_e *MockAccountSettingsInterface_Expecter) LlmProxyPartnerPoweredAccount() *MockAccountSettingsInterface_LlmProxyPartnerPoweredAccount_Call { + return &MockAccountSettingsInterface_LlmProxyPartnerPoweredAccount_Call{Call: _e.mock.On("LlmProxyPartnerPoweredAccount")} +} + +func (_c *MockAccountSettingsInterface_LlmProxyPartnerPoweredAccount_Call) Run(run func()) *MockAccountSettingsInterface_LlmProxyPartnerPoweredAccount_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockAccountSettingsInterface_LlmProxyPartnerPoweredAccount_Call) Return(_a0 settings.LlmProxyPartnerPoweredAccountInterface) *MockAccountSettingsInterface_LlmProxyPartnerPoweredAccount_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockAccountSettingsInterface_LlmProxyPartnerPoweredAccount_Call) RunAndReturn(run func() settings.LlmProxyPartnerPoweredAccountInterface) *MockAccountSettingsInterface_LlmProxyPartnerPoweredAccount_Call { + _c.Call.Return(run) + return _c +} + +// LlmProxyPartnerPoweredEnforce provides a mock function with no fields +func (_m *MockAccountSettingsInterface) LlmProxyPartnerPoweredEnforce() settings.LlmProxyPartnerPoweredEnforceInterface { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for LlmProxyPartnerPoweredEnforce") + } + + var r0 settings.LlmProxyPartnerPoweredEnforceInterface + if rf, ok := ret.Get(0).(func() settings.LlmProxyPartnerPoweredEnforceInterface); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(settings.LlmProxyPartnerPoweredEnforceInterface) + } + } + + return r0 +} + +// MockAccountSettingsInterface_LlmProxyPartnerPoweredEnforce_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LlmProxyPartnerPoweredEnforce' +type MockAccountSettingsInterface_LlmProxyPartnerPoweredEnforce_Call struct { + *mock.Call +} + +// LlmProxyPartnerPoweredEnforce is a helper method to define mock.On call +func (_e *MockAccountSettingsInterface_Expecter) LlmProxyPartnerPoweredEnforce() *MockAccountSettingsInterface_LlmProxyPartnerPoweredEnforce_Call { + return &MockAccountSettingsInterface_LlmProxyPartnerPoweredEnforce_Call{Call: _e.mock.On("LlmProxyPartnerPoweredEnforce")} +} + +func (_c *MockAccountSettingsInterface_LlmProxyPartnerPoweredEnforce_Call) Run(run func()) *MockAccountSettingsInterface_LlmProxyPartnerPoweredEnforce_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockAccountSettingsInterface_LlmProxyPartnerPoweredEnforce_Call) Return(_a0 settings.LlmProxyPartnerPoweredEnforceInterface) *MockAccountSettingsInterface_LlmProxyPartnerPoweredEnforce_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockAccountSettingsInterface_LlmProxyPartnerPoweredEnforce_Call) RunAndReturn(run func() settings.LlmProxyPartnerPoweredEnforceInterface) *MockAccountSettingsInterface_LlmProxyPartnerPoweredEnforce_Call { + _c.Call.Return(run) + return _c +} + // PersonalCompute provides a mock function with no fields func (_m *MockAccountSettingsInterface) PersonalCompute() settings.PersonalComputeInterface { ret := _m.Called() diff --git a/experimental/mocks/service/settings/mock_llm_proxy_partner_powered_account_interface.go b/experimental/mocks/service/settings/mock_llm_proxy_partner_powered_account_interface.go new file mode 100644 index 000000000..c47a07c18 --- /dev/null +++ b/experimental/mocks/service/settings/mock_llm_proxy_partner_powered_account_interface.go @@ -0,0 +1,214 @@ +// Code generated by mockery v2.53.2. DO NOT EDIT. + +package settings + +import ( + context "context" + + settings "github.com/databricks/databricks-sdk-go/service/settings" + mock "github.com/stretchr/testify/mock" +) + +// MockLlmProxyPartnerPoweredAccountInterface is an autogenerated mock type for the LlmProxyPartnerPoweredAccountInterface type +type MockLlmProxyPartnerPoweredAccountInterface struct { + mock.Mock +} + +type MockLlmProxyPartnerPoweredAccountInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *MockLlmProxyPartnerPoweredAccountInterface) EXPECT() *MockLlmProxyPartnerPoweredAccountInterface_Expecter { + return &MockLlmProxyPartnerPoweredAccountInterface_Expecter{mock: &_m.Mock} +} + +// Get provides a mock function with given fields: ctx, request +func (_m *MockLlmProxyPartnerPoweredAccountInterface) Get(ctx context.Context, request settings.GetLlmProxyPartnerPoweredAccountRequest) (*settings.LlmProxyPartnerPoweredAccount, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Get") + } + + var r0 *settings.LlmProxyPartnerPoweredAccount + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, settings.GetLlmProxyPartnerPoweredAccountRequest) (*settings.LlmProxyPartnerPoweredAccount, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, settings.GetLlmProxyPartnerPoweredAccountRequest) *settings.LlmProxyPartnerPoweredAccount); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*settings.LlmProxyPartnerPoweredAccount) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, settings.GetLlmProxyPartnerPoweredAccountRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockLlmProxyPartnerPoweredAccountInterface_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type MockLlmProxyPartnerPoweredAccountInterface_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - ctx context.Context +// - request settings.GetLlmProxyPartnerPoweredAccountRequest +func (_e *MockLlmProxyPartnerPoweredAccountInterface_Expecter) Get(ctx interface{}, request interface{}) *MockLlmProxyPartnerPoweredAccountInterface_Get_Call { + return &MockLlmProxyPartnerPoweredAccountInterface_Get_Call{Call: _e.mock.On("Get", ctx, request)} +} + +func (_c *MockLlmProxyPartnerPoweredAccountInterface_Get_Call) Run(run func(ctx context.Context, request settings.GetLlmProxyPartnerPoweredAccountRequest)) *MockLlmProxyPartnerPoweredAccountInterface_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(settings.GetLlmProxyPartnerPoweredAccountRequest)) + }) + return _c +} + +func (_c *MockLlmProxyPartnerPoweredAccountInterface_Get_Call) Return(_a0 *settings.LlmProxyPartnerPoweredAccount, _a1 error) *MockLlmProxyPartnerPoweredAccountInterface_Get_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockLlmProxyPartnerPoweredAccountInterface_Get_Call) RunAndReturn(run func(context.Context, settings.GetLlmProxyPartnerPoweredAccountRequest) (*settings.LlmProxyPartnerPoweredAccount, error)) *MockLlmProxyPartnerPoweredAccountInterface_Get_Call { + _c.Call.Return(run) + return _c +} + +// GetByAccountId provides a mock function with given fields: ctx, accountId +func (_m *MockLlmProxyPartnerPoweredAccountInterface) GetByAccountId(ctx context.Context, accountId string) (*settings.LlmProxyPartnerPoweredAccount, error) { + ret := _m.Called(ctx, accountId) + + if len(ret) == 0 { + panic("no return value specified for GetByAccountId") + } + + var r0 *settings.LlmProxyPartnerPoweredAccount + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*settings.LlmProxyPartnerPoweredAccount, error)); ok { + return rf(ctx, accountId) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *settings.LlmProxyPartnerPoweredAccount); ok { + r0 = rf(ctx, accountId) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*settings.LlmProxyPartnerPoweredAccount) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, accountId) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockLlmProxyPartnerPoweredAccountInterface_GetByAccountId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetByAccountId' +type MockLlmProxyPartnerPoweredAccountInterface_GetByAccountId_Call struct { + *mock.Call +} + +// GetByAccountId is a helper method to define mock.On call +// - ctx context.Context +// - accountId string +func (_e *MockLlmProxyPartnerPoweredAccountInterface_Expecter) GetByAccountId(ctx interface{}, accountId interface{}) *MockLlmProxyPartnerPoweredAccountInterface_GetByAccountId_Call { + return &MockLlmProxyPartnerPoweredAccountInterface_GetByAccountId_Call{Call: _e.mock.On("GetByAccountId", ctx, accountId)} +} + +func (_c *MockLlmProxyPartnerPoweredAccountInterface_GetByAccountId_Call) Run(run func(ctx context.Context, accountId string)) *MockLlmProxyPartnerPoweredAccountInterface_GetByAccountId_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockLlmProxyPartnerPoweredAccountInterface_GetByAccountId_Call) Return(_a0 *settings.LlmProxyPartnerPoweredAccount, _a1 error) *MockLlmProxyPartnerPoweredAccountInterface_GetByAccountId_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockLlmProxyPartnerPoweredAccountInterface_GetByAccountId_Call) RunAndReturn(run func(context.Context, string) (*settings.LlmProxyPartnerPoweredAccount, error)) *MockLlmProxyPartnerPoweredAccountInterface_GetByAccountId_Call { + _c.Call.Return(run) + return _c +} + +// Update provides a mock function with given fields: ctx, request +func (_m *MockLlmProxyPartnerPoweredAccountInterface) Update(ctx context.Context, request settings.UpdateLlmProxyPartnerPoweredAccountRequest) (*settings.LlmProxyPartnerPoweredAccount, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Update") + } + + var r0 *settings.LlmProxyPartnerPoweredAccount + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, settings.UpdateLlmProxyPartnerPoweredAccountRequest) (*settings.LlmProxyPartnerPoweredAccount, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, settings.UpdateLlmProxyPartnerPoweredAccountRequest) *settings.LlmProxyPartnerPoweredAccount); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*settings.LlmProxyPartnerPoweredAccount) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, settings.UpdateLlmProxyPartnerPoweredAccountRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockLlmProxyPartnerPoweredAccountInterface_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' +type MockLlmProxyPartnerPoweredAccountInterface_Update_Call struct { + *mock.Call +} + +// Update is a helper method to define mock.On call +// - ctx context.Context +// - request settings.UpdateLlmProxyPartnerPoweredAccountRequest +func (_e *MockLlmProxyPartnerPoweredAccountInterface_Expecter) Update(ctx interface{}, request interface{}) *MockLlmProxyPartnerPoweredAccountInterface_Update_Call { + return &MockLlmProxyPartnerPoweredAccountInterface_Update_Call{Call: _e.mock.On("Update", ctx, request)} +} + +func (_c *MockLlmProxyPartnerPoweredAccountInterface_Update_Call) Run(run func(ctx context.Context, request settings.UpdateLlmProxyPartnerPoweredAccountRequest)) *MockLlmProxyPartnerPoweredAccountInterface_Update_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(settings.UpdateLlmProxyPartnerPoweredAccountRequest)) + }) + return _c +} + +func (_c *MockLlmProxyPartnerPoweredAccountInterface_Update_Call) Return(_a0 *settings.LlmProxyPartnerPoweredAccount, _a1 error) *MockLlmProxyPartnerPoweredAccountInterface_Update_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockLlmProxyPartnerPoweredAccountInterface_Update_Call) RunAndReturn(run func(context.Context, settings.UpdateLlmProxyPartnerPoweredAccountRequest) (*settings.LlmProxyPartnerPoweredAccount, error)) *MockLlmProxyPartnerPoweredAccountInterface_Update_Call { + _c.Call.Return(run) + return _c +} + +// NewMockLlmProxyPartnerPoweredAccountInterface creates a new instance of MockLlmProxyPartnerPoweredAccountInterface. 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 NewMockLlmProxyPartnerPoweredAccountInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *MockLlmProxyPartnerPoweredAccountInterface { + mock := &MockLlmProxyPartnerPoweredAccountInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/experimental/mocks/service/settings/mock_llm_proxy_partner_powered_enforce_interface.go b/experimental/mocks/service/settings/mock_llm_proxy_partner_powered_enforce_interface.go new file mode 100644 index 000000000..28271cbe9 --- /dev/null +++ b/experimental/mocks/service/settings/mock_llm_proxy_partner_powered_enforce_interface.go @@ -0,0 +1,214 @@ +// Code generated by mockery v2.53.2. DO NOT EDIT. + +package settings + +import ( + context "context" + + settings "github.com/databricks/databricks-sdk-go/service/settings" + mock "github.com/stretchr/testify/mock" +) + +// MockLlmProxyPartnerPoweredEnforceInterface is an autogenerated mock type for the LlmProxyPartnerPoweredEnforceInterface type +type MockLlmProxyPartnerPoweredEnforceInterface struct { + mock.Mock +} + +type MockLlmProxyPartnerPoweredEnforceInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *MockLlmProxyPartnerPoweredEnforceInterface) EXPECT() *MockLlmProxyPartnerPoweredEnforceInterface_Expecter { + return &MockLlmProxyPartnerPoweredEnforceInterface_Expecter{mock: &_m.Mock} +} + +// Get provides a mock function with given fields: ctx, request +func (_m *MockLlmProxyPartnerPoweredEnforceInterface) Get(ctx context.Context, request settings.GetLlmProxyPartnerPoweredEnforceRequest) (*settings.LlmProxyPartnerPoweredEnforce, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Get") + } + + var r0 *settings.LlmProxyPartnerPoweredEnforce + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, settings.GetLlmProxyPartnerPoweredEnforceRequest) (*settings.LlmProxyPartnerPoweredEnforce, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, settings.GetLlmProxyPartnerPoweredEnforceRequest) *settings.LlmProxyPartnerPoweredEnforce); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*settings.LlmProxyPartnerPoweredEnforce) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, settings.GetLlmProxyPartnerPoweredEnforceRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockLlmProxyPartnerPoweredEnforceInterface_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type MockLlmProxyPartnerPoweredEnforceInterface_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - ctx context.Context +// - request settings.GetLlmProxyPartnerPoweredEnforceRequest +func (_e *MockLlmProxyPartnerPoweredEnforceInterface_Expecter) Get(ctx interface{}, request interface{}) *MockLlmProxyPartnerPoweredEnforceInterface_Get_Call { + return &MockLlmProxyPartnerPoweredEnforceInterface_Get_Call{Call: _e.mock.On("Get", ctx, request)} +} + +func (_c *MockLlmProxyPartnerPoweredEnforceInterface_Get_Call) Run(run func(ctx context.Context, request settings.GetLlmProxyPartnerPoweredEnforceRequest)) *MockLlmProxyPartnerPoweredEnforceInterface_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(settings.GetLlmProxyPartnerPoweredEnforceRequest)) + }) + return _c +} + +func (_c *MockLlmProxyPartnerPoweredEnforceInterface_Get_Call) Return(_a0 *settings.LlmProxyPartnerPoweredEnforce, _a1 error) *MockLlmProxyPartnerPoweredEnforceInterface_Get_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockLlmProxyPartnerPoweredEnforceInterface_Get_Call) RunAndReturn(run func(context.Context, settings.GetLlmProxyPartnerPoweredEnforceRequest) (*settings.LlmProxyPartnerPoweredEnforce, error)) *MockLlmProxyPartnerPoweredEnforceInterface_Get_Call { + _c.Call.Return(run) + return _c +} + +// GetByAccountId provides a mock function with given fields: ctx, accountId +func (_m *MockLlmProxyPartnerPoweredEnforceInterface) GetByAccountId(ctx context.Context, accountId string) (*settings.LlmProxyPartnerPoweredEnforce, error) { + ret := _m.Called(ctx, accountId) + + if len(ret) == 0 { + panic("no return value specified for GetByAccountId") + } + + var r0 *settings.LlmProxyPartnerPoweredEnforce + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*settings.LlmProxyPartnerPoweredEnforce, error)); ok { + return rf(ctx, accountId) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *settings.LlmProxyPartnerPoweredEnforce); ok { + r0 = rf(ctx, accountId) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*settings.LlmProxyPartnerPoweredEnforce) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, accountId) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockLlmProxyPartnerPoweredEnforceInterface_GetByAccountId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetByAccountId' +type MockLlmProxyPartnerPoweredEnforceInterface_GetByAccountId_Call struct { + *mock.Call +} + +// GetByAccountId is a helper method to define mock.On call +// - ctx context.Context +// - accountId string +func (_e *MockLlmProxyPartnerPoweredEnforceInterface_Expecter) GetByAccountId(ctx interface{}, accountId interface{}) *MockLlmProxyPartnerPoweredEnforceInterface_GetByAccountId_Call { + return &MockLlmProxyPartnerPoweredEnforceInterface_GetByAccountId_Call{Call: _e.mock.On("GetByAccountId", ctx, accountId)} +} + +func (_c *MockLlmProxyPartnerPoweredEnforceInterface_GetByAccountId_Call) Run(run func(ctx context.Context, accountId string)) *MockLlmProxyPartnerPoweredEnforceInterface_GetByAccountId_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockLlmProxyPartnerPoweredEnforceInterface_GetByAccountId_Call) Return(_a0 *settings.LlmProxyPartnerPoweredEnforce, _a1 error) *MockLlmProxyPartnerPoweredEnforceInterface_GetByAccountId_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockLlmProxyPartnerPoweredEnforceInterface_GetByAccountId_Call) RunAndReturn(run func(context.Context, string) (*settings.LlmProxyPartnerPoweredEnforce, error)) *MockLlmProxyPartnerPoweredEnforceInterface_GetByAccountId_Call { + _c.Call.Return(run) + return _c +} + +// Update provides a mock function with given fields: ctx, request +func (_m *MockLlmProxyPartnerPoweredEnforceInterface) Update(ctx context.Context, request settings.UpdateLlmProxyPartnerPoweredEnforceRequest) (*settings.LlmProxyPartnerPoweredEnforce, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Update") + } + + var r0 *settings.LlmProxyPartnerPoweredEnforce + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, settings.UpdateLlmProxyPartnerPoweredEnforceRequest) (*settings.LlmProxyPartnerPoweredEnforce, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, settings.UpdateLlmProxyPartnerPoweredEnforceRequest) *settings.LlmProxyPartnerPoweredEnforce); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*settings.LlmProxyPartnerPoweredEnforce) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, settings.UpdateLlmProxyPartnerPoweredEnforceRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockLlmProxyPartnerPoweredEnforceInterface_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' +type MockLlmProxyPartnerPoweredEnforceInterface_Update_Call struct { + *mock.Call +} + +// Update is a helper method to define mock.On call +// - ctx context.Context +// - request settings.UpdateLlmProxyPartnerPoweredEnforceRequest +func (_e *MockLlmProxyPartnerPoweredEnforceInterface_Expecter) Update(ctx interface{}, request interface{}) *MockLlmProxyPartnerPoweredEnforceInterface_Update_Call { + return &MockLlmProxyPartnerPoweredEnforceInterface_Update_Call{Call: _e.mock.On("Update", ctx, request)} +} + +func (_c *MockLlmProxyPartnerPoweredEnforceInterface_Update_Call) Run(run func(ctx context.Context, request settings.UpdateLlmProxyPartnerPoweredEnforceRequest)) *MockLlmProxyPartnerPoweredEnforceInterface_Update_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(settings.UpdateLlmProxyPartnerPoweredEnforceRequest)) + }) + return _c +} + +func (_c *MockLlmProxyPartnerPoweredEnforceInterface_Update_Call) Return(_a0 *settings.LlmProxyPartnerPoweredEnforce, _a1 error) *MockLlmProxyPartnerPoweredEnforceInterface_Update_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockLlmProxyPartnerPoweredEnforceInterface_Update_Call) RunAndReturn(run func(context.Context, settings.UpdateLlmProxyPartnerPoweredEnforceRequest) (*settings.LlmProxyPartnerPoweredEnforce, error)) *MockLlmProxyPartnerPoweredEnforceInterface_Update_Call { + _c.Call.Return(run) + return _c +} + +// NewMockLlmProxyPartnerPoweredEnforceInterface creates a new instance of MockLlmProxyPartnerPoweredEnforceInterface. 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 NewMockLlmProxyPartnerPoweredEnforceInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *MockLlmProxyPartnerPoweredEnforceInterface { + mock := &MockLlmProxyPartnerPoweredEnforceInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/experimental/mocks/service/settings/mock_llm_proxy_partner_powered_workspace_interface.go b/experimental/mocks/service/settings/mock_llm_proxy_partner_powered_workspace_interface.go new file mode 100644 index 000000000..a746f27b1 --- /dev/null +++ b/experimental/mocks/service/settings/mock_llm_proxy_partner_powered_workspace_interface.go @@ -0,0 +1,214 @@ +// Code generated by mockery v2.53.2. DO NOT EDIT. + +package settings + +import ( + context "context" + + settings "github.com/databricks/databricks-sdk-go/service/settings" + mock "github.com/stretchr/testify/mock" +) + +// MockLlmProxyPartnerPoweredWorkspaceInterface is an autogenerated mock type for the LlmProxyPartnerPoweredWorkspaceInterface type +type MockLlmProxyPartnerPoweredWorkspaceInterface struct { + mock.Mock +} + +type MockLlmProxyPartnerPoweredWorkspaceInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *MockLlmProxyPartnerPoweredWorkspaceInterface) EXPECT() *MockLlmProxyPartnerPoweredWorkspaceInterface_Expecter { + return &MockLlmProxyPartnerPoweredWorkspaceInterface_Expecter{mock: &_m.Mock} +} + +// Delete provides a mock function with given fields: ctx, request +func (_m *MockLlmProxyPartnerPoweredWorkspaceInterface) Delete(ctx context.Context, request settings.DeleteLlmProxyPartnerPoweredWorkspaceRequest) (*settings.DeleteLlmProxyPartnerPoweredWorkspaceResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Delete") + } + + var r0 *settings.DeleteLlmProxyPartnerPoweredWorkspaceResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, settings.DeleteLlmProxyPartnerPoweredWorkspaceRequest) (*settings.DeleteLlmProxyPartnerPoweredWorkspaceResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, settings.DeleteLlmProxyPartnerPoweredWorkspaceRequest) *settings.DeleteLlmProxyPartnerPoweredWorkspaceResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*settings.DeleteLlmProxyPartnerPoweredWorkspaceResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, settings.DeleteLlmProxyPartnerPoweredWorkspaceRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockLlmProxyPartnerPoweredWorkspaceInterface_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type MockLlmProxyPartnerPoweredWorkspaceInterface_Delete_Call struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - ctx context.Context +// - request settings.DeleteLlmProxyPartnerPoweredWorkspaceRequest +func (_e *MockLlmProxyPartnerPoweredWorkspaceInterface_Expecter) Delete(ctx interface{}, request interface{}) *MockLlmProxyPartnerPoweredWorkspaceInterface_Delete_Call { + return &MockLlmProxyPartnerPoweredWorkspaceInterface_Delete_Call{Call: _e.mock.On("Delete", ctx, request)} +} + +func (_c *MockLlmProxyPartnerPoweredWorkspaceInterface_Delete_Call) Run(run func(ctx context.Context, request settings.DeleteLlmProxyPartnerPoweredWorkspaceRequest)) *MockLlmProxyPartnerPoweredWorkspaceInterface_Delete_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(settings.DeleteLlmProxyPartnerPoweredWorkspaceRequest)) + }) + return _c +} + +func (_c *MockLlmProxyPartnerPoweredWorkspaceInterface_Delete_Call) Return(_a0 *settings.DeleteLlmProxyPartnerPoweredWorkspaceResponse, _a1 error) *MockLlmProxyPartnerPoweredWorkspaceInterface_Delete_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockLlmProxyPartnerPoweredWorkspaceInterface_Delete_Call) RunAndReturn(run func(context.Context, settings.DeleteLlmProxyPartnerPoweredWorkspaceRequest) (*settings.DeleteLlmProxyPartnerPoweredWorkspaceResponse, error)) *MockLlmProxyPartnerPoweredWorkspaceInterface_Delete_Call { + _c.Call.Return(run) + return _c +} + +// Get provides a mock function with given fields: ctx, request +func (_m *MockLlmProxyPartnerPoweredWorkspaceInterface) Get(ctx context.Context, request settings.GetLlmProxyPartnerPoweredWorkspaceRequest) (*settings.LlmProxyPartnerPoweredWorkspace, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Get") + } + + var r0 *settings.LlmProxyPartnerPoweredWorkspace + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, settings.GetLlmProxyPartnerPoweredWorkspaceRequest) (*settings.LlmProxyPartnerPoweredWorkspace, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, settings.GetLlmProxyPartnerPoweredWorkspaceRequest) *settings.LlmProxyPartnerPoweredWorkspace); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*settings.LlmProxyPartnerPoweredWorkspace) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, settings.GetLlmProxyPartnerPoweredWorkspaceRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockLlmProxyPartnerPoweredWorkspaceInterface_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type MockLlmProxyPartnerPoweredWorkspaceInterface_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - ctx context.Context +// - request settings.GetLlmProxyPartnerPoweredWorkspaceRequest +func (_e *MockLlmProxyPartnerPoweredWorkspaceInterface_Expecter) Get(ctx interface{}, request interface{}) *MockLlmProxyPartnerPoweredWorkspaceInterface_Get_Call { + return &MockLlmProxyPartnerPoweredWorkspaceInterface_Get_Call{Call: _e.mock.On("Get", ctx, request)} +} + +func (_c *MockLlmProxyPartnerPoweredWorkspaceInterface_Get_Call) Run(run func(ctx context.Context, request settings.GetLlmProxyPartnerPoweredWorkspaceRequest)) *MockLlmProxyPartnerPoweredWorkspaceInterface_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(settings.GetLlmProxyPartnerPoweredWorkspaceRequest)) + }) + return _c +} + +func (_c *MockLlmProxyPartnerPoweredWorkspaceInterface_Get_Call) Return(_a0 *settings.LlmProxyPartnerPoweredWorkspace, _a1 error) *MockLlmProxyPartnerPoweredWorkspaceInterface_Get_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockLlmProxyPartnerPoweredWorkspaceInterface_Get_Call) RunAndReturn(run func(context.Context, settings.GetLlmProxyPartnerPoweredWorkspaceRequest) (*settings.LlmProxyPartnerPoweredWorkspace, error)) *MockLlmProxyPartnerPoweredWorkspaceInterface_Get_Call { + _c.Call.Return(run) + return _c +} + +// Update provides a mock function with given fields: ctx, request +func (_m *MockLlmProxyPartnerPoweredWorkspaceInterface) Update(ctx context.Context, request settings.UpdateLlmProxyPartnerPoweredWorkspaceRequest) (*settings.LlmProxyPartnerPoweredWorkspace, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Update") + } + + var r0 *settings.LlmProxyPartnerPoweredWorkspace + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, settings.UpdateLlmProxyPartnerPoweredWorkspaceRequest) (*settings.LlmProxyPartnerPoweredWorkspace, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, settings.UpdateLlmProxyPartnerPoweredWorkspaceRequest) *settings.LlmProxyPartnerPoweredWorkspace); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*settings.LlmProxyPartnerPoweredWorkspace) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, settings.UpdateLlmProxyPartnerPoweredWorkspaceRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockLlmProxyPartnerPoweredWorkspaceInterface_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' +type MockLlmProxyPartnerPoweredWorkspaceInterface_Update_Call struct { + *mock.Call +} + +// Update is a helper method to define mock.On call +// - ctx context.Context +// - request settings.UpdateLlmProxyPartnerPoweredWorkspaceRequest +func (_e *MockLlmProxyPartnerPoweredWorkspaceInterface_Expecter) Update(ctx interface{}, request interface{}) *MockLlmProxyPartnerPoweredWorkspaceInterface_Update_Call { + return &MockLlmProxyPartnerPoweredWorkspaceInterface_Update_Call{Call: _e.mock.On("Update", ctx, request)} +} + +func (_c *MockLlmProxyPartnerPoweredWorkspaceInterface_Update_Call) Run(run func(ctx context.Context, request settings.UpdateLlmProxyPartnerPoweredWorkspaceRequest)) *MockLlmProxyPartnerPoweredWorkspaceInterface_Update_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(settings.UpdateLlmProxyPartnerPoweredWorkspaceRequest)) + }) + return _c +} + +func (_c *MockLlmProxyPartnerPoweredWorkspaceInterface_Update_Call) Return(_a0 *settings.LlmProxyPartnerPoweredWorkspace, _a1 error) *MockLlmProxyPartnerPoweredWorkspaceInterface_Update_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockLlmProxyPartnerPoweredWorkspaceInterface_Update_Call) RunAndReturn(run func(context.Context, settings.UpdateLlmProxyPartnerPoweredWorkspaceRequest) (*settings.LlmProxyPartnerPoweredWorkspace, error)) *MockLlmProxyPartnerPoweredWorkspaceInterface_Update_Call { + _c.Call.Return(run) + return _c +} + +// NewMockLlmProxyPartnerPoweredWorkspaceInterface creates a new instance of MockLlmProxyPartnerPoweredWorkspaceInterface. 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 NewMockLlmProxyPartnerPoweredWorkspaceInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *MockLlmProxyPartnerPoweredWorkspaceInterface { + mock := &MockLlmProxyPartnerPoweredWorkspaceInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/experimental/mocks/service/settings/mock_settings_interface.go b/experimental/mocks/service/settings/mock_settings_interface.go index 01dd451ca..22606d610 100644 --- a/experimental/mocks/service/settings/mock_settings_interface.go +++ b/experimental/mocks/service/settings/mock_settings_interface.go @@ -537,6 +537,53 @@ func (_c *MockSettingsInterface_EnhancedSecurityMonitoring_Call) RunAndReturn(ru return _c } +// LlmProxyPartnerPoweredWorkspace provides a mock function with no fields +func (_m *MockSettingsInterface) LlmProxyPartnerPoweredWorkspace() settings.LlmProxyPartnerPoweredWorkspaceInterface { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for LlmProxyPartnerPoweredWorkspace") + } + + var r0 settings.LlmProxyPartnerPoweredWorkspaceInterface + if rf, ok := ret.Get(0).(func() settings.LlmProxyPartnerPoweredWorkspaceInterface); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(settings.LlmProxyPartnerPoweredWorkspaceInterface) + } + } + + return r0 +} + +// MockSettingsInterface_LlmProxyPartnerPoweredWorkspace_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LlmProxyPartnerPoweredWorkspace' +type MockSettingsInterface_LlmProxyPartnerPoweredWorkspace_Call struct { + *mock.Call +} + +// LlmProxyPartnerPoweredWorkspace is a helper method to define mock.On call +func (_e *MockSettingsInterface_Expecter) LlmProxyPartnerPoweredWorkspace() *MockSettingsInterface_LlmProxyPartnerPoweredWorkspace_Call { + return &MockSettingsInterface_LlmProxyPartnerPoweredWorkspace_Call{Call: _e.mock.On("LlmProxyPartnerPoweredWorkspace")} +} + +func (_c *MockSettingsInterface_LlmProxyPartnerPoweredWorkspace_Call) Run(run func()) *MockSettingsInterface_LlmProxyPartnerPoweredWorkspace_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSettingsInterface_LlmProxyPartnerPoweredWorkspace_Call) Return(_a0 settings.LlmProxyPartnerPoweredWorkspaceInterface) *MockSettingsInterface_LlmProxyPartnerPoweredWorkspace_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSettingsInterface_LlmProxyPartnerPoweredWorkspace_Call) RunAndReturn(run func() settings.LlmProxyPartnerPoweredWorkspaceInterface) *MockSettingsInterface_LlmProxyPartnerPoweredWorkspace_Call { + _c.Call.Return(run) + return _c +} + // RestrictWorkspaceAdmins provides a mock function with no fields func (_m *MockSettingsInterface) RestrictWorkspaceAdmins() settings.RestrictWorkspaceAdminsInterface { ret := _m.Called() diff --git a/service/catalog/api.go b/service/catalog/api.go index 04b38a2cf..f0aa06877 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, Database Instances, 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. package catalog import ( @@ -736,6 +736,125 @@ func (a *CredentialsAPI) GetCredentialByNameArg(ctx context.Context, nameArg str }) } +type DatabaseInstancesInterface interface { + + // Create a Database Catalog. + CreateDatabaseCatalog(ctx context.Context, request CreateDatabaseCatalogRequest) (*DatabaseCatalog, error) + + // Create a Database Instance. + CreateDatabaseInstance(ctx context.Context, request CreateDatabaseInstanceRequest) (*DatabaseInstance, error) + + // Create a Synced Database Table. + CreateSyncedDatabaseTable(ctx context.Context, request CreateSyncedDatabaseTableRequest) (*SyncedDatabaseTable, error) + + // Delete a Database Catalog. + DeleteDatabaseCatalog(ctx context.Context, request DeleteDatabaseCatalogRequest) error + + // Delete a Database Catalog. + DeleteDatabaseCatalogByName(ctx context.Context, name string) error + + // Delete a Database Instance. + DeleteDatabaseInstance(ctx context.Context, request DeleteDatabaseInstanceRequest) error + + // Delete a Database Instance. + DeleteDatabaseInstanceByName(ctx context.Context, name string) error + + // Delete a Synced Database Table. + DeleteSyncedDatabaseTable(ctx context.Context, request DeleteSyncedDatabaseTableRequest) error + + // Delete a Synced Database Table. + DeleteSyncedDatabaseTableByName(ctx context.Context, name string) error + + // Find a Database Instance by uid. + FindDatabaseInstanceByUid(ctx context.Context, request FindDatabaseInstanceByUidRequest) (*DatabaseInstance, error) + + // Get a Database Catalog. + GetDatabaseCatalog(ctx context.Context, request GetDatabaseCatalogRequest) (*DatabaseCatalog, error) + + // Get a Database Catalog. + GetDatabaseCatalogByName(ctx context.Context, name string) (*DatabaseCatalog, error) + + // Get a Database Instance. + GetDatabaseInstance(ctx context.Context, request GetDatabaseInstanceRequest) (*DatabaseInstance, error) + + // Get a Database Instance. + GetDatabaseInstanceByName(ctx context.Context, name string) (*DatabaseInstance, error) + + // Get a Synced Database Table. + GetSyncedDatabaseTable(ctx context.Context, request GetSyncedDatabaseTableRequest) (*SyncedDatabaseTable, error) + + // Get a Synced Database Table. + GetSyncedDatabaseTableByName(ctx context.Context, name string) (*SyncedDatabaseTable, error) + + // List Database Instances. + // + // This method is generated by Databricks SDK Code Generator. + ListDatabaseInstances(ctx context.Context, request ListDatabaseInstancesRequest) listing.Iterator[DatabaseInstance] + + // List Database Instances. + // + // This method is generated by Databricks SDK Code Generator. + ListDatabaseInstancesAll(ctx context.Context, request ListDatabaseInstancesRequest) ([]DatabaseInstance, error) + + // Update a Database Instance. + UpdateDatabaseInstance(ctx context.Context, request UpdateDatabaseInstanceRequest) (*DatabaseInstance, error) +} + +func NewDatabaseInstances(client *client.DatabricksClient) *DatabaseInstancesAPI { + return &DatabaseInstancesAPI{ + databaseInstancesImpl: databaseInstancesImpl{ + client: client, + }, + } +} + +// Database Instances provide access to a database via REST API or direct SQL. +type DatabaseInstancesAPI struct { + databaseInstancesImpl +} + +// Delete a Database Catalog. +func (a *DatabaseInstancesAPI) DeleteDatabaseCatalogByName(ctx context.Context, name string) error { + return a.databaseInstancesImpl.DeleteDatabaseCatalog(ctx, DeleteDatabaseCatalogRequest{ + Name: name, + }) +} + +// Delete a Database Instance. +func (a *DatabaseInstancesAPI) DeleteDatabaseInstanceByName(ctx context.Context, name string) error { + return a.databaseInstancesImpl.DeleteDatabaseInstance(ctx, DeleteDatabaseInstanceRequest{ + Name: name, + }) +} + +// Delete a Synced Database Table. +func (a *DatabaseInstancesAPI) DeleteSyncedDatabaseTableByName(ctx context.Context, name string) error { + return a.databaseInstancesImpl.DeleteSyncedDatabaseTable(ctx, DeleteSyncedDatabaseTableRequest{ + Name: name, + }) +} + +// Get a Database Catalog. +func (a *DatabaseInstancesAPI) GetDatabaseCatalogByName(ctx context.Context, name string) (*DatabaseCatalog, error) { + return a.databaseInstancesImpl.GetDatabaseCatalog(ctx, GetDatabaseCatalogRequest{ + Name: name, + }) +} + +// Get a Database Instance. +func (a *DatabaseInstancesAPI) GetDatabaseInstanceByName(ctx context.Context, name string) (*DatabaseInstance, error) { + return a.databaseInstancesImpl.GetDatabaseInstance(ctx, GetDatabaseInstanceRequest{ + Name: name, + }) +} + +// Get a Synced Database Table. +func (a *DatabaseInstancesAPI) GetSyncedDatabaseTableByName(ctx context.Context, name string) (*SyncedDatabaseTable, error) { + return a.databaseInstancesImpl.GetSyncedDatabaseTable(ctx, GetSyncedDatabaseTableRequest{ + Name: name, + }) +} + type ExternalLocationsInterface interface { // Create an external location. diff --git a/service/catalog/impl.go b/service/catalog/impl.go index c94799864..06252f89b 100755 --- a/service/catalog/impl.go +++ b/service/catalog/impl.go @@ -621,6 +621,169 @@ func (a *credentialsImpl) ValidateCredential(ctx context.Context, request Valida return &validateCredentialResponse, err } +// unexported type that holds implementations of just DatabaseInstances API methods +type databaseInstancesImpl struct { + client *client.DatabricksClient +} + +func (a *databaseInstancesImpl) CreateDatabaseCatalog(ctx context.Context, request CreateDatabaseCatalogRequest) (*DatabaseCatalog, error) { + var databaseCatalog DatabaseCatalog + path := "/api/2.0/database/catalogs" + 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.Catalog, &databaseCatalog) + return &databaseCatalog, err +} + +func (a *databaseInstancesImpl) CreateDatabaseInstance(ctx context.Context, request CreateDatabaseInstanceRequest) (*DatabaseInstance, error) { + var databaseInstance DatabaseInstance + path := "/api/2.0/database/instances" + 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, &databaseInstance) + return &databaseInstance, err +} + +func (a *databaseInstancesImpl) CreateSyncedDatabaseTable(ctx context.Context, request CreateSyncedDatabaseTableRequest) (*SyncedDatabaseTable, error) { + var syncedDatabaseTable SyncedDatabaseTable + path := "/api/2.0/database/synced_tables" + 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.SyncedTable, &syncedDatabaseTable) + return &syncedDatabaseTable, err +} + +func (a *databaseInstancesImpl) 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) + return err +} + +func (a *databaseInstancesImpl) 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) + return err +} + +func (a *databaseInstancesImpl) 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) + return err +} + +func (a *databaseInstancesImpl) FindDatabaseInstanceByUid(ctx context.Context, request FindDatabaseInstanceByUidRequest) (*DatabaseInstance, error) { + var databaseInstance DatabaseInstance + path := "/api/2.0/database/instances:findByUid" + 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, &databaseInstance) + return &databaseInstance, err +} + +func (a *databaseInstancesImpl) GetDatabaseCatalog(ctx context.Context, request GetDatabaseCatalogRequest) (*DatabaseCatalog, error) { + var databaseCatalog DatabaseCatalog + 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.MethodGet, path, headers, queryParams, request, &databaseCatalog) + return &databaseCatalog, err +} + +func (a *databaseInstancesImpl) GetDatabaseInstance(ctx context.Context, request GetDatabaseInstanceRequest) (*DatabaseInstance, error) { + var databaseInstance DatabaseInstance + 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.MethodGet, path, headers, queryParams, request, &databaseInstance) + return &databaseInstance, err +} + +func (a *databaseInstancesImpl) GetSyncedDatabaseTable(ctx context.Context, request GetSyncedDatabaseTableRequest) (*SyncedDatabaseTable, error) { + var syncedDatabaseTable SyncedDatabaseTable + 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.MethodGet, path, headers, queryParams, request, &syncedDatabaseTable) + return &syncedDatabaseTable, err +} + +// List Database Instances. +func (a *databaseInstancesImpl) ListDatabaseInstances(ctx context.Context, request ListDatabaseInstancesRequest) listing.Iterator[DatabaseInstance] { + + getNextPage := func(ctx context.Context, req ListDatabaseInstancesRequest) (*ListDatabaseInstancesResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.internalListDatabaseInstances(ctx, req) + } + getItems := func(resp *ListDatabaseInstancesResponse) []DatabaseInstance { + return resp.DatabaseInstances + } + getNextReq := func(resp *ListDatabaseInstancesResponse) *ListDatabaseInstancesRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// List Database Instances. +func (a *databaseInstancesImpl) ListDatabaseInstancesAll(ctx context.Context, request ListDatabaseInstancesRequest) ([]DatabaseInstance, error) { + iterator := a.ListDatabaseInstances(ctx, request) + return listing.ToSlice[DatabaseInstance](ctx, iterator) +} + +func (a *databaseInstancesImpl) internalListDatabaseInstances(ctx context.Context, request ListDatabaseInstancesRequest) (*ListDatabaseInstancesResponse, error) { + var listDatabaseInstancesResponse ListDatabaseInstancesResponse + path := "/api/2.0/database/instances" + 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, &listDatabaseInstancesResponse) + return &listDatabaseInstancesResponse, err +} + +func (a *databaseInstancesImpl) UpdateDatabaseInstance(ctx context.Context, request UpdateDatabaseInstanceRequest) (*DatabaseInstance, error) { + var databaseInstance DatabaseInstance + path := fmt.Sprintf("/api/2.0/database/instances/%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.DatabaseInstance, &databaseInstance) + return &databaseInstance, err +} + // unexported type that holds implementations of just ExternalLocations API methods type externalLocationsImpl struct { client *client.DatabricksClient @@ -1685,7 +1848,8 @@ func (a *systemSchemasImpl) Enable(ctx context.Context, request EnableRequest) e queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, nil, &enableResponse) + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &enableResponse) return err } @@ -1695,8 +1859,6 @@ func (a *systemSchemasImpl) Enable(ctx context.Context, request EnableRequest) e // account admin or a metastore admin. func (a *systemSchemasImpl) List(ctx context.Context, request ListSystemSchemasRequest) listing.Iterator[SystemSchemaInfo] { - request.ForceSendFields = append(request.ForceSendFields, "MaxResults") - getNextPage := func(ctx context.Context, req ListSystemSchemasRequest) (*ListSystemSchemasResponse, error) { ctx = useragent.InContext(ctx, "sdk-feature", "pagination") return a.internalList(ctx, req) diff --git a/service/catalog/interface.go b/service/catalog/interface.go index a6bd36d62..b86b6fb69 100755 --- a/service/catalog/interface.go +++ b/service/catalog/interface.go @@ -317,6 +317,48 @@ type CredentialsService interface { ValidateCredential(ctx context.Context, request ValidateCredentialRequest) (*ValidateCredentialResponse, error) } +// Database Instances provide access to a database via REST API or direct SQL. +type DatabaseInstancesService interface { + + // Create a Database Catalog. + CreateDatabaseCatalog(ctx context.Context, request CreateDatabaseCatalogRequest) (*DatabaseCatalog, error) + + // Create a Database Instance. + CreateDatabaseInstance(ctx context.Context, request CreateDatabaseInstanceRequest) (*DatabaseInstance, error) + + // Create a Synced Database Table. + CreateSyncedDatabaseTable(ctx context.Context, request CreateSyncedDatabaseTableRequest) (*SyncedDatabaseTable, error) + + // Delete a Database Catalog. + DeleteDatabaseCatalog(ctx context.Context, request DeleteDatabaseCatalogRequest) error + + // Delete a Database Instance. + DeleteDatabaseInstance(ctx context.Context, request DeleteDatabaseInstanceRequest) error + + // Delete a Synced Database Table. + DeleteSyncedDatabaseTable(ctx context.Context, request DeleteSyncedDatabaseTableRequest) error + + // Find a Database Instance by uid. + FindDatabaseInstanceByUid(ctx context.Context, request FindDatabaseInstanceByUidRequest) (*DatabaseInstance, error) + + // Get a Database Catalog. + GetDatabaseCatalog(ctx context.Context, request GetDatabaseCatalogRequest) (*DatabaseCatalog, error) + + // Get a Database Instance. + GetDatabaseInstance(ctx context.Context, request GetDatabaseInstanceRequest) (*DatabaseInstance, error) + + // Get a Synced Database Table. + GetSyncedDatabaseTable(ctx context.Context, request GetSyncedDatabaseTableRequest) (*SyncedDatabaseTable, error) + + // List Database Instances. + // + // Use ListDatabaseInstancesAll() to get all DatabaseInstance instances, which will iterate over every result page. + ListDatabaseInstances(ctx context.Context, request ListDatabaseInstancesRequest) (*ListDatabaseInstancesResponse, error) + + // Update a Database Instance. + UpdateDatabaseInstance(ctx context.Context, request UpdateDatabaseInstanceRequest) (*DatabaseInstance, 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 diff --git a/service/catalog/model.go b/service/catalog/model.go index d5bc4af35..0ae7457b3 100755 --- a/service/catalog/model.go +++ b/service/catalog/model.go @@ -818,6 +818,18 @@ func (s CreateCredentialRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +// 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"` +} + type CreateExternalLocation struct { // The AWS access point to use when accesing s3 for this external location. AccessPoint string `json:"access_point,omitempty"` @@ -1201,6 +1213,12 @@ func (s CreateStorageCredential) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +// Create a Synced Database Table +type CreateSyncedDatabaseTableRequest struct { + // Next field marker: 10 + SyncedTable SyncedDatabaseTable `json:"synced_table"` +} + type CreateTableConstraint struct { // A table constraint, as defined by *one* of the following fields being // set: __primary_key_constraint__, __foreign_key_constraint__, @@ -1443,6 +1461,102 @@ func (f *DataSourceFormat) Type() string { return "DataSourceFormat" } +type DatabaseCatalog struct { + CreateDatabaseIfNotExists bool `json:"create_database_if_not_exists,omitempty"` + // The name of the DatabaseInstance housing the database. + DatabaseInstanceName string `json:"database_instance_name"` + // The name of the database (in a instance) associated with the catalog. + DatabaseName string `json:"database_name"` + // The name of the catalog in UC. + Name string `json:"name"` + + Uid string `json:"uid,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *DatabaseCatalog) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s DatabaseCatalog) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// A DatabaseInstance represents a logical Postgres instance, comprised of both +// compute and storage. +type DatabaseInstance struct { + // Password for admin user to create. If not provided, no user will be + // created. + AdminPassword string `json:"admin_password,omitempty"` + // Name of the admin role for the instance. If not provided, defaults to + // 'databricks_admin'. + AdminRolename string `json:"admin_rolename,omitempty"` + // The sku of the instance. Valid values are "CU_1", "CU_2", "CU_4". + Capacity string `json:"capacity,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"` + // The name of the instance. This is the unique identifier for the instance. + Name string `json:"name"` + // The version of Postgres running on the instance. + PgVersion string `json:"pg_version,omitempty"` + // The DNS endpoint to connect to the instance for read+write access. + ReadWriteDns string `json:"read_write_dns,omitempty"` + // The current state of the instance. + State DatabaseInstanceState `json:"state,omitempty"` + // Whether the instance is stopped. + Stopped bool `json:"stopped,omitempty"` + // An immutable UUID identifier for the instance. + Uid string `json:"uid,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *DatabaseInstance) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s DatabaseInstance) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type DatabaseInstanceState string + +const DatabaseInstanceStateAvailable DatabaseInstanceState = `AVAILABLE` + +const DatabaseInstanceStateDeleting DatabaseInstanceState = `DELETING` + +const DatabaseInstanceStateFailingOver DatabaseInstanceState = `FAILING_OVER` + +const DatabaseInstanceStateStarting DatabaseInstanceState = `STARTING` + +const DatabaseInstanceStateStopped DatabaseInstanceState = `STOPPED` + +const DatabaseInstanceStateUpdating DatabaseInstanceState = `UPDATING` + +// String representation for [fmt.Print] +func (f *DatabaseInstanceState) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *DatabaseInstanceState) Set(v string) error { + switch v { + case `AVAILABLE`, `DELETING`, `FAILING_OVER`, `STARTING`, `STOPPED`, `UPDATING`: + *f = DatabaseInstanceState(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "AVAILABLE", "DELETING", "FAILING_OVER", "STARTING", "STOPPED", "UPDATING"`, v) + } +} + +// Type always returns DatabaseInstanceState to satisfy [pflag.Value] interface +func (f *DatabaseInstanceState) Type() string { + return "DatabaseInstanceState" +} + // GCP long-lived credential. Databricks-created Google Cloud Storage service // account. type DatabricksGcpServiceAccount struct { @@ -1593,6 +1707,43 @@ func (s DeleteCredentialRequest) MarshalJSON() ([]byte, error) { type DeleteCredentialResponse struct { } +// Delete a Database Catalog +type DeleteDatabaseCatalogRequest struct { + Name string `json:"-" url:"-"` +} + +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 + // instances will be deleted as well. + Force bool `json:"-" url:"force,omitempty"` + // Name of the instance to delete. + Name string `json:"-" url:"-"` + // If false, the database instance is soft deleted. Soft deleted instances + // behave as if they are deleted, and cannot be used for CRUD operations nor + // connected to. However they can be undeleted by calling the undelete API + // for a limited time. If true, the database instance is hard deleted and + // cannot be undeleted. + Purge bool `json:"-" url:"purge,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *DeleteDatabaseInstanceRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s DeleteDatabaseInstanceRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type DeleteDatabaseInstanceResponse struct { +} + // Delete an external location type DeleteExternalLocationRequest struct { // Force deletion even if there are dependent external tables or mounts. @@ -1714,6 +1865,14 @@ func (s DeleteStorageCredentialRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +// Delete a Synced Database Table +type DeleteSyncedDatabaseTableRequest struct { + Name string `json:"-" url:"-"` +} + +type DeleteSyncedDatabaseTableResponse struct { +} + // Delete a table constraint type DeleteTableConstraintRequest struct { // If true, try deleting all child constraints of the current constraint. If @@ -1901,12 +2060,23 @@ func (f *EnablePredictiveOptimization) Type() string { return "EnablePredictiveOptimization" } -// Enable a system schema type EnableRequest struct { + // the catalog for which the system schema is to enabled in + CatalogName string `json:"catalog_name,omitempty"` // The metastore ID under which the system schema lives. MetastoreId string `json:"-" url:"-"` // Full name of the system schema. SchemaName string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *EnableRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s EnableRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) } type EnableResponse struct { @@ -2000,6 +2170,22 @@ func (s FailedStatus) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +// Find a Database Instance by uid +type FindDatabaseInstanceByUidRequest struct { + // UID of the cluster to get. + Uid string `json:"-" url:"uid,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *FindDatabaseInstanceByUidRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s FindDatabaseInstanceByUidRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type ForeignKeyConstraint struct { // Column names for this constraint. ChildColumns []string `json:"child_columns"` @@ -2539,6 +2725,17 @@ type GetCredentialRequest struct { NameArg string `json:"-" url:"-"` } +// 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 effective permissions type GetEffectiveRequest struct { // Full name of securable. @@ -2816,6 +3013,11 @@ type GetStorageCredentialRequest struct { Name string `json:"-" url:"-"` } +// Get a Synced Database Table +type GetSyncedDatabaseTableRequest struct { + Name string `json:"-" url:"-"` +} + // Get a table type GetTableRequest struct { // Full name of the table. @@ -3026,6 +3228,42 @@ func (s ListCredentialsResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +// List Database Instances +type ListDatabaseInstancesRequest struct { + // 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 *ListDatabaseInstancesRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListDatabaseInstancesRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListDatabaseInstancesResponse struct { + // List of instances. + DatabaseInstances []DatabaseInstance `json:"database_instances,omitempty"` + // Pagination token to request the next page of instances. + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListDatabaseInstancesResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListDatabaseInstancesResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + // List external locations type ListExternalLocationsRequest struct { // Whether to include external locations in the response for which the @@ -4222,6 +4460,30 @@ type NamedTableConstraint struct { Name string `json:"name"` } +// Custom fields that user can set for pipeline while creating +// SyncedDatabaseTable. Note that other fields of pipeline are still inferred by +// table def internally +type NewPipelineSpec struct { + // UC catalog for the pipeline to store intermediate files (checkpoints, + // event logs etc). This needs to be a standard catalog where the user has + // permissions to create Delta tables. + StorageCatalog string `json:"storage_catalog,omitempty"` + // UC schema for the pipeline to store intermediate files (checkpoints, + // event logs etc). This needs to be in the standard catalog where the user + // has permissions to create Delta tables. + StorageSchema string `json:"storage_schema,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *NewPipelineSpec) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s NewPipelineSpec) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + // Online Table information. type OnlineTable struct { // Full three-part (catalog, schema, table) name of the table. @@ -5027,57 +5289,122 @@ func (s StorageCredentialInfo) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -type SystemSchemaInfo struct { - // Name of the system schema. - Schema string `json:"schema,omitempty"` - // The current state of enablement for the system schema. An empty string - // means the system schema is available and ready for opt-in. - State SystemSchemaInfoState `json:"state,omitempty"` +// Next field marker: 10 +type SyncedDatabaseTable struct { + // Synced Table data synchronization status + DataSynchronizationStatus *OnlineTableStatus `json:"data_synchronization_status,omitempty"` + // Name of the target database instance. This is required when creating + // synced database tables in standard catalogs. This is optional when + // creating synced database tables in registered catalogs. If this field is + // specified when creating synced database tables in registered catalogs, + // the database instance name MUST match that of the registered catalog (or + // 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. + // If this field is specified in this scenario, the Postgres database name + // 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. + 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 + // runs asynchronously). + UnityCatalogProvisioningState ProvisioningInfoState `json:"unity_catalog_provisioning_state,omitempty"` ForceSendFields []string `json:"-" url:"-"` } -func (s *SystemSchemaInfo) UnmarshalJSON(b []byte) error { +func (s *SyncedDatabaseTable) UnmarshalJSON(b []byte) error { return marshal.Unmarshal(b, s) } -func (s SystemSchemaInfo) MarshalJSON() ([]byte, error) { +func (s SyncedDatabaseTable) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// The current state of enablement for the system schema. An empty string means -// the system schema is available and ready for opt-in. -type SystemSchemaInfoState string - -const SystemSchemaInfoStateAvailable SystemSchemaInfoState = `AVAILABLE` - -const SystemSchemaInfoStateDisableInitialized SystemSchemaInfoState = `DISABLE_INITIALIZED` +type SyncedTableSchedulingPolicy string -const SystemSchemaInfoStateEnableCompleted SystemSchemaInfoState = `ENABLE_COMPLETED` +const SyncedTableSchedulingPolicyContinuous SyncedTableSchedulingPolicy = `CONTINUOUS` -const SystemSchemaInfoStateEnableInitialized SystemSchemaInfoState = `ENABLE_INITIALIZED` +const SyncedTableSchedulingPolicySnapshot SyncedTableSchedulingPolicy = `SNAPSHOT` -const SystemSchemaInfoStateUnavailable SystemSchemaInfoState = `UNAVAILABLE` +const SyncedTableSchedulingPolicyTriggered SyncedTableSchedulingPolicy = `TRIGGERED` // String representation for [fmt.Print] -func (f *SystemSchemaInfoState) String() string { +func (f *SyncedTableSchedulingPolicy) String() string { return string(*f) } // Set raw string value and validate it against allowed values -func (f *SystemSchemaInfoState) Set(v string) error { +func (f *SyncedTableSchedulingPolicy) Set(v string) error { switch v { - case `AVAILABLE`, `DISABLE_INITIALIZED`, `ENABLE_COMPLETED`, `ENABLE_INITIALIZED`, `UNAVAILABLE`: - *f = SystemSchemaInfoState(v) + case `CONTINUOUS`, `SNAPSHOT`, `TRIGGERED`: + *f = SyncedTableSchedulingPolicy(v) return nil default: - return fmt.Errorf(`value "%s" is not one of "AVAILABLE", "DISABLE_INITIALIZED", "ENABLE_COMPLETED", "ENABLE_INITIALIZED", "UNAVAILABLE"`, v) + return fmt.Errorf(`value "%s" is not one of "CONTINUOUS", "SNAPSHOT", "TRIGGERED"`, v) } } -// Type always returns SystemSchemaInfoState to satisfy [pflag.Value] interface -func (f *SystemSchemaInfoState) Type() string { - return "SystemSchemaInfoState" +// Type always returns SyncedTableSchedulingPolicy to satisfy [pflag.Value] interface +func (f *SyncedTableSchedulingPolicy) Type() string { + return "SyncedTableSchedulingPolicy" +} + +// Specification of a synced database table. +type SyncedTableSpec struct { + // If true, the synced table's logical database and schema resources in PG + // will be created if they do not already exist. + CreateDatabaseObjectsIfMissing bool `json:"create_database_objects_if_missing,omitempty"` + // Spec of new pipeline. Should be empty if pipeline_id is set + NewPipelineSpec *NewPipelineSpec `json:"new_pipeline_spec,omitempty"` + // ID of the associated pipeline. Should be empty if new_pipeline_spec is + // set + PipelineId string `json:"pipeline_id,omitempty"` + // Primary Key columns to be used for data insert/update in the destination. + PrimaryKeyColumns []string `json:"primary_key_columns,omitempty"` + // Scheduling policy of the underlying pipeline. + SchedulingPolicy SyncedTableSchedulingPolicy `json:"scheduling_policy,omitempty"` + // Three-part (catalog, schema, table) name of the source Delta table. + SourceTableFullName string `json:"source_table_full_name,omitempty"` + // Time series key to deduplicate (tie-break) rows with the same primary + // key. + TimeseriesKey string `json:"timeseries_key,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *SyncedTableSpec) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s SyncedTableSpec) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type SystemSchemaInfo struct { + // Name of the system schema. + Schema string `json:"schema"` + // The current state of enablement for the system schema. An empty string + // means the system schema is available and ready for opt-in. Possible + // values: AVAILABLE | ENABLE_INITIALIZED | ENABLE_COMPLETED | + // DISABLE_INITIALIZED | UNAVAILABLE + State string `json:"state"` } // A table constraint, as defined by *one* of the following fields being set: @@ -5503,6 +5830,17 @@ func (s UpdateCredentialRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +// Update a Database Instance +type UpdateDatabaseInstanceRequest struct { + // A DatabaseInstance represents a logical Postgres instance, comprised of + // both compute and storage. + DatabaseInstance DatabaseInstance `json:"database_instance"` + // The name of the instance. This is the unique identifier for the instance. + Name string `json:"-" url:"-"` + // The list of fields to update. + UpdateMask string `json:"-" url:"update_mask"` +} + type UpdateExternalLocation struct { // The AWS access point to use when accesing s3 for this external location. AccessPoint string `json:"access_point,omitempty"` diff --git a/service/compute/model.go b/service/compute/model.go index bf61fd0f1..0b654bf54 100755 --- a/service/compute/model.go +++ b/service/compute/model.go @@ -2631,10 +2631,6 @@ 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 Fleet-pool 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. - 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 @@ -2766,9 +2762,27 @@ type Environment struct { // project path>(WSFS or Volumes in Databricks), E.g. // dependencies: ["foo==0.0.1", "-r /Workspace/test/requirements.txt"] Dependencies []string `json:"dependencies,omitempty"` + // We renamed `client` to `environment_version` in notebook exports. This + // field is meant solely so that imported notebooks with + // `environment_version` can be deserialized correctly, in a + // backwards-compatible way (i.e. if `client` is specified instead of + // `environment_version`, it will be deserialized correctly). Do NOT use + // this field for any other purpose, e.g. notebook storage. This field is + // not yet exposed to customers (e.g. in the jobs API). + EnvironmentVersion string `json:"environment_version,omitempty"` // List of jar dependencies, should be string representing volume paths. For // example: `/Volumes/path/to/test.jar`. JarDependencies []string `json:"jar_dependencies,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *Environment) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s Environment) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) } type EventDetails struct { @@ -3269,10 +3283,6 @@ 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 Fleet-pool 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. - 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 @@ -3726,10 +3736,6 @@ 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 Fleet-pool 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. - 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 @@ -4763,12 +4769,6 @@ 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"` diff --git a/service/dashboards/model.go b/service/dashboards/model.go index bfef2675a..ffde855a4 100755 --- a/service/dashboards/model.go +++ b/service/dashboards/model.go @@ -859,6 +859,12 @@ const MessageErrorTypeCouldNotGetUcSchemaException MessageErrorType = `COULD_NOT const MessageErrorTypeDeploymentNotFoundException MessageErrorType = `DEPLOYMENT_NOT_FOUND_EXCEPTION` +const MessageErrorTypeDescribeQueryInvalidSqlError MessageErrorType = `DESCRIBE_QUERY_INVALID_SQL_ERROR` + +const MessageErrorTypeDescribeQueryTimeout MessageErrorType = `DESCRIBE_QUERY_TIMEOUT` + +const MessageErrorTypeDescribeQueryUnexpectedFailure MessageErrorType = `DESCRIBE_QUERY_UNEXPECTED_FAILURE` + const MessageErrorTypeFunctionsNotAvailableException MessageErrorType = `FUNCTIONS_NOT_AVAILABLE_EXCEPTION` const MessageErrorTypeFunctionArgumentsInvalidException MessageErrorType = `FUNCTION_ARGUMENTS_INVALID_EXCEPTION` @@ -889,6 +895,12 @@ const MessageErrorTypeInvalidCompletionRequestException MessageErrorType = `INVA const MessageErrorTypeInvalidFunctionCallException MessageErrorType = `INVALID_FUNCTION_CALL_EXCEPTION` +const MessageErrorTypeInvalidSqlMultipleDatasetReferencesException MessageErrorType = `INVALID_SQL_MULTIPLE_DATASET_REFERENCES_EXCEPTION` + +const MessageErrorTypeInvalidSqlMultipleStatementsException MessageErrorType = `INVALID_SQL_MULTIPLE_STATEMENTS_EXCEPTION` + +const MessageErrorTypeInvalidSqlUnknownTableException MessageErrorType = `INVALID_SQL_UNKNOWN_TABLE_EXCEPTION` + const MessageErrorTypeInvalidTableIdentifierException MessageErrorType = `INVALID_TABLE_IDENTIFIER_EXCEPTION` const MessageErrorTypeLocalContextExceededException MessageErrorType = `LOCAL_CONTEXT_EXCEEDED_EXCEPTION` @@ -941,11 +953,11 @@ func (f *MessageErrorType) String() string { // Set raw string value and validate it against allowed values func (f *MessageErrorType) Set(v string) error { switch v { - case `BLOCK_MULTIPLE_EXECUTIONS_EXCEPTION`, `CHAT_COMPLETION_CLIENT_EXCEPTION`, `CHAT_COMPLETION_CLIENT_TIMEOUT_EXCEPTION`, `CHAT_COMPLETION_NETWORK_EXCEPTION`, `CONTENT_FILTER_EXCEPTION`, `CONTEXT_EXCEEDED_EXCEPTION`, `COULD_NOT_GET_MODEL_DEPLOYMENTS_EXCEPTION`, `COULD_NOT_GET_UC_SCHEMA_EXCEPTION`, `DEPLOYMENT_NOT_FOUND_EXCEPTION`, `FUNCTIONS_NOT_AVAILABLE_EXCEPTION`, `FUNCTION_ARGUMENTS_INVALID_EXCEPTION`, `FUNCTION_ARGUMENTS_INVALID_JSON_EXCEPTION`, `FUNCTION_ARGUMENTS_INVALID_TYPE_EXCEPTION`, `FUNCTION_CALL_MISSING_PARAMETER_EXCEPTION`, `GENERATED_SQL_QUERY_TOO_LONG_EXCEPTION`, `GENERIC_CHAT_COMPLETION_EXCEPTION`, `GENERIC_CHAT_COMPLETION_SERVICE_EXCEPTION`, `GENERIC_SQL_EXEC_API_CALL_EXCEPTION`, `ILLEGAL_PARAMETER_DEFINITION_EXCEPTION`, `INVALID_CERTIFIED_ANSWER_FUNCTION_EXCEPTION`, `INVALID_CERTIFIED_ANSWER_IDENTIFIER_EXCEPTION`, `INVALID_CHAT_COMPLETION_JSON_EXCEPTION`, `INVALID_COMPLETION_REQUEST_EXCEPTION`, `INVALID_FUNCTION_CALL_EXCEPTION`, `INVALID_TABLE_IDENTIFIER_EXCEPTION`, `LOCAL_CONTEXT_EXCEEDED_EXCEPTION`, `MESSAGE_CANCELLED_WHILE_EXECUTING_EXCEPTION`, `MESSAGE_DELETED_WHILE_EXECUTING_EXCEPTION`, `MESSAGE_UPDATED_WHILE_EXECUTING_EXCEPTION`, `MISSING_SQL_QUERY_EXCEPTION`, `NO_DEPLOYMENTS_AVAILABLE_TO_WORKSPACE`, `NO_QUERY_TO_VISUALIZE_EXCEPTION`, `NO_TABLES_TO_QUERY_EXCEPTION`, `RATE_LIMIT_EXCEEDED_GENERIC_EXCEPTION`, `RATE_LIMIT_EXCEEDED_SPECIFIED_WAIT_EXCEPTION`, `REPLY_PROCESS_TIMEOUT_EXCEPTION`, `RETRYABLE_PROCESSING_EXCEPTION`, `SQL_EXECUTION_EXCEPTION`, `STOP_PROCESS_DUE_TO_AUTO_REGENERATE`, `TABLES_MISSING_EXCEPTION`, `TOO_MANY_CERTIFIED_ANSWERS_EXCEPTION`, `TOO_MANY_TABLES_EXCEPTION`, `UNEXPECTED_REPLY_PROCESS_EXCEPTION`, `UNKNOWN_AI_MODEL`, `WAREHOUSE_ACCESS_MISSING_EXCEPTION`, `WAREHOUSE_NOT_FOUND_EXCEPTION`: + case `BLOCK_MULTIPLE_EXECUTIONS_EXCEPTION`, `CHAT_COMPLETION_CLIENT_EXCEPTION`, `CHAT_COMPLETION_CLIENT_TIMEOUT_EXCEPTION`, `CHAT_COMPLETION_NETWORK_EXCEPTION`, `CONTENT_FILTER_EXCEPTION`, `CONTEXT_EXCEEDED_EXCEPTION`, `COULD_NOT_GET_MODEL_DEPLOYMENTS_EXCEPTION`, `COULD_NOT_GET_UC_SCHEMA_EXCEPTION`, `DEPLOYMENT_NOT_FOUND_EXCEPTION`, `DESCRIBE_QUERY_INVALID_SQL_ERROR`, `DESCRIBE_QUERY_TIMEOUT`, `DESCRIBE_QUERY_UNEXPECTED_FAILURE`, `FUNCTIONS_NOT_AVAILABLE_EXCEPTION`, `FUNCTION_ARGUMENTS_INVALID_EXCEPTION`, `FUNCTION_ARGUMENTS_INVALID_JSON_EXCEPTION`, `FUNCTION_ARGUMENTS_INVALID_TYPE_EXCEPTION`, `FUNCTION_CALL_MISSING_PARAMETER_EXCEPTION`, `GENERATED_SQL_QUERY_TOO_LONG_EXCEPTION`, `GENERIC_CHAT_COMPLETION_EXCEPTION`, `GENERIC_CHAT_COMPLETION_SERVICE_EXCEPTION`, `GENERIC_SQL_EXEC_API_CALL_EXCEPTION`, `ILLEGAL_PARAMETER_DEFINITION_EXCEPTION`, `INVALID_CERTIFIED_ANSWER_FUNCTION_EXCEPTION`, `INVALID_CERTIFIED_ANSWER_IDENTIFIER_EXCEPTION`, `INVALID_CHAT_COMPLETION_JSON_EXCEPTION`, `INVALID_COMPLETION_REQUEST_EXCEPTION`, `INVALID_FUNCTION_CALL_EXCEPTION`, `INVALID_SQL_MULTIPLE_DATASET_REFERENCES_EXCEPTION`, `INVALID_SQL_MULTIPLE_STATEMENTS_EXCEPTION`, `INVALID_SQL_UNKNOWN_TABLE_EXCEPTION`, `INVALID_TABLE_IDENTIFIER_EXCEPTION`, `LOCAL_CONTEXT_EXCEEDED_EXCEPTION`, `MESSAGE_CANCELLED_WHILE_EXECUTING_EXCEPTION`, `MESSAGE_DELETED_WHILE_EXECUTING_EXCEPTION`, `MESSAGE_UPDATED_WHILE_EXECUTING_EXCEPTION`, `MISSING_SQL_QUERY_EXCEPTION`, `NO_DEPLOYMENTS_AVAILABLE_TO_WORKSPACE`, `NO_QUERY_TO_VISUALIZE_EXCEPTION`, `NO_TABLES_TO_QUERY_EXCEPTION`, `RATE_LIMIT_EXCEEDED_GENERIC_EXCEPTION`, `RATE_LIMIT_EXCEEDED_SPECIFIED_WAIT_EXCEPTION`, `REPLY_PROCESS_TIMEOUT_EXCEPTION`, `RETRYABLE_PROCESSING_EXCEPTION`, `SQL_EXECUTION_EXCEPTION`, `STOP_PROCESS_DUE_TO_AUTO_REGENERATE`, `TABLES_MISSING_EXCEPTION`, `TOO_MANY_CERTIFIED_ANSWERS_EXCEPTION`, `TOO_MANY_TABLES_EXCEPTION`, `UNEXPECTED_REPLY_PROCESS_EXCEPTION`, `UNKNOWN_AI_MODEL`, `WAREHOUSE_ACCESS_MISSING_EXCEPTION`, `WAREHOUSE_NOT_FOUND_EXCEPTION`: *f = MessageErrorType(v) return nil default: - return fmt.Errorf(`value "%s" is not one of "BLOCK_MULTIPLE_EXECUTIONS_EXCEPTION", "CHAT_COMPLETION_CLIENT_EXCEPTION", "CHAT_COMPLETION_CLIENT_TIMEOUT_EXCEPTION", "CHAT_COMPLETION_NETWORK_EXCEPTION", "CONTENT_FILTER_EXCEPTION", "CONTEXT_EXCEEDED_EXCEPTION", "COULD_NOT_GET_MODEL_DEPLOYMENTS_EXCEPTION", "COULD_NOT_GET_UC_SCHEMA_EXCEPTION", "DEPLOYMENT_NOT_FOUND_EXCEPTION", "FUNCTIONS_NOT_AVAILABLE_EXCEPTION", "FUNCTION_ARGUMENTS_INVALID_EXCEPTION", "FUNCTION_ARGUMENTS_INVALID_JSON_EXCEPTION", "FUNCTION_ARGUMENTS_INVALID_TYPE_EXCEPTION", "FUNCTION_CALL_MISSING_PARAMETER_EXCEPTION", "GENERATED_SQL_QUERY_TOO_LONG_EXCEPTION", "GENERIC_CHAT_COMPLETION_EXCEPTION", "GENERIC_CHAT_COMPLETION_SERVICE_EXCEPTION", "GENERIC_SQL_EXEC_API_CALL_EXCEPTION", "ILLEGAL_PARAMETER_DEFINITION_EXCEPTION", "INVALID_CERTIFIED_ANSWER_FUNCTION_EXCEPTION", "INVALID_CERTIFIED_ANSWER_IDENTIFIER_EXCEPTION", "INVALID_CHAT_COMPLETION_JSON_EXCEPTION", "INVALID_COMPLETION_REQUEST_EXCEPTION", "INVALID_FUNCTION_CALL_EXCEPTION", "INVALID_TABLE_IDENTIFIER_EXCEPTION", "LOCAL_CONTEXT_EXCEEDED_EXCEPTION", "MESSAGE_CANCELLED_WHILE_EXECUTING_EXCEPTION", "MESSAGE_DELETED_WHILE_EXECUTING_EXCEPTION", "MESSAGE_UPDATED_WHILE_EXECUTING_EXCEPTION", "MISSING_SQL_QUERY_EXCEPTION", "NO_DEPLOYMENTS_AVAILABLE_TO_WORKSPACE", "NO_QUERY_TO_VISUALIZE_EXCEPTION", "NO_TABLES_TO_QUERY_EXCEPTION", "RATE_LIMIT_EXCEEDED_GENERIC_EXCEPTION", "RATE_LIMIT_EXCEEDED_SPECIFIED_WAIT_EXCEPTION", "REPLY_PROCESS_TIMEOUT_EXCEPTION", "RETRYABLE_PROCESSING_EXCEPTION", "SQL_EXECUTION_EXCEPTION", "STOP_PROCESS_DUE_TO_AUTO_REGENERATE", "TABLES_MISSING_EXCEPTION", "TOO_MANY_CERTIFIED_ANSWERS_EXCEPTION", "TOO_MANY_TABLES_EXCEPTION", "UNEXPECTED_REPLY_PROCESS_EXCEPTION", "UNKNOWN_AI_MODEL", "WAREHOUSE_ACCESS_MISSING_EXCEPTION", "WAREHOUSE_NOT_FOUND_EXCEPTION"`, v) + return fmt.Errorf(`value "%s" is not one of "BLOCK_MULTIPLE_EXECUTIONS_EXCEPTION", "CHAT_COMPLETION_CLIENT_EXCEPTION", "CHAT_COMPLETION_CLIENT_TIMEOUT_EXCEPTION", "CHAT_COMPLETION_NETWORK_EXCEPTION", "CONTENT_FILTER_EXCEPTION", "CONTEXT_EXCEEDED_EXCEPTION", "COULD_NOT_GET_MODEL_DEPLOYMENTS_EXCEPTION", "COULD_NOT_GET_UC_SCHEMA_EXCEPTION", "DEPLOYMENT_NOT_FOUND_EXCEPTION", "DESCRIBE_QUERY_INVALID_SQL_ERROR", "DESCRIBE_QUERY_TIMEOUT", "DESCRIBE_QUERY_UNEXPECTED_FAILURE", "FUNCTIONS_NOT_AVAILABLE_EXCEPTION", "FUNCTION_ARGUMENTS_INVALID_EXCEPTION", "FUNCTION_ARGUMENTS_INVALID_JSON_EXCEPTION", "FUNCTION_ARGUMENTS_INVALID_TYPE_EXCEPTION", "FUNCTION_CALL_MISSING_PARAMETER_EXCEPTION", "GENERATED_SQL_QUERY_TOO_LONG_EXCEPTION", "GENERIC_CHAT_COMPLETION_EXCEPTION", "GENERIC_CHAT_COMPLETION_SERVICE_EXCEPTION", "GENERIC_SQL_EXEC_API_CALL_EXCEPTION", "ILLEGAL_PARAMETER_DEFINITION_EXCEPTION", "INVALID_CERTIFIED_ANSWER_FUNCTION_EXCEPTION", "INVALID_CERTIFIED_ANSWER_IDENTIFIER_EXCEPTION", "INVALID_CHAT_COMPLETION_JSON_EXCEPTION", "INVALID_COMPLETION_REQUEST_EXCEPTION", "INVALID_FUNCTION_CALL_EXCEPTION", "INVALID_SQL_MULTIPLE_DATASET_REFERENCES_EXCEPTION", "INVALID_SQL_MULTIPLE_STATEMENTS_EXCEPTION", "INVALID_SQL_UNKNOWN_TABLE_EXCEPTION", "INVALID_TABLE_IDENTIFIER_EXCEPTION", "LOCAL_CONTEXT_EXCEEDED_EXCEPTION", "MESSAGE_CANCELLED_WHILE_EXECUTING_EXCEPTION", "MESSAGE_DELETED_WHILE_EXECUTING_EXCEPTION", "MESSAGE_UPDATED_WHILE_EXECUTING_EXCEPTION", "MISSING_SQL_QUERY_EXCEPTION", "NO_DEPLOYMENTS_AVAILABLE_TO_WORKSPACE", "NO_QUERY_TO_VISUALIZE_EXCEPTION", "NO_TABLES_TO_QUERY_EXCEPTION", "RATE_LIMIT_EXCEEDED_GENERIC_EXCEPTION", "RATE_LIMIT_EXCEEDED_SPECIFIED_WAIT_EXCEPTION", "REPLY_PROCESS_TIMEOUT_EXCEPTION", "RETRYABLE_PROCESSING_EXCEPTION", "SQL_EXECUTION_EXCEPTION", "STOP_PROCESS_DUE_TO_AUTO_REGENERATE", "TABLES_MISSING_EXCEPTION", "TOO_MANY_CERTIFIED_ANSWERS_EXCEPTION", "TOO_MANY_TABLES_EXCEPTION", "UNEXPECTED_REPLY_PROCESS_EXCEPTION", "UNKNOWN_AI_MODEL", "WAREHOUSE_ACCESS_MISSING_EXCEPTION", "WAREHOUSE_NOT_FOUND_EXCEPTION"`, v) } } diff --git a/service/iam/api.go b/service/iam/api.go index a10128923..e4dbdc586 100755 --- a/service/iam/api.go +++ b/service/iam/api.go @@ -837,13 +837,13 @@ type PermissionsInterface interface { // Sets permissions on an object, replacing existing permissions if they exist. // Deletes all direct permissions if none are specified. Objects can inherit // permissions from their parent objects or root object. - Set(ctx context.Context, request PermissionsRequest) (*ObjectPermissions, error) + Set(ctx context.Context, request SetObjectPermissions) (*ObjectPermissions, error) // Update object permissions. // // Updates the permissions on an object. Objects can inherit permissions from // their parent objects or root object. - Update(ctx context.Context, request PermissionsRequest) (*ObjectPermissions, error) + Update(ctx context.Context, request UpdateObjectPermissions) (*ObjectPermissions, error) } func NewPermissions(client *client.DatabricksClient) *PermissionsAPI { @@ -855,57 +855,34 @@ func NewPermissions(client *client.DatabricksClient) *PermissionsAPI { } // Permissions API are used to create read, write, edit, update and manage -// access for various users on different objects and endpoints. -// -// * **[Apps permissions](:service:apps)** — Manage which users can manage or -// use apps. -// +// access for various users on different objects and endpoints. * **[Apps +// permissions](:service:apps)** — Manage which users can manage or use apps. // * **[Cluster permissions](:service:clusters)** — Manage which users can -// manage, restart, or attach to clusters. -// -// * **[Cluster policy permissions](:service:clusterpolicies)** — Manage which -// users can use cluster policies. -// -// * **[Delta Live Tables pipeline permissions](:service:pipelines)** — Manage -// which users can view, manage, run, cancel, or own a Delta Live Tables -// pipeline. -// -// * **[Job permissions](:service:jobs)** — Manage which users can view, -// manage, trigger, cancel, or own a job. -// -// * **[MLflow experiment permissions](:service:experiments)** — Manage which -// users can read, edit, or manage MLflow experiments. -// -// * **[MLflow registered model permissions](:service:modelregistry)** — -// Manage which users can read, edit, or manage MLflow registered models. -// -// * **[Password permissions](:service:users)** — Manage which users can use -// password login when SSO is enabled. -// -// * **[Instance Pool permissions](:service:instancepools)** — Manage which -// users can manage or attach to pools. -// -// * **[Repo permissions](repos)** — Manage which users can read, run, edit, -// or manage a repo. -// -// * **[Serving endpoint permissions](:service:servingendpoints)** — Manage -// which users can view, query, or manage a serving endpoint. -// -// * **[SQL warehouse permissions](:service:warehouses)** — Manage which users -// can use or manage SQL warehouses. -// -// * **[Token permissions](:service:tokenmanagement)** — Manage which users -// can create or use tokens. -// -// * **[Workspace object permissions](:service:workspace)** — Manage which -// users can read, run, edit, or manage alerts, dbsql-dashboards, directories, -// files, notebooks and queries. -// -// For the mapping of the required permissions for specific actions or abilities -// and other important information, see [Access Control]. -// -// Note that to manage access control on service principals, use **[Account -// Access Control Proxy](:service:accountaccesscontrolproxy)**. +// manage, restart, or attach to clusters. * **[Cluster policy +// permissions](:service:clusterpolicies)** — Manage which users can use +// cluster policies. * **[Delta Live Tables pipeline +// permissions](:service:pipelines)** — Manage which users can view, manage, +// run, cancel, or own a Delta Live Tables pipeline. * **[Job +// permissions](:service:jobs)** — Manage which users can view, manage, +// trigger, cancel, or own a job. * **[MLflow experiment +// permissions](:service:experiments)** — Manage which users can read, edit, +// or manage MLflow experiments. * **[MLflow registered model +// permissions](:service:modelregistry)** — Manage which users can read, edit, +// or manage MLflow registered models. * **[Instance Pool +// permissions](:service:instancepools)** — Manage which users can manage or +// attach to pools. * **[Repo permissions](repos)** — Manage which users can +// read, run, edit, or manage a repo. * **[Serving endpoint +// permissions](:service:servingendpoints)** — Manage which users can view, +// query, or manage a serving endpoint. * **[SQL warehouse +// permissions](:service:warehouses)** — Manage which users can use or manage +// SQL warehouses. * **[Token permissions](:service:tokenmanagement)** — +// Manage which users can create or use tokens. * **[Workspace object +// permissions](:service:workspace)** — Manage which users can read, run, +// edit, or manage alerts, dbsql-dashboards, directories, files, notebooks and +// queries. For the mapping of the required permissions for specific actions or +// abilities and other important information, see [Access Control]. Note that to +// manage access control on service principals, use **[Account Access Control +// Proxy](:service:accountaccesscontrolproxy)**. // // [Access Control]: https://docs.databricks.com/security/auth-authz/access-control/index.html type PermissionsAPI struct { diff --git a/service/iam/impl.go b/service/iam/impl.go index 729cc9784..59ee7a50e 100755 --- a/service/iam/impl.go +++ b/service/iam/impl.go @@ -595,7 +595,7 @@ func (a *permissionsImpl) GetPermissionLevels(ctx context.Context, request GetPe return &getPermissionLevelsResponse, err } -func (a *permissionsImpl) Set(ctx context.Context, request PermissionsRequest) (*ObjectPermissions, error) { +func (a *permissionsImpl) Set(ctx context.Context, request SetObjectPermissions) (*ObjectPermissions, error) { var objectPermissions ObjectPermissions path := fmt.Sprintf("/api/2.0/permissions/%v/%v", request.RequestObjectType, request.RequestObjectId) queryParams := make(map[string]any) @@ -606,7 +606,7 @@ func (a *permissionsImpl) Set(ctx context.Context, request PermissionsRequest) ( return &objectPermissions, err } -func (a *permissionsImpl) Update(ctx context.Context, request PermissionsRequest) (*ObjectPermissions, error) { +func (a *permissionsImpl) Update(ctx context.Context, request UpdateObjectPermissions) (*ObjectPermissions, error) { var objectPermissions ObjectPermissions path := fmt.Sprintf("/api/2.0/permissions/%v/%v", request.RequestObjectType, request.RequestObjectId) queryParams := make(map[string]any) diff --git a/service/iam/interface.go b/service/iam/interface.go index 6b44c4503..5739c8f75 100755 --- a/service/iam/interface.go +++ b/service/iam/interface.go @@ -267,57 +267,34 @@ type PermissionMigrationService interface { } // Permissions API are used to create read, write, edit, update and manage -// access for various users on different objects and endpoints. -// -// * **[Apps permissions](:service:apps)** — Manage which users can manage or -// use apps. -// +// access for various users on different objects and endpoints. * **[Apps +// permissions](:service:apps)** — Manage which users can manage or use apps. // * **[Cluster permissions](:service:clusters)** — Manage which users can -// manage, restart, or attach to clusters. -// -// * **[Cluster policy permissions](:service:clusterpolicies)** — Manage which -// users can use cluster policies. -// -// * **[Delta Live Tables pipeline permissions](:service:pipelines)** — Manage -// which users can view, manage, run, cancel, or own a Delta Live Tables -// pipeline. -// -// * **[Job permissions](:service:jobs)** — Manage which users can view, -// manage, trigger, cancel, or own a job. -// -// * **[MLflow experiment permissions](:service:experiments)** — Manage which -// users can read, edit, or manage MLflow experiments. -// -// * **[MLflow registered model permissions](:service:modelregistry)** — -// Manage which users can read, edit, or manage MLflow registered models. -// -// * **[Password permissions](:service:users)** — Manage which users can use -// password login when SSO is enabled. -// -// * **[Instance Pool permissions](:service:instancepools)** — Manage which -// users can manage or attach to pools. -// -// * **[Repo permissions](repos)** — Manage which users can read, run, edit, -// or manage a repo. -// -// * **[Serving endpoint permissions](:service:servingendpoints)** — Manage -// which users can view, query, or manage a serving endpoint. -// -// * **[SQL warehouse permissions](:service:warehouses)** — Manage which users -// can use or manage SQL warehouses. -// -// * **[Token permissions](:service:tokenmanagement)** — Manage which users -// can create or use tokens. -// -// * **[Workspace object permissions](:service:workspace)** — Manage which -// users can read, run, edit, or manage alerts, dbsql-dashboards, directories, -// files, notebooks and queries. -// -// For the mapping of the required permissions for specific actions or abilities -// and other important information, see [Access Control]. -// -// Note that to manage access control on service principals, use **[Account -// Access Control Proxy](:service:accountaccesscontrolproxy)**. +// manage, restart, or attach to clusters. * **[Cluster policy +// permissions](:service:clusterpolicies)** — Manage which users can use +// cluster policies. * **[Delta Live Tables pipeline +// permissions](:service:pipelines)** — Manage which users can view, manage, +// run, cancel, or own a Delta Live Tables pipeline. * **[Job +// permissions](:service:jobs)** — Manage which users can view, manage, +// trigger, cancel, or own a job. * **[MLflow experiment +// permissions](:service:experiments)** — Manage which users can read, edit, +// or manage MLflow experiments. * **[MLflow registered model +// permissions](:service:modelregistry)** — Manage which users can read, edit, +// or manage MLflow registered models. * **[Instance Pool +// permissions](:service:instancepools)** — Manage which users can manage or +// attach to pools. * **[Repo permissions](repos)** — Manage which users can +// read, run, edit, or manage a repo. * **[Serving endpoint +// permissions](:service:servingendpoints)** — Manage which users can view, +// query, or manage a serving endpoint. * **[SQL warehouse +// permissions](:service:warehouses)** — Manage which users can use or manage +// SQL warehouses. * **[Token permissions](:service:tokenmanagement)** — +// Manage which users can create or use tokens. * **[Workspace object +// permissions](:service:workspace)** — Manage which users can read, run, +// edit, or manage alerts, dbsql-dashboards, directories, files, notebooks and +// queries. For the mapping of the required permissions for specific actions or +// abilities and other important information, see [Access Control]. Note that to +// manage access control on service principals, use **[Account Access Control +// Proxy](:service:accountaccesscontrolproxy)**. // // [Access Control]: https://docs.databricks.com/security/auth-authz/access-control/index.html type PermissionsService interface { @@ -338,13 +315,13 @@ type PermissionsService interface { // Sets permissions on an object, replacing existing permissions if they // exist. Deletes all direct permissions if none are specified. Objects can // inherit permissions from their parent objects or root object. - Set(ctx context.Context, request PermissionsRequest) (*ObjectPermissions, error) + Set(ctx context.Context, request SetObjectPermissions) (*ObjectPermissions, error) // Update object permissions. // // Updates the permissions on an object. Objects can inherit permissions // from their parent objects or root object. - Update(ctx context.Context, request PermissionsRequest) (*ObjectPermissions, error) + Update(ctx context.Context, request UpdateObjectPermissions) (*ObjectPermissions, error) } // Identities for use with jobs, automated tools, and systems such as scripts, diff --git a/service/iam/model.go b/service/iam/model.go index adacda464..c9317880e 100755 --- a/service/iam/model.go +++ b/service/iam/model.go @@ -251,9 +251,12 @@ type GetPasswordPermissionLevelsResponse struct { // Get object permission levels type GetPermissionLevelsRequest struct { - // RequestObjectId string `json:"-" url:"-"` - // + // The type of the request object. Can be one of the following: alerts, + // authorization, clusters, cluster-policies, dashboards, dbsql-dashboards, + // directories, experiments, files, instance-pools, jobs, notebooks, + // pipelines, queries, registered-models, repos, serving-endpoints, or + // warehouses. RequestObjectType string `json:"-" url:"-"` } @@ -1103,6 +1106,8 @@ const PermissionLevelCanAttachTo PermissionLevel = `CAN_ATTACH_TO` const PermissionLevelCanBind PermissionLevel = `CAN_BIND` +const PermissionLevelCanCreate PermissionLevel = `CAN_CREATE` + const PermissionLevelCanEdit PermissionLevel = `CAN_EDIT` const PermissionLevelCanEditMetadata PermissionLevel = `CAN_EDIT_METADATA` @@ -1117,6 +1122,8 @@ const PermissionLevelCanManageStagingVersions PermissionLevel = `CAN_MANAGE_STAG const PermissionLevelCanMonitor PermissionLevel = `CAN_MONITOR` +const PermissionLevelCanMonitorOnly PermissionLevel = `CAN_MONITOR_ONLY` + const PermissionLevelCanQuery PermissionLevel = `CAN_QUERY` const PermissionLevelCanRead PermissionLevel = `CAN_READ` @@ -1141,11 +1148,11 @@ func (f *PermissionLevel) String() string { // Set raw string value and validate it against allowed values func (f *PermissionLevel) Set(v string) error { switch v { - case `CAN_ATTACH_TO`, `CAN_BIND`, `CAN_EDIT`, `CAN_EDIT_METADATA`, `CAN_MANAGE`, `CAN_MANAGE_PRODUCTION_VERSIONS`, `CAN_MANAGE_RUN`, `CAN_MANAGE_STAGING_VERSIONS`, `CAN_MONITOR`, `CAN_QUERY`, `CAN_READ`, `CAN_RESTART`, `CAN_RUN`, `CAN_USE`, `CAN_VIEW`, `CAN_VIEW_METADATA`, `IS_OWNER`: + case `CAN_ATTACH_TO`, `CAN_BIND`, `CAN_CREATE`, `CAN_EDIT`, `CAN_EDIT_METADATA`, `CAN_MANAGE`, `CAN_MANAGE_PRODUCTION_VERSIONS`, `CAN_MANAGE_RUN`, `CAN_MANAGE_STAGING_VERSIONS`, `CAN_MONITOR`, `CAN_MONITOR_ONLY`, `CAN_QUERY`, `CAN_READ`, `CAN_RESTART`, `CAN_RUN`, `CAN_USE`, `CAN_VIEW`, `CAN_VIEW_METADATA`, `IS_OWNER`: *f = PermissionLevel(v) return nil default: - return fmt.Errorf(`value "%s" is not one of "CAN_ATTACH_TO", "CAN_BIND", "CAN_EDIT", "CAN_EDIT_METADATA", "CAN_MANAGE", "CAN_MANAGE_PRODUCTION_VERSIONS", "CAN_MANAGE_RUN", "CAN_MANAGE_STAGING_VERSIONS", "CAN_MONITOR", "CAN_QUERY", "CAN_READ", "CAN_RESTART", "CAN_RUN", "CAN_USE", "CAN_VIEW", "CAN_VIEW_METADATA", "IS_OWNER"`, v) + return fmt.Errorf(`value "%s" is not one of "CAN_ATTACH_TO", "CAN_BIND", "CAN_CREATE", "CAN_EDIT", "CAN_EDIT_METADATA", "CAN_MANAGE", "CAN_MANAGE_PRODUCTION_VERSIONS", "CAN_MANAGE_RUN", "CAN_MANAGE_STAGING_VERSIONS", "CAN_MONITOR", "CAN_MONITOR_ONLY", "CAN_QUERY", "CAN_READ", "CAN_RESTART", "CAN_RUN", "CAN_USE", "CAN_VIEW", "CAN_VIEW_METADATA", "IS_OWNER"`, v) } } @@ -1187,18 +1194,6 @@ func (s PermissionsDescription) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -type PermissionsRequest struct { - AccessControlList []AccessControlRequest `json:"access_control_list,omitempty"` - // The id of the request object. - RequestObjectId string `json:"-" url:"-"` - // The type of the request object. Can be one of the following: alerts, - // authorization, clusters, cluster-policies, dashboards, dbsql-dashboards, - // directories, experiments, files, instance-pools, jobs, notebooks, - // pipelines, queries, registered-models, repos, serving-endpoints, or - // warehouses. - RequestObjectType string `json:"-" url:"-"` -} - // Information about the principal assigned to the workspace. type PrincipalOutput struct { // The display name of the principal. @@ -1383,6 +1378,30 @@ func (f *ServicePrincipalSchema) Type() string { return "ServicePrincipalSchema" } +type SetObjectPermissions struct { + AccessControlList []AccessControlRequest `json:"access_control_list,omitempty"` + // The id of the request object. + RequestObjectId string `json:"-" url:"-"` + // The type of the request object. Can be one of the following: alerts, + // authorization, clusters, cluster-policies, dashboards, dbsql-dashboards, + // directories, experiments, files, instance-pools, jobs, notebooks, + // pipelines, queries, registered-models, repos, serving-endpoints, or + // warehouses. + RequestObjectType string `json:"-" url:"-"` +} + +type UpdateObjectPermissions struct { + AccessControlList []AccessControlRequest `json:"access_control_list,omitempty"` + // The id of the request object. + RequestObjectId string `json:"-" url:"-"` + // The type of the request object. Can be one of the following: alerts, + // authorization, clusters, cluster-policies, dashboards, dbsql-dashboards, + // directories, experiments, files, instance-pools, jobs, notebooks, + // pipelines, queries, registered-models, repos, serving-endpoints, or + // warehouses. + RequestObjectType string `json:"-" url:"-"` +} + type UpdateResponse struct { } diff --git a/service/jobs/model.go b/service/jobs/model.go index ec3933531..411c32ed4 100755 --- a/service/jobs/model.go +++ b/service/jobs/model.go @@ -4941,19 +4941,20 @@ func (s TaskNotificationSettings) MarshalJSON() ([]byte, error) { // The code indicates why the run was terminated. Additional codes might be // introduced in future releases. * `SUCCESS`: The run was completed -// successfully. * `USER_CANCELED`: The run was successfully canceled during -// execution by a user. * `CANCELED`: The run was canceled during execution by -// the Databricks platform; for example, if the maximum run duration was -// exceeded. * `SKIPPED`: Run was never executed, for example, if the upstream -// task run failed, the dependency type condition was not met, or there were no -// material tasks to execute. * `INTERNAL_ERROR`: The run encountered an -// unexpected error. Refer to the state message for further details. * -// `DRIVER_ERROR`: The run encountered an error while communicating with the -// Spark Driver. * `CLUSTER_ERROR`: The run failed due to a cluster error. Refer -// to the state message for further details. * `REPOSITORY_CHECKOUT_FAILED`: -// Failed to complete the checkout due to an error when communicating with the -// third party service. * `INVALID_CLUSTER_REQUEST`: The run failed because it -// issued an invalid request to start the cluster. * +// successfully. * `SUCCESS_WITH_FAILURES`: The run was completed successfully +// but some child runs failed. * `USER_CANCELED`: The run was successfully +// canceled during execution by a user. * `CANCELED`: The run was canceled +// during execution by the Databricks platform; for example, if the maximum run +// duration was exceeded. * `SKIPPED`: Run was never executed, for example, if +// the upstream task run failed, the dependency type condition was not met, or +// there were no material tasks to execute. * `INTERNAL_ERROR`: The run +// encountered an unexpected error. Refer to the state message for further +// details. * `DRIVER_ERROR`: The run encountered an error while communicating +// with the Spark Driver. * `CLUSTER_ERROR`: The run failed due to a cluster +// error. Refer to the state message for further details. * +// `REPOSITORY_CHECKOUT_FAILED`: Failed to complete the checkout due to an error +// when communicating with the third party service. * `INVALID_CLUSTER_REQUEST`: +// The run failed because it issued an invalid request to start the cluster. * // `WORKSPACE_RUN_LIMIT_EXCEEDED`: The workspace has reached the quota for the // maximum number of concurrent active runs. Consider scheduling the runs over a // larger time frame. * `FEATURE_DISABLED`: The run failed because it tried to @@ -5069,6 +5070,9 @@ const TerminationCodeCodeStorageAccessError TerminationCodeCode = `STORAGE_ACCES // The run was completed successfully. const TerminationCodeCodeSuccess TerminationCodeCode = `SUCCESS` +// The run was completed successfully but some child runs failed. +const TerminationCodeCodeSuccessWithFailures TerminationCodeCode = `SUCCESS_WITH_FAILURES` + // The run failed due to a permission issue while accessing a resource. Refer to // the state message for further details. const TerminationCodeCodeUnauthorizedError TerminationCodeCode = `UNAUTHORIZED_ERROR` @@ -5088,11 +5092,11 @@ func (f *TerminationCodeCode) String() string { // Set raw string value and validate it against allowed values func (f *TerminationCodeCode) Set(v string) error { switch v { - case `BUDGET_POLICY_LIMIT_EXCEEDED`, `CANCELED`, `CLOUD_FAILURE`, `CLUSTER_ERROR`, `CLUSTER_REQUEST_LIMIT_EXCEEDED`, `DISABLED`, `DRIVER_ERROR`, `FEATURE_DISABLED`, `INTERNAL_ERROR`, `INVALID_CLUSTER_REQUEST`, `INVALID_RUN_CONFIGURATION`, `LIBRARY_INSTALLATION_ERROR`, `MAX_CONCURRENT_RUNS_EXCEEDED`, `MAX_JOB_QUEUE_SIZE_EXCEEDED`, `MAX_SPARK_CONTEXTS_EXCEEDED`, `REPOSITORY_CHECKOUT_FAILED`, `RESOURCE_NOT_FOUND`, `RUN_EXECUTION_ERROR`, `SKIPPED`, `STORAGE_ACCESS_ERROR`, `SUCCESS`, `UNAUTHORIZED_ERROR`, `USER_CANCELED`, `WORKSPACE_RUN_LIMIT_EXCEEDED`: + case `BUDGET_POLICY_LIMIT_EXCEEDED`, `CANCELED`, `CLOUD_FAILURE`, `CLUSTER_ERROR`, `CLUSTER_REQUEST_LIMIT_EXCEEDED`, `DISABLED`, `DRIVER_ERROR`, `FEATURE_DISABLED`, `INTERNAL_ERROR`, `INVALID_CLUSTER_REQUEST`, `INVALID_RUN_CONFIGURATION`, `LIBRARY_INSTALLATION_ERROR`, `MAX_CONCURRENT_RUNS_EXCEEDED`, `MAX_JOB_QUEUE_SIZE_EXCEEDED`, `MAX_SPARK_CONTEXTS_EXCEEDED`, `REPOSITORY_CHECKOUT_FAILED`, `RESOURCE_NOT_FOUND`, `RUN_EXECUTION_ERROR`, `SKIPPED`, `STORAGE_ACCESS_ERROR`, `SUCCESS`, `SUCCESS_WITH_FAILURES`, `UNAUTHORIZED_ERROR`, `USER_CANCELED`, `WORKSPACE_RUN_LIMIT_EXCEEDED`: *f = TerminationCodeCode(v) return nil default: - return fmt.Errorf(`value "%s" is not one of "BUDGET_POLICY_LIMIT_EXCEEDED", "CANCELED", "CLOUD_FAILURE", "CLUSTER_ERROR", "CLUSTER_REQUEST_LIMIT_EXCEEDED", "DISABLED", "DRIVER_ERROR", "FEATURE_DISABLED", "INTERNAL_ERROR", "INVALID_CLUSTER_REQUEST", "INVALID_RUN_CONFIGURATION", "LIBRARY_INSTALLATION_ERROR", "MAX_CONCURRENT_RUNS_EXCEEDED", "MAX_JOB_QUEUE_SIZE_EXCEEDED", "MAX_SPARK_CONTEXTS_EXCEEDED", "REPOSITORY_CHECKOUT_FAILED", "RESOURCE_NOT_FOUND", "RUN_EXECUTION_ERROR", "SKIPPED", "STORAGE_ACCESS_ERROR", "SUCCESS", "UNAUTHORIZED_ERROR", "USER_CANCELED", "WORKSPACE_RUN_LIMIT_EXCEEDED"`, v) + return fmt.Errorf(`value "%s" is not one of "BUDGET_POLICY_LIMIT_EXCEEDED", "CANCELED", "CLOUD_FAILURE", "CLUSTER_ERROR", "CLUSTER_REQUEST_LIMIT_EXCEEDED", "DISABLED", "DRIVER_ERROR", "FEATURE_DISABLED", "INTERNAL_ERROR", "INVALID_CLUSTER_REQUEST", "INVALID_RUN_CONFIGURATION", "LIBRARY_INSTALLATION_ERROR", "MAX_CONCURRENT_RUNS_EXCEEDED", "MAX_JOB_QUEUE_SIZE_EXCEEDED", "MAX_SPARK_CONTEXTS_EXCEEDED", "REPOSITORY_CHECKOUT_FAILED", "RESOURCE_NOT_FOUND", "RUN_EXECUTION_ERROR", "SKIPPED", "STORAGE_ACCESS_ERROR", "SUCCESS", "SUCCESS_WITH_FAILURES", "UNAUTHORIZED_ERROR", "USER_CANCELED", "WORKSPACE_RUN_LIMIT_EXCEEDED"`, v) } } @@ -5104,19 +5108,20 @@ func (f *TerminationCodeCode) Type() string { type TerminationDetails struct { // The code indicates why the run was terminated. Additional codes might be // introduced in future releases. * `SUCCESS`: The run was completed - // successfully. * `USER_CANCELED`: The run was successfully canceled during - // execution by a user. * `CANCELED`: The run was canceled during execution - // by the Databricks platform; for example, if the maximum run duration was - // exceeded. * `SKIPPED`: Run was never executed, for example, if the - // upstream task run failed, the dependency type condition was not met, or - // there were no material tasks to execute. * `INTERNAL_ERROR`: The run - // encountered an unexpected error. Refer to the state message for further - // details. * `DRIVER_ERROR`: The run encountered an error while - // communicating with the Spark Driver. * `CLUSTER_ERROR`: The run failed - // due to a cluster error. Refer to the state message for further details. * - // `REPOSITORY_CHECKOUT_FAILED`: Failed to complete the checkout due to an - // error when communicating with the third party service. * - // `INVALID_CLUSTER_REQUEST`: The run failed because it issued an invalid + // successfully. * `SUCCESS_WITH_FAILURES`: The run was completed + // successfully but some child runs failed. * `USER_CANCELED`: The run was + // successfully canceled during execution by a user. * `CANCELED`: The run + // was canceled during execution by the Databricks platform; for example, if + // the maximum run duration was exceeded. * `SKIPPED`: Run was never + // executed, for example, if the upstream task run failed, the dependency + // type condition was not met, or there were no material tasks to execute. * + // `INTERNAL_ERROR`: The run encountered an unexpected error. Refer to the + // state message for further details. * `DRIVER_ERROR`: The run encountered + // an error while communicating with the Spark Driver. * `CLUSTER_ERROR`: + // The run failed due to a cluster error. Refer to the state message for + // further details. * `REPOSITORY_CHECKOUT_FAILED`: Failed to complete the + // checkout due to an error when communicating with the third party service. + // * `INVALID_CLUSTER_REQUEST`: The run failed because it issued an invalid // request to start the cluster. * `WORKSPACE_RUN_LIMIT_EXCEEDED`: The // workspace has reached the quota for the maximum number of concurrent // active runs. Consider scheduling the runs over a larger time frame. * diff --git a/service/pipelines/model.go b/service/pipelines/model.go index f7a6c092d..b35e66473 100755 --- a/service/pipelines/model.go +++ b/service/pipelines/model.go @@ -549,6 +549,10 @@ type IngestionPipelineDefinition struct { // Required. Settings specifying tables to replicate and the destination for // the replicated tables. Objects []IngestionConfig `json:"objects,omitempty"` + // The type of the foreign source. The source type will be inferred from the + // source connection or ingestion gateway. This field is output only and + // will be ignored if provided. + SourceType IngestionSourceType `json:"source_type,omitempty"` // Configuration settings to control the ingestion of tables. These settings // are applied to all tables in the pipeline. TableConfiguration *TableSpecificConfig `json:"table_configuration,omitempty"` @@ -564,6 +568,53 @@ func (s IngestionPipelineDefinition) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type IngestionSourceType string + +const IngestionSourceTypeDynamics365 IngestionSourceType = `DYNAMICS365` + +const IngestionSourceTypeGa4RawData IngestionSourceType = `GA4_RAW_DATA` + +const IngestionSourceTypeManagedPostgresql IngestionSourceType = `MANAGED_POSTGRESQL` + +const IngestionSourceTypeMysql IngestionSourceType = `MYSQL` + +const IngestionSourceTypeNetsuite IngestionSourceType = `NETSUITE` + +const IngestionSourceTypeOracle IngestionSourceType = `ORACLE` + +const IngestionSourceTypePostgresql IngestionSourceType = `POSTGRESQL` + +const IngestionSourceTypeSalesforce IngestionSourceType = `SALESFORCE` + +const IngestionSourceTypeServicenow IngestionSourceType = `SERVICENOW` + +const IngestionSourceTypeSharepoint IngestionSourceType = `SHAREPOINT` + +const IngestionSourceTypeSqlserver IngestionSourceType = `SQLSERVER` + +const IngestionSourceTypeWorkdayRaas IngestionSourceType = `WORKDAY_RAAS` + +// String representation for [fmt.Print] +func (f *IngestionSourceType) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *IngestionSourceType) Set(v string) error { + switch v { + case `DYNAMICS365`, `GA4_RAW_DATA`, `MANAGED_POSTGRESQL`, `MYSQL`, `NETSUITE`, `ORACLE`, `POSTGRESQL`, `SALESFORCE`, `SERVICENOW`, `SHAREPOINT`, `SQLSERVER`, `WORKDAY_RAAS`: + *f = IngestionSourceType(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "DYNAMICS365", "GA4_RAW_DATA", "MANAGED_POSTGRESQL", "MYSQL", "NETSUITE", "ORACLE", "POSTGRESQL", "SALESFORCE", "SERVICENOW", "SHAREPOINT", "SQLSERVER", "WORKDAY_RAAS"`, v) + } +} + +// Type always returns IngestionSourceType to satisfy [pflag.Value] interface +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 @@ -824,6 +875,21 @@ func (s Origin) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type PathPattern struct { + // The source code to include for pipelines + Include string `json:"include,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *PathPattern) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s PathPattern) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type PipelineAccessControlRequest struct { // name of the group GroupName string `json:"group_name,omitempty"` @@ -1075,6 +1141,10 @@ type PipelineLibrary struct { // The path to a file that defines a pipeline and is stored in the // Databricks Repos. File *FileLibrary `json:"file,omitempty"` + // The unified field to include source codes. Each entry can be a notebook + // path, a file path, or a folder path that ends `/**`. This field cannot be + // used together with `notebook` or `file`. + Glob *PathPattern `json:"glob,omitempty"` // URI of the jar to be installed. Currently only DBFS is supported. Jar string `json:"jar,omitempty"` // Specification of a maven library to be installed. @@ -1560,6 +1630,8 @@ type StartUpdateCause string const StartUpdateCauseApiCall StartUpdateCause = `API_CALL` +const StartUpdateCauseInfrastructureMaintenance StartUpdateCause = `INFRASTRUCTURE_MAINTENANCE` + const StartUpdateCauseJobTask StartUpdateCause = `JOB_TASK` const StartUpdateCauseRetryOnFailure StartUpdateCause = `RETRY_ON_FAILURE` @@ -1578,11 +1650,11 @@ func (f *StartUpdateCause) String() string { // Set raw string value and validate it against allowed values func (f *StartUpdateCause) Set(v string) error { switch v { - case `API_CALL`, `JOB_TASK`, `RETRY_ON_FAILURE`, `SCHEMA_CHANGE`, `SERVICE_UPGRADE`, `USER_ACTION`: + case `API_CALL`, `INFRASTRUCTURE_MAINTENANCE`, `JOB_TASK`, `RETRY_ON_FAILURE`, `SCHEMA_CHANGE`, `SERVICE_UPGRADE`, `USER_ACTION`: *f = StartUpdateCause(v) return nil default: - return fmt.Errorf(`value "%s" is not one of "API_CALL", "JOB_TASK", "RETRY_ON_FAILURE", "SCHEMA_CHANGE", "SERVICE_UPGRADE", "USER_ACTION"`, v) + return fmt.Errorf(`value "%s" is not one of "API_CALL", "INFRASTRUCTURE_MAINTENANCE", "JOB_TASK", "RETRY_ON_FAILURE", "SCHEMA_CHANGE", "SERVICE_UPGRADE", "USER_ACTION"`, v) } } @@ -1756,6 +1828,8 @@ type UpdateInfoCause string const UpdateInfoCauseApiCall UpdateInfoCause = `API_CALL` +const UpdateInfoCauseInfrastructureMaintenance UpdateInfoCause = `INFRASTRUCTURE_MAINTENANCE` + const UpdateInfoCauseJobTask UpdateInfoCause = `JOB_TASK` const UpdateInfoCauseRetryOnFailure UpdateInfoCause = `RETRY_ON_FAILURE` @@ -1774,11 +1848,11 @@ func (f *UpdateInfoCause) String() string { // Set raw string value and validate it against allowed values func (f *UpdateInfoCause) Set(v string) error { switch v { - case `API_CALL`, `JOB_TASK`, `RETRY_ON_FAILURE`, `SCHEMA_CHANGE`, `SERVICE_UPGRADE`, `USER_ACTION`: + case `API_CALL`, `INFRASTRUCTURE_MAINTENANCE`, `JOB_TASK`, `RETRY_ON_FAILURE`, `SCHEMA_CHANGE`, `SERVICE_UPGRADE`, `USER_ACTION`: *f = UpdateInfoCause(v) return nil default: - return fmt.Errorf(`value "%s" is not one of "API_CALL", "JOB_TASK", "RETRY_ON_FAILURE", "SCHEMA_CHANGE", "SERVICE_UPGRADE", "USER_ACTION"`, v) + return fmt.Errorf(`value "%s" is not one of "API_CALL", "INFRASTRUCTURE_MAINTENANCE", "JOB_TASK", "RETRY_ON_FAILURE", "SCHEMA_CHANGE", "SERVICE_UPGRADE", "USER_ACTION"`, v) } } diff --git a/service/pkg.go b/service/pkg.go index 751c65297..60e3a8f2c 100644 --- a/service/pkg.go +++ b/service/pkg.go @@ -72,6 +72,8 @@ // // - [sql.DataSourcesAPI]: This API is provided to assist you in making new query objects. // +// - [catalog.DatabaseInstancesAPI]: Database Instances provide access to a database via REST API or direct SQL. +// // - [files.DbfsAPI]: DBFS API makes it simple to interact with various data sources without having to include a users credentials every time to read a file. // // - [sql.DbsqlPermissionsAPI]: The SQL Permissions API is similar to the endpoints of the :method:permissions/set. @@ -136,6 +138,12 @@ // // - [compute.LibrariesAPI]: The Libraries API allows you to install and uninstall libraries and get the status of libraries on a cluster. // +// - [settings.LlmProxyPartnerPoweredAccountAPI]: Determines if partner powered models are enabled or not for a specific account. +// +// - [settings.LlmProxyPartnerPoweredEnforceAPI]: Determines if the account-level partner-powered setting value is enforced upon the workspace-level partner-powered setting. +// +// - [settings.LlmProxyPartnerPoweredWorkspaceAPI]: Determines if partner powered models are enabled or not for a specific workspace. +// // - [billing.LogDeliveryAPI]: These APIs manage log delivery configurations for this account. // // - [catalog.AccountMetastoreAssignmentsAPI]: These APIs manage metastore assignments to a workspace. @@ -357,6 +365,7 @@ var ( _ *sql.DashboardWidgetsAPI = nil _ *sql.DashboardsAPI = nil _ *sql.DataSourcesAPI = nil + _ *catalog.DatabaseInstancesAPI = nil _ *files.DbfsAPI = nil _ *sql.DbsqlPermissionsAPI = nil _ *settings.DefaultNamespaceAPI = nil @@ -389,6 +398,9 @@ var ( _ *dashboards.LakeviewAPI = nil _ *dashboards.LakeviewEmbeddedAPI = nil _ *compute.LibrariesAPI = nil + _ *settings.LlmProxyPartnerPoweredAccountAPI = nil + _ *settings.LlmProxyPartnerPoweredEnforceAPI = nil + _ *settings.LlmProxyPartnerPoweredWorkspaceAPI = nil _ *billing.LogDeliveryAPI = nil _ *catalog.AccountMetastoreAssignmentsAPI = nil _ *catalog.MetastoresAPI = nil diff --git a/service/serving/api.go b/service/serving/api.go index c5e91522c..a0de1e23c 100755 --- a/service/serving/api.go +++ b/service/serving/api.go @@ -42,6 +42,17 @@ type ServingEndpointsInterface interface { // Deprecated: use [ServingEndpointsAPIInterface.Create].Get() or [ServingEndpointsAPIInterface.WaitGetServingEndpointNotUpdating] CreateAndWait(ctx context.Context, createServingEndpoint CreateServingEndpoint, options ...retries.Option[ServingEndpointDetailed]) (*ServingEndpointDetailed, error) + // Create a new PT serving endpoint. + CreateProvisionedThroughputEndpoint(ctx context.Context, createPtEndpointRequest CreatePtEndpointRequest) (*WaitGetServingEndpointNotUpdating[ServingEndpointDetailed], error) + + // Calls [ServingEndpointsAPIInterface.CreateProvisionedThroughputEndpoint] and waits to reach NOT_UPDATING state + // + // You can override the default timeout of 20 minutes by calling adding + // retries.Timeout[ServingEndpointDetailed](60*time.Minute) functional option. + // + // Deprecated: use [ServingEndpointsAPIInterface.CreateProvisionedThroughputEndpoint].Get() or [ServingEndpointsAPIInterface.WaitGetServingEndpointNotUpdating] + CreateProvisionedThroughputEndpointAndWait(ctx context.Context, createPtEndpointRequest CreatePtEndpointRequest, options ...retries.Option[ServingEndpointDetailed]) (*ServingEndpointDetailed, error) + // Delete a serving endpoint. Delete(ctx context.Context, request DeleteServingEndpointRequest) error @@ -178,6 +189,21 @@ type ServingEndpointsInterface interface { // Updates the permissions on a serving endpoint. Serving endpoints can inherit // permissions from their root object. UpdatePermissions(ctx context.Context, request ServingEndpointPermissionsRequest) (*ServingEndpointPermissions, error) + + // Update config of a PT serving endpoint. + // + // Updates any combination of the pt endpoint's served entities, the compute + // configuration of those served entities, and the endpoint's traffic config. + // Updates are instantaneous and endpoint should be updated instantly + UpdateProvisionedThroughputEndpointConfig(ctx context.Context, updateProvisionedThroughputEndpointConfigRequest UpdateProvisionedThroughputEndpointConfigRequest) (*WaitGetServingEndpointNotUpdating[ServingEndpointDetailed], error) + + // Calls [ServingEndpointsAPIInterface.UpdateProvisionedThroughputEndpointConfig] and waits to reach NOT_UPDATING state + // + // You can override the default timeout of 20 minutes by calling adding + // retries.Timeout[ServingEndpointDetailed](60*time.Minute) functional option. + // + // Deprecated: use [ServingEndpointsAPIInterface.UpdateProvisionedThroughputEndpointConfig].Get() or [ServingEndpointsAPIInterface.WaitGetServingEndpointNotUpdating] + UpdateProvisionedThroughputEndpointConfigAndWait(ctx context.Context, updateProvisionedThroughputEndpointConfigRequest UpdateProvisionedThroughputEndpointConfigRequest, options ...retries.Option[ServingEndpointDetailed]) (*ServingEndpointDetailed, error) } func NewServingEndpoints(client *client.DatabricksClient) *ServingEndpointsAPI { @@ -313,6 +339,50 @@ func (a *ServingEndpointsAPI) CreateAndWait(ctx context.Context, createServingEn return wait.Get() } +// Create a new PT serving endpoint. +func (a *ServingEndpointsAPI) CreateProvisionedThroughputEndpoint(ctx context.Context, createPtEndpointRequest CreatePtEndpointRequest) (*WaitGetServingEndpointNotUpdating[ServingEndpointDetailed], error) { + servingEndpointDetailed, err := a.servingEndpointsImpl.CreateProvisionedThroughputEndpoint(ctx, createPtEndpointRequest) + if err != nil { + return nil, err + } + return &WaitGetServingEndpointNotUpdating[ServingEndpointDetailed]{ + Response: servingEndpointDetailed, + Name: servingEndpointDetailed.Name, + Poll: func(timeout time.Duration, callback func(*ServingEndpointDetailed)) (*ServingEndpointDetailed, error) { + return a.WaitGetServingEndpointNotUpdating(ctx, servingEndpointDetailed.Name, timeout, callback) + }, + timeout: 20 * time.Minute, + callback: nil, + }, nil +} + +// Calls [ServingEndpointsAPI.CreateProvisionedThroughputEndpoint] and waits to reach NOT_UPDATING state +// +// You can override the default timeout of 20 minutes by calling adding +// retries.Timeout[ServingEndpointDetailed](60*time.Minute) functional option. +// +// Deprecated: use [ServingEndpointsAPI.CreateProvisionedThroughputEndpoint].Get() or [ServingEndpointsAPI.WaitGetServingEndpointNotUpdating] +func (a *ServingEndpointsAPI) CreateProvisionedThroughputEndpointAndWait(ctx context.Context, createPtEndpointRequest CreatePtEndpointRequest, options ...retries.Option[ServingEndpointDetailed]) (*ServingEndpointDetailed, error) { + wait, err := a.CreateProvisionedThroughputEndpoint(ctx, createPtEndpointRequest) + if err != nil { + return nil, err + } + tmp := &retries.Info[ServingEndpointDetailed]{Timeout: 20 * time.Minute} + for _, o := range options { + o(tmp) + } + wait.timeout = tmp.Timeout + wait.callback = func(info *ServingEndpointDetailed) { + for _, o := range options { + o(&retries.Info[ServingEndpointDetailed]{ + Info: info, + Timeout: wait.timeout, + }) + } + } + return wait.Get() +} + // Delete a serving endpoint. func (a *ServingEndpointsAPI) DeleteByName(ctx context.Context, name string) error { return a.servingEndpointsImpl.Delete(ctx, DeleteServingEndpointRequest{ @@ -428,6 +498,54 @@ func (a *ServingEndpointsAPI) UpdateConfigAndWait(ctx context.Context, endpointC return wait.Get() } +// Update config of a PT serving endpoint. +// +// Updates any combination of the pt endpoint's served entities, the compute +// configuration of those served entities, and the endpoint's traffic config. +// Updates are instantaneous and endpoint should be updated instantly +func (a *ServingEndpointsAPI) UpdateProvisionedThroughputEndpointConfig(ctx context.Context, updateProvisionedThroughputEndpointConfigRequest UpdateProvisionedThroughputEndpointConfigRequest) (*WaitGetServingEndpointNotUpdating[ServingEndpointDetailed], error) { + servingEndpointDetailed, err := a.servingEndpointsImpl.UpdateProvisionedThroughputEndpointConfig(ctx, updateProvisionedThroughputEndpointConfigRequest) + if err != nil { + return nil, err + } + return &WaitGetServingEndpointNotUpdating[ServingEndpointDetailed]{ + Response: servingEndpointDetailed, + Name: servingEndpointDetailed.Name, + Poll: func(timeout time.Duration, callback func(*ServingEndpointDetailed)) (*ServingEndpointDetailed, error) { + return a.WaitGetServingEndpointNotUpdating(ctx, servingEndpointDetailed.Name, timeout, callback) + }, + timeout: 20 * time.Minute, + callback: nil, + }, nil +} + +// Calls [ServingEndpointsAPI.UpdateProvisionedThroughputEndpointConfig] and waits to reach NOT_UPDATING state +// +// You can override the default timeout of 20 minutes by calling adding +// retries.Timeout[ServingEndpointDetailed](60*time.Minute) functional option. +// +// Deprecated: use [ServingEndpointsAPI.UpdateProvisionedThroughputEndpointConfig].Get() or [ServingEndpointsAPI.WaitGetServingEndpointNotUpdating] +func (a *ServingEndpointsAPI) UpdateProvisionedThroughputEndpointConfigAndWait(ctx context.Context, updateProvisionedThroughputEndpointConfigRequest UpdateProvisionedThroughputEndpointConfigRequest, options ...retries.Option[ServingEndpointDetailed]) (*ServingEndpointDetailed, error) { + wait, err := a.UpdateProvisionedThroughputEndpointConfig(ctx, updateProvisionedThroughputEndpointConfigRequest) + if err != nil { + return nil, err + } + tmp := &retries.Info[ServingEndpointDetailed]{Timeout: 20 * time.Minute} + for _, o := range options { + o(tmp) + } + wait.timeout = tmp.Timeout + wait.callback = func(info *ServingEndpointDetailed) { + for _, o := range options { + o(&retries.Info[ServingEndpointDetailed]{ + Info: info, + Timeout: wait.timeout, + }) + } + } + return wait.Get() +} + type ServingEndpointsDataPlaneInterface interface { // Query a serving endpoint. diff --git a/service/serving/impl.go b/service/serving/impl.go index f0170053f..b4fa2f11f 100755 --- a/service/serving/impl.go +++ b/service/serving/impl.go @@ -42,6 +42,17 @@ func (a *servingEndpointsImpl) Create(ctx context.Context, request CreateServing return &servingEndpointDetailed, err } +func (a *servingEndpointsImpl) CreateProvisionedThroughputEndpoint(ctx context.Context, request CreatePtEndpointRequest) (*ServingEndpointDetailed, error) { + var servingEndpointDetailed ServingEndpointDetailed + path := "/api/2.0/serving-endpoints/pt" + 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, &servingEndpointDetailed) + return &servingEndpointDetailed, err +} + func (a *servingEndpointsImpl) Delete(ctx context.Context, request DeleteServingEndpointRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/serving-endpoints/%v", request.Name) @@ -235,6 +246,17 @@ func (a *servingEndpointsImpl) UpdatePermissions(ctx context.Context, request Se return &servingEndpointPermissions, err } +func (a *servingEndpointsImpl) UpdateProvisionedThroughputEndpointConfig(ctx context.Context, request UpdateProvisionedThroughputEndpointConfigRequest) (*ServingEndpointDetailed, error) { + var servingEndpointDetailed ServingEndpointDetailed + path := fmt.Sprintf("/api/2.0/serving-endpoints/pt/%v/config", 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.MethodPut, path, headers, queryParams, request, &servingEndpointDetailed) + return &servingEndpointDetailed, err +} + // unexported type that holds implementations of just ServingEndpointsDataPlane API methods type servingEndpointsDataPlaneImpl struct { client *client.DatabricksClient diff --git a/service/serving/interface.go b/service/serving/interface.go index 0cf50e923..408c33f19 100755 --- a/service/serving/interface.go +++ b/service/serving/interface.go @@ -29,6 +29,9 @@ type ServingEndpointsService interface { // Create a new serving endpoint. Create(ctx context.Context, request CreateServingEndpoint) (*ServingEndpointDetailed, error) + // Create a new PT serving endpoint. + CreateProvisionedThroughputEndpoint(ctx context.Context, request CreatePtEndpointRequest) (*ServingEndpointDetailed, error) + // Delete a serving endpoint. Delete(ctx context.Context, request DeleteServingEndpointRequest) error @@ -116,6 +119,14 @@ type ServingEndpointsService interface { // Updates the permissions on a serving endpoint. Serving endpoints can // inherit permissions from their root object. UpdatePermissions(ctx context.Context, request ServingEndpointPermissionsRequest) (*ServingEndpointPermissions, error) + + // Update config of a PT serving endpoint. + // + // Updates any combination of the pt endpoint's served entities, the compute + // configuration of those served entities, and the endpoint's traffic + // config. Updates are instantaneous and endpoint should be updated + // instantly + UpdateProvisionedThroughputEndpointConfig(ctx context.Context, request UpdateProvisionedThroughputEndpointConfigRequest) (*ServingEndpointDetailed, error) } // Serving endpoints DataPlane provides a set of operations to interact with diff --git a/service/serving/model.go b/service/serving/model.go index f4f890c1c..79fb0b048 100755 --- a/service/serving/model.go +++ b/service/serving/model.go @@ -505,6 +505,32 @@ func (s CohereConfig) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type CreatePtEndpointRequest struct { + // The AI Gateway configuration for the serving endpoint. + AiGateway *AiGatewayConfig `json:"ai_gateway,omitempty"` + // The budget policy associated with the endpoint. + BudgetPolicyId string `json:"budget_policy_id,omitempty"` + // The core config of the serving endpoint. + Config PtEndpointCoreConfig `json:"config"` + // 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. + Name string `json:"name"` + // Tags to be attached to the serving endpoint and automatically propagated + // to billing logs. + Tags []EndpointTag `json:"tags,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *CreatePtEndpointRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s CreatePtEndpointRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type CreateServingEndpoint struct { // The AI Gateway configuration for the serving endpoint. NOTE: External // model, provisioned throughput, and pay-per-token endpoints are fully @@ -1252,6 +1278,42 @@ func (s PayloadTable) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type PtEndpointCoreConfig struct { + // The list of served entities under the serving endpoint config. + ServedEntities []PtServedModel `json:"served_entities,omitempty"` + + TrafficConfig *TrafficConfig `json:"traffic_config,omitempty"` +} + +type PtServedModel struct { + // The name of the entity to be served. The entity may be a model in the + // Databricks Model Registry, a model in the Unity Catalog (UC), or a + // function of type FEATURE_SPEC in the UC. If it is a UC object, the full + // name of the object should be given in the form of + // **catalog_name.schema_name.model_name**. + EntityName string `json:"entity_name"` + + EntityVersion string `json:"entity_version,omitempty"` + // The name of a served entity. It must be unique across an endpoint. A + // served entity name can consist of alphanumeric characters, dashes, and + // underscores. If not specified for an external model, this field defaults + // to external_model.name, with '.' and ':' replaced with '-', and if not + // specified for other entities, it defaults to entity_name-entity_version. + Name string `json:"name,omitempty"` + // The number of model units to be provisioned. + ProvisionedModelUnits int64 `json:"provisioned_model_units"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *PtServedModel) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s PtServedModel) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type PutAiGatewayRequest struct { // Configuration for traffic fallback which auto fallbacks to other served // entities if the request to a served entity fails with certain error @@ -2198,6 +2260,12 @@ type TrafficConfig struct { Routes []Route `json:"routes,omitempty"` } +type UpdateProvisionedThroughputEndpointConfigRequest struct { + Config PtEndpointCoreConfig `json:"config"` + // The name of the pt endpoint to update. This field is required. + Name string `json:"-" url:"-"` +} + type V1ResponseChoiceElement struct { // The finish reason returned by the endpoint. FinishReason string `json:"finishReason,omitempty"` diff --git a/service/settings/api.go b/service/settings/api.go index 808e67ebd..7f9b3f201 100755 --- a/service/settings/api.go +++ b/service/settings/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 Ip Access Lists, Account Settings, Aibi Dashboard Embedding Access Policy, Aibi Dashboard Embedding Approved Domains, Automatic Cluster Update, Compliance Security Profile, Credentials Manager, Csp Enablement Account, Default Namespace, Disable Legacy Access, Disable Legacy Dbfs, Disable Legacy Features, Enable Export Notebook, Enable Ip Access Lists, Enable Notebook Table Clipboard, Enable Results Downloading, Enhanced Security Monitoring, Esm Enablement Account, Ip Access Lists, Network Connectivity, Notification Destinations, Personal Compute, Restrict Workspace Admins, Settings, Token Management, Tokens, Workspace Conf, etc. +// These APIs allow you to manage Account Ip Access Lists, Account Settings, Aibi Dashboard Embedding Access Policy, Aibi Dashboard Embedding Approved Domains, Automatic Cluster Update, Compliance Security Profile, Credentials Manager, Csp Enablement Account, Default Namespace, Disable Legacy Access, Disable Legacy Dbfs, Disable Legacy Features, Enable Export Notebook, Enable Ip Access Lists, Enable Notebook Table Clipboard, Enable Results Downloading, Enhanced Security Monitoring, Esm Enablement Account, Ip Access Lists, Llm Proxy Partner Powered Account, Llm Proxy Partner Powered Enforce, Llm Proxy Partner Powered Workspace, Network Connectivity, Notification Destinations, Personal Compute, Restrict Workspace Admins, Settings, Token Management, Tokens, Workspace Conf, etc. package settings import ( @@ -255,6 +255,14 @@ type AccountSettingsInterface interface { // individually for each workspace. EsmEnablementAccount() EsmEnablementAccountInterface + // Determines if partner powered models are enabled or not for a specific + // account + LlmProxyPartnerPoweredAccount() LlmProxyPartnerPoweredAccountInterface + + // Determines if the account-level partner-powered setting value is enforced + // upon the workspace-level partner-powered setting + LlmProxyPartnerPoweredEnforce() LlmProxyPartnerPoweredEnforceInterface + // The Personal Compute enablement setting lets you control which users can // use the Personal Compute default policy to create compute resources. By // default all users in all workspaces have access (ON), but you can change @@ -282,6 +290,10 @@ func NewAccountSettings(client *client.DatabricksClient) *AccountSettingsAPI { esmEnablementAccount: NewEsmEnablementAccount(client), + llmProxyPartnerPoweredAccount: NewLlmProxyPartnerPoweredAccount(client), + + llmProxyPartnerPoweredEnforce: NewLlmProxyPartnerPoweredEnforce(client), + personalCompute: NewPersonalCompute(client), } } @@ -320,6 +332,14 @@ type AccountSettingsAPI struct { // individually for each workspace. esmEnablementAccount EsmEnablementAccountInterface + // Determines if partner powered models are enabled or not for a specific + // account + llmProxyPartnerPoweredAccount LlmProxyPartnerPoweredAccountInterface + + // Determines if the account-level partner-powered setting value is enforced + // upon the workspace-level partner-powered setting + llmProxyPartnerPoweredEnforce LlmProxyPartnerPoweredEnforceInterface + // The Personal Compute enablement setting lets you control which users can // use the Personal Compute default policy to create compute resources. By // default all users in all workspaces have access (ON), but you can change @@ -349,6 +369,14 @@ func (a *AccountSettingsAPI) EsmEnablementAccount() EsmEnablementAccountInterfac return a.esmEnablementAccount } +func (a *AccountSettingsAPI) LlmProxyPartnerPoweredAccount() LlmProxyPartnerPoweredAccountInterface { + return a.llmProxyPartnerPoweredAccount +} + +func (a *AccountSettingsAPI) LlmProxyPartnerPoweredEnforce() LlmProxyPartnerPoweredEnforceInterface { + return a.llmProxyPartnerPoweredEnforce +} + func (a *AccountSettingsAPI) PersonalCompute() PersonalComputeInterface { return a.personalCompute } @@ -1107,6 +1135,122 @@ func (a *IpAccessListsAPI) GetByLabel(ctx context.Context, name string) (*IpAcce return &alternatives[0], nil } +type LlmProxyPartnerPoweredAccountInterface interface { + + // Get the enable partner powered AI features account setting. + // + // Gets the enable partner powered AI features account setting. + Get(ctx context.Context, request GetLlmProxyPartnerPoweredAccountRequest) (*LlmProxyPartnerPoweredAccount, error) + + // Get the enable partner powered AI features account setting. + // + // Gets the enable partner powered AI features account setting. + GetByAccountId(ctx context.Context, accountId string) (*LlmProxyPartnerPoweredAccount, error) + + // Update the enable partner powered AI features account setting. + // + // Updates the enable partner powered AI features account setting. + Update(ctx context.Context, request UpdateLlmProxyPartnerPoweredAccountRequest) (*LlmProxyPartnerPoweredAccount, error) +} + +func NewLlmProxyPartnerPoweredAccount(client *client.DatabricksClient) *LlmProxyPartnerPoweredAccountAPI { + return &LlmProxyPartnerPoweredAccountAPI{ + llmProxyPartnerPoweredAccountImpl: llmProxyPartnerPoweredAccountImpl{ + client: client, + }, + } +} + +// Determines if partner powered models are enabled or not for a specific +// account +type LlmProxyPartnerPoweredAccountAPI struct { + llmProxyPartnerPoweredAccountImpl +} + +// Get the enable partner powered AI features account setting. +// +// Gets the enable partner powered AI features account setting. +func (a *LlmProxyPartnerPoweredAccountAPI) GetByAccountId(ctx context.Context, accountId string) (*LlmProxyPartnerPoweredAccount, error) { + return a.llmProxyPartnerPoweredAccountImpl.Get(ctx, GetLlmProxyPartnerPoweredAccountRequest{ + AccountId: accountId, + }) +} + +type LlmProxyPartnerPoweredEnforceInterface interface { + + // Get the enforcement status of partner powered AI features account setting. + // + // Gets the enforcement status of partner powered AI features account setting. + Get(ctx context.Context, request GetLlmProxyPartnerPoweredEnforceRequest) (*LlmProxyPartnerPoweredEnforce, error) + + // Get the enforcement status of partner powered AI features account setting. + // + // Gets the enforcement status of partner powered AI features account setting. + GetByAccountId(ctx context.Context, accountId string) (*LlmProxyPartnerPoweredEnforce, error) + + // Update the enforcement status of partner powered AI features account setting. + // + // Updates the enable enforcement status of partner powered AI features account + // setting. + Update(ctx context.Context, request UpdateLlmProxyPartnerPoweredEnforceRequest) (*LlmProxyPartnerPoweredEnforce, error) +} + +func NewLlmProxyPartnerPoweredEnforce(client *client.DatabricksClient) *LlmProxyPartnerPoweredEnforceAPI { + return &LlmProxyPartnerPoweredEnforceAPI{ + llmProxyPartnerPoweredEnforceImpl: llmProxyPartnerPoweredEnforceImpl{ + client: client, + }, + } +} + +// Determines if the account-level partner-powered setting value is enforced +// upon the workspace-level partner-powered setting +type LlmProxyPartnerPoweredEnforceAPI struct { + llmProxyPartnerPoweredEnforceImpl +} + +// Get the enforcement status of partner powered AI features account setting. +// +// Gets the enforcement status of partner powered AI features account setting. +func (a *LlmProxyPartnerPoweredEnforceAPI) GetByAccountId(ctx context.Context, accountId string) (*LlmProxyPartnerPoweredEnforce, error) { + return a.llmProxyPartnerPoweredEnforceImpl.Get(ctx, GetLlmProxyPartnerPoweredEnforceRequest{ + AccountId: accountId, + }) +} + +type LlmProxyPartnerPoweredWorkspaceInterface interface { + + // Delete the enable partner powered AI features workspace setting. + // + // Reverts the enable partner powered AI features workspace setting to its + // default value. + Delete(ctx context.Context, request DeleteLlmProxyPartnerPoweredWorkspaceRequest) (*DeleteLlmProxyPartnerPoweredWorkspaceResponse, error) + + // Get the enable partner powered AI features workspace setting. + // + // Gets the enable partner powered AI features workspace setting. + Get(ctx context.Context, request GetLlmProxyPartnerPoweredWorkspaceRequest) (*LlmProxyPartnerPoweredWorkspace, error) + + // Update the enable partner powered AI features workspace setting. + // + // Updates the enable partner powered AI features workspace setting. + Update(ctx context.Context, request UpdateLlmProxyPartnerPoweredWorkspaceRequest) (*LlmProxyPartnerPoweredWorkspace, error) +} + +func NewLlmProxyPartnerPoweredWorkspace(client *client.DatabricksClient) *LlmProxyPartnerPoweredWorkspaceAPI { + return &LlmProxyPartnerPoweredWorkspaceAPI{ + llmProxyPartnerPoweredWorkspaceImpl: llmProxyPartnerPoweredWorkspaceImpl{ + client: client, + }, + } +} + +// Determines if partner powered models are enabled or not for a specific +// workspace +type LlmProxyPartnerPoweredWorkspaceAPI struct { + llmProxyPartnerPoweredWorkspaceImpl +} + type NetworkConnectivityInterface interface { // Create a network connectivity configuration. @@ -1548,6 +1692,10 @@ type SettingsInterface interface { // this setting and it is not permanent. EnhancedSecurityMonitoring() EnhancedSecurityMonitoringInterface + // Determines if partner powered models are enabled or not for a specific + // workspace + LlmProxyPartnerPoweredWorkspace() LlmProxyPartnerPoweredWorkspaceInterface + // The Restrict Workspace Admins setting lets you control the capabilities // of workspace admins. With the setting status set to ALLOW_ALL, workspace // admins can create service principal personal access tokens on behalf of @@ -1592,6 +1740,8 @@ func NewSettings(client *client.DatabricksClient) *SettingsAPI { enhancedSecurityMonitoring: NewEnhancedSecurityMonitoring(client), + llmProxyPartnerPoweredWorkspace: NewLlmProxyPartnerPoweredWorkspace(client), + restrictWorkspaceAdmins: NewRestrictWorkspaceAdmins(client), } } @@ -1671,6 +1821,10 @@ type SettingsAPI struct { // this setting and it is not permanent. enhancedSecurityMonitoring EnhancedSecurityMonitoringInterface + // Determines if partner powered models are enabled or not for a specific + // workspace + llmProxyPartnerPoweredWorkspace LlmProxyPartnerPoweredWorkspaceInterface + // The Restrict Workspace Admins setting lets you control the capabilities // of workspace admins. With the setting status set to ALLOW_ALL, workspace // admins can create service principal personal access tokens on behalf of @@ -1731,6 +1885,10 @@ func (a *SettingsAPI) EnhancedSecurityMonitoring() EnhancedSecurityMonitoringInt return a.enhancedSecurityMonitoring } +func (a *SettingsAPI) LlmProxyPartnerPoweredWorkspace() LlmProxyPartnerPoweredWorkspaceInterface { + return a.llmProxyPartnerPoweredWorkspace +} + func (a *SettingsAPI) RestrictWorkspaceAdmins() RestrictWorkspaceAdminsInterface { return a.restrictWorkspaceAdmins } diff --git a/service/settings/impl.go b/service/settings/impl.go index d91e4d9be..7040bf503 100755 --- a/service/settings/impl.go +++ b/service/settings/impl.go @@ -683,6 +683,94 @@ func (a *ipAccessListsImpl) Update(ctx context.Context, request UpdateIpAccessLi return err } +// unexported type that holds implementations of just LlmProxyPartnerPoweredAccount API methods +type llmProxyPartnerPoweredAccountImpl struct { + client *client.DatabricksClient +} + +func (a *llmProxyPartnerPoweredAccountImpl) Get(ctx context.Context, request GetLlmProxyPartnerPoweredAccountRequest) (*LlmProxyPartnerPoweredAccount, error) { + var llmProxyPartnerPoweredAccount LlmProxyPartnerPoweredAccount + path := fmt.Sprintf("/api/2.0/accounts/%v/settings/types/llm_proxy_partner_powered/names/default", request.AccountId) + 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, &llmProxyPartnerPoweredAccount) + return &llmProxyPartnerPoweredAccount, err +} + +func (a *llmProxyPartnerPoweredAccountImpl) Update(ctx context.Context, request UpdateLlmProxyPartnerPoweredAccountRequest) (*LlmProxyPartnerPoweredAccount, error) { + var llmProxyPartnerPoweredAccount LlmProxyPartnerPoweredAccount + path := fmt.Sprintf("/api/2.0/accounts/%v/settings/types/llm_proxy_partner_powered/names/default", request.AccountId) + 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, &llmProxyPartnerPoweredAccount) + return &llmProxyPartnerPoweredAccount, err +} + +// unexported type that holds implementations of just LlmProxyPartnerPoweredEnforce API methods +type llmProxyPartnerPoweredEnforceImpl struct { + client *client.DatabricksClient +} + +func (a *llmProxyPartnerPoweredEnforceImpl) Get(ctx context.Context, request GetLlmProxyPartnerPoweredEnforceRequest) (*LlmProxyPartnerPoweredEnforce, error) { + var llmProxyPartnerPoweredEnforce LlmProxyPartnerPoweredEnforce + path := fmt.Sprintf("/api/2.0/accounts/%v/settings/types/llm_proxy_partner_powered_enforce/names/default", request.AccountId) + 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, &llmProxyPartnerPoweredEnforce) + return &llmProxyPartnerPoweredEnforce, err +} + +func (a *llmProxyPartnerPoweredEnforceImpl) Update(ctx context.Context, request UpdateLlmProxyPartnerPoweredEnforceRequest) (*LlmProxyPartnerPoweredEnforce, error) { + var llmProxyPartnerPoweredEnforce LlmProxyPartnerPoweredEnforce + path := fmt.Sprintf("/api/2.0/accounts/%v/settings/types/llm_proxy_partner_powered_enforce/names/default", request.AccountId) + 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, &llmProxyPartnerPoweredEnforce) + return &llmProxyPartnerPoweredEnforce, err +} + +// unexported type that holds implementations of just LlmProxyPartnerPoweredWorkspace API methods +type llmProxyPartnerPoweredWorkspaceImpl struct { + client *client.DatabricksClient +} + +func (a *llmProxyPartnerPoweredWorkspaceImpl) Delete(ctx context.Context, request DeleteLlmProxyPartnerPoweredWorkspaceRequest) (*DeleteLlmProxyPartnerPoweredWorkspaceResponse, error) { + var deleteLlmProxyPartnerPoweredWorkspaceResponse DeleteLlmProxyPartnerPoweredWorkspaceResponse + path := "/api/2.0/settings/types/llm_proxy_partner_powered/names/default" + 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, &deleteLlmProxyPartnerPoweredWorkspaceResponse) + return &deleteLlmProxyPartnerPoweredWorkspaceResponse, err +} + +func (a *llmProxyPartnerPoweredWorkspaceImpl) Get(ctx context.Context, request GetLlmProxyPartnerPoweredWorkspaceRequest) (*LlmProxyPartnerPoweredWorkspace, error) { + var llmProxyPartnerPoweredWorkspace LlmProxyPartnerPoweredWorkspace + path := "/api/2.0/settings/types/llm_proxy_partner_powered/names/default" + 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, &llmProxyPartnerPoweredWorkspace) + return &llmProxyPartnerPoweredWorkspace, err +} + +func (a *llmProxyPartnerPoweredWorkspaceImpl) Update(ctx context.Context, request UpdateLlmProxyPartnerPoweredWorkspaceRequest) (*LlmProxyPartnerPoweredWorkspace, error) { + var llmProxyPartnerPoweredWorkspace LlmProxyPartnerPoweredWorkspace + path := "/api/2.0/settings/types/llm_proxy_partner_powered/names/default" + 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, &llmProxyPartnerPoweredWorkspace) + return &llmProxyPartnerPoweredWorkspace, err +} + // unexported type that holds implementations of just NetworkConnectivity API methods type networkConnectivityImpl struct { client *client.DatabricksClient diff --git a/service/settings/interface.go b/service/settings/interface.go index cfed01c9e..132159c03 100755 --- a/service/settings/interface.go +++ b/service/settings/interface.go @@ -561,6 +561,61 @@ type IpAccessListsService interface { Update(ctx context.Context, request UpdateIpAccessList) error } +// Determines if partner powered models are enabled or not for a specific +// account +type LlmProxyPartnerPoweredAccountService interface { + + // Get the enable partner powered AI features account setting. + // + // Gets the enable partner powered AI features account setting. + Get(ctx context.Context, request GetLlmProxyPartnerPoweredAccountRequest) (*LlmProxyPartnerPoweredAccount, error) + + // Update the enable partner powered AI features account setting. + // + // Updates the enable partner powered AI features account setting. + Update(ctx context.Context, request UpdateLlmProxyPartnerPoweredAccountRequest) (*LlmProxyPartnerPoweredAccount, error) +} + +// Determines if the account-level partner-powered setting value is enforced +// upon the workspace-level partner-powered setting +type LlmProxyPartnerPoweredEnforceService interface { + + // Get the enforcement status of partner powered AI features account + // setting. + // + // Gets the enforcement status of partner powered AI features account + // setting. + Get(ctx context.Context, request GetLlmProxyPartnerPoweredEnforceRequest) (*LlmProxyPartnerPoweredEnforce, error) + + // Update the enforcement status of partner powered AI features account + // setting. + // + // Updates the enable enforcement status of partner powered AI features + // account setting. + Update(ctx context.Context, request UpdateLlmProxyPartnerPoweredEnforceRequest) (*LlmProxyPartnerPoweredEnforce, error) +} + +// Determines if partner powered models are enabled or not for a specific +// workspace +type LlmProxyPartnerPoweredWorkspaceService interface { + + // Delete the enable partner powered AI features workspace setting. + // + // Reverts the enable partner powered AI features workspace setting to its + // default value. + Delete(ctx context.Context, request DeleteLlmProxyPartnerPoweredWorkspaceRequest) (*DeleteLlmProxyPartnerPoweredWorkspaceResponse, error) + + // Get the enable partner powered AI features workspace setting. + // + // Gets the enable partner powered AI features workspace setting. + Get(ctx context.Context, request GetLlmProxyPartnerPoweredWorkspaceRequest) (*LlmProxyPartnerPoweredWorkspace, error) + + // Update the enable partner powered AI features workspace setting. + // + // Updates the enable partner powered AI features workspace setting. + Update(ctx context.Context, request UpdateLlmProxyPartnerPoweredWorkspaceRequest) (*LlmProxyPartnerPoweredWorkspace, error) +} + // These APIs provide configurations for the network connectivity of your // workspaces for serverless compute resources. This API provides stable subnets // for your workspace so that you can configure your firewalls on your Azure diff --git a/service/settings/model.go b/service/settings/model.go index a3f5747eb..c11886fe4 100755 --- a/service/settings/model.go +++ b/service/settings/model.go @@ -939,6 +939,40 @@ type DeleteIpAccessListRequest struct { 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 + // help prevent simultaneous writes of a setting overwriting each other. It + // is strongly suggested that systems make use of the etag in the read -> + // delete pattern to perform setting deletions in order to avoid race + // conditions. That is, get an etag from a GET request, and pass it with the + // DELETE request to identify the rule set version you are deleting. + Etag string `json:"-" url:"etag,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *DeleteLlmProxyPartnerPoweredWorkspaceRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s DeleteLlmProxyPartnerPoweredWorkspaceRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// The etag is returned. +type DeleteLlmProxyPartnerPoweredWorkspaceResponse struct { + // etag used for versioning. The response is at least as fresh as the eTag + // provided. This is used for optimistic concurrency control as a way to + // help prevent simultaneous writes of a setting overwriting each other. It + // is strongly suggested that systems make use of the etag in the read -> + // delete pattern to perform setting deletions in order to avoid race + // conditions. That is, get an etag from a GET request, and pass it with the + // DELETE request to identify the rule set version you are deleting. + Etag string `json:"etag"` +} + // Delete a network connectivity configuration type DeleteNetworkConnectivityConfigurationRequest struct { // Your Network Connectivity Configuration ID. @@ -1958,6 +1992,74 @@ type GetIpAccessListsResponse struct { IpAccessLists []IpAccessListInfo `json:"ip_access_lists,omitempty"` } +// Get the enable partner powered AI features account setting +type GetLlmProxyPartnerPoweredAccountRequest struct { + AccountId string `json:"-" url:"-"` + // etag used for versioning. The response is at least as fresh as the eTag + // provided. This is used for optimistic concurrency control as a way to + // help prevent simultaneous writes of a setting overwriting each other. It + // is strongly suggested that systems make use of the etag in the read -> + // delete pattern to perform setting deletions in order to avoid race + // conditions. That is, get an etag from a GET request, and pass it with the + // DELETE request to identify the rule set version you are deleting. + Etag string `json:"-" url:"etag,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *GetLlmProxyPartnerPoweredAccountRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s GetLlmProxyPartnerPoweredAccountRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Get the enforcement status of partner powered AI features account setting +type GetLlmProxyPartnerPoweredEnforceRequest struct { + AccountId string `json:"-" url:"-"` + // etag used for versioning. The response is at least as fresh as the eTag + // provided. This is used for optimistic concurrency control as a way to + // help prevent simultaneous writes of a setting overwriting each other. It + // is strongly suggested that systems make use of the etag in the read -> + // delete pattern to perform setting deletions in order to avoid race + // conditions. That is, get an etag from a GET request, and pass it with the + // DELETE request to identify the rule set version you are deleting. + Etag string `json:"-" url:"etag,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *GetLlmProxyPartnerPoweredEnforceRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +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 + // help prevent simultaneous writes of a setting overwriting each other. It + // is strongly suggested that systems make use of the etag in the read -> + // delete pattern to perform setting deletions in order to avoid race + // conditions. That is, get an etag from a GET request, and pass it with the + // DELETE request to identify the rule set version you are deleting. + Etag string `json:"-" url:"etag,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *GetLlmProxyPartnerPoweredWorkspaceRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s GetLlmProxyPartnerPoweredWorkspaceRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + // Get a network connectivity configuration type GetNetworkConnectivityConfigurationRequest struct { // Your Network Connectivity Configuration ID. @@ -2274,6 +2376,90 @@ func (f *ListType) Type() string { return "ListType" } +type LlmProxyPartnerPoweredAccount struct { + BooleanVal BooleanMessage `json:"boolean_val"` + // etag used for versioning. The response is at least as fresh as the eTag + // provided. This is used for optimistic concurrency control as a way to + // help prevent simultaneous writes of a setting overwriting each other. It + // is strongly suggested that systems make use of the etag in the read -> + // update pattern to perform setting updates in order to avoid race + // conditions. That is, get an etag from a GET request, and pass it with the + // PATCH request to identify the setting version you are updating. + Etag string `json:"etag,omitempty"` + // Name of the corresponding setting. This field is populated in the + // response, but it will not be respected even if it's set in the request + // body. The setting name in the path parameter will be respected instead. + // Setting name is required to be 'default' if the setting only has one + // instance per workspace. + SettingName string `json:"setting_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *LlmProxyPartnerPoweredAccount) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s LlmProxyPartnerPoweredAccount) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type LlmProxyPartnerPoweredEnforce struct { + BooleanVal BooleanMessage `json:"boolean_val"` + // etag used for versioning. The response is at least as fresh as the eTag + // provided. This is used for optimistic concurrency control as a way to + // help prevent simultaneous writes of a setting overwriting each other. It + // is strongly suggested that systems make use of the etag in the read -> + // update pattern to perform setting updates in order to avoid race + // conditions. That is, get an etag from a GET request, and pass it with the + // PATCH request to identify the setting version you are updating. + Etag string `json:"etag,omitempty"` + // Name of the corresponding setting. This field is populated in the + // response, but it will not be respected even if it's set in the request + // body. The setting name in the path parameter will be respected instead. + // Setting name is required to be 'default' if the setting only has one + // instance per workspace. + SettingName string `json:"setting_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *LlmProxyPartnerPoweredEnforce) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s LlmProxyPartnerPoweredEnforce) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type LlmProxyPartnerPoweredWorkspace struct { + BooleanVal BooleanMessage `json:"boolean_val"` + // etag used for versioning. The response is at least as fresh as the eTag + // provided. This is used for optimistic concurrency control as a way to + // help prevent simultaneous writes of a setting overwriting each other. It + // is strongly suggested that systems make use of the etag in the read -> + // update pattern to perform setting updates in order to avoid race + // conditions. That is, get an etag from a GET request, and pass it with the + // PATCH request to identify the setting version you are updating. + Etag string `json:"etag,omitempty"` + // Name of the corresponding setting. This field is populated in the + // response, but it will not be respected even if it's set in the request + // body. The setting name in the path parameter will be respected instead. + // Setting name is required to be 'default' if the setting only has one + // instance per workspace. + SettingName string `json:"setting_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *LlmProxyPartnerPoweredWorkspace) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s LlmProxyPartnerPoweredWorkspace) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type MicrosoftTeamsConfig struct { // [Input-Only] URL for Microsoft Teams. Url string `json:"url,omitempty"` @@ -3299,6 +3485,73 @@ func (s UpdateIpAccessList) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +// Details required to update a setting. +type UpdateLlmProxyPartnerPoweredAccountRequest struct { + // Databricks account ID of the account being managed. + AccountId string `json:"-" url:"-"` + // This should always be set to true for Settings API. Added for AIP + // compliance. + AllowMissing bool `json:"allow_missing"` + // 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. + FieldMask string `json:"field_mask"` + + Setting LlmProxyPartnerPoweredAccount `json:"setting"` +} + +// Details required to update a setting. +type UpdateLlmProxyPartnerPoweredEnforceRequest struct { + // Databricks account ID of the account being managed. + AccountId string `json:"-" url:"-"` + // This should always be set to true for Settings API. Added for AIP + // compliance. + AllowMissing bool `json:"allow_missing"` + // 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. + FieldMask string `json:"field_mask"` + + Setting LlmProxyPartnerPoweredEnforce `json:"setting"` +} + +// Details required to update a setting. +type UpdateLlmProxyPartnerPoweredWorkspaceRequest struct { + // This should always be set to true for Settings API. Added for AIP + // compliance. + AllowMissing bool `json:"allow_missing"` + // 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. + FieldMask string `json:"field_mask"` + + Setting LlmProxyPartnerPoweredWorkspace `json:"setting"` +} + // Update a private endpoint rule type UpdateNccAzurePrivateEndpointRulePublicRequest struct { // Your Network Connectivity Configuration ID. diff --git a/service/sql/impl.go b/service/sql/impl.go index c10f98d3d..23aa103b3 100755 --- a/service/sql/impl.go +++ b/service/sql/impl.go @@ -177,7 +177,7 @@ func (a *alertsV2Impl) CreateAlert(ctx context.Context, request CreateAlertV2Req 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, &alertV2) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request.Alert, &alertV2) return &alertV2, err } @@ -250,10 +250,13 @@ func (a *alertsV2Impl) UpdateAlert(ctx context.Context, request UpdateAlertV2Req var alertV2 AlertV2 path := fmt.Sprintf("/api/2.0/alerts/%v", request.Id) 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, &alertV2) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request.Alert, &alertV2) return &alertV2, err } diff --git a/service/sql/model.go b/service/sql/model.go index 31f9f23fd..89cd9f838 100755 --- a/service/sql/model.go +++ b/service/sql/model.go @@ -891,8 +891,9 @@ func (s CreateAlertRequestAlert) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +// Create an alert type CreateAlertV2Request struct { - Alert *AlertV2 `json:"alert,omitempty"` + Alert AlertV2 `json:"alert"` } type CreateQueryRequest struct { @@ -4854,8 +4855,9 @@ func (s UpdateAlertRequestAlert) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +// Update an alert type UpdateAlertV2Request struct { - Alert *AlertV2 `json:"alert,omitempty"` + Alert AlertV2 `json:"alert"` // UUID identifying the alert. Id string `json:"-" url:"-"` // The field mask must be a single string, with multiple fields separated by @@ -4869,7 +4871,7 @@ type UpdateAlertV2Request struct { // 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:"update_mask"` + UpdateMask string `json:"-" url:"update_mask"` } type UpdateQueryRequest struct { diff --git a/service/vectorsearch/model.go b/service/vectorsearch/model.go index 80ca3e57c..868b235e8 100755 --- a/service/vectorsearch/model.go +++ b/service/vectorsearch/model.go @@ -458,11 +458,6 @@ func (s ListIndexesRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// copied from proto3 / Google Well Known Types, source: -// https://github.com/protocolbuffers/protobuf/blob/450d24ca820750c5db5112a6f0b0c2efb9758021/src/google/protobuf/struct.proto -// `ListValue` is a wrapper around a repeated field of values. -// -// The JSON representation for `ListValue` is JSON array. type ListValue struct { // Repeated field of dynamically typed values. Values []Value `json:"values,omitempty"` @@ -748,15 +743,6 @@ func (s ScanVectorIndexResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// copied from proto3 / Google Well Known Types, source: -// https://github.com/protocolbuffers/protobuf/blob/450d24ca820750c5db5112a6f0b0c2efb9758021/src/google/protobuf/struct.proto -// `Struct` represents a structured data value, consisting of fields which map -// to dynamically typed values. In some languages, `Struct` might be supported -// by a native representation. For example, in scripting languages like JS a -// struct is represented as an object. The details of that representation are -// described together with the proto support for the language. -// -// The JSON representation for `Struct` is JSON object. type Struct struct { // Data entry, corresponding to a row in a vector index. Fields []MapStringValueEntry `json:"fields,omitempty"` @@ -858,26 +844,13 @@ type UpsertDataVectorIndexResponse struct { type Value struct { BoolValue bool `json:"bool_value,omitempty"` - // copied from proto3 / Google Well Known Types, source: - // https://github.com/protocolbuffers/protobuf/blob/450d24ca820750c5db5112a6f0b0c2efb9758021/src/google/protobuf/struct.proto - // `ListValue` is a wrapper around a repeated field of values. - // - // The JSON representation for `ListValue` is JSON array. + ListValue *ListValue `json:"list_value,omitempty"` NumberValue float64 `json:"number_value,omitempty"` StringValue string `json:"string_value,omitempty"` - // copied from proto3 / Google Well Known Types, source: - // https://github.com/protocolbuffers/protobuf/blob/450d24ca820750c5db5112a6f0b0c2efb9758021/src/google/protobuf/struct.proto - // `Struct` represents a structured data value, consisting of fields which - // map to dynamically typed values. In some languages, `Struct` might be - // supported by a native representation. For example, in scripting languages - // like JS a struct is represented as an object. The details of that - // representation are described together with the proto support for the - // language. - // - // The JSON representation for `Struct` is JSON object. + StructValue *Struct `json:"struct_value,omitempty"` ForceSendFields []string `json:"-" url:"-"` diff --git a/workspace_client.go b/workspace_client.go index a66fc8983..54b9423c7 100755 --- a/workspace_client.go +++ b/workspace_client.go @@ -238,6 +238,10 @@ type WorkspaceClient struct { // [Learn more]: https://docs.databricks.com/en/sql/dbsql-api-latest.html DataSources sql.DataSourcesInterface + // Database Instances provide access to a database via REST API or direct + // SQL. + DatabaseInstances catalog.DatabaseInstancesInterface + // DBFS API makes it simple to interact with various data sources without // having to include a users credentials every time to read a file. Dbfs files.DbfsInterface @@ -524,57 +528,35 @@ type WorkspaceClient struct { PermissionMigration iam.PermissionMigrationInterface // Permissions API are used to create read, write, edit, update and manage - // access for various users on different objects and endpoints. - // - // * **[Apps permissions](:service:apps)** — Manage which users can manage - // or use apps. - // - // * **[Cluster permissions](:service:clusters)** — Manage which users can - // manage, restart, or attach to clusters. - // - // * **[Cluster policy permissions](:service:clusterpolicies)** — Manage - // which users can use cluster policies. - // - // * **[Delta Live Tables pipeline permissions](:service:pipelines)** — - // Manage which users can view, manage, run, cancel, or own a Delta Live - // Tables pipeline. - // - // * **[Job permissions](:service:jobs)** — Manage which users can view, - // manage, trigger, cancel, or own a job. - // - // * **[MLflow experiment permissions](:service:experiments)** — Manage - // which users can read, edit, or manage MLflow experiments. - // - // * **[MLflow registered model permissions](:service:modelregistry)** — - // Manage which users can read, edit, or manage MLflow registered models. - // - // * **[Password permissions](:service:users)** — Manage which users can - // use password login when SSO is enabled. - // - // * **[Instance Pool permissions](:service:instancepools)** — Manage - // which users can manage or attach to pools. - // - // * **[Repo permissions](repos)** — Manage which users can read, run, - // edit, or manage a repo. - // - // * **[Serving endpoint permissions](:service:servingendpoints)** — - // Manage which users can view, query, or manage a serving endpoint. - // - // * **[SQL warehouse permissions](:service:warehouses)** — Manage which - // users can use or manage SQL warehouses. - // - // * **[Token permissions](:service:tokenmanagement)** — Manage which - // users can create or use tokens. - // - // * **[Workspace object permissions](:service:workspace)** — Manage which - // users can read, run, edit, or manage alerts, dbsql-dashboards, - // directories, files, notebooks and queries. - // - // For the mapping of the required permissions for specific actions or - // abilities and other important information, see [Access Control]. - // - // Note that to manage access control on service principals, use **[Account - // Access Control Proxy](:service:accountaccesscontrolproxy)**. + // access for various users on different objects and endpoints. * **[Apps + // permissions](:service:apps)** — Manage which users can manage or use + // apps. * **[Cluster permissions](:service:clusters)** — Manage which + // users can manage, restart, or attach to clusters. * **[Cluster policy + // permissions](:service:clusterpolicies)** — Manage which users can use + // cluster policies. * **[Delta Live Tables pipeline + // permissions](:service:pipelines)** — Manage which users can view, + // manage, run, cancel, or own a Delta Live Tables pipeline. * **[Job + // permissions](:service:jobs)** — Manage which users can view, manage, + // trigger, cancel, or own a job. * **[MLflow experiment + // permissions](:service:experiments)** — Manage which users can read, + // edit, or manage MLflow experiments. * **[MLflow registered model + // permissions](:service:modelregistry)** — Manage which users can read, + // edit, or manage MLflow registered models. * **[Instance Pool + // permissions](:service:instancepools)** — Manage which users can manage + // or attach to pools. * **[Repo permissions](repos)** — Manage which + // users can read, run, edit, or manage a repo. * **[Serving endpoint + // permissions](:service:servingendpoints)** — Manage which users can + // view, query, or manage a serving endpoint. * **[SQL warehouse + // permissions](:service:warehouses)** — Manage which users can use or + // manage SQL warehouses. * **[Token + // permissions](:service:tokenmanagement)** — Manage which users can + // create or use tokens. * **[Workspace object + // permissions](:service:workspace)** — Manage which users can read, run, + // edit, or manage alerts, dbsql-dashboards, directories, files, notebooks + // and queries. For the mapping of the required permissions for specific + // actions or abilities and other important information, see [Access + // Control]. Note that to manage access control on service principals, use + // **[Account Access Control Proxy](:service:accountaccesscontrolproxy)**. // // [Access Control]: https://docs.databricks.com/security/auth-authz/access-control/index.html Permissions iam.PermissionsInterface @@ -1201,6 +1183,7 @@ func NewWorkspaceClient(c ...*Config) (*WorkspaceClient, error) { DashboardWidgets: sql.NewDashboardWidgets(databricksClient), Dashboards: sql.NewDashboards(databricksClient), DataSources: sql.NewDataSources(databricksClient), + DatabaseInstances: catalog.NewDatabaseInstances(databricksClient), Dbfs: files.NewDbfs(databricksClient), DbsqlPermissions: sql.NewDbsqlPermissions(databricksClient), Experiments: ml.NewExperiments(databricksClient),