diff --git a/.codegen/_openapi_sha b/.codegen/_openapi_sha index c30ba6afa..890655a3b 100755 --- a/.codegen/_openapi_sha +++ b/.codegen/_openapi_sha @@ -1 +1 @@ -c68a27fa9c9d838e839c584be8018eb3b68377d5 \ No newline at end of file +805d88b51faa37301c51d1848da2db5a2e6ed921 \ No newline at end of file diff --git a/.gitattributes b/.gitattributes index b1c69dcb0..8cbaa9f42 100755 --- a/.gitattributes +++ b/.gitattributes @@ -244,6 +244,10 @@ service/agentbricks/api.go linguist-generated=true service/agentbricks/impl.go linguist-generated=true service/agentbricks/interface.go linguist-generated=true service/agentbricks/model.go linguist-generated=true +service/aisearch/api.go linguist-generated=true +service/aisearch/impl.go linguist-generated=true +service/aisearch/interface.go linguist-generated=true +service/aisearch/model.go linguist-generated=true service/apps/api.go linguist-generated=true service/apps/impl.go linguist-generated=true service/apps/interface.go linguist-generated=true @@ -252,10 +256,10 @@ service/billing/api.go linguist-generated=true service/billing/impl.go linguist-generated=true service/billing/interface.go linguist-generated=true service/billing/model.go linguist-generated=true -service/bundle/api.go linguist-generated=true -service/bundle/impl.go linguist-generated=true -service/bundle/interface.go linguist-generated=true -service/bundle/model.go linguist-generated=true +service/bundledeployments/api.go linguist-generated=true +service/bundledeployments/impl.go linguist-generated=true +service/bundledeployments/interface.go linguist-generated=true +service/bundledeployments/model.go linguist-generated=true service/catalog/api.go linguist-generated=true service/catalog/impl.go linguist-generated=true service/catalog/interface.go linguist-generated=true diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md index f4b481087..ebddfd094 100644 --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -13,3 +13,33 @@ ### Internal Changes ### API Changes +* Add [aisearch](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/aisearch) and [bundledeployments](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/bundledeployments) packages. +* Add [w.AiSearch](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/aisearch#AiSearchAPI) workspace-level service. +* Add [w.BundleDeployments](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/bundledeployments#BundleDeploymentsAPI) workspace-level service. +* Add `RunningInstances` field for [apps.ApplicationStatus](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/apps#ApplicationStatus). +* Add `CustomMaxRetentionHours` field for [catalog.CatalogInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#CatalogInfo). +* Add `EnvironmentSettings` field for [catalog.ConnectionInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#ConnectionInfo). +* Add `CustomMaxRetentionHours` field for [catalog.CreateCatalog](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#CreateCatalog). +* Add `EnvironmentSettings` field for [catalog.CreateConnection](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#CreateConnection). +* Add `CustomMaxRetentionHours` field for [catalog.CreateSchema](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#CreateSchema). +* Add `CustomMaxRetentionHours` field for [catalog.SchemaInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#SchemaInfo). +* Add `CustomMaxRetentionHours` field for [catalog.UpdateCatalog](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#UpdateCatalog). +* Add `EnvironmentSettings` field for [catalog.UpdateConnection](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#UpdateConnection). +* Add `CustomMaxRetentionHours` field for [catalog.UpdateSchema](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#UpdateSchema). +* Add `StreamSource` field for [ml.DataSource](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/ml#DataSource). +* Add `IngestionConfig` field for [ml.KafkaConfig](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/ml#KafkaConfig). +* Add `ClusteringColumns`, `EnableAutoClustering` and `TableProperties` fields for [pipelines.TableSpecificConfig](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/pipelines#TableSpecificConfig). +* Add `BranchId` field for [postgres.Branch](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/postgres#Branch). +* Add `CatalogId` field for [postgres.Catalog](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/postgres#Catalog). +* Add `DatabaseId` field for [postgres.Database](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/postgres#Database). +* Add `EndpointId` field for [postgres.Endpoint](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/postgres#Endpoint). +* Add `ProjectId` field for [postgres.Project](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/postgres#Project). +* Add `RoleId` field for [postgres.Role](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/postgres#Role). +* Add `SyncedTableId` field for [postgres.SyncedTable](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/postgres#SyncedTable). +* Add `AllowedDatabricksDestinations` field for [settings.EgressNetworkPolicyNetworkAccessPolicy](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/settings#EgressNetworkPolicyNetworkAccessPolicy). +* Add `Facets`, `QueryColumns` and `SortColumns` fields for [vectorsearch.QueryVectorIndexRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/vectorsearch#QueryVectorIndexRequest). +* Add `FacetResult` field for [vectorsearch.QueryVectorIndexResponse](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/vectorsearch#QueryVectorIndexResponse). +* Add `FacetColumnCount` and `FacetColumns` fields for [vectorsearch.ResultManifest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/vectorsearch#ResultManifest). +* Add `DangerouslyForceDiscardAll` field for [workspace.UpdateRepoRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/workspace#UpdateRepoRequest). +* [Breaking] Remove [bundle](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/bundle) package. +* [Breaking] Remove [w.Bundle](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/bundle#BundleAPI) workspace-level service. \ No newline at end of file diff --git a/experimental/mocks/mock_workspace_client.go b/experimental/mocks/mock_workspace_client.go index a9f13c168..2f68bccef 100755 --- a/experimental/mocks/mock_workspace_client.go +++ b/experimental/mocks/mock_workspace_client.go @@ -8,8 +8,9 @@ import ( "github.com/databricks/databricks-sdk-go" "github.com/databricks/databricks-sdk-go/experimental/mocks/service/agentbricks" + "github.com/databricks/databricks-sdk-go/experimental/mocks/service/aisearch" "github.com/databricks/databricks-sdk-go/experimental/mocks/service/apps" - "github.com/databricks/databricks-sdk-go/experimental/mocks/service/bundle" + "github.com/databricks/databricks-sdk-go/experimental/mocks/service/bundledeployments" "github.com/databricks/databricks-sdk-go/experimental/mocks/service/catalog" "github.com/databricks/databricks-sdk-go/experimental/mocks/service/cleanrooms" "github.com/databricks/databricks-sdk-go/experimental/mocks/service/compute" @@ -58,13 +59,14 @@ func NewMockWorkspaceClient(t interface { AccessControl: iam.NewMockAccessControlInterface(t), AccountAccessControlProxy: iam.NewMockAccountAccessControlProxyInterface(t), AgentBricks: agentbricks.NewMockAgentBricksInterface(t), + AiSearch: aisearch.NewMockAiSearchInterface(t), Alerts: sql.NewMockAlertsInterface(t), AlertsLegacy: sql.NewMockAlertsLegacyInterface(t), AlertsV2: sql.NewMockAlertsV2Interface(t), Apps: apps.NewMockAppsInterface(t), AppsSettings: apps.NewMockAppsSettingsInterface(t), ArtifactAllowlists: catalog.NewMockArtifactAllowlistsInterface(t), - Bundle: bundle.NewMockBundleInterface(t), + BundleDeployments: bundledeployments.NewMockBundleDeploymentsInterface(t), Catalogs: catalog.NewMockCatalogsInterface(t), CleanRoomAssetRevisions: cleanrooms.NewMockCleanRoomAssetRevisionsInterface(t), CleanRoomAssets: cleanrooms.NewMockCleanRoomAssetsInterface(t), @@ -395,6 +397,14 @@ func (m *MockWorkspaceClient) GetMockAgentBricksAPI() *agentbricks.MockAgentBric return api } +func (m *MockWorkspaceClient) GetMockAiSearchAPI() *aisearch.MockAiSearchInterface { + api, ok := m.WorkspaceClient.AiSearch.(*aisearch.MockAiSearchInterface) + if !ok { + panic(fmt.Sprintf("expected AiSearch to be *aisearch.MockAiSearchInterface, actual was %T", m.WorkspaceClient.AiSearch)) + } + return api +} + func (m *MockWorkspaceClient) GetMockAlertsAPI() *sql.MockAlertsInterface { api, ok := m.WorkspaceClient.Alerts.(*sql.MockAlertsInterface) if !ok { @@ -443,10 +453,10 @@ func (m *MockWorkspaceClient) GetMockArtifactAllowlistsAPI() *catalog.MockArtifa return api } -func (m *MockWorkspaceClient) GetMockBundleAPI() *bundle.MockBundleInterface { - api, ok := m.WorkspaceClient.Bundle.(*bundle.MockBundleInterface) +func (m *MockWorkspaceClient) GetMockBundleDeploymentsAPI() *bundledeployments.MockBundleDeploymentsInterface { + api, ok := m.WorkspaceClient.BundleDeployments.(*bundledeployments.MockBundleDeploymentsInterface) if !ok { - panic(fmt.Sprintf("expected Bundle to be *bundle.MockBundleInterface, actual was %T", m.WorkspaceClient.Bundle)) + panic(fmt.Sprintf("expected BundleDeployments to be *bundledeployments.MockBundleDeploymentsInterface, actual was %T", m.WorkspaceClient.BundleDeployments)) } return api } diff --git a/experimental/mocks/service/aisearch/mock_ai_search_interface.go b/experimental/mocks/service/aisearch/mock_ai_search_interface.go new file mode 100644 index 000000000..677b86797 --- /dev/null +++ b/experimental/mocks/service/aisearch/mock_ai_search_interface.go @@ -0,0 +1,938 @@ +// Code generated by mockery v2.53.2. DO NOT EDIT. + +package aisearch + +import ( + context "context" + + listing "github.com/databricks/databricks-sdk-go/listing" + aisearch "github.com/databricks/databricks-sdk-go/service/aisearch" + mock "github.com/stretchr/testify/mock" +) + +// MockAiSearchInterface is an autogenerated mock type for the AiSearchInterface type +type MockAiSearchInterface struct { + mock.Mock +} + +type MockAiSearchInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *MockAiSearchInterface) EXPECT() *MockAiSearchInterface_Expecter { + return &MockAiSearchInterface_Expecter{mock: &_m.Mock} +} + +// CreateEndpoint provides a mock function with given fields: ctx, request +func (_m *MockAiSearchInterface) CreateEndpoint(ctx context.Context, request aisearch.CreateEndpointRequest) (*aisearch.Endpoint, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for CreateEndpoint") + } + + var r0 *aisearch.Endpoint + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, aisearch.CreateEndpointRequest) (*aisearch.Endpoint, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, aisearch.CreateEndpointRequest) *aisearch.Endpoint); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*aisearch.Endpoint) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, aisearch.CreateEndpointRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAiSearchInterface_CreateEndpoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateEndpoint' +type MockAiSearchInterface_CreateEndpoint_Call struct { + *mock.Call +} + +// CreateEndpoint is a helper method to define mock.On call +// - ctx context.Context +// - request aisearch.CreateEndpointRequest +func (_e *MockAiSearchInterface_Expecter) CreateEndpoint(ctx interface{}, request interface{}) *MockAiSearchInterface_CreateEndpoint_Call { + return &MockAiSearchInterface_CreateEndpoint_Call{Call: _e.mock.On("CreateEndpoint", ctx, request)} +} + +func (_c *MockAiSearchInterface_CreateEndpoint_Call) Run(run func(ctx context.Context, request aisearch.CreateEndpointRequest)) *MockAiSearchInterface_CreateEndpoint_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(aisearch.CreateEndpointRequest)) + }) + return _c +} + +func (_c *MockAiSearchInterface_CreateEndpoint_Call) Return(_a0 *aisearch.Endpoint, _a1 error) *MockAiSearchInterface_CreateEndpoint_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAiSearchInterface_CreateEndpoint_Call) RunAndReturn(run func(context.Context, aisearch.CreateEndpointRequest) (*aisearch.Endpoint, error)) *MockAiSearchInterface_CreateEndpoint_Call { + _c.Call.Return(run) + return _c +} + +// CreateIndex provides a mock function with given fields: ctx, request +func (_m *MockAiSearchInterface) CreateIndex(ctx context.Context, request aisearch.CreateIndexRequest) (*aisearch.Index, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for CreateIndex") + } + + var r0 *aisearch.Index + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, aisearch.CreateIndexRequest) (*aisearch.Index, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, aisearch.CreateIndexRequest) *aisearch.Index); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*aisearch.Index) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, aisearch.CreateIndexRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAiSearchInterface_CreateIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateIndex' +type MockAiSearchInterface_CreateIndex_Call struct { + *mock.Call +} + +// CreateIndex is a helper method to define mock.On call +// - ctx context.Context +// - request aisearch.CreateIndexRequest +func (_e *MockAiSearchInterface_Expecter) CreateIndex(ctx interface{}, request interface{}) *MockAiSearchInterface_CreateIndex_Call { + return &MockAiSearchInterface_CreateIndex_Call{Call: _e.mock.On("CreateIndex", ctx, request)} +} + +func (_c *MockAiSearchInterface_CreateIndex_Call) Run(run func(ctx context.Context, request aisearch.CreateIndexRequest)) *MockAiSearchInterface_CreateIndex_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(aisearch.CreateIndexRequest)) + }) + return _c +} + +func (_c *MockAiSearchInterface_CreateIndex_Call) Return(_a0 *aisearch.Index, _a1 error) *MockAiSearchInterface_CreateIndex_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAiSearchInterface_CreateIndex_Call) RunAndReturn(run func(context.Context, aisearch.CreateIndexRequest) (*aisearch.Index, error)) *MockAiSearchInterface_CreateIndex_Call { + _c.Call.Return(run) + return _c +} + +// DeleteEndpoint provides a mock function with given fields: ctx, request +func (_m *MockAiSearchInterface) DeleteEndpoint(ctx context.Context, request aisearch.DeleteEndpointRequest) error { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for DeleteEndpoint") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, aisearch.DeleteEndpointRequest) error); ok { + r0 = rf(ctx, request) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockAiSearchInterface_DeleteEndpoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteEndpoint' +type MockAiSearchInterface_DeleteEndpoint_Call struct { + *mock.Call +} + +// DeleteEndpoint is a helper method to define mock.On call +// - ctx context.Context +// - request aisearch.DeleteEndpointRequest +func (_e *MockAiSearchInterface_Expecter) DeleteEndpoint(ctx interface{}, request interface{}) *MockAiSearchInterface_DeleteEndpoint_Call { + return &MockAiSearchInterface_DeleteEndpoint_Call{Call: _e.mock.On("DeleteEndpoint", ctx, request)} +} + +func (_c *MockAiSearchInterface_DeleteEndpoint_Call) Run(run func(ctx context.Context, request aisearch.DeleteEndpointRequest)) *MockAiSearchInterface_DeleteEndpoint_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(aisearch.DeleteEndpointRequest)) + }) + return _c +} + +func (_c *MockAiSearchInterface_DeleteEndpoint_Call) Return(_a0 error) *MockAiSearchInterface_DeleteEndpoint_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockAiSearchInterface_DeleteEndpoint_Call) RunAndReturn(run func(context.Context, aisearch.DeleteEndpointRequest) error) *MockAiSearchInterface_DeleteEndpoint_Call { + _c.Call.Return(run) + return _c +} + +// DeleteIndex provides a mock function with given fields: ctx, request +func (_m *MockAiSearchInterface) DeleteIndex(ctx context.Context, request aisearch.DeleteIndexRequest) error { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for DeleteIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, aisearch.DeleteIndexRequest) error); ok { + r0 = rf(ctx, request) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockAiSearchInterface_DeleteIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteIndex' +type MockAiSearchInterface_DeleteIndex_Call struct { + *mock.Call +} + +// DeleteIndex is a helper method to define mock.On call +// - ctx context.Context +// - request aisearch.DeleteIndexRequest +func (_e *MockAiSearchInterface_Expecter) DeleteIndex(ctx interface{}, request interface{}) *MockAiSearchInterface_DeleteIndex_Call { + return &MockAiSearchInterface_DeleteIndex_Call{Call: _e.mock.On("DeleteIndex", ctx, request)} +} + +func (_c *MockAiSearchInterface_DeleteIndex_Call) Run(run func(ctx context.Context, request aisearch.DeleteIndexRequest)) *MockAiSearchInterface_DeleteIndex_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(aisearch.DeleteIndexRequest)) + }) + return _c +} + +func (_c *MockAiSearchInterface_DeleteIndex_Call) Return(_a0 error) *MockAiSearchInterface_DeleteIndex_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockAiSearchInterface_DeleteIndex_Call) RunAndReturn(run func(context.Context, aisearch.DeleteIndexRequest) error) *MockAiSearchInterface_DeleteIndex_Call { + _c.Call.Return(run) + return _c +} + +// GetEndpoint provides a mock function with given fields: ctx, request +func (_m *MockAiSearchInterface) GetEndpoint(ctx context.Context, request aisearch.GetEndpointRequest) (*aisearch.Endpoint, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for GetEndpoint") + } + + var r0 *aisearch.Endpoint + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, aisearch.GetEndpointRequest) (*aisearch.Endpoint, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, aisearch.GetEndpointRequest) *aisearch.Endpoint); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*aisearch.Endpoint) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, aisearch.GetEndpointRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAiSearchInterface_GetEndpoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEndpoint' +type MockAiSearchInterface_GetEndpoint_Call struct { + *mock.Call +} + +// GetEndpoint is a helper method to define mock.On call +// - ctx context.Context +// - request aisearch.GetEndpointRequest +func (_e *MockAiSearchInterface_Expecter) GetEndpoint(ctx interface{}, request interface{}) *MockAiSearchInterface_GetEndpoint_Call { + return &MockAiSearchInterface_GetEndpoint_Call{Call: _e.mock.On("GetEndpoint", ctx, request)} +} + +func (_c *MockAiSearchInterface_GetEndpoint_Call) Run(run func(ctx context.Context, request aisearch.GetEndpointRequest)) *MockAiSearchInterface_GetEndpoint_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(aisearch.GetEndpointRequest)) + }) + return _c +} + +func (_c *MockAiSearchInterface_GetEndpoint_Call) Return(_a0 *aisearch.Endpoint, _a1 error) *MockAiSearchInterface_GetEndpoint_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAiSearchInterface_GetEndpoint_Call) RunAndReturn(run func(context.Context, aisearch.GetEndpointRequest) (*aisearch.Endpoint, error)) *MockAiSearchInterface_GetEndpoint_Call { + _c.Call.Return(run) + return _c +} + +// GetIndex provides a mock function with given fields: ctx, request +func (_m *MockAiSearchInterface) GetIndex(ctx context.Context, request aisearch.GetIndexRequest) (*aisearch.Index, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for GetIndex") + } + + var r0 *aisearch.Index + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, aisearch.GetIndexRequest) (*aisearch.Index, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, aisearch.GetIndexRequest) *aisearch.Index); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*aisearch.Index) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, aisearch.GetIndexRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAiSearchInterface_GetIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetIndex' +type MockAiSearchInterface_GetIndex_Call struct { + *mock.Call +} + +// GetIndex is a helper method to define mock.On call +// - ctx context.Context +// - request aisearch.GetIndexRequest +func (_e *MockAiSearchInterface_Expecter) GetIndex(ctx interface{}, request interface{}) *MockAiSearchInterface_GetIndex_Call { + return &MockAiSearchInterface_GetIndex_Call{Call: _e.mock.On("GetIndex", ctx, request)} +} + +func (_c *MockAiSearchInterface_GetIndex_Call) Run(run func(ctx context.Context, request aisearch.GetIndexRequest)) *MockAiSearchInterface_GetIndex_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(aisearch.GetIndexRequest)) + }) + return _c +} + +func (_c *MockAiSearchInterface_GetIndex_Call) Return(_a0 *aisearch.Index, _a1 error) *MockAiSearchInterface_GetIndex_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAiSearchInterface_GetIndex_Call) RunAndReturn(run func(context.Context, aisearch.GetIndexRequest) (*aisearch.Index, error)) *MockAiSearchInterface_GetIndex_Call { + _c.Call.Return(run) + return _c +} + +// ListEndpoints provides a mock function with given fields: ctx, request +func (_m *MockAiSearchInterface) ListEndpoints(ctx context.Context, request aisearch.ListEndpointsRequest) listing.Iterator[aisearch.Endpoint] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListEndpoints") + } + + var r0 listing.Iterator[aisearch.Endpoint] + if rf, ok := ret.Get(0).(func(context.Context, aisearch.ListEndpointsRequest) listing.Iterator[aisearch.Endpoint]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[aisearch.Endpoint]) + } + } + + return r0 +} + +// MockAiSearchInterface_ListEndpoints_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListEndpoints' +type MockAiSearchInterface_ListEndpoints_Call struct { + *mock.Call +} + +// ListEndpoints is a helper method to define mock.On call +// - ctx context.Context +// - request aisearch.ListEndpointsRequest +func (_e *MockAiSearchInterface_Expecter) ListEndpoints(ctx interface{}, request interface{}) *MockAiSearchInterface_ListEndpoints_Call { + return &MockAiSearchInterface_ListEndpoints_Call{Call: _e.mock.On("ListEndpoints", ctx, request)} +} + +func (_c *MockAiSearchInterface_ListEndpoints_Call) Run(run func(ctx context.Context, request aisearch.ListEndpointsRequest)) *MockAiSearchInterface_ListEndpoints_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(aisearch.ListEndpointsRequest)) + }) + return _c +} + +func (_c *MockAiSearchInterface_ListEndpoints_Call) Return(_a0 listing.Iterator[aisearch.Endpoint]) *MockAiSearchInterface_ListEndpoints_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockAiSearchInterface_ListEndpoints_Call) RunAndReturn(run func(context.Context, aisearch.ListEndpointsRequest) listing.Iterator[aisearch.Endpoint]) *MockAiSearchInterface_ListEndpoints_Call { + _c.Call.Return(run) + return _c +} + +// ListEndpointsAll provides a mock function with given fields: ctx, request +func (_m *MockAiSearchInterface) ListEndpointsAll(ctx context.Context, request aisearch.ListEndpointsRequest) ([]aisearch.Endpoint, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListEndpointsAll") + } + + var r0 []aisearch.Endpoint + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, aisearch.ListEndpointsRequest) ([]aisearch.Endpoint, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, aisearch.ListEndpointsRequest) []aisearch.Endpoint); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]aisearch.Endpoint) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, aisearch.ListEndpointsRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAiSearchInterface_ListEndpointsAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListEndpointsAll' +type MockAiSearchInterface_ListEndpointsAll_Call struct { + *mock.Call +} + +// ListEndpointsAll is a helper method to define mock.On call +// - ctx context.Context +// - request aisearch.ListEndpointsRequest +func (_e *MockAiSearchInterface_Expecter) ListEndpointsAll(ctx interface{}, request interface{}) *MockAiSearchInterface_ListEndpointsAll_Call { + return &MockAiSearchInterface_ListEndpointsAll_Call{Call: _e.mock.On("ListEndpointsAll", ctx, request)} +} + +func (_c *MockAiSearchInterface_ListEndpointsAll_Call) Run(run func(ctx context.Context, request aisearch.ListEndpointsRequest)) *MockAiSearchInterface_ListEndpointsAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(aisearch.ListEndpointsRequest)) + }) + return _c +} + +func (_c *MockAiSearchInterface_ListEndpointsAll_Call) Return(_a0 []aisearch.Endpoint, _a1 error) *MockAiSearchInterface_ListEndpointsAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAiSearchInterface_ListEndpointsAll_Call) RunAndReturn(run func(context.Context, aisearch.ListEndpointsRequest) ([]aisearch.Endpoint, error)) *MockAiSearchInterface_ListEndpointsAll_Call { + _c.Call.Return(run) + return _c +} + +// ListIndexes provides a mock function with given fields: ctx, request +func (_m *MockAiSearchInterface) ListIndexes(ctx context.Context, request aisearch.ListIndexesRequest) listing.Iterator[aisearch.Index] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListIndexes") + } + + var r0 listing.Iterator[aisearch.Index] + if rf, ok := ret.Get(0).(func(context.Context, aisearch.ListIndexesRequest) listing.Iterator[aisearch.Index]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[aisearch.Index]) + } + } + + return r0 +} + +// MockAiSearchInterface_ListIndexes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListIndexes' +type MockAiSearchInterface_ListIndexes_Call struct { + *mock.Call +} + +// ListIndexes is a helper method to define mock.On call +// - ctx context.Context +// - request aisearch.ListIndexesRequest +func (_e *MockAiSearchInterface_Expecter) ListIndexes(ctx interface{}, request interface{}) *MockAiSearchInterface_ListIndexes_Call { + return &MockAiSearchInterface_ListIndexes_Call{Call: _e.mock.On("ListIndexes", ctx, request)} +} + +func (_c *MockAiSearchInterface_ListIndexes_Call) Run(run func(ctx context.Context, request aisearch.ListIndexesRequest)) *MockAiSearchInterface_ListIndexes_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(aisearch.ListIndexesRequest)) + }) + return _c +} + +func (_c *MockAiSearchInterface_ListIndexes_Call) Return(_a0 listing.Iterator[aisearch.Index]) *MockAiSearchInterface_ListIndexes_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockAiSearchInterface_ListIndexes_Call) RunAndReturn(run func(context.Context, aisearch.ListIndexesRequest) listing.Iterator[aisearch.Index]) *MockAiSearchInterface_ListIndexes_Call { + _c.Call.Return(run) + return _c +} + +// ListIndexesAll provides a mock function with given fields: ctx, request +func (_m *MockAiSearchInterface) ListIndexesAll(ctx context.Context, request aisearch.ListIndexesRequest) ([]aisearch.Index, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListIndexesAll") + } + + var r0 []aisearch.Index + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, aisearch.ListIndexesRequest) ([]aisearch.Index, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, aisearch.ListIndexesRequest) []aisearch.Index); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]aisearch.Index) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, aisearch.ListIndexesRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAiSearchInterface_ListIndexesAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListIndexesAll' +type MockAiSearchInterface_ListIndexesAll_Call struct { + *mock.Call +} + +// ListIndexesAll is a helper method to define mock.On call +// - ctx context.Context +// - request aisearch.ListIndexesRequest +func (_e *MockAiSearchInterface_Expecter) ListIndexesAll(ctx interface{}, request interface{}) *MockAiSearchInterface_ListIndexesAll_Call { + return &MockAiSearchInterface_ListIndexesAll_Call{Call: _e.mock.On("ListIndexesAll", ctx, request)} +} + +func (_c *MockAiSearchInterface_ListIndexesAll_Call) Run(run func(ctx context.Context, request aisearch.ListIndexesRequest)) *MockAiSearchInterface_ListIndexesAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(aisearch.ListIndexesRequest)) + }) + return _c +} + +func (_c *MockAiSearchInterface_ListIndexesAll_Call) Return(_a0 []aisearch.Index, _a1 error) *MockAiSearchInterface_ListIndexesAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAiSearchInterface_ListIndexesAll_Call) RunAndReturn(run func(context.Context, aisearch.ListIndexesRequest) ([]aisearch.Index, error)) *MockAiSearchInterface_ListIndexesAll_Call { + _c.Call.Return(run) + return _c +} + +// QueryIndex provides a mock function with given fields: ctx, request +func (_m *MockAiSearchInterface) QueryIndex(ctx context.Context, request aisearch.QueryIndexRequest) (*aisearch.QueryIndexResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for QueryIndex") + } + + var r0 *aisearch.QueryIndexResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, aisearch.QueryIndexRequest) (*aisearch.QueryIndexResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, aisearch.QueryIndexRequest) *aisearch.QueryIndexResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*aisearch.QueryIndexResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, aisearch.QueryIndexRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAiSearchInterface_QueryIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'QueryIndex' +type MockAiSearchInterface_QueryIndex_Call struct { + *mock.Call +} + +// QueryIndex is a helper method to define mock.On call +// - ctx context.Context +// - request aisearch.QueryIndexRequest +func (_e *MockAiSearchInterface_Expecter) QueryIndex(ctx interface{}, request interface{}) *MockAiSearchInterface_QueryIndex_Call { + return &MockAiSearchInterface_QueryIndex_Call{Call: _e.mock.On("QueryIndex", ctx, request)} +} + +func (_c *MockAiSearchInterface_QueryIndex_Call) Run(run func(ctx context.Context, request aisearch.QueryIndexRequest)) *MockAiSearchInterface_QueryIndex_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(aisearch.QueryIndexRequest)) + }) + return _c +} + +func (_c *MockAiSearchInterface_QueryIndex_Call) Return(_a0 *aisearch.QueryIndexResponse, _a1 error) *MockAiSearchInterface_QueryIndex_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAiSearchInterface_QueryIndex_Call) RunAndReturn(run func(context.Context, aisearch.QueryIndexRequest) (*aisearch.QueryIndexResponse, error)) *MockAiSearchInterface_QueryIndex_Call { + _c.Call.Return(run) + return _c +} + +// RemoveData provides a mock function with given fields: ctx, request +func (_m *MockAiSearchInterface) RemoveData(ctx context.Context, request aisearch.RemoveDataRequest) (*aisearch.RemoveDataResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for RemoveData") + } + + var r0 *aisearch.RemoveDataResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, aisearch.RemoveDataRequest) (*aisearch.RemoveDataResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, aisearch.RemoveDataRequest) *aisearch.RemoveDataResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*aisearch.RemoveDataResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, aisearch.RemoveDataRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAiSearchInterface_RemoveData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveData' +type MockAiSearchInterface_RemoveData_Call struct { + *mock.Call +} + +// RemoveData is a helper method to define mock.On call +// - ctx context.Context +// - request aisearch.RemoveDataRequest +func (_e *MockAiSearchInterface_Expecter) RemoveData(ctx interface{}, request interface{}) *MockAiSearchInterface_RemoveData_Call { + return &MockAiSearchInterface_RemoveData_Call{Call: _e.mock.On("RemoveData", ctx, request)} +} + +func (_c *MockAiSearchInterface_RemoveData_Call) Run(run func(ctx context.Context, request aisearch.RemoveDataRequest)) *MockAiSearchInterface_RemoveData_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(aisearch.RemoveDataRequest)) + }) + return _c +} + +func (_c *MockAiSearchInterface_RemoveData_Call) Return(_a0 *aisearch.RemoveDataResponse, _a1 error) *MockAiSearchInterface_RemoveData_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAiSearchInterface_RemoveData_Call) RunAndReturn(run func(context.Context, aisearch.RemoveDataRequest) (*aisearch.RemoveDataResponse, error)) *MockAiSearchInterface_RemoveData_Call { + _c.Call.Return(run) + return _c +} + +// ScanIndex provides a mock function with given fields: ctx, request +func (_m *MockAiSearchInterface) ScanIndex(ctx context.Context, request aisearch.ScanIndexRequest) (*aisearch.ScanIndexResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ScanIndex") + } + + var r0 *aisearch.ScanIndexResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, aisearch.ScanIndexRequest) (*aisearch.ScanIndexResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, aisearch.ScanIndexRequest) *aisearch.ScanIndexResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*aisearch.ScanIndexResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, aisearch.ScanIndexRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAiSearchInterface_ScanIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ScanIndex' +type MockAiSearchInterface_ScanIndex_Call struct { + *mock.Call +} + +// ScanIndex is a helper method to define mock.On call +// - ctx context.Context +// - request aisearch.ScanIndexRequest +func (_e *MockAiSearchInterface_Expecter) ScanIndex(ctx interface{}, request interface{}) *MockAiSearchInterface_ScanIndex_Call { + return &MockAiSearchInterface_ScanIndex_Call{Call: _e.mock.On("ScanIndex", ctx, request)} +} + +func (_c *MockAiSearchInterface_ScanIndex_Call) Run(run func(ctx context.Context, request aisearch.ScanIndexRequest)) *MockAiSearchInterface_ScanIndex_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(aisearch.ScanIndexRequest)) + }) + return _c +} + +func (_c *MockAiSearchInterface_ScanIndex_Call) Return(_a0 *aisearch.ScanIndexResponse, _a1 error) *MockAiSearchInterface_ScanIndex_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAiSearchInterface_ScanIndex_Call) RunAndReturn(run func(context.Context, aisearch.ScanIndexRequest) (*aisearch.ScanIndexResponse, error)) *MockAiSearchInterface_ScanIndex_Call { + _c.Call.Return(run) + return _c +} + +// SyncIndex provides a mock function with given fields: ctx, request +func (_m *MockAiSearchInterface) SyncIndex(ctx context.Context, request aisearch.SyncIndexRequest) (*aisearch.SyncIndexResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for SyncIndex") + } + + var r0 *aisearch.SyncIndexResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, aisearch.SyncIndexRequest) (*aisearch.SyncIndexResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, aisearch.SyncIndexRequest) *aisearch.SyncIndexResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*aisearch.SyncIndexResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, aisearch.SyncIndexRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAiSearchInterface_SyncIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SyncIndex' +type MockAiSearchInterface_SyncIndex_Call struct { + *mock.Call +} + +// SyncIndex is a helper method to define mock.On call +// - ctx context.Context +// - request aisearch.SyncIndexRequest +func (_e *MockAiSearchInterface_Expecter) SyncIndex(ctx interface{}, request interface{}) *MockAiSearchInterface_SyncIndex_Call { + return &MockAiSearchInterface_SyncIndex_Call{Call: _e.mock.On("SyncIndex", ctx, request)} +} + +func (_c *MockAiSearchInterface_SyncIndex_Call) Run(run func(ctx context.Context, request aisearch.SyncIndexRequest)) *MockAiSearchInterface_SyncIndex_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(aisearch.SyncIndexRequest)) + }) + return _c +} + +func (_c *MockAiSearchInterface_SyncIndex_Call) Return(_a0 *aisearch.SyncIndexResponse, _a1 error) *MockAiSearchInterface_SyncIndex_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAiSearchInterface_SyncIndex_Call) RunAndReturn(run func(context.Context, aisearch.SyncIndexRequest) (*aisearch.SyncIndexResponse, error)) *MockAiSearchInterface_SyncIndex_Call { + _c.Call.Return(run) + return _c +} + +// UpdateEndpoint provides a mock function with given fields: ctx, request +func (_m *MockAiSearchInterface) UpdateEndpoint(ctx context.Context, request aisearch.UpdateEndpointRequest) (*aisearch.Endpoint, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for UpdateEndpoint") + } + + var r0 *aisearch.Endpoint + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, aisearch.UpdateEndpointRequest) (*aisearch.Endpoint, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, aisearch.UpdateEndpointRequest) *aisearch.Endpoint); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*aisearch.Endpoint) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, aisearch.UpdateEndpointRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAiSearchInterface_UpdateEndpoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateEndpoint' +type MockAiSearchInterface_UpdateEndpoint_Call struct { + *mock.Call +} + +// UpdateEndpoint is a helper method to define mock.On call +// - ctx context.Context +// - request aisearch.UpdateEndpointRequest +func (_e *MockAiSearchInterface_Expecter) UpdateEndpoint(ctx interface{}, request interface{}) *MockAiSearchInterface_UpdateEndpoint_Call { + return &MockAiSearchInterface_UpdateEndpoint_Call{Call: _e.mock.On("UpdateEndpoint", ctx, request)} +} + +func (_c *MockAiSearchInterface_UpdateEndpoint_Call) Run(run func(ctx context.Context, request aisearch.UpdateEndpointRequest)) *MockAiSearchInterface_UpdateEndpoint_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(aisearch.UpdateEndpointRequest)) + }) + return _c +} + +func (_c *MockAiSearchInterface_UpdateEndpoint_Call) Return(_a0 *aisearch.Endpoint, _a1 error) *MockAiSearchInterface_UpdateEndpoint_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAiSearchInterface_UpdateEndpoint_Call) RunAndReturn(run func(context.Context, aisearch.UpdateEndpointRequest) (*aisearch.Endpoint, error)) *MockAiSearchInterface_UpdateEndpoint_Call { + _c.Call.Return(run) + return _c +} + +// UpsertData provides a mock function with given fields: ctx, request +func (_m *MockAiSearchInterface) UpsertData(ctx context.Context, request aisearch.UpsertDataRequest) (*aisearch.UpsertDataResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for UpsertData") + } + + var r0 *aisearch.UpsertDataResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, aisearch.UpsertDataRequest) (*aisearch.UpsertDataResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, aisearch.UpsertDataRequest) *aisearch.UpsertDataResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*aisearch.UpsertDataResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, aisearch.UpsertDataRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAiSearchInterface_UpsertData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpsertData' +type MockAiSearchInterface_UpsertData_Call struct { + *mock.Call +} + +// UpsertData is a helper method to define mock.On call +// - ctx context.Context +// - request aisearch.UpsertDataRequest +func (_e *MockAiSearchInterface_Expecter) UpsertData(ctx interface{}, request interface{}) *MockAiSearchInterface_UpsertData_Call { + return &MockAiSearchInterface_UpsertData_Call{Call: _e.mock.On("UpsertData", ctx, request)} +} + +func (_c *MockAiSearchInterface_UpsertData_Call) Run(run func(ctx context.Context, request aisearch.UpsertDataRequest)) *MockAiSearchInterface_UpsertData_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(aisearch.UpsertDataRequest)) + }) + return _c +} + +func (_c *MockAiSearchInterface_UpsertData_Call) Return(_a0 *aisearch.UpsertDataResponse, _a1 error) *MockAiSearchInterface_UpsertData_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAiSearchInterface_UpsertData_Call) RunAndReturn(run func(context.Context, aisearch.UpsertDataRequest) (*aisearch.UpsertDataResponse, error)) *MockAiSearchInterface_UpsertData_Call { + _c.Call.Return(run) + return _c +} + +// NewMockAiSearchInterface creates a new instance of MockAiSearchInterface. 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 NewMockAiSearchInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *MockAiSearchInterface { + mock := &MockAiSearchInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/experimental/mocks/service/bundledeployments/mock_bundle_deployments_interface.go b/experimental/mocks/service/bundledeployments/mock_bundle_deployments_interface.go new file mode 100644 index 000000000..7e3ebae98 --- /dev/null +++ b/experimental/mocks/service/bundledeployments/mock_bundle_deployments_interface.go @@ -0,0 +1,1048 @@ +// Code generated by mockery v2.53.2. DO NOT EDIT. + +package bundledeployments + +import ( + context "context" + + listing "github.com/databricks/databricks-sdk-go/listing" + bundledeployments "github.com/databricks/databricks-sdk-go/service/bundledeployments" + mock "github.com/stretchr/testify/mock" +) + +// MockBundleDeploymentsInterface is an autogenerated mock type for the BundleDeploymentsInterface type +type MockBundleDeploymentsInterface struct { + mock.Mock +} + +type MockBundleDeploymentsInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *MockBundleDeploymentsInterface) EXPECT() *MockBundleDeploymentsInterface_Expecter { + return &MockBundleDeploymentsInterface_Expecter{mock: &_m.Mock} +} + +// CompleteVersion provides a mock function with given fields: ctx, request +func (_m *MockBundleDeploymentsInterface) CompleteVersion(ctx context.Context, request bundledeployments.CompleteVersionRequest) (*bundledeployments.Version, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for CompleteVersion") + } + + var r0 *bundledeployments.Version + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, bundledeployments.CompleteVersionRequest) (*bundledeployments.Version, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, bundledeployments.CompleteVersionRequest) *bundledeployments.Version); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*bundledeployments.Version) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, bundledeployments.CompleteVersionRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockBundleDeploymentsInterface_CompleteVersion_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CompleteVersion' +type MockBundleDeploymentsInterface_CompleteVersion_Call struct { + *mock.Call +} + +// CompleteVersion is a helper method to define mock.On call +// - ctx context.Context +// - request bundledeployments.CompleteVersionRequest +func (_e *MockBundleDeploymentsInterface_Expecter) CompleteVersion(ctx interface{}, request interface{}) *MockBundleDeploymentsInterface_CompleteVersion_Call { + return &MockBundleDeploymentsInterface_CompleteVersion_Call{Call: _e.mock.On("CompleteVersion", ctx, request)} +} + +func (_c *MockBundleDeploymentsInterface_CompleteVersion_Call) Run(run func(ctx context.Context, request bundledeployments.CompleteVersionRequest)) *MockBundleDeploymentsInterface_CompleteVersion_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(bundledeployments.CompleteVersionRequest)) + }) + return _c +} + +func (_c *MockBundleDeploymentsInterface_CompleteVersion_Call) Return(_a0 *bundledeployments.Version, _a1 error) *MockBundleDeploymentsInterface_CompleteVersion_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockBundleDeploymentsInterface_CompleteVersion_Call) RunAndReturn(run func(context.Context, bundledeployments.CompleteVersionRequest) (*bundledeployments.Version, error)) *MockBundleDeploymentsInterface_CompleteVersion_Call { + _c.Call.Return(run) + return _c +} + +// CreateDeployment provides a mock function with given fields: ctx, request +func (_m *MockBundleDeploymentsInterface) CreateDeployment(ctx context.Context, request bundledeployments.CreateDeploymentRequest) (*bundledeployments.Deployment, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for CreateDeployment") + } + + var r0 *bundledeployments.Deployment + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, bundledeployments.CreateDeploymentRequest) (*bundledeployments.Deployment, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, bundledeployments.CreateDeploymentRequest) *bundledeployments.Deployment); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*bundledeployments.Deployment) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, bundledeployments.CreateDeploymentRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockBundleDeploymentsInterface_CreateDeployment_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateDeployment' +type MockBundleDeploymentsInterface_CreateDeployment_Call struct { + *mock.Call +} + +// CreateDeployment is a helper method to define mock.On call +// - ctx context.Context +// - request bundledeployments.CreateDeploymentRequest +func (_e *MockBundleDeploymentsInterface_Expecter) CreateDeployment(ctx interface{}, request interface{}) *MockBundleDeploymentsInterface_CreateDeployment_Call { + return &MockBundleDeploymentsInterface_CreateDeployment_Call{Call: _e.mock.On("CreateDeployment", ctx, request)} +} + +func (_c *MockBundleDeploymentsInterface_CreateDeployment_Call) Run(run func(ctx context.Context, request bundledeployments.CreateDeploymentRequest)) *MockBundleDeploymentsInterface_CreateDeployment_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(bundledeployments.CreateDeploymentRequest)) + }) + return _c +} + +func (_c *MockBundleDeploymentsInterface_CreateDeployment_Call) Return(_a0 *bundledeployments.Deployment, _a1 error) *MockBundleDeploymentsInterface_CreateDeployment_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockBundleDeploymentsInterface_CreateDeployment_Call) RunAndReturn(run func(context.Context, bundledeployments.CreateDeploymentRequest) (*bundledeployments.Deployment, error)) *MockBundleDeploymentsInterface_CreateDeployment_Call { + _c.Call.Return(run) + return _c +} + +// CreateOperation provides a mock function with given fields: ctx, request +func (_m *MockBundleDeploymentsInterface) CreateOperation(ctx context.Context, request bundledeployments.CreateOperationRequest) (*bundledeployments.Operation, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for CreateOperation") + } + + var r0 *bundledeployments.Operation + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, bundledeployments.CreateOperationRequest) (*bundledeployments.Operation, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, bundledeployments.CreateOperationRequest) *bundledeployments.Operation); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*bundledeployments.Operation) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, bundledeployments.CreateOperationRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockBundleDeploymentsInterface_CreateOperation_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateOperation' +type MockBundleDeploymentsInterface_CreateOperation_Call struct { + *mock.Call +} + +// CreateOperation is a helper method to define mock.On call +// - ctx context.Context +// - request bundledeployments.CreateOperationRequest +func (_e *MockBundleDeploymentsInterface_Expecter) CreateOperation(ctx interface{}, request interface{}) *MockBundleDeploymentsInterface_CreateOperation_Call { + return &MockBundleDeploymentsInterface_CreateOperation_Call{Call: _e.mock.On("CreateOperation", ctx, request)} +} + +func (_c *MockBundleDeploymentsInterface_CreateOperation_Call) Run(run func(ctx context.Context, request bundledeployments.CreateOperationRequest)) *MockBundleDeploymentsInterface_CreateOperation_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(bundledeployments.CreateOperationRequest)) + }) + return _c +} + +func (_c *MockBundleDeploymentsInterface_CreateOperation_Call) Return(_a0 *bundledeployments.Operation, _a1 error) *MockBundleDeploymentsInterface_CreateOperation_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockBundleDeploymentsInterface_CreateOperation_Call) RunAndReturn(run func(context.Context, bundledeployments.CreateOperationRequest) (*bundledeployments.Operation, error)) *MockBundleDeploymentsInterface_CreateOperation_Call { + _c.Call.Return(run) + return _c +} + +// CreateVersion provides a mock function with given fields: ctx, request +func (_m *MockBundleDeploymentsInterface) CreateVersion(ctx context.Context, request bundledeployments.CreateVersionRequest) (*bundledeployments.Version, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for CreateVersion") + } + + var r0 *bundledeployments.Version + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, bundledeployments.CreateVersionRequest) (*bundledeployments.Version, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, bundledeployments.CreateVersionRequest) *bundledeployments.Version); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*bundledeployments.Version) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, bundledeployments.CreateVersionRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockBundleDeploymentsInterface_CreateVersion_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateVersion' +type MockBundleDeploymentsInterface_CreateVersion_Call struct { + *mock.Call +} + +// CreateVersion is a helper method to define mock.On call +// - ctx context.Context +// - request bundledeployments.CreateVersionRequest +func (_e *MockBundleDeploymentsInterface_Expecter) CreateVersion(ctx interface{}, request interface{}) *MockBundleDeploymentsInterface_CreateVersion_Call { + return &MockBundleDeploymentsInterface_CreateVersion_Call{Call: _e.mock.On("CreateVersion", ctx, request)} +} + +func (_c *MockBundleDeploymentsInterface_CreateVersion_Call) Run(run func(ctx context.Context, request bundledeployments.CreateVersionRequest)) *MockBundleDeploymentsInterface_CreateVersion_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(bundledeployments.CreateVersionRequest)) + }) + return _c +} + +func (_c *MockBundleDeploymentsInterface_CreateVersion_Call) Return(_a0 *bundledeployments.Version, _a1 error) *MockBundleDeploymentsInterface_CreateVersion_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockBundleDeploymentsInterface_CreateVersion_Call) RunAndReturn(run func(context.Context, bundledeployments.CreateVersionRequest) (*bundledeployments.Version, error)) *MockBundleDeploymentsInterface_CreateVersion_Call { + _c.Call.Return(run) + return _c +} + +// DeleteDeployment provides a mock function with given fields: ctx, request +func (_m *MockBundleDeploymentsInterface) DeleteDeployment(ctx context.Context, request bundledeployments.DeleteDeploymentRequest) error { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for DeleteDeployment") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, bundledeployments.DeleteDeploymentRequest) error); ok { + r0 = rf(ctx, request) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockBundleDeploymentsInterface_DeleteDeployment_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteDeployment' +type MockBundleDeploymentsInterface_DeleteDeployment_Call struct { + *mock.Call +} + +// DeleteDeployment is a helper method to define mock.On call +// - ctx context.Context +// - request bundledeployments.DeleteDeploymentRequest +func (_e *MockBundleDeploymentsInterface_Expecter) DeleteDeployment(ctx interface{}, request interface{}) *MockBundleDeploymentsInterface_DeleteDeployment_Call { + return &MockBundleDeploymentsInterface_DeleteDeployment_Call{Call: _e.mock.On("DeleteDeployment", ctx, request)} +} + +func (_c *MockBundleDeploymentsInterface_DeleteDeployment_Call) Run(run func(ctx context.Context, request bundledeployments.DeleteDeploymentRequest)) *MockBundleDeploymentsInterface_DeleteDeployment_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(bundledeployments.DeleteDeploymentRequest)) + }) + return _c +} + +func (_c *MockBundleDeploymentsInterface_DeleteDeployment_Call) Return(_a0 error) *MockBundleDeploymentsInterface_DeleteDeployment_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockBundleDeploymentsInterface_DeleteDeployment_Call) RunAndReturn(run func(context.Context, bundledeployments.DeleteDeploymentRequest) error) *MockBundleDeploymentsInterface_DeleteDeployment_Call { + _c.Call.Return(run) + return _c +} + +// GetDeployment provides a mock function with given fields: ctx, request +func (_m *MockBundleDeploymentsInterface) GetDeployment(ctx context.Context, request bundledeployments.GetDeploymentRequest) (*bundledeployments.Deployment, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for GetDeployment") + } + + var r0 *bundledeployments.Deployment + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, bundledeployments.GetDeploymentRequest) (*bundledeployments.Deployment, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, bundledeployments.GetDeploymentRequest) *bundledeployments.Deployment); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*bundledeployments.Deployment) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, bundledeployments.GetDeploymentRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockBundleDeploymentsInterface_GetDeployment_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDeployment' +type MockBundleDeploymentsInterface_GetDeployment_Call struct { + *mock.Call +} + +// GetDeployment is a helper method to define mock.On call +// - ctx context.Context +// - request bundledeployments.GetDeploymentRequest +func (_e *MockBundleDeploymentsInterface_Expecter) GetDeployment(ctx interface{}, request interface{}) *MockBundleDeploymentsInterface_GetDeployment_Call { + return &MockBundleDeploymentsInterface_GetDeployment_Call{Call: _e.mock.On("GetDeployment", ctx, request)} +} + +func (_c *MockBundleDeploymentsInterface_GetDeployment_Call) Run(run func(ctx context.Context, request bundledeployments.GetDeploymentRequest)) *MockBundleDeploymentsInterface_GetDeployment_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(bundledeployments.GetDeploymentRequest)) + }) + return _c +} + +func (_c *MockBundleDeploymentsInterface_GetDeployment_Call) Return(_a0 *bundledeployments.Deployment, _a1 error) *MockBundleDeploymentsInterface_GetDeployment_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockBundleDeploymentsInterface_GetDeployment_Call) RunAndReturn(run func(context.Context, bundledeployments.GetDeploymentRequest) (*bundledeployments.Deployment, error)) *MockBundleDeploymentsInterface_GetDeployment_Call { + _c.Call.Return(run) + return _c +} + +// GetOperation provides a mock function with given fields: ctx, request +func (_m *MockBundleDeploymentsInterface) GetOperation(ctx context.Context, request bundledeployments.GetOperationRequest) (*bundledeployments.Operation, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for GetOperation") + } + + var r0 *bundledeployments.Operation + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, bundledeployments.GetOperationRequest) (*bundledeployments.Operation, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, bundledeployments.GetOperationRequest) *bundledeployments.Operation); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*bundledeployments.Operation) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, bundledeployments.GetOperationRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockBundleDeploymentsInterface_GetOperation_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetOperation' +type MockBundleDeploymentsInterface_GetOperation_Call struct { + *mock.Call +} + +// GetOperation is a helper method to define mock.On call +// - ctx context.Context +// - request bundledeployments.GetOperationRequest +func (_e *MockBundleDeploymentsInterface_Expecter) GetOperation(ctx interface{}, request interface{}) *MockBundleDeploymentsInterface_GetOperation_Call { + return &MockBundleDeploymentsInterface_GetOperation_Call{Call: _e.mock.On("GetOperation", ctx, request)} +} + +func (_c *MockBundleDeploymentsInterface_GetOperation_Call) Run(run func(ctx context.Context, request bundledeployments.GetOperationRequest)) *MockBundleDeploymentsInterface_GetOperation_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(bundledeployments.GetOperationRequest)) + }) + return _c +} + +func (_c *MockBundleDeploymentsInterface_GetOperation_Call) Return(_a0 *bundledeployments.Operation, _a1 error) *MockBundleDeploymentsInterface_GetOperation_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockBundleDeploymentsInterface_GetOperation_Call) RunAndReturn(run func(context.Context, bundledeployments.GetOperationRequest) (*bundledeployments.Operation, error)) *MockBundleDeploymentsInterface_GetOperation_Call { + _c.Call.Return(run) + return _c +} + +// GetResource provides a mock function with given fields: ctx, request +func (_m *MockBundleDeploymentsInterface) GetResource(ctx context.Context, request bundledeployments.GetResourceRequest) (*bundledeployments.Resource, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for GetResource") + } + + var r0 *bundledeployments.Resource + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, bundledeployments.GetResourceRequest) (*bundledeployments.Resource, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, bundledeployments.GetResourceRequest) *bundledeployments.Resource); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*bundledeployments.Resource) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, bundledeployments.GetResourceRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockBundleDeploymentsInterface_GetResource_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetResource' +type MockBundleDeploymentsInterface_GetResource_Call struct { + *mock.Call +} + +// GetResource is a helper method to define mock.On call +// - ctx context.Context +// - request bundledeployments.GetResourceRequest +func (_e *MockBundleDeploymentsInterface_Expecter) GetResource(ctx interface{}, request interface{}) *MockBundleDeploymentsInterface_GetResource_Call { + return &MockBundleDeploymentsInterface_GetResource_Call{Call: _e.mock.On("GetResource", ctx, request)} +} + +func (_c *MockBundleDeploymentsInterface_GetResource_Call) Run(run func(ctx context.Context, request bundledeployments.GetResourceRequest)) *MockBundleDeploymentsInterface_GetResource_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(bundledeployments.GetResourceRequest)) + }) + return _c +} + +func (_c *MockBundleDeploymentsInterface_GetResource_Call) Return(_a0 *bundledeployments.Resource, _a1 error) *MockBundleDeploymentsInterface_GetResource_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockBundleDeploymentsInterface_GetResource_Call) RunAndReturn(run func(context.Context, bundledeployments.GetResourceRequest) (*bundledeployments.Resource, error)) *MockBundleDeploymentsInterface_GetResource_Call { + _c.Call.Return(run) + return _c +} + +// GetVersion provides a mock function with given fields: ctx, request +func (_m *MockBundleDeploymentsInterface) GetVersion(ctx context.Context, request bundledeployments.GetVersionRequest) (*bundledeployments.Version, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for GetVersion") + } + + var r0 *bundledeployments.Version + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, bundledeployments.GetVersionRequest) (*bundledeployments.Version, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, bundledeployments.GetVersionRequest) *bundledeployments.Version); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*bundledeployments.Version) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, bundledeployments.GetVersionRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockBundleDeploymentsInterface_GetVersion_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetVersion' +type MockBundleDeploymentsInterface_GetVersion_Call struct { + *mock.Call +} + +// GetVersion is a helper method to define mock.On call +// - ctx context.Context +// - request bundledeployments.GetVersionRequest +func (_e *MockBundleDeploymentsInterface_Expecter) GetVersion(ctx interface{}, request interface{}) *MockBundleDeploymentsInterface_GetVersion_Call { + return &MockBundleDeploymentsInterface_GetVersion_Call{Call: _e.mock.On("GetVersion", ctx, request)} +} + +func (_c *MockBundleDeploymentsInterface_GetVersion_Call) Run(run func(ctx context.Context, request bundledeployments.GetVersionRequest)) *MockBundleDeploymentsInterface_GetVersion_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(bundledeployments.GetVersionRequest)) + }) + return _c +} + +func (_c *MockBundleDeploymentsInterface_GetVersion_Call) Return(_a0 *bundledeployments.Version, _a1 error) *MockBundleDeploymentsInterface_GetVersion_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockBundleDeploymentsInterface_GetVersion_Call) RunAndReturn(run func(context.Context, bundledeployments.GetVersionRequest) (*bundledeployments.Version, error)) *MockBundleDeploymentsInterface_GetVersion_Call { + _c.Call.Return(run) + return _c +} + +// Heartbeat provides a mock function with given fields: ctx, request +func (_m *MockBundleDeploymentsInterface) Heartbeat(ctx context.Context, request bundledeployments.HeartbeatRequest) (*bundledeployments.HeartbeatResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Heartbeat") + } + + var r0 *bundledeployments.HeartbeatResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, bundledeployments.HeartbeatRequest) (*bundledeployments.HeartbeatResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, bundledeployments.HeartbeatRequest) *bundledeployments.HeartbeatResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*bundledeployments.HeartbeatResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, bundledeployments.HeartbeatRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockBundleDeploymentsInterface_Heartbeat_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Heartbeat' +type MockBundleDeploymentsInterface_Heartbeat_Call struct { + *mock.Call +} + +// Heartbeat is a helper method to define mock.On call +// - ctx context.Context +// - request bundledeployments.HeartbeatRequest +func (_e *MockBundleDeploymentsInterface_Expecter) Heartbeat(ctx interface{}, request interface{}) *MockBundleDeploymentsInterface_Heartbeat_Call { + return &MockBundleDeploymentsInterface_Heartbeat_Call{Call: _e.mock.On("Heartbeat", ctx, request)} +} + +func (_c *MockBundleDeploymentsInterface_Heartbeat_Call) Run(run func(ctx context.Context, request bundledeployments.HeartbeatRequest)) *MockBundleDeploymentsInterface_Heartbeat_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(bundledeployments.HeartbeatRequest)) + }) + return _c +} + +func (_c *MockBundleDeploymentsInterface_Heartbeat_Call) Return(_a0 *bundledeployments.HeartbeatResponse, _a1 error) *MockBundleDeploymentsInterface_Heartbeat_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockBundleDeploymentsInterface_Heartbeat_Call) RunAndReturn(run func(context.Context, bundledeployments.HeartbeatRequest) (*bundledeployments.HeartbeatResponse, error)) *MockBundleDeploymentsInterface_Heartbeat_Call { + _c.Call.Return(run) + return _c +} + +// ListDeployments provides a mock function with given fields: ctx, request +func (_m *MockBundleDeploymentsInterface) ListDeployments(ctx context.Context, request bundledeployments.ListDeploymentsRequest) listing.Iterator[bundledeployments.Deployment] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListDeployments") + } + + var r0 listing.Iterator[bundledeployments.Deployment] + if rf, ok := ret.Get(0).(func(context.Context, bundledeployments.ListDeploymentsRequest) listing.Iterator[bundledeployments.Deployment]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[bundledeployments.Deployment]) + } + } + + return r0 +} + +// MockBundleDeploymentsInterface_ListDeployments_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListDeployments' +type MockBundleDeploymentsInterface_ListDeployments_Call struct { + *mock.Call +} + +// ListDeployments is a helper method to define mock.On call +// - ctx context.Context +// - request bundledeployments.ListDeploymentsRequest +func (_e *MockBundleDeploymentsInterface_Expecter) ListDeployments(ctx interface{}, request interface{}) *MockBundleDeploymentsInterface_ListDeployments_Call { + return &MockBundleDeploymentsInterface_ListDeployments_Call{Call: _e.mock.On("ListDeployments", ctx, request)} +} + +func (_c *MockBundleDeploymentsInterface_ListDeployments_Call) Run(run func(ctx context.Context, request bundledeployments.ListDeploymentsRequest)) *MockBundleDeploymentsInterface_ListDeployments_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(bundledeployments.ListDeploymentsRequest)) + }) + return _c +} + +func (_c *MockBundleDeploymentsInterface_ListDeployments_Call) Return(_a0 listing.Iterator[bundledeployments.Deployment]) *MockBundleDeploymentsInterface_ListDeployments_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockBundleDeploymentsInterface_ListDeployments_Call) RunAndReturn(run func(context.Context, bundledeployments.ListDeploymentsRequest) listing.Iterator[bundledeployments.Deployment]) *MockBundleDeploymentsInterface_ListDeployments_Call { + _c.Call.Return(run) + return _c +} + +// ListDeploymentsAll provides a mock function with given fields: ctx, request +func (_m *MockBundleDeploymentsInterface) ListDeploymentsAll(ctx context.Context, request bundledeployments.ListDeploymentsRequest) ([]bundledeployments.Deployment, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListDeploymentsAll") + } + + var r0 []bundledeployments.Deployment + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, bundledeployments.ListDeploymentsRequest) ([]bundledeployments.Deployment, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, bundledeployments.ListDeploymentsRequest) []bundledeployments.Deployment); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]bundledeployments.Deployment) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, bundledeployments.ListDeploymentsRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockBundleDeploymentsInterface_ListDeploymentsAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListDeploymentsAll' +type MockBundleDeploymentsInterface_ListDeploymentsAll_Call struct { + *mock.Call +} + +// ListDeploymentsAll is a helper method to define mock.On call +// - ctx context.Context +// - request bundledeployments.ListDeploymentsRequest +func (_e *MockBundleDeploymentsInterface_Expecter) ListDeploymentsAll(ctx interface{}, request interface{}) *MockBundleDeploymentsInterface_ListDeploymentsAll_Call { + return &MockBundleDeploymentsInterface_ListDeploymentsAll_Call{Call: _e.mock.On("ListDeploymentsAll", ctx, request)} +} + +func (_c *MockBundleDeploymentsInterface_ListDeploymentsAll_Call) Run(run func(ctx context.Context, request bundledeployments.ListDeploymentsRequest)) *MockBundleDeploymentsInterface_ListDeploymentsAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(bundledeployments.ListDeploymentsRequest)) + }) + return _c +} + +func (_c *MockBundleDeploymentsInterface_ListDeploymentsAll_Call) Return(_a0 []bundledeployments.Deployment, _a1 error) *MockBundleDeploymentsInterface_ListDeploymentsAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockBundleDeploymentsInterface_ListDeploymentsAll_Call) RunAndReturn(run func(context.Context, bundledeployments.ListDeploymentsRequest) ([]bundledeployments.Deployment, error)) *MockBundleDeploymentsInterface_ListDeploymentsAll_Call { + _c.Call.Return(run) + return _c +} + +// ListOperations provides a mock function with given fields: ctx, request +func (_m *MockBundleDeploymentsInterface) ListOperations(ctx context.Context, request bundledeployments.ListOperationsRequest) listing.Iterator[bundledeployments.Operation] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListOperations") + } + + var r0 listing.Iterator[bundledeployments.Operation] + if rf, ok := ret.Get(0).(func(context.Context, bundledeployments.ListOperationsRequest) listing.Iterator[bundledeployments.Operation]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[bundledeployments.Operation]) + } + } + + return r0 +} + +// MockBundleDeploymentsInterface_ListOperations_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListOperations' +type MockBundleDeploymentsInterface_ListOperations_Call struct { + *mock.Call +} + +// ListOperations is a helper method to define mock.On call +// - ctx context.Context +// - request bundledeployments.ListOperationsRequest +func (_e *MockBundleDeploymentsInterface_Expecter) ListOperations(ctx interface{}, request interface{}) *MockBundleDeploymentsInterface_ListOperations_Call { + return &MockBundleDeploymentsInterface_ListOperations_Call{Call: _e.mock.On("ListOperations", ctx, request)} +} + +func (_c *MockBundleDeploymentsInterface_ListOperations_Call) Run(run func(ctx context.Context, request bundledeployments.ListOperationsRequest)) *MockBundleDeploymentsInterface_ListOperations_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(bundledeployments.ListOperationsRequest)) + }) + return _c +} + +func (_c *MockBundleDeploymentsInterface_ListOperations_Call) Return(_a0 listing.Iterator[bundledeployments.Operation]) *MockBundleDeploymentsInterface_ListOperations_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockBundleDeploymentsInterface_ListOperations_Call) RunAndReturn(run func(context.Context, bundledeployments.ListOperationsRequest) listing.Iterator[bundledeployments.Operation]) *MockBundleDeploymentsInterface_ListOperations_Call { + _c.Call.Return(run) + return _c +} + +// ListOperationsAll provides a mock function with given fields: ctx, request +func (_m *MockBundleDeploymentsInterface) ListOperationsAll(ctx context.Context, request bundledeployments.ListOperationsRequest) ([]bundledeployments.Operation, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListOperationsAll") + } + + var r0 []bundledeployments.Operation + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, bundledeployments.ListOperationsRequest) ([]bundledeployments.Operation, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, bundledeployments.ListOperationsRequest) []bundledeployments.Operation); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]bundledeployments.Operation) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, bundledeployments.ListOperationsRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockBundleDeploymentsInterface_ListOperationsAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListOperationsAll' +type MockBundleDeploymentsInterface_ListOperationsAll_Call struct { + *mock.Call +} + +// ListOperationsAll is a helper method to define mock.On call +// - ctx context.Context +// - request bundledeployments.ListOperationsRequest +func (_e *MockBundleDeploymentsInterface_Expecter) ListOperationsAll(ctx interface{}, request interface{}) *MockBundleDeploymentsInterface_ListOperationsAll_Call { + return &MockBundleDeploymentsInterface_ListOperationsAll_Call{Call: _e.mock.On("ListOperationsAll", ctx, request)} +} + +func (_c *MockBundleDeploymentsInterface_ListOperationsAll_Call) Run(run func(ctx context.Context, request bundledeployments.ListOperationsRequest)) *MockBundleDeploymentsInterface_ListOperationsAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(bundledeployments.ListOperationsRequest)) + }) + return _c +} + +func (_c *MockBundleDeploymentsInterface_ListOperationsAll_Call) Return(_a0 []bundledeployments.Operation, _a1 error) *MockBundleDeploymentsInterface_ListOperationsAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockBundleDeploymentsInterface_ListOperationsAll_Call) RunAndReturn(run func(context.Context, bundledeployments.ListOperationsRequest) ([]bundledeployments.Operation, error)) *MockBundleDeploymentsInterface_ListOperationsAll_Call { + _c.Call.Return(run) + return _c +} + +// ListResources provides a mock function with given fields: ctx, request +func (_m *MockBundleDeploymentsInterface) ListResources(ctx context.Context, request bundledeployments.ListResourcesRequest) listing.Iterator[bundledeployments.Resource] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListResources") + } + + var r0 listing.Iterator[bundledeployments.Resource] + if rf, ok := ret.Get(0).(func(context.Context, bundledeployments.ListResourcesRequest) listing.Iterator[bundledeployments.Resource]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[bundledeployments.Resource]) + } + } + + return r0 +} + +// MockBundleDeploymentsInterface_ListResources_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListResources' +type MockBundleDeploymentsInterface_ListResources_Call struct { + *mock.Call +} + +// ListResources is a helper method to define mock.On call +// - ctx context.Context +// - request bundledeployments.ListResourcesRequest +func (_e *MockBundleDeploymentsInterface_Expecter) ListResources(ctx interface{}, request interface{}) *MockBundleDeploymentsInterface_ListResources_Call { + return &MockBundleDeploymentsInterface_ListResources_Call{Call: _e.mock.On("ListResources", ctx, request)} +} + +func (_c *MockBundleDeploymentsInterface_ListResources_Call) Run(run func(ctx context.Context, request bundledeployments.ListResourcesRequest)) *MockBundleDeploymentsInterface_ListResources_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(bundledeployments.ListResourcesRequest)) + }) + return _c +} + +func (_c *MockBundleDeploymentsInterface_ListResources_Call) Return(_a0 listing.Iterator[bundledeployments.Resource]) *MockBundleDeploymentsInterface_ListResources_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockBundleDeploymentsInterface_ListResources_Call) RunAndReturn(run func(context.Context, bundledeployments.ListResourcesRequest) listing.Iterator[bundledeployments.Resource]) *MockBundleDeploymentsInterface_ListResources_Call { + _c.Call.Return(run) + return _c +} + +// ListResourcesAll provides a mock function with given fields: ctx, request +func (_m *MockBundleDeploymentsInterface) ListResourcesAll(ctx context.Context, request bundledeployments.ListResourcesRequest) ([]bundledeployments.Resource, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListResourcesAll") + } + + var r0 []bundledeployments.Resource + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, bundledeployments.ListResourcesRequest) ([]bundledeployments.Resource, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, bundledeployments.ListResourcesRequest) []bundledeployments.Resource); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]bundledeployments.Resource) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, bundledeployments.ListResourcesRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockBundleDeploymentsInterface_ListResourcesAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListResourcesAll' +type MockBundleDeploymentsInterface_ListResourcesAll_Call struct { + *mock.Call +} + +// ListResourcesAll is a helper method to define mock.On call +// - ctx context.Context +// - request bundledeployments.ListResourcesRequest +func (_e *MockBundleDeploymentsInterface_Expecter) ListResourcesAll(ctx interface{}, request interface{}) *MockBundleDeploymentsInterface_ListResourcesAll_Call { + return &MockBundleDeploymentsInterface_ListResourcesAll_Call{Call: _e.mock.On("ListResourcesAll", ctx, request)} +} + +func (_c *MockBundleDeploymentsInterface_ListResourcesAll_Call) Run(run func(ctx context.Context, request bundledeployments.ListResourcesRequest)) *MockBundleDeploymentsInterface_ListResourcesAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(bundledeployments.ListResourcesRequest)) + }) + return _c +} + +func (_c *MockBundleDeploymentsInterface_ListResourcesAll_Call) Return(_a0 []bundledeployments.Resource, _a1 error) *MockBundleDeploymentsInterface_ListResourcesAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockBundleDeploymentsInterface_ListResourcesAll_Call) RunAndReturn(run func(context.Context, bundledeployments.ListResourcesRequest) ([]bundledeployments.Resource, error)) *MockBundleDeploymentsInterface_ListResourcesAll_Call { + _c.Call.Return(run) + return _c +} + +// ListVersions provides a mock function with given fields: ctx, request +func (_m *MockBundleDeploymentsInterface) ListVersions(ctx context.Context, request bundledeployments.ListVersionsRequest) listing.Iterator[bundledeployments.Version] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListVersions") + } + + var r0 listing.Iterator[bundledeployments.Version] + if rf, ok := ret.Get(0).(func(context.Context, bundledeployments.ListVersionsRequest) listing.Iterator[bundledeployments.Version]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[bundledeployments.Version]) + } + } + + return r0 +} + +// MockBundleDeploymentsInterface_ListVersions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListVersions' +type MockBundleDeploymentsInterface_ListVersions_Call struct { + *mock.Call +} + +// ListVersions is a helper method to define mock.On call +// - ctx context.Context +// - request bundledeployments.ListVersionsRequest +func (_e *MockBundleDeploymentsInterface_Expecter) ListVersions(ctx interface{}, request interface{}) *MockBundleDeploymentsInterface_ListVersions_Call { + return &MockBundleDeploymentsInterface_ListVersions_Call{Call: _e.mock.On("ListVersions", ctx, request)} +} + +func (_c *MockBundleDeploymentsInterface_ListVersions_Call) Run(run func(ctx context.Context, request bundledeployments.ListVersionsRequest)) *MockBundleDeploymentsInterface_ListVersions_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(bundledeployments.ListVersionsRequest)) + }) + return _c +} + +func (_c *MockBundleDeploymentsInterface_ListVersions_Call) Return(_a0 listing.Iterator[bundledeployments.Version]) *MockBundleDeploymentsInterface_ListVersions_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockBundleDeploymentsInterface_ListVersions_Call) RunAndReturn(run func(context.Context, bundledeployments.ListVersionsRequest) listing.Iterator[bundledeployments.Version]) *MockBundleDeploymentsInterface_ListVersions_Call { + _c.Call.Return(run) + return _c +} + +// ListVersionsAll provides a mock function with given fields: ctx, request +func (_m *MockBundleDeploymentsInterface) ListVersionsAll(ctx context.Context, request bundledeployments.ListVersionsRequest) ([]bundledeployments.Version, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListVersionsAll") + } + + var r0 []bundledeployments.Version + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, bundledeployments.ListVersionsRequest) ([]bundledeployments.Version, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, bundledeployments.ListVersionsRequest) []bundledeployments.Version); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]bundledeployments.Version) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, bundledeployments.ListVersionsRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockBundleDeploymentsInterface_ListVersionsAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListVersionsAll' +type MockBundleDeploymentsInterface_ListVersionsAll_Call struct { + *mock.Call +} + +// ListVersionsAll is a helper method to define mock.On call +// - ctx context.Context +// - request bundledeployments.ListVersionsRequest +func (_e *MockBundleDeploymentsInterface_Expecter) ListVersionsAll(ctx interface{}, request interface{}) *MockBundleDeploymentsInterface_ListVersionsAll_Call { + return &MockBundleDeploymentsInterface_ListVersionsAll_Call{Call: _e.mock.On("ListVersionsAll", ctx, request)} +} + +func (_c *MockBundleDeploymentsInterface_ListVersionsAll_Call) Run(run func(ctx context.Context, request bundledeployments.ListVersionsRequest)) *MockBundleDeploymentsInterface_ListVersionsAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(bundledeployments.ListVersionsRequest)) + }) + return _c +} + +func (_c *MockBundleDeploymentsInterface_ListVersionsAll_Call) Return(_a0 []bundledeployments.Version, _a1 error) *MockBundleDeploymentsInterface_ListVersionsAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockBundleDeploymentsInterface_ListVersionsAll_Call) RunAndReturn(run func(context.Context, bundledeployments.ListVersionsRequest) ([]bundledeployments.Version, error)) *MockBundleDeploymentsInterface_ListVersionsAll_Call { + _c.Call.Return(run) + return _c +} + +// NewMockBundleDeploymentsInterface creates a new instance of MockBundleDeploymentsInterface. 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 NewMockBundleDeploymentsInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *MockBundleDeploymentsInterface { + mock := &MockBundleDeploymentsInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/service/aisearch/api.go b/service/aisearch/api.go new file mode 100755 index 000000000..ebd2c9d0b --- /dev/null +++ b/service/aisearch/api.go @@ -0,0 +1,94 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +// **AI Search Endpoint**: Represents the compute resources to host AI Search +// indexes. AIP-conformant replacement for the legacy VectorSearchEndpoints API; +// functionally equivalent. +package aisearch + +import ( + "context" + + "github.com/databricks/databricks-sdk-go/client" + "github.com/databricks/databricks-sdk-go/listing" +) + +type AiSearchInterface interface { + + // Create a new AI Search endpoint. + CreateEndpoint(ctx context.Context, request CreateEndpointRequest) (*Endpoint, error) + + // Create a new AI Search index. + CreateIndex(ctx context.Context, request CreateIndexRequest) (*Index, error) + + // Delete an AI Search endpoint. + DeleteEndpoint(ctx context.Context, request DeleteEndpointRequest) error + + // Delete an AI Search index. + DeleteIndex(ctx context.Context, request DeleteIndexRequest) error + + // Get details for a single AI Search endpoint. + GetEndpoint(ctx context.Context, request GetEndpointRequest) (*Endpoint, error) + + // Get details for a single AI Search index. + GetIndex(ctx context.Context, request GetIndexRequest) (*Index, error) + + // List AI Search endpoints in a workspace. + // + // This method is generated by Databricks SDK Code Generator. + ListEndpoints(ctx context.Context, request ListEndpointsRequest) listing.Iterator[Endpoint] + + // List AI Search endpoints in a workspace. + // + // This method is generated by Databricks SDK Code Generator. + ListEndpointsAll(ctx context.Context, request ListEndpointsRequest) ([]Endpoint, error) + + // List AI Search indexes on an endpoint. + // + // This method is generated by Databricks SDK Code Generator. + ListIndexes(ctx context.Context, request ListIndexesRequest) listing.Iterator[Index] + + // List AI Search indexes on an endpoint. + // + // This method is generated by Databricks SDK Code Generator. + ListIndexesAll(ctx context.Context, request ListIndexesRequest) ([]Index, error) + + // Query (search) an AI Search index. Read-only, so a read-scoped token may + // invoke it. + QueryIndex(ctx context.Context, request QueryIndexRequest) (*QueryIndexResponse, error) + + // Remove rows by primary key from a Direct Access AI Search index. + RemoveData(ctx context.Context, request RemoveDataRequest) (*RemoveDataResponse, error) + + // Scan (paginate over) the rows of an AI Search index. + ScanIndex(ctx context.Context, request ScanIndexRequest) (*ScanIndexResponse, error) + + // Synchronize a Delta Sync AI Search index with its source Delta table. Applies + // only to Delta Sync indexes; Direct Access indexes are written via the + // data-plane upsert path. + SyncIndex(ctx context.Context, request SyncIndexRequest) (*SyncIndexResponse, error) + + // Update an existing AI Search endpoint. Multi-bucket masks are supported and + // dispatched in deterministic bucket order: budget policy, custom tags, + // throughput, then scaling/replicas. Per-bucket dispatch is not atomic across + // buckets — if a later bucket fails, earlier buckets may already have been + // applied. + UpdateEndpoint(ctx context.Context, request UpdateEndpointRequest) (*Endpoint, error) + + // Upsert rows into a Direct Access AI Search index. + UpsertData(ctx context.Context, request UpsertDataRequest) (*UpsertDataResponse, error) +} + +func NewAiSearch(client *client.DatabricksClient) *AiSearchAPI { + return &AiSearchAPI{ + aiSearchImpl: aiSearchImpl{ + client: client, + }, + } +} + +// **AI Search Endpoint**: Represents the compute resources to host AI Search +// indexes. AIP-conformant replacement for the legacy VectorSearchEndpoints API; +// functionally equivalent. +type AiSearchAPI struct { + aiSearchImpl +} diff --git a/service/aisearch/impl.go b/service/aisearch/impl.go new file mode 100755 index 000000000..a866f38ae --- /dev/null +++ b/service/aisearch/impl.go @@ -0,0 +1,300 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package aisearch + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + "strings" + + "github.com/databricks/databricks-sdk-go/client" + "github.com/databricks/databricks-sdk-go/listing" + "github.com/databricks/databricks-sdk-go/useragent" + "golang.org/x/exp/slices" +) + +// unexported type that holds implementations of just AiSearch API methods +type aiSearchImpl struct { + client *client.DatabricksClient +} + +func (a *aiSearchImpl) CreateEndpoint(ctx context.Context, request CreateEndpointRequest) (*Endpoint, error) { + var endpoint Endpoint + path := fmt.Sprintf("/api/2.0/ai-search/%v/endpoints", request.Parent) + queryParams := make(map[string]any) + + if request.EndpointId != "" || slices.Contains(request.ForceSendFields, "EndpointId") { + queryParams["endpoint_id"] = request.EndpointId + } + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + cfg := a.client.Config + if cfg.WorkspaceID != "" { + headers["X-Databricks-Workspace-Id"] = cfg.WorkspaceID + } + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request.Endpoint, &endpoint) + return &endpoint, err +} + +func (a *aiSearchImpl) CreateIndex(ctx context.Context, request CreateIndexRequest) (*Index, error) { + var index Index + path := fmt.Sprintf("/api/2.0/ai-search/%v/indexes", request.Parent) + queryParams := make(map[string]any) + + if request.IndexId != "" || slices.Contains(request.ForceSendFields, "IndexId") { + queryParams["index_id"] = request.IndexId + } + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + cfg := a.client.Config + if cfg.WorkspaceID != "" { + headers["X-Databricks-Workspace-Id"] = cfg.WorkspaceID + } + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request.Index, &index) + return &index, err +} + +func (a *aiSearchImpl) DeleteEndpoint(ctx context.Context, request DeleteEndpointRequest) error { + path := fmt.Sprintf("/api/2.0/ai-search/%v", request.Name) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + cfg := a.client.Config + if cfg.WorkspaceID != "" { + headers["X-Databricks-Workspace-Id"] = cfg.WorkspaceID + } + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) + return err +} + +func (a *aiSearchImpl) DeleteIndex(ctx context.Context, request DeleteIndexRequest) error { + path := fmt.Sprintf("/api/2.0/ai-search/%v", request.Name) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + cfg := a.client.Config + if cfg.WorkspaceID != "" { + headers["X-Databricks-Workspace-Id"] = cfg.WorkspaceID + } + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) + return err +} + +func (a *aiSearchImpl) GetEndpoint(ctx context.Context, request GetEndpointRequest) (*Endpoint, error) { + var endpoint Endpoint + path := fmt.Sprintf("/api/2.0/ai-search/%v", request.Name) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + cfg := a.client.Config + if cfg.WorkspaceID != "" { + headers["X-Databricks-Workspace-Id"] = cfg.WorkspaceID + } + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &endpoint) + return &endpoint, err +} + +func (a *aiSearchImpl) GetIndex(ctx context.Context, request GetIndexRequest) (*Index, error) { + var index Index + path := fmt.Sprintf("/api/2.0/ai-search/%v", request.Name) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + cfg := a.client.Config + if cfg.WorkspaceID != "" { + headers["X-Databricks-Workspace-Id"] = cfg.WorkspaceID + } + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &index) + return &index, err +} + +// List AI Search endpoints in a workspace. +func (a *aiSearchImpl) ListEndpoints(ctx context.Context, request ListEndpointsRequest) listing.Iterator[Endpoint] { + + getNextPage := func(ctx context.Context, req ListEndpointsRequest) (*ListEndpointsResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.internalListEndpoints(ctx, req) + } + getItems := func(resp *ListEndpointsResponse) []Endpoint { + return resp.Endpoints + } + getNextReq := func(resp *ListEndpointsResponse) *ListEndpointsRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// List AI Search endpoints in a workspace. +func (a *aiSearchImpl) ListEndpointsAll(ctx context.Context, request ListEndpointsRequest) ([]Endpoint, error) { + iterator := a.ListEndpoints(ctx, request) + return listing.ToSlice[Endpoint](ctx, iterator) +} + +func (a *aiSearchImpl) internalListEndpoints(ctx context.Context, request ListEndpointsRequest) (*ListEndpointsResponse, error) { + var listEndpointsResponse ListEndpointsResponse + path := fmt.Sprintf("/api/2.0/ai-search/%v/endpoints", request.Parent) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + cfg := a.client.Config + if cfg.WorkspaceID != "" { + headers["X-Databricks-Workspace-Id"] = cfg.WorkspaceID + } + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listEndpointsResponse) + return &listEndpointsResponse, err +} + +// List AI Search indexes on an endpoint. +func (a *aiSearchImpl) ListIndexes(ctx context.Context, request ListIndexesRequest) listing.Iterator[Index] { + + getNextPage := func(ctx context.Context, req ListIndexesRequest) (*ListIndexesResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.internalListIndexes(ctx, req) + } + getItems := func(resp *ListIndexesResponse) []Index { + return resp.Indexes + } + getNextReq := func(resp *ListIndexesResponse) *ListIndexesRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// List AI Search indexes on an endpoint. +func (a *aiSearchImpl) ListIndexesAll(ctx context.Context, request ListIndexesRequest) ([]Index, error) { + iterator := a.ListIndexes(ctx, request) + return listing.ToSlice[Index](ctx, iterator) +} + +func (a *aiSearchImpl) internalListIndexes(ctx context.Context, request ListIndexesRequest) (*ListIndexesResponse, error) { + var listIndexesResponse ListIndexesResponse + path := fmt.Sprintf("/api/2.0/ai-search/%v/indexes", request.Parent) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + cfg := a.client.Config + if cfg.WorkspaceID != "" { + headers["X-Databricks-Workspace-Id"] = cfg.WorkspaceID + } + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listIndexesResponse) + return &listIndexesResponse, err +} + +func (a *aiSearchImpl) QueryIndex(ctx context.Context, request QueryIndexRequest) (*QueryIndexResponse, error) { + var queryIndexResponse QueryIndexResponse + path := fmt.Sprintf("/api/2.0/ai-search/%v:query", request.Name) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + cfg := a.client.Config + if cfg.WorkspaceID != "" { + headers["X-Databricks-Workspace-Id"] = cfg.WorkspaceID + } + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &queryIndexResponse) + return &queryIndexResponse, err +} + +func (a *aiSearchImpl) RemoveData(ctx context.Context, request RemoveDataRequest) (*RemoveDataResponse, error) { + var removeDataResponse RemoveDataResponse + path := fmt.Sprintf("/api/2.0/ai-search/%v:removeData", request.Name) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + cfg := a.client.Config + if cfg.WorkspaceID != "" { + headers["X-Databricks-Workspace-Id"] = cfg.WorkspaceID + } + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &removeDataResponse) + return &removeDataResponse, err +} + +func (a *aiSearchImpl) ScanIndex(ctx context.Context, request ScanIndexRequest) (*ScanIndexResponse, error) { + var scanIndexResponse ScanIndexResponse + path := fmt.Sprintf("/api/2.0/ai-search/%v:scan", request.Name) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + cfg := a.client.Config + if cfg.WorkspaceID != "" { + headers["X-Databricks-Workspace-Id"] = cfg.WorkspaceID + } + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &scanIndexResponse) + return &scanIndexResponse, err +} + +func (a *aiSearchImpl) SyncIndex(ctx context.Context, request SyncIndexRequest) (*SyncIndexResponse, error) { + var syncIndexResponse SyncIndexResponse + path := fmt.Sprintf("/api/2.0/ai-search/%v:sync", request.Name) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + cfg := a.client.Config + if cfg.WorkspaceID != "" { + headers["X-Databricks-Workspace-Id"] = cfg.WorkspaceID + } + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &syncIndexResponse) + return &syncIndexResponse, err +} + +func (a *aiSearchImpl) UpdateEndpoint(ctx context.Context, request UpdateEndpointRequest) (*Endpoint, error) { + var endpoint Endpoint + path := fmt.Sprintf("/api/2.0/ai-search/%v", request.Name) + queryParams := make(map[string]any) + + updateMaskJson, updateMaskMarshallError := json.Marshal(request.UpdateMask) + if updateMaskMarshallError != nil { + return nil, updateMaskMarshallError + } + + queryParams["update_mask"] = strings.Trim(string(updateMaskJson), `"`) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + cfg := a.client.Config + if cfg.WorkspaceID != "" { + headers["X-Databricks-Workspace-Id"] = cfg.WorkspaceID + } + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request.Endpoint, &endpoint) + return &endpoint, err +} + +func (a *aiSearchImpl) UpsertData(ctx context.Context, request UpsertDataRequest) (*UpsertDataResponse, error) { + var upsertDataResponse UpsertDataResponse + path := fmt.Sprintf("/api/2.0/ai-search/%v:upsertData", request.Name) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + cfg := a.client.Config + if cfg.WorkspaceID != "" { + headers["X-Databricks-Workspace-Id"] = cfg.WorkspaceID + } + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &upsertDataResponse) + return &upsertDataResponse, err +} diff --git a/service/aisearch/interface.go b/service/aisearch/interface.go new file mode 100755 index 000000000..414dbe389 --- /dev/null +++ b/service/aisearch/interface.go @@ -0,0 +1,64 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package aisearch + +import ( + "context" +) + +// **AI Search Endpoint**: Represents the compute resources to host AI Search +// indexes. AIP-conformant replacement for the legacy VectorSearchEndpoints API; +// functionally equivalent. +// +// Deprecated: Do not use this interface, it will be removed in a future version of the SDK. +type AiSearchService interface { + + // Create a new AI Search endpoint. + CreateEndpoint(ctx context.Context, request CreateEndpointRequest) (*Endpoint, error) + + // Create a new AI Search index. + CreateIndex(ctx context.Context, request CreateIndexRequest) (*Index, error) + + // Delete an AI Search endpoint. + DeleteEndpoint(ctx context.Context, request DeleteEndpointRequest) error + + // Delete an AI Search index. + DeleteIndex(ctx context.Context, request DeleteIndexRequest) error + + // Get details for a single AI Search endpoint. + GetEndpoint(ctx context.Context, request GetEndpointRequest) (*Endpoint, error) + + // Get details for a single AI Search index. + GetIndex(ctx context.Context, request GetIndexRequest) (*Index, error) + + // List AI Search endpoints in a workspace. + ListEndpoints(ctx context.Context, request ListEndpointsRequest) (*ListEndpointsResponse, error) + + // List AI Search indexes on an endpoint. + ListIndexes(ctx context.Context, request ListIndexesRequest) (*ListIndexesResponse, error) + + // Query (search) an AI Search index. Read-only, so a read-scoped token may + // invoke it. + QueryIndex(ctx context.Context, request QueryIndexRequest) (*QueryIndexResponse, error) + + // Remove rows by primary key from a Direct Access AI Search index. + RemoveData(ctx context.Context, request RemoveDataRequest) (*RemoveDataResponse, error) + + // Scan (paginate over) the rows of an AI Search index. + ScanIndex(ctx context.Context, request ScanIndexRequest) (*ScanIndexResponse, error) + + // Synchronize a Delta Sync AI Search index with its source Delta table. + // Applies only to Delta Sync indexes; Direct Access indexes are written via + // the data-plane upsert path. + SyncIndex(ctx context.Context, request SyncIndexRequest) (*SyncIndexResponse, error) + + // Update an existing AI Search endpoint. Multi-bucket masks are supported + // and dispatched in deterministic bucket order: budget policy, custom tags, + // throughput, then scaling/replicas. Per-bucket dispatch is not atomic + // across buckets — if a later bucket fails, earlier buckets may already + // have been applied. + UpdateEndpoint(ctx context.Context, request UpdateEndpointRequest) (*Endpoint, error) + + // Upsert rows into a Direct Access AI Search index. + UpsertData(ctx context.Context, request UpsertDataRequest) (*UpsertDataResponse, error) +} diff --git a/service/aisearch/model.go b/service/aisearch/model.go new file mode 100755 index 000000000..540f41fc3 --- /dev/null +++ b/service/aisearch/model.go @@ -0,0 +1,1192 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package aisearch + +import ( + "encoding/json" + "fmt" + + "github.com/databricks/databricks-sdk-go/common/types/fieldmask" + "github.com/databricks/databricks-sdk-go/common/types/time" + "github.com/databricks/databricks-sdk-go/marshal" +) + +// Column information (name and data type) for an index column. Surfaced on +// `Index.column_info`. +type ColumnInfo struct { + // Name of the column. + Name string `json:"name,omitempty"` + // Data type of the column (e.g., "string", "int", "array"). + TypeText string `json:"type_text,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ColumnInfo) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ColumnInfo) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type CreateEndpointRequest struct { + // The Endpoint resource to create. Fields other than `endpoint.name` carry + // the desired configuration; `endpoint.name` is server-assigned from + // `parent` and `endpoint_id`. + Endpoint Endpoint `json:"endpoint"` + // The user-supplied short name for the Endpoint, per AIP-133. The server + // composes the full `Endpoint.name` as `{parent}/endpoints/{endpoint_id}`. + // AIP-133 does not list `endpoint_id` as a fields-may-be-required entry, so + // we annotate it OPTIONAL on the wire; the server still rejects empty + // values with INVALID_PARAMETER_VALUE. + EndpointId string `json:"-" url:"endpoint_id,omitempty"` + // The Workspace where this Endpoint will be created. Format: + // `workspaces/{workspace_id}` + Parent string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *CreateEndpointRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s CreateEndpointRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type CreateIndexRequest struct { + // The Index resource to create. Fields other than `index.name` carry the + // desired configuration; `index.name` is server-assigned from `parent` and + // `index_id`. + Index Index `json:"index"` + // The user-supplied Unity Catalog table name for the Index, per AIP-133. + // The server composes the full `Index.name` as + // `{parent}/indexes/{index_id}`. AIP-133 does not list `index_id` as a + // fields-may-be-required entry, so we annotate it OPTIONAL on the wire; the + // server still rejects empty values with INVALID_PARAMETER_VALUE. + IndexId string `json:"-" url:"index_id,omitempty"` + // The Endpoint where this Index will be created. Format: + // `workspaces/{workspace_id}/endpoints/{endpoint_id}` + Parent string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *CreateIndexRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s CreateIndexRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// User-defined key/value tag attached to an AI Search endpoint for cost +// attribution and access control. +type CustomTag struct { + // Key field for an AI Search endpoint tag. + Key string `json:"key"` + // [Optional] Value field for an AI Search endpoint tag. + Value string `json:"value,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *CustomTag) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s CustomTag) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Per-row outcome of a data-plane upsert or delete operation. +type DataModificationResult struct { + // Primary keys of rows that failed to process. + FailedPrimaryKeys []string `json:"failed_primary_keys,omitempty"` + // Count of rows processed successfully. + SuccessRowCount int64 `json:"success_row_count,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *DataModificationResult) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s DataModificationResult) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Overall outcome of a data-plane upsert or delete. Mirrors the legacy +// `databricks.brickindexscheduler.UpsertDeleteDataStatus` value-for-value. +type DataModificationStatus string + +const DataModificationStatusFailure DataModificationStatus = `FAILURE` + +const DataModificationStatusPartialSuccess DataModificationStatus = `PARTIAL_SUCCESS` + +const DataModificationStatusSuccess DataModificationStatus = `SUCCESS` + +// String representation for [fmt.Print] +func (f *DataModificationStatus) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *DataModificationStatus) Set(v string) error { + switch v { + case `FAILURE`, `PARTIAL_SUCCESS`, `SUCCESS`: + *f = DataModificationStatus(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "FAILURE", "PARTIAL_SUCCESS", "SUCCESS"`, v) + } +} + +// Values returns all possible values for DataModificationStatus. +// +// There is no guarantee on the order of the values in the slice. +func (f *DataModificationStatus) Values() []DataModificationStatus { + return []DataModificationStatus{ + DataModificationStatusFailure, + DataModificationStatusPartialSuccess, + DataModificationStatusSuccess, + } +} + +// Type always returns DataModificationStatus to satisfy [pflag.Value] interface +func (f *DataModificationStatus) Type() string { + return "DataModificationStatus" +} + +type DeleteEndpointRequest struct { + // Full resource name of the endpoint to delete. Format: + // `workspaces/{workspace_id}/endpoints/{endpoint_id}` + Name string `json:"-" url:"-"` +} + +type DeleteIndexRequest struct { + // Full resource name of the index to delete. Format: + // `workspaces/{workspace_id}/endpoints/{endpoint_id}/indexes/{index_id}` + Name string `json:"-" url:"-"` +} + +// Specification for a Delta Sync index — the index is kept in sync with a +// source Delta table. +type DeltaSyncIndexSpec struct { + // [Optional] Select the columns to sync with the index. If left blank, all + // columns from the source table are synced. The primary key column and + // embedding source or vector column are always synced. + ColumnsToSync []string `json:"columns_to_sync,omitempty"` + // The columns that contain the embedding source. + EmbeddingSourceColumns []EmbeddingSourceColumn `json:"embedding_source_columns,omitempty"` + // The columns that contain the embedding vectors. + EmbeddingVectorColumns []EmbeddingVectorColumn `json:"embedding_vector_columns,omitempty"` + // [Optional] Name of the Delta table to sync the index contents and + // computed embeddings to. + EmbeddingWritebackTable string `json:"embedding_writeback_table,omitempty"` + // The ID of the pipeline that is used to sync the index. + PipelineId string `json:"pipeline_id,omitempty"` + // Pipeline execution mode. Required on create — the backend rejects an + // unset value. Storage Optimized endpoints accept only `TRIGGERED`; + // Standard endpoints accept both. No explicit `stage` — a REQUIRED field + // staged below its service would be dropped from combined specs while + // remaining in `required`, tripping the OpenAPI required-vs-properties + // consistency check. The field inherits the service's launch stage. + PipelineType PipelineType `json:"pipeline_type"` + // The full name of the source Delta table. + SourceTable string `json:"source_table,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *DeltaSyncIndexSpec) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s DeltaSyncIndexSpec) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Specification for a Direct Access index — the customer manages vectors and +// metadata directly. +type DirectAccessIndexSpec struct { + // The columns that contain the embedding source. + EmbeddingSourceColumns []EmbeddingSourceColumn `json:"embedding_source_columns,omitempty"` + // The columns that contain the embedding vectors. + EmbeddingVectorColumns []EmbeddingVectorColumn `json:"embedding_vector_columns,omitempty"` + // The schema of the index in JSON format. Supported types are `integer`, + // `long`, `float`, `double`, `boolean`, `string`, `date`, `timestamp`. + // Supported types for vector columns: `array`, `array`. + SchemaJson string `json:"schema_json,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *DirectAccessIndexSpec) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s DirectAccessIndexSpec) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Name of an embedding source column and its associated embedding model +// endpoint. +type EmbeddingSourceColumn struct { + // Name of the embedding model endpoint, used by default for both ingestion + // and querying. + EmbeddingModelEndpoint string `json:"embedding_model_endpoint,omitempty"` + // Name of the embedding model endpoint which, if specified, is used for + // querying (not ingestion). + ModelEndpointNameForQuery string `json:"model_endpoint_name_for_query,omitempty"` + // Name of the source column. + Name string `json:"name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *EmbeddingSourceColumn) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s EmbeddingSourceColumn) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Name and dimension of an embedding vector column. +type EmbeddingVectorColumn struct { + // Dimension of the embedding vector. + EmbeddingDimension int `json:"embedding_dimension,omitempty"` + // Name of the column. + Name string `json:"name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *EmbeddingVectorColumn) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s EmbeddingVectorColumn) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// An AI Search endpoint — compute infrastructure that hosts AI Search indexes +// and serves queries against them. Customers create, query, and delete +// endpoints; the system manages provisioning, scaling, and health status. +type Endpoint struct { + // The user-selected budget policy id for the endpoint. + BudgetPolicyId string `json:"budget_policy_id,omitempty"` + // Time the endpoint was created. + CreateTime *time.Time `json:"create_time,omitempty"` + // Creator of the endpoint + Creator string `json:"creator,omitempty"` + // The custom tags assigned to the endpoint + CustomTags []CustomTag `json:"custom_tags,omitempty"` + // The budget policy id applied to the endpoint + EffectiveBudgetPolicyId string `json:"effective_budget_policy_id,omitempty"` + // Current status of the endpoint + EndpointStatus *EndpointStatus `json:"endpoint_status,omitempty"` + // Type of endpoint. Required on create and immutable thereafter. + EndpointType EndpointType `json:"endpoint_type"` + // Unique identifier of the endpoint + Id string `json:"id,omitempty"` + // Number of indexes on the endpoint + IndexCount int `json:"index_count,omitempty"` + // User who last updated the endpoint + LastUpdatedUser string `json:"last_updated_user,omitempty"` + // Name of the AI Search endpoint. Server-assigned full resource path + // (`workspaces/{workspace}/endpoints/{endpoint}`) on output. On create, the + // user-supplied short name is conveyed via + // `CreateEndpointRequest.endpoint_id`; the server composes the full `name` + // and returns it on the response. + Name string `json:"name,omitempty"` + // The client-supplied desired number of replicas for the endpoint, applied + // at create/update time. Mutually exclusive with `target_qps`. + ReplicaCount int `json:"replica_count,omitempty"` + // Scaling information for the endpoint + ScalingInfo *EndpointScalingInfo `json:"scaling_info,omitempty"` + // Target QPS for the endpoint. Mutually exclusive with `replica_count`. + // Best-effort; the system does not guarantee this QPS will be achieved. + TargetQps int `json:"target_qps,omitempty"` + // Throughput information for the endpoint + ThroughputInfo *EndpointThroughputInfo `json:"throughput_info,omitempty"` + // Time the endpoint was last updated. + UpdateTime *time.Time `json:"update_time,omitempty"` + // The usage policy id applied to the endpoint. + UsagePolicyId string `json:"usage_policy_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *Endpoint) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s Endpoint) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Scaling information for a Storage Optimized endpoint — current scaling +// state and the requested QPS target the system is scaling toward. +type EndpointScalingInfo struct { + // The requested QPS target for the endpoint. Best-effort; the system does + // not guarantee this QPS will be achieved. + RequestedTargetQps int64 `json:"requested_target_qps,omitempty"` + // The current state of the scaling change request. + State ScalingChangeState `json:"state,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *EndpointScalingInfo) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s EndpointScalingInfo) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Lifecycle and health state of an AI Search endpoint, along with any +// human-readable detail about that state. +type EndpointStatus struct { + // Human-readable detail about the endpoint's current state or the reason + // for a state transition. + Message string `json:"message,omitempty"` + // Current lifecycle state of the endpoint. See `State` for the meaning of + // each value. + State EndpointStatusState `json:"state,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *EndpointStatus) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s EndpointStatus) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Lifecycle state of an AI Search endpoint, used by both Standard and Storage +// Optimized SKUs. +type EndpointStatusState string + +const EndpointStatusStateDeleted EndpointStatusState = `DELETED` + +const EndpointStatusStateOffline EndpointStatusState = `OFFLINE` + +const EndpointStatusStateOnline EndpointStatusState = `ONLINE` + +const EndpointStatusStateProvisioning EndpointStatusState = `PROVISIONING` + +const EndpointStatusStateRedState EndpointStatusState = `RED_STATE` + +const EndpointStatusStateYellowState EndpointStatusState = `YELLOW_STATE` + +// String representation for [fmt.Print] +func (f *EndpointStatusState) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *EndpointStatusState) Set(v string) error { + switch v { + case `DELETED`, `OFFLINE`, `ONLINE`, `PROVISIONING`, `RED_STATE`, `YELLOW_STATE`: + *f = EndpointStatusState(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "DELETED", "OFFLINE", "ONLINE", "PROVISIONING", "RED_STATE", "YELLOW_STATE"`, v) + } +} + +// Values returns all possible values for EndpointStatusState. +// +// There is no guarantee on the order of the values in the slice. +func (f *EndpointStatusState) Values() []EndpointStatusState { + return []EndpointStatusState{ + EndpointStatusStateDeleted, + EndpointStatusStateOffline, + EndpointStatusStateOnline, + EndpointStatusStateProvisioning, + EndpointStatusStateRedState, + EndpointStatusStateYellowState, + } +} + +// Type always returns EndpointStatusState to satisfy [pflag.Value] interface +func (f *EndpointStatusState) Type() string { + return "EndpointStatusState" +} + +// Throughput information for an AI Search endpoint, including requested and +// current concurrency settings. +type EndpointThroughputInfo struct { + // Additional information about the throughput change request + ChangeRequestMessage string `json:"change_request_message,omitempty"` + // The state of the most recent throughput change request + ChangeRequestState ThroughputChangeRequestState `json:"change_request_state,omitempty"` + // The current concurrency (total CPU) allocated to the endpoint + CurrentConcurrency float64 `json:"current_concurrency,omitempty"` + // The current utilization of concurrency as a percentage (0-100) + CurrentConcurrencyUtilizationPercentage float64 `json:"current_concurrency_utilization_percentage,omitempty"` + // The current number of replicas allocated to the endpoint + CurrentNumReplicas int `json:"current_num_replicas,omitempty"` + // The maximum concurrency allowed for this endpoint + MaximumConcurrencyAllowed float64 `json:"maximum_concurrency_allowed,omitempty"` + // The minimum concurrency allowed for this endpoint + MinimalConcurrencyAllowed float64 `json:"minimal_concurrency_allowed,omitempty"` + // The requested concurrency (total CPU) for the endpoint + RequestedConcurrency float64 `json:"requested_concurrency,omitempty"` + // The requested number of replicas for the endpoint + RequestedNumReplicas int `json:"requested_num_replicas,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *EndpointThroughputInfo) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s EndpointThroughputInfo) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Type of endpoint. +type EndpointType string + +const EndpointTypeStandard EndpointType = `STANDARD` + +const EndpointTypeStorageOptimized EndpointType = `STORAGE_OPTIMIZED` + +// String representation for [fmt.Print] +func (f *EndpointType) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *EndpointType) Set(v string) error { + switch v { + case `STANDARD`, `STORAGE_OPTIMIZED`: + *f = EndpointType(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "STANDARD", "STORAGE_OPTIMIZED"`, v) + } +} + +// Values returns all possible values for EndpointType. +// +// There is no guarantee on the order of the values in the slice. +func (f *EndpointType) Values() []EndpointType { + return []EndpointType{ + EndpointTypeStandard, + EndpointTypeStorageOptimized, + } +} + +// Type always returns EndpointType to satisfy [pflag.Value] interface +func (f *EndpointType) Type() string { + return "EndpointType" +} + +// Facet aggregation rows returned by a query. +type FacetResultData struct { + // Facet rows; each row is `[facet_column_name, value_or_range, count]`. + FacetArray [][]json.RawMessage `json:"facet_array,omitempty"` + // Number of facet rows returned. + FacetRowCount int `json:"facet_row_count,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *FacetResultData) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s FacetResultData) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type GetEndpointRequest struct { + // Full resource name of the endpoint. Format: + // `workspaces/{workspace_id}/endpoints/{endpoint_id}` + Name string `json:"-" url:"-"` +} + +type GetIndexRequest struct { + // Full resource name of the index. Format: + // `workspaces/{workspace_id}/endpoints/{endpoint_id}/indexes/{index_id}` + Name string `json:"-" url:"-"` +} + +// An AI Search index — a searchable collection of vectors and metadata hosted +// on an AI Search endpoint. Indexes are children of endpoints; customers +// create, get, list, and delete them. The `{index}` segment of the resource +// name is the index's Unity Catalog table name. +type Index struct { + // Creator of the index. + Creator string `json:"creator,omitempty"` + // Specification for a Delta Sync index. Set when `index_type` is + // `DELTA_SYNC`. + DeltaSyncIndexSpec *DeltaSyncIndexSpec `json:"delta_sync_index_spec,omitempty"` + // Specification for a Direct Access index. Set when `index_type` is + // `DIRECT_ACCESS`. + DirectAccessIndexSpec *DirectAccessIndexSpec `json:"direct_access_index_spec,omitempty"` + // Name of the endpoint associated with the index. Ignored on create — the + // endpoint is taken from `CreateIndexRequest.parent`; populated only on + // output. + Endpoint string `json:"endpoint,omitempty"` + // The subtype of the index. Set on create and immutable thereafter. + IndexSubtype IndexSubtype `json:"index_subtype,omitempty"` + // Type of index. Required on create and immutable thereafter. + IndexType IndexType `json:"index_type"` + // Name of the AI Search index. Server-assigned full resource path + // (`workspaces/{workspace}/endpoints/{endpoint}/indexes/{index}`) on + // output, where `{index}` is the index's Unity Catalog table name. On + // create, the user-supplied UC table name is conveyed via + // `CreateIndexRequest.index_id`; the server composes the full `name` and + // returns it on the response. + Name string `json:"name,omitempty"` + // Primary key of the index. Set on create and immutable thereafter. + PrimaryKey string `json:"primary_key"` + // Current status of the index. + Status *IndexStatus `json:"status,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *Index) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s Index) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Lifecycle and health state of an AI Search index, along with human-readable +// detail about that state and basic indexing progress. +type IndexStatus struct { + // Index API URL used to perform operations on the index. + IndexUrl string `json:"index_url,omitempty"` + // Number of rows indexed. + IndexedRowCount int64 `json:"indexed_row_count,omitempty"` + // Human-readable detail about the index's current state. + Message string `json:"message,omitempty"` + // Whether the index is ready for search. + Ready bool `json:"ready,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *IndexStatus) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s IndexStatus) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// The subtype of the AI Search index, determining the indexing and retrieval +// strategy. - `VECTOR`: Not a supported create value — do not select it. Use +// `HYBRID` (vector + hybrid search) or `FULL_TEXT` (full-text only). It is the +// proto2 default (`= 0`) solely to mirror the legacy `index_v2.proto` enum +// value-for-value; it is not an offered index subtype. - `FULL_TEXT`: An index +// that uses full-text search without vector embeddings. - `HYBRID`: An index +// that uses vector embeddings for similarity search and hybrid search. +type IndexSubtype string + +// An index that uses full-text search without vector embeddings. +const IndexSubtypeFullText IndexSubtype = `FULL_TEXT` + +// An index that uses vector embeddings for similarity search and hybrid search. +const IndexSubtypeHybrid IndexSubtype = `HYBRID` + +// Not a supported create value — do not select it. Use `HYBRID` (vector + +// hybrid +const IndexSubtypeVector IndexSubtype = `VECTOR` + +// String representation for [fmt.Print] +func (f *IndexSubtype) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *IndexSubtype) Set(v string) error { + switch v { + case `FULL_TEXT`, `HYBRID`, `VECTOR`: + *f = IndexSubtype(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "FULL_TEXT", "HYBRID", "VECTOR"`, v) + } +} + +// Values returns all possible values for IndexSubtype. +// +// There is no guarantee on the order of the values in the slice. +func (f *IndexSubtype) Values() []IndexSubtype { + return []IndexSubtype{ + IndexSubtypeFullText, + IndexSubtypeHybrid, + IndexSubtypeVector, + } +} + +// Type always returns IndexSubtype to satisfy [pflag.Value] interface +func (f *IndexSubtype) Type() string { + return "IndexSubtype" +} + +// There are 2 types of AI Search indexes: - `DELTA_SYNC`: An index that +// automatically syncs with a source Delta Table, automatically and +// incrementally updating the index as the underlying data in the Delta Table +// changes. - `DIRECT_ACCESS`: An index that supports direct read and write of +// vectors and metadata through our REST and SDK APIs. With this model, the user +// manages index updates. +type IndexType string + +// An index that automatically syncs with a source Delta Table, +const IndexTypeDeltaSync IndexType = `DELTA_SYNC` + +// An index that supports direct read and write of vectors and +const IndexTypeDirectAccess IndexType = `DIRECT_ACCESS` + +// String representation for [fmt.Print] +func (f *IndexType) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *IndexType) Set(v string) error { + switch v { + case `DELTA_SYNC`, `DIRECT_ACCESS`: + *f = IndexType(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "DELTA_SYNC", "DIRECT_ACCESS"`, v) + } +} + +// Values returns all possible values for IndexType. +// +// There is no guarantee on the order of the values in the slice. +func (f *IndexType) Values() []IndexType { + return []IndexType{ + IndexTypeDeltaSync, + IndexTypeDirectAccess, + } +} + +// Type always returns IndexType to satisfy [pflag.Value] interface +func (f *IndexType) Type() string { + return "IndexType" +} + +type ListEndpointsRequest struct { + // Best-effort upper bound on the number of results to return. Honored as an + // upper bound by the shim: `page_size` only narrows the legacy backend's + // response, never widens it, so the practical cap is `min(page_size, + // legacy_fixed_page_size)`. + PageSize int `json:"-" url:"page_size,omitempty"` + // Page token from a previous response. If not provided, returns the first + // page. + PageToken string `json:"-" url:"page_token,omitempty"` + // The Workspace that owns this collection of endpoints. Format: + // `workspaces/{workspace_id}` + Parent string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListEndpointsRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListEndpointsRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Response for ListEndpoints carrying the page of endpoints and an optional +// continuation token. +type ListEndpointsResponse struct { + // The endpoints in the workspace. + Endpoints []Endpoint `json:"endpoints,omitempty"` + // A token that can be used to get the next page of results. Empty when + // there are no more results. + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListEndpointsResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListEndpointsResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListIndexesRequest struct { + // Best-effort upper bound on the number of results to return. Honored as an + // upper bound by the shim: `page_size` only narrows the legacy backend's + // response, never widens it, so the practical cap is `min(page_size, + // legacy_fixed_page_size)`. + PageSize int `json:"-" url:"page_size,omitempty"` + // Page token from a previous response. If not provided, returns the first + // page. + PageToken string `json:"-" url:"page_token,omitempty"` + // The Endpoint that owns this collection of indexes. Format: + // `workspaces/{workspace_id}/endpoints/{endpoint_id}` + Parent string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListIndexesRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListIndexesRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Response for ListIndexes carrying the page of indexes and an optional +// continuation token. +type ListIndexesResponse struct { + // The indexes on the endpoint. The field is named `indexes` (not the + // irregular plural `indices`) to satisfy core::0132, which derives the + // response field name from the ListIndexes method. + // core::0158::response-plural-first-field independently computes the + // resource plural as `indices` and is satisfied via a scoped field + // exception below. + Indexes []Index `json:"indexes,omitempty"` + // A token that can be used to get the next page of results. Empty when + // there are no more results. + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListIndexesResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListIndexesResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Pipeline execution mode for a Delta Sync index. Required on create for Delta +// Sync indexes; the legacy backend rejects an unset value with +// INVALID_PARAMETER_VALUE. - `TRIGGERED`: the pipeline stops after refreshing +// the source table once, using the data available when the update started. - +// `CONTINUOUS`: the pipeline processes new data as it arrives in the source +// table to keep the index fresh. +type PipelineType string + +// the pipeline processes new data as it arrives in the source table to +const PipelineTypeContinuous PipelineType = `CONTINUOUS` + +// the pipeline stops after refreshing the source table once, using the +const PipelineTypeTriggered PipelineType = `TRIGGERED` + +// String representation for [fmt.Print] +func (f *PipelineType) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *PipelineType) Set(v string) error { + switch v { + case `CONTINUOUS`, `TRIGGERED`: + *f = PipelineType(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "CONTINUOUS", "TRIGGERED"`, v) + } +} + +// Values returns all possible values for PipelineType. +// +// There is no guarantee on the order of the values in the slice. +func (f *PipelineType) Values() []PipelineType { + return []PipelineType{ + PipelineTypeContinuous, + PipelineTypeTriggered, + } +} + +// Type always returns PipelineType to satisfy [pflag.Value] interface +func (f *PipelineType) Type() string { + return "PipelineType" +} + +// Request to query (search) an AI Search index. The legacy `num_results` count +// is exposed as `max_results`; v1 returns up to `max_results` rows in a single +// response (no cursor pagination — see the note on `max_results` below). +type QueryIndexRequest struct { + // Column names to include in each result row. + Columns []string `json:"columns"` + // Columns whose values are sent to the reranker. + ColumnsToRerank []string `json:"columns_to_rerank,omitempty"` + // Facets to compute over the matched results (e.g. `"category TOP 5"`). + Facets []string `json:"facets,omitempty"` + // JSON string describing query filters (e.g. `{"id >": 5}`). + FiltersJson string `json:"filters_json,omitempty"` + // Maximum number of results to return (the legacy `num_results`). Defaults + // to 10. + MaxResults int `json:"max_results,omitempty"` + // Full resource name of the index to query. Format: + // `workspaces/{workspace_id}/endpoints/{endpoint_id}/indexes/{index_id}` + Name string `json:"-" url:"-"` + // Text columns to search for `query_text`. When empty, all text columns are + // searched. + QueryColumns []string `json:"query_columns,omitempty"` + // Query text. Required for Delta Sync indexes that compute embeddings from + // a model endpoint. + QueryText string `json:"query_text,omitempty"` + // Query type: `ANN`, `HYBRID`, or `FULL_TEXT`. Defaults to `ANN`. + QueryType string `json:"query_type,omitempty"` + // Query vector. Required for Direct Access indexes and Delta Sync indexes + // with self-managed vectors. + QueryVector []float64 `json:"query_vector,omitempty"` + // If set, results are reranked before being returned. + Reranker *RerankerConfig `json:"reranker,omitempty"` + // Score threshold for the approximate nearest-neighbor search. Defaults to + // 0.0. + ScoreThreshold float64 `json:"score_threshold,omitempty"` + // Sort clauses, e.g. `["rating DESC", "price ASC"]`. Overrides relevance + // ordering. + SortColumns []string `json:"sort_columns,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *QueryIndexRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s QueryIndexRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Response for QueryIndex carrying the matched rows and their column metadata. +type QueryIndexResponse struct { + // Facet aggregation rows, when facets were requested. + FacetResult *FacetResultData `json:"facet_result,omitempty"` + // Metadata describing the result columns. + Manifest *ResultManifest `json:"manifest,omitempty"` + // The matched result rows. + Result *ResultData `json:"result,omitempty"` +} + +// Request to remove rows by primary key from a Direct Access AI Search index. +// Named RemoveData (not DeleteData) so the linter does not classify it as a +// standard AIP-135 Delete method — it deletes rows within an index, not the +// index resource. +type RemoveDataRequest struct { + // Full resource name of the index. Must be a Direct Access index. Format: + // `workspaces/{workspace_id}/endpoints/{endpoint_id}/indexes/{index_id}` + Name string `json:"-" url:"-"` + // Primary keys of the rows to remove. + PrimaryKeys []string `json:"primary_keys"` +} + +// Response for RemoveData. +type RemoveDataResponse struct { + // Per-row outcome of the delete. + Result *DataModificationResult `json:"result,omitempty"` + // Overall status of the delete. + Status DataModificationStatus `json:"status,omitempty"` +} + +// Configuration for reranking query results with a reranker model. +type RerankerConfig struct { + // Reranker identifier: "databricks_reranker" for the base model, or a Model + // Serving endpoint name when `model_type` is MODEL_TYPE_FINETUNED. + Model string `json:"model,omitempty"` + // Discriminator for how `model` is interpreted. + ModelType RerankerConfigModelType `json:"model_type,omitempty"` + // Parameters controlling reranking. + Parameters *RerankerConfigRerankerParameters `json:"parameters,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *RerankerConfig) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s RerankerConfig) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// How the `model` field is interpreted. +type RerankerConfigModelType string + +const RerankerConfigModelTypeModelTypeBase RerankerConfigModelType = `MODEL_TYPE_BASE` + +const RerankerConfigModelTypeModelTypeFinetuned RerankerConfigModelType = `MODEL_TYPE_FINETUNED` + +// String representation for [fmt.Print] +func (f *RerankerConfigModelType) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *RerankerConfigModelType) Set(v string) error { + switch v { + case `MODEL_TYPE_BASE`, `MODEL_TYPE_FINETUNED`: + *f = RerankerConfigModelType(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "MODEL_TYPE_BASE", "MODEL_TYPE_FINETUNED"`, v) + } +} + +// Values returns all possible values for RerankerConfigModelType. +// +// There is no guarantee on the order of the values in the slice. +func (f *RerankerConfigModelType) Values() []RerankerConfigModelType { + return []RerankerConfigModelType{ + RerankerConfigModelTypeModelTypeBase, + RerankerConfigModelTypeModelTypeFinetuned, + } +} + +// Type always returns RerankerConfigModelType to satisfy [pflag.Value] interface +func (f *RerankerConfigModelType) Type() string { + return "RerankerConfigModelType" +} + +// Parameters controlling how the reranker processes results. +type RerankerConfigRerankerParameters struct { + // Columns whose values are concatenated and sent to the reranker. + ColumnsToRerank []string `json:"columns_to_rerank,omitempty"` +} + +// The rows of a query result set. +type ResultData struct { + // Result rows; each row is a list of column values aligned with the + // manifest columns. + DataArray [][]json.RawMessage `json:"data_array,omitempty"` + // Number of rows in the result set. + RowCount int `json:"row_count,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ResultData) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ResultData) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Metadata describing the columns of a query result set. +type ResultManifest struct { + // Number of columns in the result set. + ColumnCount int `json:"column_count,omitempty"` + // Information about each column in the result set. + Columns []ColumnInfo `json:"columns,omitempty"` + // Number of columns in the facet result. + FacetColumnCount int `json:"facet_column_count,omitempty"` + // Information about each facet column. + FacetColumns []ColumnInfo `json:"facet_columns,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ResultManifest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ResultManifest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// State of the most recent scaling change request for a Storage Optimized +// endpoint. +type ScalingChangeState string + +const ScalingChangeStateScalingChangeApplied ScalingChangeState = `SCALING_CHANGE_APPLIED` + +const ScalingChangeStateScalingChangeInProgress ScalingChangeState = `SCALING_CHANGE_IN_PROGRESS` + +const ScalingChangeStateScalingChangeUnspecified ScalingChangeState = `SCALING_CHANGE_UNSPECIFIED` + +// String representation for [fmt.Print] +func (f *ScalingChangeState) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *ScalingChangeState) Set(v string) error { + switch v { + case `SCALING_CHANGE_APPLIED`, `SCALING_CHANGE_IN_PROGRESS`, `SCALING_CHANGE_UNSPECIFIED`: + *f = ScalingChangeState(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "SCALING_CHANGE_APPLIED", "SCALING_CHANGE_IN_PROGRESS", "SCALING_CHANGE_UNSPECIFIED"`, v) + } +} + +// Values returns all possible values for ScalingChangeState. +// +// There is no guarantee on the order of the values in the slice. +func (f *ScalingChangeState) Values() []ScalingChangeState { + return []ScalingChangeState{ + ScalingChangeStateScalingChangeApplied, + ScalingChangeStateScalingChangeInProgress, + ScalingChangeStateScalingChangeUnspecified, + } +} + +// Type always returns ScalingChangeState to satisfy [pflag.Value] interface +func (f *ScalingChangeState) Type() string { + return "ScalingChangeState" +} + +// Request to scan (paginate over) the rows of an AI Search index. Models the +// legacy `num_results` / `last_primary_key` cursor as AIP-158 `page_size` / +// `page_token`. +type ScanIndexRequest struct { + // Full resource name of the index to scan. Format: + // `workspaces/{workspace_id}/endpoints/{endpoint_id}/indexes/{index_id}` + Name string `json:"-" url:"-"` + // Maximum number of rows to return in this page. + PageSize int `json:"page_size,omitempty"` + // Page token from a previous response; if unset, scanning starts from the + // beginning. + PageToken string `json:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ScanIndexRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ScanIndexRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Response for ScanIndex carrying a page of rows and an optional continuation +// token. +type ScanIndexResponse struct { + // The rows in this page, each a struct of column name to value. + Data []map[string]json.RawMessage `json:"data,omitempty"` + // Token for the next page; empty when the scan is exhausted. + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ScanIndexResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ScanIndexResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Request to synchronize a Delta Sync AI Search index with its source Delta +// table. +type SyncIndexRequest struct { + // Full resource name of the index to synchronize. Must be a Delta Sync + // index. Format: + // `workspaces/{workspace_id}/endpoints/{endpoint_id}/indexes/{index_id}` + Name string `json:"-" url:"-"` +} + +// Response for SyncIndex. Empty today; reserved so future sync metadata (e.g. +// an operation handle) can be added without breaking the wire contract. +type SyncIndexResponse struct { +} + +// State of the most recent throughput change request issued against a Storage +// Optimized endpoint. Surfaced on +// `EndpointThroughputInfo.change_request_state`. +type ThroughputChangeRequestState string + +const ThroughputChangeRequestStateChangeAdjusted ThroughputChangeRequestState = `CHANGE_ADJUSTED` + +const ThroughputChangeRequestStateChangeFailed ThroughputChangeRequestState = `CHANGE_FAILED` + +const ThroughputChangeRequestStateChangeInProgress ThroughputChangeRequestState = `CHANGE_IN_PROGRESS` + +const ThroughputChangeRequestStateChangeReachedMaximum ThroughputChangeRequestState = `CHANGE_REACHED_MAXIMUM` + +const ThroughputChangeRequestStateChangeReachedMinimum ThroughputChangeRequestState = `CHANGE_REACHED_MINIMUM` + +const ThroughputChangeRequestStateChangeSuccess ThroughputChangeRequestState = `CHANGE_SUCCESS` + +// String representation for [fmt.Print] +func (f *ThroughputChangeRequestState) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *ThroughputChangeRequestState) Set(v string) error { + switch v { + case `CHANGE_ADJUSTED`, `CHANGE_FAILED`, `CHANGE_IN_PROGRESS`, `CHANGE_REACHED_MAXIMUM`, `CHANGE_REACHED_MINIMUM`, `CHANGE_SUCCESS`: + *f = ThroughputChangeRequestState(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "CHANGE_ADJUSTED", "CHANGE_FAILED", "CHANGE_IN_PROGRESS", "CHANGE_REACHED_MAXIMUM", "CHANGE_REACHED_MINIMUM", "CHANGE_SUCCESS"`, v) + } +} + +// Values returns all possible values for ThroughputChangeRequestState. +// +// There is no guarantee on the order of the values in the slice. +func (f *ThroughputChangeRequestState) Values() []ThroughputChangeRequestState { + return []ThroughputChangeRequestState{ + ThroughputChangeRequestStateChangeAdjusted, + ThroughputChangeRequestStateChangeFailed, + ThroughputChangeRequestStateChangeInProgress, + ThroughputChangeRequestStateChangeReachedMaximum, + ThroughputChangeRequestStateChangeReachedMinimum, + ThroughputChangeRequestStateChangeSuccess, + } +} + +// Type always returns ThroughputChangeRequestState to satisfy [pflag.Value] interface +func (f *ThroughputChangeRequestState) Type() string { + return "ThroughputChangeRequestState" +} + +type UpdateEndpointRequest struct { + // The Endpoint resource to update. `endpoint.name` carries the full + // resource path. + Endpoint Endpoint `json:"endpoint"` + // Name of the AI Search endpoint. Server-assigned full resource path + // (`workspaces/{workspace}/endpoints/{endpoint}`) on output. On create, the + // user-supplied short name is conveyed via + // `CreateEndpointRequest.endpoint_id`; the server composes the full `name` + // and returns it on the response. + Name string `json:"-" url:"-"` + // The list of fields to update. + UpdateMask fieldmask.FieldMask `json:"-" url:"update_mask"` +} + +// Request to upsert rows into a Direct Access AI Search index. +type UpsertDataRequest struct { + // JSON document describing the rows to upsert. + InputsJson string `json:"inputs_json"` + // Full resource name of the index. Must be a Direct Access index. Format: + // `workspaces/{workspace_id}/endpoints/{endpoint_id}/indexes/{index_id}` + Name string `json:"-" url:"-"` +} + +// Response for UpsertData. +type UpsertDataResponse struct { + // Per-row outcome of the upsert. + Result *DataModificationResult `json:"result,omitempty"` + // Overall status of the upsert. + Status DataModificationStatus `json:"status,omitempty"` +} diff --git a/service/apps/model.go b/service/apps/model.go index 52644d88a..45d813cbe 100755 --- a/service/apps/model.go +++ b/service/apps/model.go @@ -1521,6 +1521,8 @@ func (f *ApplicationState) Type() string { type ApplicationStatus struct { // Application status message Message string `json:"message,omitempty"` + // The number of running instances of this application. + RunningInstances int `json:"running_instances,omitempty"` // State of the application. State ApplicationState `json:"state,omitempty"` diff --git a/service/bundledeployments/api.go b/service/bundledeployments/api.go new file mode 100755 index 000000000..bcda60a42 --- /dev/null +++ b/service/bundledeployments/api.go @@ -0,0 +1,129 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +// Service for managing bundle deployment metadata. +package bundledeployments + +import ( + "context" + + "github.com/databricks/databricks-sdk-go/client" + "github.com/databricks/databricks-sdk-go/listing" +) + +type BundleDeploymentsInterface interface { + + // Marks a version as complete and releases the deployment lock. + // + // The server atomically: 1. Sets the version status to the provided terminal + // status. 2. Sets `complete_time` to the current server timestamp. 3. Releases + // the lock on the parent deployment. 4. Updates the parent deployment's + // `status` and `last_version_id`. + CompleteVersion(ctx context.Context, request CompleteVersionRequest) (*Version, error) + + // Creates a new deployment in the workspace. + // + // The caller must provide a `deployment_id` which becomes the final component + // of the deployment's resource name. If a deployment with the same ID already + // exists, the server returns `ALREADY_EXISTS`. + CreateDeployment(ctx context.Context, request CreateDeploymentRequest) (*Deployment, error) + + // Creates a resource operation under a version. + // + // The caller must provide a `resource_key` which becomes the final component of + // the operation's name. If an operation with the same key already exists under + // the version, the server returns `ALREADY_EXISTS`. + // + // On success the server also updates the corresponding deployment-level + // Resource (creating it if this is the first operation for that resource_key, + // or removing it if action_type is DELETE). + CreateOperation(ctx context.Context, request CreateOperationRequest) (*Operation, error) + + // Creates a new version under a deployment. + // + // Creating a version acquires an exclusive lock on the deployment, preventing + // concurrent deploys. The caller provides a `version_id` which the server + // validates equals `last_version_id + 1` on the deployment. + CreateVersion(ctx context.Context, request CreateVersionRequest) (*Version, error) + + // Deletes a deployment. + // + // The deployment is marked as deleted. It and all its children (versions and + // their operations) will be permanently deleted after the retention policy + // expires. If the deployment has an in-progress version, the server returns + // `RESOURCE_CONFLICT`. + DeleteDeployment(ctx context.Context, request DeleteDeploymentRequest) error + + // Retrieves a deployment by its resource name. + GetDeployment(ctx context.Context, request GetDeploymentRequest) (*Deployment, error) + + // Retrieves a resource operation by its resource name. + GetOperation(ctx context.Context, request GetOperationRequest) (*Operation, error) + + // Retrieves a deployment resource by its resource name. + GetResource(ctx context.Context, request GetResourceRequest) (*Resource, error) + + // Retrieves a version by its resource name. + GetVersion(ctx context.Context, request GetVersionRequest) (*Version, error) + + // Sends a heartbeat to renew the lock held by a version. + // + // The server validates that the version is the active (non-terminal) version on + // the parent deployment and resets the lock expiry. If the lock has already + // expired or the version is no longer active, the server returns `ABORTED`. + Heartbeat(ctx context.Context, request HeartbeatRequest) (*HeartbeatResponse, error) + + // Lists deployments in the workspace. + // + // This method is generated by Databricks SDK Code Generator. + ListDeployments(ctx context.Context, request ListDeploymentsRequest) listing.Iterator[Deployment] + + // Lists deployments in the workspace. + // + // This method is generated by Databricks SDK Code Generator. + ListDeploymentsAll(ctx context.Context, request ListDeploymentsRequest) ([]Deployment, error) + + // Lists resource operations under a version. + // + // This method is generated by Databricks SDK Code Generator. + ListOperations(ctx context.Context, request ListOperationsRequest) listing.Iterator[Operation] + + // Lists resource operations under a version. + // + // This method is generated by Databricks SDK Code Generator. + ListOperationsAll(ctx context.Context, request ListOperationsRequest) ([]Operation, error) + + // Lists resources under a deployment. + // + // This method is generated by Databricks SDK Code Generator. + ListResources(ctx context.Context, request ListResourcesRequest) listing.Iterator[Resource] + + // Lists resources under a deployment. + // + // This method is generated by Databricks SDK Code Generator. + ListResourcesAll(ctx context.Context, request ListResourcesRequest) ([]Resource, error) + + // Lists versions under a deployment, ordered by version_id descending (most + // recent first). + // + // This method is generated by Databricks SDK Code Generator. + ListVersions(ctx context.Context, request ListVersionsRequest) listing.Iterator[Version] + + // Lists versions under a deployment, ordered by version_id descending (most + // recent first). + // + // This method is generated by Databricks SDK Code Generator. + ListVersionsAll(ctx context.Context, request ListVersionsRequest) ([]Version, error) +} + +func NewBundleDeployments(client *client.DatabricksClient) *BundleDeploymentsAPI { + return &BundleDeploymentsAPI{ + bundleDeploymentsImpl: bundleDeploymentsImpl{ + client: client, + }, + } +} + +// Service for managing bundle deployment metadata. +type BundleDeploymentsAPI struct { + bundleDeploymentsImpl +} diff --git a/service/bundledeployments/impl.go b/service/bundledeployments/impl.go new file mode 100755 index 000000000..0045b2126 --- /dev/null +++ b/service/bundledeployments/impl.go @@ -0,0 +1,356 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package bundledeployments + +import ( + "context" + "fmt" + "net/http" + + "github.com/databricks/databricks-sdk-go/client" + "github.com/databricks/databricks-sdk-go/listing" + "github.com/databricks/databricks-sdk-go/useragent" +) + +// unexported type that holds implementations of just BundleDeployments API methods +type bundleDeploymentsImpl struct { + client *client.DatabricksClient +} + +func (a *bundleDeploymentsImpl) CompleteVersion(ctx context.Context, request CompleteVersionRequest) (*Version, error) { + var version Version + path := fmt.Sprintf("/api/2.0/bundle/%v/complete", request.Name) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + cfg := a.client.Config + if cfg.WorkspaceID != "" { + headers["X-Databricks-Workspace-Id"] = cfg.WorkspaceID + } + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &version) + return &version, err +} + +func (a *bundleDeploymentsImpl) CreateDeployment(ctx context.Context, request CreateDeploymentRequest) (*Deployment, error) { + var deployment Deployment + path := "/api/2.0/bundle/deployments" + queryParams := make(map[string]any) + + if request.DeploymentId != "" { + queryParams["deployment_id"] = request.DeploymentId + } + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + cfg := a.client.Config + if cfg.WorkspaceID != "" { + headers["X-Databricks-Workspace-Id"] = cfg.WorkspaceID + } + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request.Deployment, &deployment) + return &deployment, err +} + +func (a *bundleDeploymentsImpl) CreateOperation(ctx context.Context, request CreateOperationRequest) (*Operation, error) { + var operation Operation + path := fmt.Sprintf("/api/2.0/bundle/%v/operations", request.Parent) + queryParams := make(map[string]any) + + if request.ResourceKey != "" { + queryParams["resource_key"] = request.ResourceKey + } + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + cfg := a.client.Config + if cfg.WorkspaceID != "" { + headers["X-Databricks-Workspace-Id"] = cfg.WorkspaceID + } + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request.Operation, &operation) + return &operation, err +} + +func (a *bundleDeploymentsImpl) CreateVersion(ctx context.Context, request CreateVersionRequest) (*Version, error) { + var version Version + path := fmt.Sprintf("/api/2.0/bundle/%v/versions", request.Parent) + queryParams := make(map[string]any) + + if request.VersionId != "" { + queryParams["version_id"] = request.VersionId + } + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + cfg := a.client.Config + if cfg.WorkspaceID != "" { + headers["X-Databricks-Workspace-Id"] = cfg.WorkspaceID + } + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request.Version, &version) + return &version, err +} + +func (a *bundleDeploymentsImpl) DeleteDeployment(ctx context.Context, request DeleteDeploymentRequest) error { + path := fmt.Sprintf("/api/2.0/bundle/%v", request.Name) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + cfg := a.client.Config + if cfg.WorkspaceID != "" { + headers["X-Databricks-Workspace-Id"] = cfg.WorkspaceID + } + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) + return err +} + +func (a *bundleDeploymentsImpl) GetDeployment(ctx context.Context, request GetDeploymentRequest) (*Deployment, error) { + var deployment Deployment + path := fmt.Sprintf("/api/2.0/bundle/%v", request.Name) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + cfg := a.client.Config + if cfg.WorkspaceID != "" { + headers["X-Databricks-Workspace-Id"] = cfg.WorkspaceID + } + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &deployment) + return &deployment, err +} + +func (a *bundleDeploymentsImpl) GetOperation(ctx context.Context, request GetOperationRequest) (*Operation, error) { + var operation Operation + path := fmt.Sprintf("/api/2.0/bundle/%v", request.Name) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + cfg := a.client.Config + if cfg.WorkspaceID != "" { + headers["X-Databricks-Workspace-Id"] = cfg.WorkspaceID + } + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &operation) + return &operation, err +} + +func (a *bundleDeploymentsImpl) GetResource(ctx context.Context, request GetResourceRequest) (*Resource, error) { + var resource Resource + path := fmt.Sprintf("/api/2.0/bundle/%v", request.Name) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + cfg := a.client.Config + if cfg.WorkspaceID != "" { + headers["X-Databricks-Workspace-Id"] = cfg.WorkspaceID + } + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &resource) + return &resource, err +} + +func (a *bundleDeploymentsImpl) GetVersion(ctx context.Context, request GetVersionRequest) (*Version, error) { + var version Version + path := fmt.Sprintf("/api/2.0/bundle/%v", request.Name) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + cfg := a.client.Config + if cfg.WorkspaceID != "" { + headers["X-Databricks-Workspace-Id"] = cfg.WorkspaceID + } + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &version) + return &version, err +} + +func (a *bundleDeploymentsImpl) Heartbeat(ctx context.Context, request HeartbeatRequest) (*HeartbeatResponse, error) { + var heartbeatResponse HeartbeatResponse + path := fmt.Sprintf("/api/2.0/bundle/%v/heartbeat", request.Name) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + cfg := a.client.Config + if cfg.WorkspaceID != "" { + headers["X-Databricks-Workspace-Id"] = cfg.WorkspaceID + } + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &heartbeatResponse) + return &heartbeatResponse, err +} + +// Lists deployments in the workspace. +func (a *bundleDeploymentsImpl) ListDeployments(ctx context.Context, request ListDeploymentsRequest) listing.Iterator[Deployment] { + + getNextPage := func(ctx context.Context, req ListDeploymentsRequest) (*ListDeploymentsResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.internalListDeployments(ctx, req) + } + getItems := func(resp *ListDeploymentsResponse) []Deployment { + return resp.Deployments + } + getNextReq := func(resp *ListDeploymentsResponse) *ListDeploymentsRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// Lists deployments in the workspace. +func (a *bundleDeploymentsImpl) ListDeploymentsAll(ctx context.Context, request ListDeploymentsRequest) ([]Deployment, error) { + iterator := a.ListDeployments(ctx, request) + return listing.ToSlice[Deployment](ctx, iterator) +} + +func (a *bundleDeploymentsImpl) internalListDeployments(ctx context.Context, request ListDeploymentsRequest) (*ListDeploymentsResponse, error) { + var listDeploymentsResponse ListDeploymentsResponse + path := "/api/2.0/bundle/deployments" + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + cfg := a.client.Config + if cfg.WorkspaceID != "" { + headers["X-Databricks-Workspace-Id"] = cfg.WorkspaceID + } + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listDeploymentsResponse) + return &listDeploymentsResponse, err +} + +// Lists resource operations under a version. +func (a *bundleDeploymentsImpl) ListOperations(ctx context.Context, request ListOperationsRequest) listing.Iterator[Operation] { + + getNextPage := func(ctx context.Context, req ListOperationsRequest) (*ListOperationsResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.internalListOperations(ctx, req) + } + getItems := func(resp *ListOperationsResponse) []Operation { + return resp.Operations + } + getNextReq := func(resp *ListOperationsResponse) *ListOperationsRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// Lists resource operations under a version. +func (a *bundleDeploymentsImpl) ListOperationsAll(ctx context.Context, request ListOperationsRequest) ([]Operation, error) { + iterator := a.ListOperations(ctx, request) + return listing.ToSlice[Operation](ctx, iterator) +} + +func (a *bundleDeploymentsImpl) internalListOperations(ctx context.Context, request ListOperationsRequest) (*ListOperationsResponse, error) { + var listOperationsResponse ListOperationsResponse + path := fmt.Sprintf("/api/2.0/bundle/%v/operations", request.Parent) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + cfg := a.client.Config + if cfg.WorkspaceID != "" { + headers["X-Databricks-Workspace-Id"] = cfg.WorkspaceID + } + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listOperationsResponse) + return &listOperationsResponse, err +} + +// Lists resources under a deployment. +func (a *bundleDeploymentsImpl) ListResources(ctx context.Context, request ListResourcesRequest) listing.Iterator[Resource] { + + getNextPage := func(ctx context.Context, req ListResourcesRequest) (*ListResourcesResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.internalListResources(ctx, req) + } + getItems := func(resp *ListResourcesResponse) []Resource { + return resp.Resources + } + getNextReq := func(resp *ListResourcesResponse) *ListResourcesRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// Lists resources under a deployment. +func (a *bundleDeploymentsImpl) ListResourcesAll(ctx context.Context, request ListResourcesRequest) ([]Resource, error) { + iterator := a.ListResources(ctx, request) + return listing.ToSlice[Resource](ctx, iterator) +} + +func (a *bundleDeploymentsImpl) internalListResources(ctx context.Context, request ListResourcesRequest) (*ListResourcesResponse, error) { + var listResourcesResponse ListResourcesResponse + path := fmt.Sprintf("/api/2.0/bundle/%v/resources", request.Parent) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + cfg := a.client.Config + if cfg.WorkspaceID != "" { + headers["X-Databricks-Workspace-Id"] = cfg.WorkspaceID + } + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listResourcesResponse) + return &listResourcesResponse, err +} + +// Lists versions under a deployment, ordered by version_id descending (most +// recent first). +func (a *bundleDeploymentsImpl) ListVersions(ctx context.Context, request ListVersionsRequest) listing.Iterator[Version] { + + getNextPage := func(ctx context.Context, req ListVersionsRequest) (*ListVersionsResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.internalListVersions(ctx, req) + } + getItems := func(resp *ListVersionsResponse) []Version { + return resp.Versions + } + getNextReq := func(resp *ListVersionsResponse) *ListVersionsRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// Lists versions under a deployment, ordered by version_id descending (most +// recent first). +func (a *bundleDeploymentsImpl) ListVersionsAll(ctx context.Context, request ListVersionsRequest) ([]Version, error) { + iterator := a.ListVersions(ctx, request) + return listing.ToSlice[Version](ctx, iterator) +} + +func (a *bundleDeploymentsImpl) internalListVersions(ctx context.Context, request ListVersionsRequest) (*ListVersionsResponse, error) { + var listVersionsResponse ListVersionsResponse + path := fmt.Sprintf("/api/2.0/bundle/%v/versions", request.Parent) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + cfg := a.client.Config + if cfg.WorkspaceID != "" { + headers["X-Databricks-Workspace-Id"] = cfg.WorkspaceID + } + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listVersionsResponse) + return &listVersionsResponse, err +} diff --git a/service/bundledeployments/interface.go b/service/bundledeployments/interface.go new file mode 100755 index 000000000..da91663dd --- /dev/null +++ b/service/bundledeployments/interface.go @@ -0,0 +1,87 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package bundledeployments + +import ( + "context" +) + +// Service for managing bundle deployment metadata. +// +// Deprecated: Do not use this interface, it will be removed in a future version of the SDK. +type BundleDeploymentsService interface { + + // Marks a version as complete and releases the deployment lock. + // + // The server atomically: 1. Sets the version status to the provided + // terminal status. 2. Sets `complete_time` to the current server timestamp. + // 3. Releases the lock on the parent deployment. 4. Updates the parent + // deployment's `status` and `last_version_id`. + CompleteVersion(ctx context.Context, request CompleteVersionRequest) (*Version, error) + + // Creates a new deployment in the workspace. + // + // The caller must provide a `deployment_id` which becomes the final + // component of the deployment's resource name. If a deployment with the + // same ID already exists, the server returns `ALREADY_EXISTS`. + CreateDeployment(ctx context.Context, request CreateDeploymentRequest) (*Deployment, error) + + // Creates a resource operation under a version. + // + // The caller must provide a `resource_key` which becomes the final + // component of the operation's name. If an operation with the same key + // already exists under the version, the server returns `ALREADY_EXISTS`. + // + // On success the server also updates the corresponding deployment-level + // Resource (creating it if this is the first operation for that + // resource_key, or removing it if action_type is DELETE). + CreateOperation(ctx context.Context, request CreateOperationRequest) (*Operation, error) + + // Creates a new version under a deployment. + // + // Creating a version acquires an exclusive lock on the deployment, + // preventing concurrent deploys. The caller provides a `version_id` which + // the server validates equals `last_version_id + 1` on the deployment. + CreateVersion(ctx context.Context, request CreateVersionRequest) (*Version, error) + + // Deletes a deployment. + // + // The deployment is marked as deleted. It and all its children (versions + // and their operations) will be permanently deleted after the retention + // policy expires. If the deployment has an in-progress version, the server + // returns `RESOURCE_CONFLICT`. + DeleteDeployment(ctx context.Context, request DeleteDeploymentRequest) error + + // Retrieves a deployment by its resource name. + GetDeployment(ctx context.Context, request GetDeploymentRequest) (*Deployment, error) + + // Retrieves a resource operation by its resource name. + GetOperation(ctx context.Context, request GetOperationRequest) (*Operation, error) + + // Retrieves a deployment resource by its resource name. + GetResource(ctx context.Context, request GetResourceRequest) (*Resource, error) + + // Retrieves a version by its resource name. + GetVersion(ctx context.Context, request GetVersionRequest) (*Version, error) + + // Sends a heartbeat to renew the lock held by a version. + // + // The server validates that the version is the active (non-terminal) + // version on the parent deployment and resets the lock expiry. If the lock + // has already expired or the version is no longer active, the server + // returns `ABORTED`. + Heartbeat(ctx context.Context, request HeartbeatRequest) (*HeartbeatResponse, error) + + // Lists deployments in the workspace. + ListDeployments(ctx context.Context, request ListDeploymentsRequest) (*ListDeploymentsResponse, error) + + // Lists resource operations under a version. + ListOperations(ctx context.Context, request ListOperationsRequest) (*ListOperationsResponse, error) + + // Lists resources under a deployment. + ListResources(ctx context.Context, request ListResourcesRequest) (*ListResourcesResponse, error) + + // Lists versions under a deployment, ordered by version_id descending (most + // recent first). + ListVersions(ctx context.Context, request ListVersionsRequest) (*ListVersionsResponse, error) +} diff --git a/service/bundledeployments/model.go b/service/bundledeployments/model.go new file mode 100755 index 000000000..b69ef6eb8 --- /dev/null +++ b/service/bundledeployments/model.go @@ -0,0 +1,909 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package bundledeployments + +import ( + "encoding/json" + "fmt" + + "github.com/databricks/databricks-sdk-go/common/types/time" + "github.com/databricks/databricks-sdk-go/marshal" +) + +// A request to complete a Version. +type CompleteVersionRequest struct { + // The reason for completing the version. Must be a terminal reason: + // VERSION_COMPLETE_SUCCESS, VERSION_COMPLETE_FAILURE, or + // VERSION_COMPLETE_FORCE_ABORT. + CompletionReason VersionComplete `json:"completion_reason"` + // If true, force-completes the version even if the caller is not the + // original creator. The completion_reason must be + // VERSION_COMPLETE_FORCE_ABORT when force is true. + Force bool `json:"force,omitempty"` + // The name of the version to complete. Format: + // deployments/{deployment_id}/versions/{version_id} + Name string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *CompleteVersionRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s CompleteVersionRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type CreateDeploymentRequest struct { + // The deployment to create. + Deployment Deployment `json:"deployment"` + // The ID to use for the deployment, which will become the final component + // of the deployment's resource name (i.e. `deployments/{deployment_id}`). + DeploymentId string `json:"-" url:"deployment_id"` +} + +type CreateOperationRequest struct { + // The resource operation to create. + Operation Operation `json:"operation"` + // The parent version where this operation will be recorded. Format: + // deployments/{deployment_id}/versions/{version_id} + Parent string `json:"-" url:"-"` + // The key identifying the resource this operation applies to. Becomes the + // final component of the operation's name. + ResourceKey string `json:"-" url:"resource_key"` +} + +type CreateVersionRequest struct { + // The parent deployment where this version will be created. Format: + // deployments/{deployment_id} + Parent string `json:"-" url:"-"` + // The version to create. + Version Version `json:"version"` + // The version ID the caller expects to create. The server validates this + // equals `last_version_id + 1` on the deployment. If it doesn't match, the + // server returns `ABORTED`. + VersionId string `json:"-" url:"version_id"` +} + +type DeleteDeploymentRequest struct { + // Resource name of the deployment to delete. Format: + // deployments/{deployment_id} + Name string `json:"-" url:"-"` +} + +// A bundle deployment registered with the control plane. +type Deployment struct { + // When the deployment was created. + CreateTime *time.Time `json:"create_time,omitempty"` + // The user who created the deployment (email or principal name). + CreatedBy string `json:"created_by,omitempty"` + // Bundle target deployment mode (development or production), derived from + // the most recent version's mode. + DeploymentMode DeploymentMode `json:"deployment_mode,omitempty"` + // When the deployment was destroyed (i.e. `bundle destroy` completed). + // Unset if the deployment has not been destroyed. Named destroy_time (not + // delete_time) because this tracks the `databricks bundle destroy` command, + // not the API-level deletion. + DestroyTime *time.Time `json:"destroy_time,omitempty"` + // The user who destroyed the deployment (email or principal name). Unset if + // the deployment has not been destroyed. + DestroyedBy string `json:"destroyed_by,omitempty"` + // Human-readable name for the deployment. Output only: it is denormalized + // from the latest version, not set directly on the deployment. + DisplayName string `json:"display_name,omitempty"` + // Git provenance of the deployment's source, derived from the latest + // version. + GitInfo *GitInfo `json:"git_info,omitempty"` + // The version_id of the most recent deployment version. + LastVersionId string `json:"last_version_id,omitempty"` + // Resource name of the deployment. Format: deployments/{deployment_id} + Name string `json:"name,omitempty"` + // Current status of the deployment. + Status DeploymentStatus `json:"status,omitempty"` + // The bundle target name associated with this deployment. Output only: it + // is denormalized from the latest version, not set directly on the + // deployment. + TargetName string `json:"target_name,omitempty"` + // When the deployment was last updated. + UpdateTime *time.Time `json:"update_time,omitempty"` + // Workspace location of the deployment, derived from the latest version. + WorkspaceInfo *WorkspaceInfo `json:"workspace_info,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *Deployment) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s Deployment) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Bundle target deployment mode. Mirrors the `mode` field on a bundle target in +// `databricks.yml` (see +// https://docs.databricks.com/dev-tools/bundles/deployment-modes). +type DeploymentMode string + +const DeploymentModeDeploymentModeDevelopment DeploymentMode = `DEPLOYMENT_MODE_DEVELOPMENT` + +const DeploymentModeDeploymentModeProduction DeploymentMode = `DEPLOYMENT_MODE_PRODUCTION` + +// String representation for [fmt.Print] +func (f *DeploymentMode) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *DeploymentMode) Set(v string) error { + switch v { + case `DEPLOYMENT_MODE_DEVELOPMENT`, `DEPLOYMENT_MODE_PRODUCTION`: + *f = DeploymentMode(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "DEPLOYMENT_MODE_DEVELOPMENT", "DEPLOYMENT_MODE_PRODUCTION"`, v) + } +} + +// Values returns all possible values for DeploymentMode. +// +// There is no guarantee on the order of the values in the slice. +func (f *DeploymentMode) Values() []DeploymentMode { + return []DeploymentMode{ + DeploymentModeDeploymentModeDevelopment, + DeploymentModeDeploymentModeProduction, + } +} + +// Type always returns DeploymentMode to satisfy [pflag.Value] interface +func (f *DeploymentMode) Type() string { + return "DeploymentMode" +} + +// Type of a deployment resource. +type DeploymentResourceType string + +const DeploymentResourceTypeDeploymentResourceTypeAlert DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_ALERT` + +const DeploymentResourceTypeDeploymentResourceTypeApp DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_APP` + +const DeploymentResourceTypeDeploymentResourceTypeCatalog DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_CATALOG` + +const DeploymentResourceTypeDeploymentResourceTypeCluster DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_CLUSTER` + +const DeploymentResourceTypeDeploymentResourceTypeDashboard DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_DASHBOARD` + +const DeploymentResourceTypeDeploymentResourceTypeDatabaseCatalog DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_DATABASE_CATALOG` + +const DeploymentResourceTypeDeploymentResourceTypeDatabaseInstance DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_DATABASE_INSTANCE` + +const DeploymentResourceTypeDeploymentResourceTypeExperiment DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_EXPERIMENT` + +const DeploymentResourceTypeDeploymentResourceTypeExternalLocation DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_EXTERNAL_LOCATION` + +const DeploymentResourceTypeDeploymentResourceTypeJob DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_JOB` + +const DeploymentResourceTypeDeploymentResourceTypeModel DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_MODEL` + +const DeploymentResourceTypeDeploymentResourceTypeModelServingEndpoint DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_MODEL_SERVING_ENDPOINT` + +const DeploymentResourceTypeDeploymentResourceTypePipeline DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_PIPELINE` + +const DeploymentResourceTypeDeploymentResourceTypePostgresBranch DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_POSTGRES_BRANCH` + +const DeploymentResourceTypeDeploymentResourceTypePostgresEndpoint DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_POSTGRES_ENDPOINT` + +const DeploymentResourceTypeDeploymentResourceTypePostgresProject DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_POSTGRES_PROJECT` + +const DeploymentResourceTypeDeploymentResourceTypeQualityMonitor DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_QUALITY_MONITOR` + +const DeploymentResourceTypeDeploymentResourceTypeRegisteredModel DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_REGISTERED_MODEL` + +const DeploymentResourceTypeDeploymentResourceTypeSchema DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_SCHEMA` + +const DeploymentResourceTypeDeploymentResourceTypeSecretScope DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_SECRET_SCOPE` + +const DeploymentResourceTypeDeploymentResourceTypeSqlWarehouse DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_SQL_WAREHOUSE` + +const DeploymentResourceTypeDeploymentResourceTypeSyncedDatabaseTable DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_SYNCED_DATABASE_TABLE` + +const DeploymentResourceTypeDeploymentResourceTypeVolume DeploymentResourceType = `DEPLOYMENT_RESOURCE_TYPE_VOLUME` + +// String representation for [fmt.Print] +func (f *DeploymentResourceType) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *DeploymentResourceType) Set(v string) error { + switch v { + case `DEPLOYMENT_RESOURCE_TYPE_ALERT`, `DEPLOYMENT_RESOURCE_TYPE_APP`, `DEPLOYMENT_RESOURCE_TYPE_CATALOG`, `DEPLOYMENT_RESOURCE_TYPE_CLUSTER`, `DEPLOYMENT_RESOURCE_TYPE_DASHBOARD`, `DEPLOYMENT_RESOURCE_TYPE_DATABASE_CATALOG`, `DEPLOYMENT_RESOURCE_TYPE_DATABASE_INSTANCE`, `DEPLOYMENT_RESOURCE_TYPE_EXPERIMENT`, `DEPLOYMENT_RESOURCE_TYPE_EXTERNAL_LOCATION`, `DEPLOYMENT_RESOURCE_TYPE_JOB`, `DEPLOYMENT_RESOURCE_TYPE_MODEL`, `DEPLOYMENT_RESOURCE_TYPE_MODEL_SERVING_ENDPOINT`, `DEPLOYMENT_RESOURCE_TYPE_PIPELINE`, `DEPLOYMENT_RESOURCE_TYPE_POSTGRES_BRANCH`, `DEPLOYMENT_RESOURCE_TYPE_POSTGRES_ENDPOINT`, `DEPLOYMENT_RESOURCE_TYPE_POSTGRES_PROJECT`, `DEPLOYMENT_RESOURCE_TYPE_QUALITY_MONITOR`, `DEPLOYMENT_RESOURCE_TYPE_REGISTERED_MODEL`, `DEPLOYMENT_RESOURCE_TYPE_SCHEMA`, `DEPLOYMENT_RESOURCE_TYPE_SECRET_SCOPE`, `DEPLOYMENT_RESOURCE_TYPE_SQL_WAREHOUSE`, `DEPLOYMENT_RESOURCE_TYPE_SYNCED_DATABASE_TABLE`, `DEPLOYMENT_RESOURCE_TYPE_VOLUME`: + *f = DeploymentResourceType(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "DEPLOYMENT_RESOURCE_TYPE_ALERT", "DEPLOYMENT_RESOURCE_TYPE_APP", "DEPLOYMENT_RESOURCE_TYPE_CATALOG", "DEPLOYMENT_RESOURCE_TYPE_CLUSTER", "DEPLOYMENT_RESOURCE_TYPE_DASHBOARD", "DEPLOYMENT_RESOURCE_TYPE_DATABASE_CATALOG", "DEPLOYMENT_RESOURCE_TYPE_DATABASE_INSTANCE", "DEPLOYMENT_RESOURCE_TYPE_EXPERIMENT", "DEPLOYMENT_RESOURCE_TYPE_EXTERNAL_LOCATION", "DEPLOYMENT_RESOURCE_TYPE_JOB", "DEPLOYMENT_RESOURCE_TYPE_MODEL", "DEPLOYMENT_RESOURCE_TYPE_MODEL_SERVING_ENDPOINT", "DEPLOYMENT_RESOURCE_TYPE_PIPELINE", "DEPLOYMENT_RESOURCE_TYPE_POSTGRES_BRANCH", "DEPLOYMENT_RESOURCE_TYPE_POSTGRES_ENDPOINT", "DEPLOYMENT_RESOURCE_TYPE_POSTGRES_PROJECT", "DEPLOYMENT_RESOURCE_TYPE_QUALITY_MONITOR", "DEPLOYMENT_RESOURCE_TYPE_REGISTERED_MODEL", "DEPLOYMENT_RESOURCE_TYPE_SCHEMA", "DEPLOYMENT_RESOURCE_TYPE_SECRET_SCOPE", "DEPLOYMENT_RESOURCE_TYPE_SQL_WAREHOUSE", "DEPLOYMENT_RESOURCE_TYPE_SYNCED_DATABASE_TABLE", "DEPLOYMENT_RESOURCE_TYPE_VOLUME"`, v) + } +} + +// Values returns all possible values for DeploymentResourceType. +// +// There is no guarantee on the order of the values in the slice. +func (f *DeploymentResourceType) Values() []DeploymentResourceType { + return []DeploymentResourceType{ + DeploymentResourceTypeDeploymentResourceTypeAlert, + DeploymentResourceTypeDeploymentResourceTypeApp, + DeploymentResourceTypeDeploymentResourceTypeCatalog, + DeploymentResourceTypeDeploymentResourceTypeCluster, + DeploymentResourceTypeDeploymentResourceTypeDashboard, + DeploymentResourceTypeDeploymentResourceTypeDatabaseCatalog, + DeploymentResourceTypeDeploymentResourceTypeDatabaseInstance, + DeploymentResourceTypeDeploymentResourceTypeExperiment, + DeploymentResourceTypeDeploymentResourceTypeExternalLocation, + DeploymentResourceTypeDeploymentResourceTypeJob, + DeploymentResourceTypeDeploymentResourceTypeModel, + DeploymentResourceTypeDeploymentResourceTypeModelServingEndpoint, + DeploymentResourceTypeDeploymentResourceTypePipeline, + DeploymentResourceTypeDeploymentResourceTypePostgresBranch, + DeploymentResourceTypeDeploymentResourceTypePostgresEndpoint, + DeploymentResourceTypeDeploymentResourceTypePostgresProject, + DeploymentResourceTypeDeploymentResourceTypeQualityMonitor, + DeploymentResourceTypeDeploymentResourceTypeRegisteredModel, + DeploymentResourceTypeDeploymentResourceTypeSchema, + DeploymentResourceTypeDeploymentResourceTypeSecretScope, + DeploymentResourceTypeDeploymentResourceTypeSqlWarehouse, + DeploymentResourceTypeDeploymentResourceTypeSyncedDatabaseTable, + DeploymentResourceTypeDeploymentResourceTypeVolume, + } +} + +// Type always returns DeploymentResourceType to satisfy [pflag.Value] interface +func (f *DeploymentResourceType) Type() string { + return "DeploymentResourceType" +} + +// Status of a deployment. +type DeploymentStatus string + +const DeploymentStatusDeploymentStatusActive DeploymentStatus = `DEPLOYMENT_STATUS_ACTIVE` + +const DeploymentStatusDeploymentStatusDeleted DeploymentStatus = `DEPLOYMENT_STATUS_DELETED` + +const DeploymentStatusDeploymentStatusFailed DeploymentStatus = `DEPLOYMENT_STATUS_FAILED` + +const DeploymentStatusDeploymentStatusInProgress DeploymentStatus = `DEPLOYMENT_STATUS_IN_PROGRESS` + +// String representation for [fmt.Print] +func (f *DeploymentStatus) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *DeploymentStatus) Set(v string) error { + switch v { + case `DEPLOYMENT_STATUS_ACTIVE`, `DEPLOYMENT_STATUS_DELETED`, `DEPLOYMENT_STATUS_FAILED`, `DEPLOYMENT_STATUS_IN_PROGRESS`: + *f = DeploymentStatus(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "DEPLOYMENT_STATUS_ACTIVE", "DEPLOYMENT_STATUS_DELETED", "DEPLOYMENT_STATUS_FAILED", "DEPLOYMENT_STATUS_IN_PROGRESS"`, v) + } +} + +// Values returns all possible values for DeploymentStatus. +// +// There is no guarantee on the order of the values in the slice. +func (f *DeploymentStatus) Values() []DeploymentStatus { + return []DeploymentStatus{ + DeploymentStatusDeploymentStatusActive, + DeploymentStatusDeploymentStatusDeleted, + DeploymentStatusDeploymentStatusFailed, + DeploymentStatusDeploymentStatusInProgress, + } +} + +// Type always returns DeploymentStatus to satisfy [pflag.Value] interface +func (f *DeploymentStatus) Type() string { + return "DeploymentStatus" +} + +type GetDeploymentRequest struct { + // Resource name of the deployment to retrieve. Format: + // deployments/{deployment_id} + Name string `json:"-" url:"-"` +} + +type GetOperationRequest struct { + // The name of the resource operation to retrieve. Format: + // deployments/{deployment_id}/versions/{version_id}/operations/{resource_key} + Name string `json:"-" url:"-"` +} + +type GetResourceRequest struct { + // The name of the resource to retrieve. Format: + // deployments/{deployment_id}/resources/{resource_key} + Name string `json:"-" url:"-"` +} + +type GetVersionRequest struct { + // The name of the version to retrieve. Format: + // deployments/{deployment_id}/versions/{version_id} + Name string `json:"-" url:"-"` +} + +// Git provenance of a bundle's source, captured at deploy time. Lets consumers +// link a deployed resource back to its source in version control. +type GitInfo struct { + // Branch the source was deployed from. + Branch string `json:"branch,omitempty"` + // Commit SHA of the deployed source. + Commit string `json:"commit,omitempty"` + // URL of the git remote the source was deployed from. + OriginUrl string `json:"origin_url,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *GitInfo) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s GitInfo) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// A request to send a heartbeat for a Version. +type HeartbeatRequest struct { + // The version whose lock to renew. Format: + // deployments/{deployment_id}/versions/{version_id} + Name string `json:"-" url:"-"` +} + +// Response for Heartbeat. +type HeartbeatResponse struct { + // The new lock expiry time after renewal. + ExpireTime *time.Time `json:"expire_time,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *HeartbeatResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s HeartbeatResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListDeploymentsRequest struct { + // The maximum number of deployments to return. The service may return fewer + // than this value. If unspecified, at most 50 deployments will be returned. + // The maximum value is 1000; values above 1000 will be coerced to 1000. + PageSize int `json:"-" url:"page_size,omitempty"` + // A page token, received from a previous `ListDeployments` call. Provide + // this to retrieve the subsequent page. + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListDeploymentsRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListDeploymentsRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Response for ListDeployments. +type ListDeploymentsResponse struct { + // The deployments from the queried workspace. + Deployments []Deployment `json:"deployments,omitempty"` + // A token, which can be sent as `page_token` to retrieve the next page. If + // this field is omitted, there are no subsequent pages. + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListDeploymentsResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListDeploymentsResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListOperationsRequest struct { + // The maximum number of operations to return. The service may return fewer + // than this value. If unspecified, at most 50 operations will be returned. + // The maximum value is 1000; values above 1000 will be coerced to 1000. + PageSize int `json:"-" url:"page_size,omitempty"` + // A page token, received from a previous `ListOperations` call. Provide + // this to retrieve the subsequent page. + PageToken string `json:"-" url:"page_token,omitempty"` + // The parent version. Format: + // deployments/{deployment_id}/versions/{version_id} + Parent string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListOperationsRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListOperationsRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Response for ListOperations. +type ListOperationsResponse struct { + // A token, which can be sent as `page_token` to retrieve the next page. If + // this field is omitted, there are no subsequent pages. + NextPageToken string `json:"next_page_token,omitempty"` + // The resource operations under the specified version. + Operations []Operation `json:"operations,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListOperationsResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListOperationsResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListResourcesRequest struct { + // The maximum number of resources to return. The service may return fewer + // than this value. If unspecified, at most 50 resources will be returned. + // The maximum value is 1000; values above 1000 will be coerced to 1000. + PageSize int `json:"-" url:"page_size,omitempty"` + // A page token, received from a previous `ListResources` call. Provide this + // to retrieve the subsequent page. + PageToken string `json:"-" url:"page_token,omitempty"` + // The parent deployment. Format: deployments/{deployment_id} + Parent string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListResourcesRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListResourcesRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Response for ListResources. +type ListResourcesResponse struct { + // A token, which can be sent as `page_token` to retrieve the next page. If + // this field is omitted, there are no subsequent pages. + NextPageToken string `json:"next_page_token,omitempty"` + // The resources under the specified deployment. + Resources []Resource `json:"resources,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListResourcesResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListResourcesResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListVersionsRequest struct { + // The maximum number of versions to return. The service may return fewer + // than this value. If unspecified, at most 50 versions will be returned. + // The maximum value is 1000; values above 1000 will be coerced to 1000. + PageSize int `json:"-" url:"page_size,omitempty"` + // A page token, received from a previous `ListVersions` call. Provide this + // to retrieve the subsequent page. + PageToken string `json:"-" url:"page_token,omitempty"` + // The parent deployment. Format: deployments/{deployment_id} + Parent string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListVersionsRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListVersionsRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Response for ListVersions. +type ListVersionsResponse struct { + // A token, which can be sent as `page_token` to retrieve the next page. If + // this field is omitted, there are no subsequent pages. + NextPageToken string `json:"next_page_token,omitempty"` + // The versions under the specified deployment. + Versions []Version `json:"versions,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListVersionsResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListVersionsResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// An operation on a single resource performed during a version. Operations are +// append-only and record the result of applying a resource change to the +// workspace. +type Operation struct { + // The type of operation performed on this resource. + ActionType OperationActionType `json:"action_type"` + // When the operation was recorded. + CreateTime *time.Time `json:"create_time,omitempty"` + // Error message if the operation failed. Set when status is + // OPERATION_STATUS_FAILED. Captures the error encountered while applying + // the resource to the workspace. + ErrorMessage string `json:"error_message,omitempty"` + // Resource name of the operation. Format: + // deployments/{deployment_id}/versions/{version_id}/operations/{resource_key} + Name string `json:"name,omitempty"` + // ID reference for the actual resource in the workspace (e.g. the job ID, + // pipeline ID). + ResourceId string `json:"resource_id"` + // Resource identifier within the bundle (e.g. "jobs.foo", "pipelines.bar", + // "jobs.foo.permissions", "files."). Can be an arbitrary UTF-8 + // encoded string key. This key links the operation to the corresponding + // deployment-level Resource. + ResourceKey string `json:"resource_key,omitempty"` + // The type of the deployment resource this operation applies to. Derived + // from the `resource_key` prefix (e.g. "jobs" → JOB); the caller does not + // set this field. + ResourceType DeploymentResourceType `json:"resource_type,omitempty"` + // Serialized local config state after the operation. Should be unset for + // delete operations. + State *json.RawMessage `json:"state,omitempty"` + // Whether the operation succeeded or failed. + Status OperationStatus `json:"status"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *Operation) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s Operation) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Type of action performed on a resource during a deployment. +type OperationActionType string + +const OperationActionTypeOperationActionTypeBind OperationActionType = `OPERATION_ACTION_TYPE_BIND` + +const OperationActionTypeOperationActionTypeBindAndUpdate OperationActionType = `OPERATION_ACTION_TYPE_BIND_AND_UPDATE` + +const OperationActionTypeOperationActionTypeCreate OperationActionType = `OPERATION_ACTION_TYPE_CREATE` + +const OperationActionTypeOperationActionTypeDelete OperationActionType = `OPERATION_ACTION_TYPE_DELETE` + +const OperationActionTypeOperationActionTypeInitialRegister OperationActionType = `OPERATION_ACTION_TYPE_INITIAL_REGISTER` + +const OperationActionTypeOperationActionTypeRecreate OperationActionType = `OPERATION_ACTION_TYPE_RECREATE` + +const OperationActionTypeOperationActionTypeResize OperationActionType = `OPERATION_ACTION_TYPE_RESIZE` + +const OperationActionTypeOperationActionTypeUpdate OperationActionType = `OPERATION_ACTION_TYPE_UPDATE` + +const OperationActionTypeOperationActionTypeUpdateWithId OperationActionType = `OPERATION_ACTION_TYPE_UPDATE_WITH_ID` + +// String representation for [fmt.Print] +func (f *OperationActionType) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *OperationActionType) Set(v string) error { + switch v { + case `OPERATION_ACTION_TYPE_BIND`, `OPERATION_ACTION_TYPE_BIND_AND_UPDATE`, `OPERATION_ACTION_TYPE_CREATE`, `OPERATION_ACTION_TYPE_DELETE`, `OPERATION_ACTION_TYPE_INITIAL_REGISTER`, `OPERATION_ACTION_TYPE_RECREATE`, `OPERATION_ACTION_TYPE_RESIZE`, `OPERATION_ACTION_TYPE_UPDATE`, `OPERATION_ACTION_TYPE_UPDATE_WITH_ID`: + *f = OperationActionType(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "OPERATION_ACTION_TYPE_BIND", "OPERATION_ACTION_TYPE_BIND_AND_UPDATE", "OPERATION_ACTION_TYPE_CREATE", "OPERATION_ACTION_TYPE_DELETE", "OPERATION_ACTION_TYPE_INITIAL_REGISTER", "OPERATION_ACTION_TYPE_RECREATE", "OPERATION_ACTION_TYPE_RESIZE", "OPERATION_ACTION_TYPE_UPDATE", "OPERATION_ACTION_TYPE_UPDATE_WITH_ID"`, v) + } +} + +// Values returns all possible values for OperationActionType. +// +// There is no guarantee on the order of the values in the slice. +func (f *OperationActionType) Values() []OperationActionType { + return []OperationActionType{ + OperationActionTypeOperationActionTypeBind, + OperationActionTypeOperationActionTypeBindAndUpdate, + OperationActionTypeOperationActionTypeCreate, + OperationActionTypeOperationActionTypeDelete, + OperationActionTypeOperationActionTypeInitialRegister, + OperationActionTypeOperationActionTypeRecreate, + OperationActionTypeOperationActionTypeResize, + OperationActionTypeOperationActionTypeUpdate, + OperationActionTypeOperationActionTypeUpdateWithId, + } +} + +// Type always returns OperationActionType to satisfy [pflag.Value] interface +func (f *OperationActionType) Type() string { + return "OperationActionType" +} + +// Status of a resource operation. +type OperationStatus string + +const OperationStatusOperationStatusFailed OperationStatus = `OPERATION_STATUS_FAILED` + +const OperationStatusOperationStatusSucceeded OperationStatus = `OPERATION_STATUS_SUCCEEDED` + +// String representation for [fmt.Print] +func (f *OperationStatus) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *OperationStatus) Set(v string) error { + switch v { + case `OPERATION_STATUS_FAILED`, `OPERATION_STATUS_SUCCEEDED`: + *f = OperationStatus(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "OPERATION_STATUS_FAILED", "OPERATION_STATUS_SUCCEEDED"`, v) + } +} + +// Values returns all possible values for OperationStatus. +// +// There is no guarantee on the order of the values in the slice. +func (f *OperationStatus) Values() []OperationStatus { + return []OperationStatus{ + OperationStatusOperationStatusFailed, + OperationStatusOperationStatusSucceeded, + } +} + +// Type always returns OperationStatus to satisfy [pflag.Value] interface +func (f *OperationStatus) Type() string { + return "OperationStatus" +} + +// A resource managed by a deployment. Resources are implicitly created, +// updated, or deleted when operations are recorded on a version. +type Resource struct { + // The action performed on this resource during the last version. + LastActionType OperationActionType `json:"last_action_type,omitempty"` + // The version_id of the last version where this resource was updated. + LastVersionId string `json:"last_version_id,omitempty"` + // Resource name. Format: + // deployments/{deployment_id}/resources/{resource_key} + Name string `json:"name,omitempty"` + // ID that references the actual resource in the workspace (e.g. the job ID, + // pipeline ID). + ResourceId string `json:"resource_id,omitempty"` + // Resource identifier within the bundle (e.g. "jobs.foo", "pipelines.bar", + // "jobs.foo.permissions"). + ResourceKey string `json:"resource_key,omitempty"` + // The type of the deployment resource. + ResourceType DeploymentResourceType `json:"resource_type"` + // Serialized local config state (what the CLI deployed). + State *json.RawMessage `json:"state,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *Resource) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s Resource) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// A single invocation of a deploy or destroy command against a deployment. +// Creating a version acquires an exclusive lock on the parent deployment. +type Version struct { + // CLI version used to initiate the version. + CliVersion string `json:"cli_version"` + // When the version completed. Unset while the version is in progress. + CompleteTime *time.Time `json:"complete_time,omitempty"` + // The user who completed the version (email or principal name). May differ + // from `created_by` when another user force-completes the version. + CompletedBy string `json:"completed_by,omitempty"` + // Why the version was completed. Unset while in progress. Set when status + // transitions to COMPLETED. + CompletionReason VersionComplete `json:"completion_reason,omitempty"` + // When the version was created. + CreateTime *time.Time `json:"create_time,omitempty"` + // The user who created the version (email or principal name). + CreatedBy string `json:"created_by,omitempty"` + // Bundle target deployment mode (development or production), captured at + // the time of this version. + DeploymentMode DeploymentMode `json:"deployment_mode,omitempty"` + // Display name for the deployment, captured at the time of this version. + DisplayName string `json:"display_name,omitempty"` + // Git provenance of the source, captured at the time of this version. + GitInfo *GitInfo `json:"git_info,omitempty"` + // Resource name of the version. Format: + // deployments/{deployment_id}/versions/{version_id} + Name string `json:"name,omitempty"` + // Status of the version: IN_PROGRESS or COMPLETED. + Status VersionStatus `json:"status,omitempty"` + // Target name of the deployment, captured at the time of this version. + TargetName string `json:"target_name,omitempty"` + // Monotonically increasing version identifier within the parent deployment. + // Assigned by the client on creation. + VersionId string `json:"version_id,omitempty"` + // Type of version (deploy or destroy). + VersionType VersionType `json:"version_type"` + // Workspace location of the deployment, captured at the time of this + // version. + WorkspaceInfo *WorkspaceInfo `json:"workspace_info,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *Version) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s Version) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Reason why a version was completed. +type VersionComplete string + +const VersionCompleteVersionCompleteFailure VersionComplete = `VERSION_COMPLETE_FAILURE` + +const VersionCompleteVersionCompleteForceAbort VersionComplete = `VERSION_COMPLETE_FORCE_ABORT` + +const VersionCompleteVersionCompleteLeaseExpired VersionComplete = `VERSION_COMPLETE_LEASE_EXPIRED` + +const VersionCompleteVersionCompleteSuccess VersionComplete = `VERSION_COMPLETE_SUCCESS` + +// String representation for [fmt.Print] +func (f *VersionComplete) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *VersionComplete) Set(v string) error { + switch v { + case `VERSION_COMPLETE_FAILURE`, `VERSION_COMPLETE_FORCE_ABORT`, `VERSION_COMPLETE_LEASE_EXPIRED`, `VERSION_COMPLETE_SUCCESS`: + *f = VersionComplete(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "VERSION_COMPLETE_FAILURE", "VERSION_COMPLETE_FORCE_ABORT", "VERSION_COMPLETE_LEASE_EXPIRED", "VERSION_COMPLETE_SUCCESS"`, v) + } +} + +// Values returns all possible values for VersionComplete. +// +// There is no guarantee on the order of the values in the slice. +func (f *VersionComplete) Values() []VersionComplete { + return []VersionComplete{ + VersionCompleteVersionCompleteFailure, + VersionCompleteVersionCompleteForceAbort, + VersionCompleteVersionCompleteLeaseExpired, + VersionCompleteVersionCompleteSuccess, + } +} + +// Type always returns VersionComplete to satisfy [pflag.Value] interface +func (f *VersionComplete) Type() string { + return "VersionComplete" +} + +// Status of a version. +type VersionStatus string + +const VersionStatusVersionStatusCompleted VersionStatus = `VERSION_STATUS_COMPLETED` + +const VersionStatusVersionStatusInProgress VersionStatus = `VERSION_STATUS_IN_PROGRESS` + +// String representation for [fmt.Print] +func (f *VersionStatus) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *VersionStatus) Set(v string) error { + switch v { + case `VERSION_STATUS_COMPLETED`, `VERSION_STATUS_IN_PROGRESS`: + *f = VersionStatus(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "VERSION_STATUS_COMPLETED", "VERSION_STATUS_IN_PROGRESS"`, v) + } +} + +// Values returns all possible values for VersionStatus. +// +// There is no guarantee on the order of the values in the slice. +func (f *VersionStatus) Values() []VersionStatus { + return []VersionStatus{ + VersionStatusVersionStatusCompleted, + VersionStatusVersionStatusInProgress, + } +} + +// Type always returns VersionStatus to satisfy [pflag.Value] interface +func (f *VersionStatus) Type() string { + return "VersionStatus" +} + +// Type of version. +type VersionType string + +const VersionTypeVersionTypeDeploy VersionType = `VERSION_TYPE_DEPLOY` + +const VersionTypeVersionTypeDestroy VersionType = `VERSION_TYPE_DESTROY` + +// String representation for [fmt.Print] +func (f *VersionType) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *VersionType) Set(v string) error { + switch v { + case `VERSION_TYPE_DEPLOY`, `VERSION_TYPE_DESTROY`: + *f = VersionType(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "VERSION_TYPE_DEPLOY", "VERSION_TYPE_DESTROY"`, v) + } +} + +// Values returns all possible values for VersionType. +// +// There is no guarantee on the order of the values in the slice. +func (f *VersionType) Values() []VersionType { + return []VersionType{ + VersionTypeVersionTypeDeploy, + VersionTypeVersionTypeDestroy, + } +} + +// Type always returns VersionType to satisfy [pflag.Value] interface +func (f *VersionType) Type() string { + return "VersionType" +} + +// Workspace location of a bundle deployment, captured at deploy time. +type WorkspaceInfo struct { + // Absolute workspace path where the deployed bundle files live. Mirrors the + // workspace.file_path field in DABs bundle config. + FilePath string `json:"file_path,omitempty"` + // When deployed from a Databricks Git folder, the absolute workspace path + // of that folder; empty for local deploys. + GitFolderPath string `json:"git_folder_path,omitempty"` + // Absolute workspace path of the deployment root — the base path the + // deployed files live under. Mirrors workspace.root_path in the DABs bundle + // config; file_path is its files subdirectory. + RootPath string `json:"root_path,omitempty"` + // Whether files are served directly from the source sync root instead of + // being copied into file_path. + SourceLinked bool `json:"source_linked,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *WorkspaceInfo) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s WorkspaceInfo) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} diff --git a/service/catalog/model.go b/service/catalog/model.go index 7a30c34dc..3af89f205 100755 --- a/service/catalog/model.go +++ b/service/catalog/model.go @@ -551,6 +551,8 @@ type CatalogInfo struct { CreatedAt int64 `json:"created_at,omitempty"` // Username of catalog creator. CreatedBy string `json:"created_by,omitempty"` + // Custom maximum retention period in hours for the catalog + CustomMaxRetentionHours int64 `json:"custom_max_retention_hours,omitempty"` EffectivePredictiveOptimizationFlag *EffectivePredictiveOptimizationFlag `json:"effective_predictive_optimization_flag,omitempty"` // Whether predictive optimization should be enabled for this object and @@ -929,6 +931,9 @@ type ConnectionInfo struct { CreatedBy string `json:"created_by,omitempty"` // The type of credential. CredentialType CredentialType `json:"credential_type,omitempty"` + // [Create,Update:OPT] Connection environment settings as + // EnvironmentSettings object. + EnvironmentSettings *EnvironmentSettings `json:"environment_settings,omitempty"` // Full name of connection. FullName string `json:"full_name,omitempty"` // Unique identifier of parent metastore. @@ -1196,6 +1201,8 @@ type CreateCatalog struct { Comment string `json:"comment,omitempty"` // The name of the connection to an external data source. ConnectionName string `json:"connection_name,omitempty"` + // Custom maximum retention period in hours for the catalog + CustomMaxRetentionHours int64 `json:"custom_max_retention_hours,omitempty"` // Control CMK encryption for managed catalog data ManagedEncryptionSettings *EncryptionSettings `json:"managed_encryption_settings,omitempty"` // Name of catalog. @@ -1230,6 +1237,9 @@ type CreateConnection struct { Comment string `json:"comment,omitempty"` // The type of connection. ConnectionType ConnectionType `json:"connection_type"` + // [Create,Update:OPT] Connection environment settings as + // EnvironmentSettings object. + EnvironmentSettings *EnvironmentSettings `json:"environment_settings,omitempty"` // Name of the connection. Name string `json:"name"` // A map of key-value properties attached to the securable. @@ -1727,6 +1737,8 @@ type CreateSchema struct { CatalogName string `json:"catalog_name"` // User-provided free-form text description. Comment string `json:"comment,omitempty"` + // Custom maximum retention period in hours for the schema. + CustomMaxRetentionHours int64 `json:"custom_max_retention_hours,omitempty"` // Name of schema, relative to parent catalog. Name string `json:"name"` // A map of key-value properties attached to the securable. @@ -2846,6 +2858,22 @@ func (s EntityTagAssignment) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type EnvironmentSettings struct { + EnvironmentVersion string `json:"environment_version,omitempty"` + + JavaDependencies []string `json:"java_dependencies,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *EnvironmentSettings) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s EnvironmentSettings) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type ExistsRequest struct { // Full name of the table. FullName string `json:"-" url:"-"` @@ -7116,6 +7144,8 @@ type SchemaInfo struct { CreatedAt int64 `json:"created_at,omitempty"` // Username of schema creator. CreatedBy string `json:"created_by,omitempty"` + // Custom maximum retention period in hours for the schema. + CustomMaxRetentionHours int64 `json:"custom_max_retention_hours,omitempty"` EffectivePredictiveOptimizationFlag *EffectivePredictiveOptimizationFlag `json:"effective_predictive_optimization_flag,omitempty"` // Whether predictive optimization should be enabled for this object and @@ -7241,9 +7271,10 @@ func (s Securable) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Latest kind: MEMORY_STORE_STANDARD = 342; Next id: 343. Reserved numbers: -// 316, 317, 327, 330, 341 (former ENDPOINT_LLM_*, MODEL_SERVICE_STANDARD, -// MODEL_SERVICE_SYSTEM_DELTASHARING, MCP_SERVICE_STANDARD). +// Latest kind: CONNECTION_ADOBE_CAMPAIGNS_OAUTH_M2M = 345; Next id: 346. +// Reserved numbers: 316, 317, 327, 330, 341 (former ENDPOINT_LLM_*, +// MODEL_SERVICE_STANDARD, MODEL_SERVICE_SYSTEM_DELTASHARING, +// MCP_SERVICE_STANDARD). type SecurableKind string const SecurableKindTableDbStorage SecurableKind = `TABLE_DB_STORAGE` @@ -8315,6 +8346,8 @@ func (s UpdateAccountsStorageCredential) MarshalJSON() ([]byte, error) { type UpdateCatalog struct { // User-provided free-form text description. Comment string `json:"comment,omitempty"` + // Custom maximum retention period in hours for the catalog + CustomMaxRetentionHours int64 `json:"custom_max_retention_hours,omitempty"` // Whether predictive optimization should be enabled for this object and // objects under it. EnablePredictiveOptimization EnablePredictiveOptimization `json:"enable_predictive_optimization,omitempty"` @@ -8351,6 +8384,9 @@ type UpdateCatalogWorkspaceBindingsResponse struct { } type UpdateConnection struct { + // [Create,Update:OPT] Connection environment settings as + // EnvironmentSettings object. + EnvironmentSettings *EnvironmentSettings `json:"environment_settings,omitempty"` // Name of the connection. Name string `json:"-" url:"-"` // New name for the connection. @@ -8830,6 +8866,8 @@ func (s UpdateRequestExternalLineage) MarshalJSON() ([]byte, error) { type UpdateSchema struct { // User-provided free-form text description. Comment string `json:"comment,omitempty"` + // Custom maximum retention period in hours for the schema. + CustomMaxRetentionHours int64 `json:"custom_max_retention_hours,omitempty"` // Whether predictive optimization should be enabled for this object and // objects under it. EnablePredictiveOptimization EnablePredictiveOptimization `json:"enable_predictive_optimization,omitempty"` diff --git a/service/disasterrecovery/api.go b/service/disasterrecovery/api.go index 967d40205..6d8c21711 100755 --- a/service/disasterrecovery/api.go +++ b/service/disasterrecovery/api.go @@ -35,11 +35,17 @@ type DisasterRecoveryInterface interface { // List failover groups. // + // List entries are abbreviated: `state` and `replication_point` are not + // populated. Call GetFailoverGroup to retrieve the full resource. + // // This method is generated by Databricks SDK Code Generator. ListFailoverGroups(ctx context.Context, request ListFailoverGroupsRequest) listing.Iterator[FailoverGroup] // List failover groups. // + // List entries are abbreviated: `state` and `replication_point` are not + // populated. Call GetFailoverGroup to retrieve the full resource. + // // This method is generated by Databricks SDK Code Generator. ListFailoverGroupsAll(ctx context.Context, request ListFailoverGroupsRequest) ([]FailoverGroup, error) diff --git a/service/disasterrecovery/impl.go b/service/disasterrecovery/impl.go index 57b41b0b4..42b1af2bf 100755 --- a/service/disasterrecovery/impl.go +++ b/service/disasterrecovery/impl.go @@ -115,6 +115,9 @@ func (a *disasterRecoveryImpl) GetStableUrl(ctx context.Context, request GetStab } // List failover groups. +// +// List entries are abbreviated: `state` and `replication_point` are not +// populated. Call GetFailoverGroup to retrieve the full resource. func (a *disasterRecoveryImpl) ListFailoverGroups(ctx context.Context, request ListFailoverGroupsRequest) listing.Iterator[FailoverGroup] { getNextPage := func(ctx context.Context, req ListFailoverGroupsRequest) (*ListFailoverGroupsResponse, error) { @@ -140,6 +143,9 @@ func (a *disasterRecoveryImpl) ListFailoverGroups(ctx context.Context, request L } // List failover groups. +// +// List entries are abbreviated: `state` and `replication_point` are not +// populated. Call GetFailoverGroup to retrieve the full resource. func (a *disasterRecoveryImpl) ListFailoverGroupsAll(ctx context.Context, request ListFailoverGroupsRequest) ([]FailoverGroup, error) { iterator := a.ListFailoverGroups(ctx, request) return listing.ToSlice[FailoverGroup](ctx, iterator) diff --git a/service/disasterrecovery/interface.go b/service/disasterrecovery/interface.go index 80521519e..cde401009 100755 --- a/service/disasterrecovery/interface.go +++ b/service/disasterrecovery/interface.go @@ -33,6 +33,9 @@ type DisasterRecoveryService interface { GetStableUrl(ctx context.Context, request GetStableUrlRequest) (*StableUrl, error) // List failover groups. + // + // List entries are abbreviated: `state` and `replication_point` are not + // populated. Call GetFailoverGroup to retrieve the full resource. ListFailoverGroups(ctx context.Context, request ListFailoverGroupsRequest) (*ListFailoverGroupsResponse, error) // List stable URLs for an account. diff --git a/service/disasterrecovery/model.go b/service/disasterrecovery/model.go index 11462f6d0..6078a0bb2 100755 --- a/service/disasterrecovery/model.go +++ b/service/disasterrecovery/model.go @@ -90,7 +90,7 @@ type FailoverFailoverGroupRequest struct { // The fully qualified resource name of the failover group to failover. // Format: accounts/{account_id}/failover-groups/{failover_group_id}. Name string `json:"-" url:"-"` - // The target primary region. Must be one of the derived regions and + // The target primary region. Must be one of the participating regions and // different from the current effective_primary_region. Serves as an // idempotency check. TargetPrimaryRegion string `json:"target_primary_region"` @@ -142,7 +142,7 @@ func (f *FailoverFailoverGroupRequestFailoverType) Type() string { } // A failover group manages disaster recovery across workspace sets, -// coordinating UCDR and CPDR replication. +// coordinating Unity Catalog and workspace assets replication. type FailoverGroup struct { // Time at which this failover group was created. CreateTime *time.Time `json:"create_time,omitempty"` @@ -361,19 +361,17 @@ type StableUrl struct { // Fully qualified resource name of the FailoverGroup this stable URL is // currently linked to, in the format // `accounts/{account_id}/failover-groups/{failover_group_id}`. Empty when - // the stable URL is not attached to any failover group. Server-controlled: - // written by CreateFailoverGroup / UpdateFailoverGroup on link, cleared by - // DeleteFailoverGroup / UpdateFailoverGroup on unlink. + // the stable URL is not attached to any failover group. FailoverGroupName string `json:"failover_group_name,omitempty"` // The workspace this stable URL is initially bound to. Used only in Create // requests to associate the stable URL with a workspace. Not returned in - // responses. Mirrors FailoverGroup.initial_primary_region semantics. + // responses. InitialWorkspaceId string `json:"initial_workspace_id"` // Fully qualified resource name. Format: // accounts/{account_id}/stable-urls/{stable_url_id}. Name string `json:"name,omitempty"` - // The stable URL endpoint. Generated by the backend on creation and - // immutable thereafter. For non-Private-Link workspaces this is + // The stable URL endpoint. Generated on creation and immutable thereafter. + // For non-Private-Link workspaces this is // `https:///?c=`. For Private-Link workspaces // this is the per-connection hostname. Url string `json:"url,omitempty"` @@ -422,13 +420,13 @@ type WorkspaceSet struct { // Resource name for this workspace set. Name string `json:"name"` // Whether to enable control plane DR (notebooks, jobs, clusters, etc.) for - // this set. Requires all workspaces in the set to be Mission Critical tier. + // this set. ReplicateWorkspaceAssets bool `json:"replicate_workspace_assets"` // Resource names of stable URLs associated with this workspace set. Format: // accounts/{account_id}/stable-urls/{stable_url_id}. The referenced stable // URLs must already exist (via CreateStableUrl). StableUrlNames []string `json:"stable_url_names,omitempty"` - // Workspace IDs in this set. The system derives and validates regions. EA: - // exactly 2 workspaces (one per region). + // Workspace IDs in this set. The system derives and validates regions. All + // workspaces must be in the Mission Critical tier. WorkspaceIds []string `json:"workspace_ids"` } diff --git a/service/jobs/model.go b/service/jobs/model.go index 5d2e3e0f1..43f33306b 100755 --- a/service/jobs/model.go +++ b/service/jobs/model.go @@ -1459,6 +1459,11 @@ func (f *Format) Type() string { return "Format" } +// DEPRECATED — use `AiRuntimeTask` for all new BYOT multi-node GPU workloads +// (see ai_runtime_task.proto). `AiRuntimeTask` is the only supported BYOT task +// type for new workloads; this proto is retained only for AIR CLI (fka SGCLI) +// pywheel backwards compatibility and will be removed once the pywheel → +// databricks-cli migration completes (post- PuPr). type GenAiComputeTask struct { // Command launcher to run the actual script, e.g. bash, python etc. Command string `json:"command,omitempty"` diff --git a/service/ml/model.go b/service/ml/model.go index d0005a8d4..79fdb7058 100755 --- a/service/ml/model.go +++ b/service/ml/model.go @@ -929,6 +929,8 @@ type DataSource struct { KafkaSource *KafkaSource `json:"kafka_source,omitempty"` // A request-time data source. RequestSource *RequestSource `json:"request_source,omitempty"` + // A Stream data source. + StreamSource *StreamSource `json:"stream_source,omitempty"` } // Dataset. Represents a reference to data used for training, testing, or @@ -2207,6 +2209,9 @@ type KafkaConfig struct { // Catch-all for miscellaneous options. Keys should be source options or // Kafka consumer options (kafka.*) ExtraOptions map[string]string `json:"extra_options,omitempty"` + // Configuration for ingesting Kafka data into a Databricks-managed Delta + // table. + IngestionConfig *IngestionConfig `json:"ingestion_config,omitempty"` // Schema configuration for extracting message keys from topics. At least // one of key_schema and value_schema must be provided. KeySchema *SchemaConfig `json:"key_schema,omitempty"` @@ -2670,6 +2675,13 @@ func (s ListStreamsRequest) MarshalJSON() ([]byte, error) { } // Response to a ListStreamsRequest. +// +// NOTE: Results are post-filtered by access permission on each stream's +// ingestion table. This means: - Returned results may be fewer than page_size +// (including zero) - Page token points to next unfiltered batch, not next +// filtered batch, and may point to an item that will be filtered out Callers +// should paginate until next_page_token is empty to retrieve all accessible +// streams. type ListStreamsResponse struct { // Pagination token to request the next page of results for this query. NextPageToken string `json:"next_page_token,omitempty"` @@ -3018,6 +3030,8 @@ func (s LoggedModelTag) MarshalJSON() ([]byte, error) { type MaterializedFeature struct { // The quartz cron expression that defines the schedule of the // materialization pipeline. The schedule is evaluated in the UTC timezone. + // Hidden from GraphQL: superseded by the `trigger` oneof + // (cron_schedule_trigger), so not exposed to Catalog Explorer. CronSchedule string `json:"cron_schedule,omitempty"` // A cron-based schedule trigger for the materialization pipeline. CronScheduleTrigger *CronSchedule `json:"cron_schedule_trigger,omitempty"` @@ -3035,7 +3049,8 @@ type MaterializedFeature struct { OfflineStoreConfig *OfflineStoreConfig `json:"offline_store_config,omitempty"` // Destination for writing feature values to an online Lakebase table. OnlineStoreConfig *OnlineStoreConfig `json:"online_store_config,omitempty"` - // The schedule state of the materialization pipeline. + // The schedule state of the materialization pipeline. Hidden from GraphQL: + // being deprecated, so not exposed to Catalog Explorer. PipelineScheduleState MaterializedFeaturePipelineScheduleState `json:"pipeline_schedule_state,omitempty"` // The Structured Streaming trigger mode used for materialization. Real-time // mode (RTM) targets sub-second latency for operational workloads; @@ -4952,6 +4967,24 @@ type StreamSchemaConfig struct { DirectSchemas *DirectSchemas `json:"direct_schemas,omitempty"` } +// A Stream entity used as a data source for a feature. +type StreamSource struct { + // The filter condition applied to the source data before aggregation. + FilterCondition string `json:"filter_condition,omitempty"` + // Three-part full name of the Stream (catalog.schema.stream). + FullName string `json:"full_name"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *StreamSource) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s StreamSource) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + // Source-specific configuration. Determines the streaming platform source. type StreamSourceConfig struct { // Configuration for Apache Kafka streams. diff --git a/service/pipelines/model.go b/service/pipelines/model.go index beba46d74..6a689d0a1 100755 --- a/service/pipelines/model.go +++ b/service/pipelines/model.go @@ -1680,26 +1680,32 @@ func (f *MaturityLevel) Type() string { // Meta Marketing (Meta Ads) specific options for ingestion type MetaMarketingOptions struct { - // (Optional) Action attribution windows for insights reporting (e.g. - // "28d_click", "1d_view") + // (Optional, DEPRECATED — use + // custom_report_options.action_attribution_windows) Action attribution + // windows for insights reporting (e.g. "28d_click", "1d_view") ActionAttributionWindows []string `json:"action_attribution_windows,omitempty"` - // (Optional) Action breakdowns to configure for data aggregation + // (Optional, DEPRECATED — use custom_report_options.action_breakdowns) + // Action breakdowns ActionBreakdowns []string `json:"action_breakdowns,omitempty"` - // (Optional) Timing used to report action statistics (impression, - // conversion, mixed, or lifetime) + // (Optional, DEPRECATED — use custom_report_options.action_report_time) + // Timing used to report action statistics (impression, conversion, mixed, + // or lifetime) ActionReportTime string `json:"action_report_time,omitempty"` - // (Optional) Breakdowns to configure for data aggregation + // (Optional, DEPRECATED — use custom_report_options.breakdowns) + // Breakdowns to configure Breakdowns []string `json:"breakdowns,omitempty"` // (Optional) Window in days to revisit data during sync to capture updated - // conversion data from the API. + // conversion data from the API, shared by prebuilt and custom reports. CustomInsightsLookbackWindow int `json:"custom_insights_lookback_window,omitempty"` - // (Optional) Granularity of data to pull (account, ad, adset, campaign) + // (Optional, DEPRECATED — use custom_report_options.level) Granularity of + // data to pull (account, ad, adset, campaign) Level string `json:"level,omitempty"` // (Optional) Start date in yyyy-MM-dd format (e.g. 2025-01-15). Data added - // after this date will be ingested + // after this date will be ingested, shared by prebuilt and custom reports. StartDate string `json:"start_date,omitempty"` - // (Optional) Value in string by which to aggregate statistics (can take - // all_days, monthly or number of days) + // (Optional, DEPRECATED — use custom_report_options.time_increment) Value + // in string by which to aggregate statistics (can take all_days, monthly or + // number of days) TimeIncrement string `json:"time_increment,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -3186,6 +3192,21 @@ type TableSpecificConfig struct { // "auto_full_refresh_policy": { "enabled": true, "min_interval_hours": 23, // } } If unspecified, auto full refresh is disabled. AutoFullRefreshPolicy *AutoFullRefreshPolicy `json:"auto_full_refresh_policy,omitempty"` + // List of column names to use for clustering the destination table. When + // specified, the destination Delta table will be clustered by these + // columns. This can improve query performance when filtering on these + // columns. Note: clustering_columns in table specific configuration will + // override the pipeline definition. Note: we can only provide + // enable_auto_clustering or clustering_columns, added as separate fields as + // we cannot have repeated field in oneof. + ClusteringColumns []string `json:"clustering_columns,omitempty"` + // Whether to enable auto clustering on the destination table. When enabled, + // Delta will automatically optimize the data layout based on the clustering + // columns for improved query performance. Note: enable_auto_clustering in + // table specific configuration will override the pipeline definition. Note: + // we can only provide enable_auto_clustering or clustering_columns, added + // as separate fields as we cannot have repeated field in oneof. + EnableAutoClustering bool `json:"enable_auto_clustering,omitempty"` // A list of column names to be excluded for the ingestion. When not // specified, include_columns fully controls what columns to be ingested. // When specified, all other columns including future ones will be @@ -3215,6 +3236,13 @@ type TableSpecificConfig struct { // data. Spark Declarative Pipelines uses this sequencing to handle change // events that arrive out of order. SequenceBy []string `json:"sequence_by,omitempty"` + // Table properties to set on the destination table. These are key-value + // pairs that configure various Delta table behaviors or any user defined + // properties. Example: {"delta.feature.variantType": "supported", + // "delta.enableTypeWidening": "true"} Note: table_properties in table + // specific configuration will override the table_properties of the pipeline + // definition. + TableProperties map[string]string `json:"table_properties,omitempty"` // (Optional) Additional custom parameters for Workday Report WorkdayReportParameters *IngestionPipelineDefinitionWorkdayReportParameters `json:"workday_report_parameters,omitempty"` @@ -3272,32 +3300,23 @@ func (f *TableSpecificConfigScdType) Type() string { // TikTok Ads specific options for ingestion type TikTokAdsOptions struct { - // (Optional) Data level for the report. If not specified, defaults to - // AUCTION_CAMPAIGN. + // Deprecated. Use custom_report_options.data_level instead. DataLevel TikTokAdsOptionsTikTokDataLevel `json:"data_level,omitempty"` - // (Optional) Dimensions to include in the report. Examples: "campaign_id", - // "adgroup_id", "ad_id", "stat_time_day", "stat_time_hour" If not - // specified, defaults to campaign_id. + // Deprecated. Use custom_report_options.dimensions instead. Dimensions []string `json:"dimensions,omitempty"` // (Optional) Number of days to look back for report tables during // incremental sync to capture late-arriving conversions and attribution - // data. If not specified, defaults to 7 days. + // data. LookbackWindowDays int `json:"lookback_window_days,omitempty"` - // (Optional) Metrics to include in the report. Examples: "spend", - // "impressions", "clicks", "conversion", "cpc" If not specified, defaults - // to basic metrics (spend, impressions, clicks, etc.) + // Deprecated. Use custom_report_options.metrics instead. Metrics []string `json:"metrics,omitempty"` - // (Optional) Whether to request lifetime metrics (all-time aggregated - // data). When true, the report returns all-time data. If not specified, - // defaults to false. + // Deprecated. Use custom_report_options.query_lifetime instead. QueryLifetime bool `json:"query_lifetime,omitempty"` - // (Optional) Report type for the TikTok Ads API. If not specified, defaults - // to BASIC. + // Deprecated. Use custom_report_options.report_type instead. ReportType TikTokAdsOptionsTikTokReportType `json:"report_type,omitempty"` // (Optional) Start date for the initial sync of report tables in YYYY-MM-DD // format. This determines the earliest date from which to sync historical - // data. If not specified, defaults to 1 year of historical data for daily - // reports and 30 days for hourly reports. + // data. SyncStartDate string `json:"sync_start_date,omitempty"` ForceSendFields []string `json:"-" url:"-"` diff --git a/service/pkg.go b/service/pkg.go index 177759df8..bdabe66e6 100755 --- a/service/pkg.go +++ b/service/pkg.go @@ -8,6 +8,8 @@ // // - [agentbricks.AgentBricksAPI]: The Custom LLMs service manages state and powers the UI for the Custom LLM product. // +// - [aisearch.AiSearchAPI]: **AI Search Endpoint**: Represents the compute resources to host AI Search indexes. +// // - [settings.AibiDashboardEmbeddingAccessPolicyAPI]: Controls whether AI/BI published dashboard embedding is enabled, conditionally enabled, or disabled at the workspace level. // // - [settings.AibiDashboardEmbeddingApprovedDomainsAPI]: Controls the list of domains approved to host the embedded AI/BI dashboards. @@ -32,7 +34,7 @@ // // - [billing.BudgetsAPI]: These APIs manage budget configurations for this account. // -// - [bundle.BundleAPI]: Service for managing bundle deployment metadata. +// - [bundledeployments.BundleDeploymentsAPI]: Service for managing bundle deployment metadata. // // - [catalog.CatalogsAPI]: A catalog is the first layer of Unity Catalog’s three-level namespace. // @@ -377,9 +379,10 @@ package service import ( "github.com/databricks/databricks-sdk-go/service/agentbricks" + "github.com/databricks/databricks-sdk-go/service/aisearch" "github.com/databricks/databricks-sdk-go/service/apps" "github.com/databricks/databricks-sdk-go/service/billing" - "github.com/databricks/databricks-sdk-go/service/bundle" + "github.com/databricks/databricks-sdk-go/service/bundledeployments" "github.com/databricks/databricks-sdk-go/service/catalog" "github.com/databricks/databricks-sdk-go/service/cleanrooms" "github.com/databricks/databricks-sdk-go/service/compute" @@ -422,6 +425,7 @@ var ( _ *iam.AccountAccessControlAPI = nil _ *iam.AccountAccessControlProxyAPI = nil _ *agentbricks.AgentBricksAPI = nil + _ *aisearch.AiSearchAPI = nil _ *settings.AibiDashboardEmbeddingAccessPolicyAPI = nil _ *settings.AibiDashboardEmbeddingApprovedDomainsAPI = nil _ *sql.AlertsAPI = nil @@ -434,7 +438,7 @@ var ( _ *billing.BillableUsageAPI = nil _ *billing.BudgetPolicyAPI = nil _ *billing.BudgetsAPI = nil - _ *bundle.BundleAPI = nil + _ *bundledeployments.BundleDeploymentsAPI = nil _ *catalog.CatalogsAPI = nil _ *cleanrooms.CleanRoomAssetRevisionsAPI = nil _ *cleanrooms.CleanRoomAssetsAPI = nil diff --git a/service/postgres/model.go b/service/postgres/model.go index d0cc66444..682f526af 100755 --- a/service/postgres/model.go +++ b/service/postgres/model.go @@ -13,6 +13,8 @@ import ( ) type Branch struct { + // The part of the name, chosen by the user when the resource was created. + BranchId string `json:"branch_id,omitempty"` // A timestamp indicating when the branch was created. CreateTime *time.Time `json:"create_time,omitempty"` // Output only. The full resource path of the branch. Format: @@ -185,6 +187,8 @@ func (f *BranchStatusState) Type() string { } type Catalog struct { + // The part of the name, chosen by the user when the resource was created. + CatalogId string `json:"catalog_id,omitempty"` // A timestamp indicating when the catalog was created. CreateTime *time.Time `json:"create_time,omitempty"` // Output only. The full resource path of the catalog. @@ -431,6 +435,8 @@ type CreateSyncedTableRequest struct { type Database struct { // A timestamp indicating when the database was created. CreateTime *time.Time `json:"create_time,omitempty"` + // The part of the name, chosen by the user when the resource was created. + DatabaseId string `json:"database_id,omitempty"` // The resource name of the database. Format: // projects/{project_id}/branches/{branch_id}/databases/{database_id} Name string `json:"name,omitempty"` @@ -653,6 +659,8 @@ func (s DeltaTableSyncInfo) MarshalJSON() ([]byte, error) { type Endpoint struct { // A timestamp indicating when the compute endpoint was created. CreateTime *time.Time `json:"create_time,omitempty"` + // The part of the name, chosen by the user when the resource was created. + EndpointId string `json:"endpoint_id,omitempty"` // Output only. The full resource path of the endpoint. Format: // projects/{project_id}/branches/{branch_id}/endpoints/{endpoint_id} Name string `json:"name,omitempty"` @@ -1534,6 +1542,8 @@ type Project struct { // Output only. The full resource path of the project. Format: // projects/{project_id} Name string `json:"name,omitempty"` + // The part of the name, chosen by the user when the resource was created. + ProjectId string `json:"project_id,omitempty"` // A timestamp indicating when the project is scheduled for permanent // deletion. Empty if the project is not deleted, otherwise set to a // timestamp in the future. @@ -1845,6 +1855,8 @@ type Role struct { // The Branch where this Role exists. Format: // projects/{project_id}/branches/{branch_id} Parent string `json:"parent,omitempty"` + // The part of the name, chosen by the user when the resource was created. + RoleId string `json:"role_id,omitempty"` // The spec contains the role configuration, including identity type, // authentication method, and role attributes. Spec *RoleRoleSpec `json:"spec,omitempty"` @@ -2110,6 +2122,8 @@ type SyncedTable struct { Spec *SyncedTableSyncedTableSpec `json:"spec,omitempty"` // Synced Table data synchronization status. Status *SyncedTableSyncedTableStatus `json:"status,omitempty"` + // The part of the name, chosen by the user when the resource was created. + SyncedTableId string `json:"synced_table_id,omitempty"` // The Unity Catalog table ID for this synced table. Uid string `json:"uid,omitempty"` diff --git a/service/settings/model.go b/service/settings/model.go index f838e0d89..797d88774 100755 --- a/service/settings/model.go +++ b/service/settings/model.go @@ -2429,6 +2429,9 @@ func (f *EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestina } type EgressNetworkPolicyNetworkAccessPolicy struct { + // List of Databricks workspace destinations that serverless workloads are + // allowed to access when in RESTRICTED_ACCESS mode. + AllowedDatabricksDestinations []EgressNetworkPolicyNetworkAccessPolicyDatabricksDestination `json:"allowed_databricks_destinations,omitempty"` // List of internet destinations that serverless workloads are allowed to // access when in RESTRICTED_ACCESS mode. AllowedInternetDestinations []EgressNetworkPolicyNetworkAccessPolicyInternetDestination `json:"allowed_internet_destinations,omitempty"` @@ -2448,6 +2451,11 @@ type EgressNetworkPolicyNetworkAccessPolicy struct { RestrictionMode EgressNetworkPolicyNetworkAccessPolicyRestrictionMode `json:"restriction_mode"` } +type EgressNetworkPolicyNetworkAccessPolicyDatabricksDestination struct { + // The workspace IDs to allow egress traffic to. + WorkspaceIds []int64 `json:"workspace_ids,omitempty"` +} + // Users can specify accessible internet destinations when outbound access is // restricted. We only support DNS_NAME (FQDN format) destinations for the time // being. Going forward we may extend support to host names and IP addresses. diff --git a/service/sql/impl.go b/service/sql/impl.go index a740392d9..bbee0e283 100755 --- a/service/sql/impl.go +++ b/service/sql/impl.go @@ -1319,12 +1319,11 @@ func (a *warehousesImpl) Start(ctx context.Context, request StartRequest) error queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - headers["Content-Type"] = "application/json" cfg := a.client.Config if cfg.WorkspaceID != "" { headers["X-Databricks-Workspace-Id"] = cfg.WorkspaceID } - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, nil) return err } @@ -1333,12 +1332,11 @@ func (a *warehousesImpl) Stop(ctx context.Context, request StopRequest) error { queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - headers["Content-Type"] = "application/json" cfg := a.client.Config if cfg.WorkspaceID != "" { headers["X-Databricks-Workspace-Id"] = cfg.WorkspaceID } - err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, nil) return err } diff --git a/service/sql/model.go b/service/sql/model.go index efcc7bd6f..91809f457 100755 --- a/service/sql/model.go +++ b/service/sql/model.go @@ -4994,7 +4994,6 @@ func (f *SpotInstancePolicy) Type() string { return "SpotInstancePolicy" } -// Starts a SQL warehouse. This API is idempotent. type StartRequest struct { // Required. Id of the SQL warehouse. Id string `json:"-" url:"-"` @@ -5213,7 +5212,6 @@ func (f *Status) Type() string { return "Status" } -// Stops a SQL warehouse. This API is idempotent. type StopRequest struct { // Required. Id of the SQL warehouse. Id string `json:"-" url:"-"` diff --git a/service/vectorsearch/model.go b/service/vectorsearch/model.go index e1d04e9b5..e8e89cd50 100755 --- a/service/vectorsearch/model.go +++ b/service/vectorsearch/model.go @@ -478,6 +478,24 @@ func (f *EndpointType) Type() string { return "EndpointType" } +// Facet aggregation rows returned by a query. +type FacetResultData struct { + // Facet rows. Each row is `[facet_column_name, value_or_range, count]`. + FacetArray [][]string `json:"facet_array,omitempty"` + // Number of facet rows returned. + FacetRowCount int `json:"facet_row_count,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *FacetResultData) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s FacetResultData) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type GetEndpointRequest struct { // Name of the endpoint EndpointName string `json:"-" url:"-"` @@ -862,6 +880,12 @@ type QueryVectorIndexRequest struct { Columns []string `json:"columns"` // Column names used to retrieve data to send to the reranker. ColumnsToRerank []string `json:"columns_to_rerank,omitempty"` + // Facets to compute over the matched results. Each entry has one of these + // forms: `""` - top 10 distinct values by count `" TOP + // "` - top n distinct values, where n > 0 `" BUCKETS + // [[from,to],...]"` - inclusive numeric ranges `TOP` and `BUCKETS` are + // case-insensitive. A column may appear at most once. + Facets []string `json:"facets,omitempty"` // JSON string representing query filters. // // Example filters: @@ -875,6 +899,9 @@ type QueryVectorIndexRequest struct { IndexName string `json:"-" url:"-"` // Number of results to return. Defaults to 10. NumResults int `json:"num_results,omitempty"` + // Text columns to search for `query_text`. When empty, all text columns are + // searched. + QueryColumns []string `json:"query_columns,omitempty"` // Query text. Required for Delta Sync Index using model endpoint. QueryText string `json:"query_text,omitempty"` // The query type to use. Choices are `ANN` and `HYBRID` and `FULL_TEXT`. @@ -893,6 +920,10 @@ type QueryVectorIndexRequest struct { Reranker *RerankerConfig `json:"reranker,omitempty"` // Threshold for the approximate nearest neighbor search. Defaults to 0.0. ScoreThreshold float64 `json:"score_threshold,omitempty"` + // Sort results by column values instead of the default relevance ordering. + // Each clause has the form `" ASC"` or `" DESC"`, for + // example `["rating DESC", "price ASC"]`. + SortColumns []string `json:"sort_columns,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -906,6 +937,8 @@ func (s QueryVectorIndexRequest) MarshalJSON() ([]byte, error) { } type QueryVectorIndexResponse struct { + // Facet aggregation rows returned by a query. + FacetResult *FacetResultData `json:"facet_result,omitempty"` // Metadata about the result set. Manifest *ResultManifest `json:"manifest,omitempty"` // [Optional] Token that can be used in `QueryVectorIndexNextPage` API to @@ -974,6 +1007,10 @@ type ResultManifest struct { ColumnCount int `json:"column_count,omitempty"` // Information about each column in the result set. Columns []ColumnInfo `json:"columns,omitempty"` + // Number of columns in `facet_result`. + FacetColumnCount int `json:"facet_column_count,omitempty"` + // Information about each column in `facet_result`. + FacetColumns []ColumnInfo `json:"facet_columns,omitempty"` ForceSendFields []string `json:"-" url:"-"` } diff --git a/service/workspace/model.go b/service/workspace/model.go index bd1a614e9..b16d5015f 100755 --- a/service/workspace/model.go +++ b/service/workspace/model.go @@ -1283,6 +1283,19 @@ func (s UpdateCredentialsRequest) MarshalJSON() ([]byte, error) { type UpdateRepoRequest struct { // Branch that the local version of the repo is checked out to. Branch string `json:"branch,omitempty"` + // WARNING: DESTRUCTIVE AND IRREVERSIBLE. If true, permanently deletes ALL + // uncommitted changes in the Git folder — staged, unstaged, and untracked + // files — before updating. Lost data CANNOT be recovered. + // + // NEVER use this on Git folders where users author or edit files. This flag + // is intended ONLY for automated jobs that treat the Git folder as a + // read-only mirror of a remote branch and need to force-sync it. If any + // user has uncommitted work in the Git folder, that work will be + // permanently destroyed without warning. + // + // Local commits that have been made but not yet pushed to the remote are + // preserved. + DangerouslyForceDiscardAll bool `json:"dangerously_force_discard_all,omitempty"` // ID of the Git folder (repo) object in the workspace. RepoId int64 `json:"-" url:"-"` // If specified, update the sparse checkout settings. The update will fail diff --git a/workspace_client.go b/workspace_client.go index b332050be..26e1c72cc 100755 --- a/workspace_client.go +++ b/workspace_client.go @@ -8,8 +8,9 @@ import ( "github.com/databricks/databricks-sdk-go/httpclient" "github.com/databricks/databricks-sdk-go/service/agentbricks" + "github.com/databricks/databricks-sdk-go/service/aisearch" "github.com/databricks/databricks-sdk-go/service/apps" - "github.com/databricks/databricks-sdk-go/service/bundle" + "github.com/databricks/databricks-sdk-go/service/bundledeployments" "github.com/databricks/databricks-sdk-go/service/catalog" "github.com/databricks/databricks-sdk-go/service/cleanrooms" "github.com/databricks/databricks-sdk-go/service/compute" @@ -57,6 +58,11 @@ type WorkspaceClient struct { // LLM product. AgentBricks agentbricks.AgentBricksInterface + // **AI Search Endpoint**: Represents the compute resources to host AI + // Search indexes. AIP-conformant replacement for the legacy + // VectorSearchEndpoints API; functionally equivalent. + AiSearch aisearch.AiSearchInterface + // The alerts API can be used to perform CRUD operations on alerts. An alert // is a Databricks SQL object that periodically runs a query, evaluates a // condition of its result, and notifies one or more users and/or @@ -96,7 +102,7 @@ type WorkspaceClient struct { ArtifactAllowlists catalog.ArtifactAllowlistsInterface // Service for managing bundle deployment metadata. - Bundle bundle.BundleInterface + BundleDeployments bundledeployments.BundleDeploymentsInterface // A catalog is the first layer of Unity Catalog’s three-level namespace. // It’s used to organize your data assets. Users can see all catalogs on @@ -1453,13 +1459,14 @@ func NewWorkspaceClient(c ...*Config) (*WorkspaceClient, error) { AccessControl: iam.NewAccessControl(databricksClient), AccountAccessControlProxy: iam.NewAccountAccessControlProxy(databricksClient), AgentBricks: agentbricks.NewAgentBricks(databricksClient), + AiSearch: aisearch.NewAiSearch(databricksClient), Alerts: sql.NewAlerts(databricksClient), AlertsLegacy: sql.NewAlertsLegacy(databricksClient), AlertsV2: sql.NewAlertsV2(databricksClient), Apps: apps.NewApps(databricksClient), AppsSettings: apps.NewAppsSettings(databricksClient), ArtifactAllowlists: catalog.NewArtifactAllowlists(databricksClient), - Bundle: bundle.NewBundle(databricksClient), + BundleDeployments: bundledeployments.NewBundleDeployments(databricksClient), Catalogs: catalog.NewCatalogs(databricksClient), CleanRoomAssetRevisions: cleanrooms.NewCleanRoomAssetRevisions(databricksClient), CleanRoomAssets: cleanrooms.NewCleanRoomAssets(databricksClient),