From b7ad13d52a5c445b6a378caae1eb004eac3dec4a Mon Sep 17 00:00:00 2001 From: "databricks-ci-ghec-2[bot]" <184307802+databricks-ci-ghec-2[bot]@users.noreply.github.com> Date: Thu, 24 Sep 2026 03:58:49 +0000 Subject: [PATCH] Update SDK to 388928928041608fa79ac7c11ee94e017f0aa2b7 --- .codegen/_openapi_sha | 2 +- .gitattributes | 4 + NEXT_CHANGELOG.md | 9 + experimental/mocks/mock_workspace_client.go | 10 + .../service/mason/mock_mason_interface.go | 1877 +++++++++++++++++ service/aisearch/model.go | 3 +- service/apps/api.go | 3 +- service/apps/interface.go | 3 +- service/apps/model.go | 21 +- service/bundledeployments/model.go | 8 +- service/catalog/model.go | 28 + service/cleanrooms/model.go | 6 +- service/iamv2/api.go | 12 + service/iamv2/interface.go | 12 + service/jobs/model.go | 21 + service/mason/api.go | 173 ++ service/mason/impl.go | 647 ++++++ service/mason/interface.go | 115 + service/mason/model.go | 954 +++++++++ service/ml/model.go | 26 + service/oauth2/model.go | 4 +- service/pipelines/model.go | 4 +- service/pkg.go | 4 + service/sql/model.go | 10 +- service/tags/model.go | 10 +- workspace_client.go | 6 + 26 files changed, 3936 insertions(+), 36 deletions(-) create mode 100644 experimental/mocks/service/mason/mock_mason_interface.go mode change 100755 => 100644 service/apps/api.go mode change 100755 => 100644 service/apps/interface.go create mode 100644 service/mason/api.go create mode 100644 service/mason/impl.go create mode 100644 service/mason/interface.go create mode 100644 service/mason/model.go diff --git a/.codegen/_openapi_sha b/.codegen/_openapi_sha index 444b180c2..a5cd7b7a8 100644 --- a/.codegen/_openapi_sha +++ b/.codegen/_openapi_sha @@ -1 +1 @@ -4648d66fa37e7683468dc92cc043c6aa7a34f301 \ No newline at end of file +388928928041608fa79ac7c11ee94e017f0aa2b7 \ No newline at end of file diff --git a/.gitattributes b/.gitattributes index 23d8931c6..5f29b1ea8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -344,6 +344,10 @@ service/marketplace/api.go linguist-generated=true service/marketplace/impl.go linguist-generated=true service/marketplace/interface.go linguist-generated=true service/marketplace/model.go linguist-generated=true +service/mason/api.go linguist-generated=true +service/mason/impl.go linguist-generated=true +service/mason/interface.go linguist-generated=true +service/mason/model.go linguist-generated=true service/ml/api.go linguist-generated=true service/ml/impl.go linguist-generated=true service/ml/interface.go linguist-generated=true diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md index 984bf5ad2..f58f517e8 100644 --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -13,3 +13,12 @@ ### Internal Changes ### API Changes +* Add [mason](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/mason) package. +* Add [w.Mason](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/mason#MasonAPI) workspace-level service. +* Add `ServiceCredential` field for [catalog.ModelProviderServiceConfigGeminiEnterpriseProviderDirectConfig](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#ModelProviderServiceConfigGeminiEnterpriseProviderDirectConfig). +* Add `SecretReference` field for [catalog.ModelProviderServiceConfigProviderSecret](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#ModelProviderServiceConfigProviderSecret). +* Add `OnMaintenanceComplete` and `OnMaintenanceStart` fields for [jobs.JobEmailNotifications](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#JobEmailNotifications). +* Add `OnMaintenanceComplete` and `OnMaintenanceStart` fields for [jobs.TaskEmailNotifications](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#TaskEmailNotifications). +* Add `OnMaintenanceComplete` and `OnMaintenanceStart` fields for [jobs.WebhookNotifications](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#WebhookNotifications). +* Add `BudgetPolicyId` and `Tags` fields for [ml.BackfillFeaturesRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/ml#BackfillFeaturesRequest). +* Add `BudgetPolicyId` and `Tags` fields for [ml.PurgeFeatureEntitiesRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/ml#PurgeFeatureEntitiesRequest). \ No newline at end of file diff --git a/experimental/mocks/mock_workspace_client.go b/experimental/mocks/mock_workspace_client.go index 56c24377f..516e3535e 100644 --- a/experimental/mocks/mock_workspace_client.go +++ b/experimental/mocks/mock_workspace_client.go @@ -27,6 +27,7 @@ import ( "github.com/databricks/databricks-sdk-go/experimental/mocks/service/jobs" "github.com/databricks/databricks-sdk-go/experimental/mocks/service/knowledgeassistants" "github.com/databricks/databricks-sdk-go/experimental/mocks/service/marketplace" + "github.com/databricks/databricks-sdk-go/experimental/mocks/service/mason" "github.com/databricks/databricks-sdk-go/experimental/mocks/service/ml" "github.com/databricks/databricks-sdk-go/experimental/mocks/service/oauth2" "github.com/databricks/databricks-sdk-go/experimental/mocks/service/pipelines" @@ -123,6 +124,7 @@ func NewMockWorkspaceClient(t interface { Lakeview: dashboards.NewMockLakeviewInterface(t), LakeviewEmbedded: dashboards.NewMockLakeviewEmbeddedInterface(t), Libraries: compute.NewMockLibrariesInterface(t), + Mason: mason.NewMockMasonInterface(t), MaterializedFeatures: ml.NewMockMaterializedFeaturesInterface(t), Metastores: catalog.NewMockMetastoresInterface(t), ModelRegistry: ml.NewMockModelRegistryInterface(t), @@ -892,6 +894,14 @@ func (m *MockWorkspaceClient) GetMockLibrariesAPI() *compute.MockLibrariesInterf return api } +func (m *MockWorkspaceClient) GetMockMasonAPI() *mason.MockMasonInterface { + api, ok := m.WorkspaceClient.Mason.(*mason.MockMasonInterface) + if !ok { + panic(fmt.Sprintf("expected Mason to be *mason.MockMasonInterface, actual was %T", m.WorkspaceClient.Mason)) + } + return api +} + func (m *MockWorkspaceClient) GetMockMaterializedFeaturesAPI() *ml.MockMaterializedFeaturesInterface { api, ok := m.WorkspaceClient.MaterializedFeatures.(*ml.MockMaterializedFeaturesInterface) if !ok { diff --git a/experimental/mocks/service/mason/mock_mason_interface.go b/experimental/mocks/service/mason/mock_mason_interface.go new file mode 100644 index 000000000..6998d1bba --- /dev/null +++ b/experimental/mocks/service/mason/mock_mason_interface.go @@ -0,0 +1,1877 @@ +// Code generated by mockery v2.53.2. DO NOT EDIT. + +package mason + +import ( + context "context" + + listing "github.com/databricks/databricks-sdk-go/listing" + mason "github.com/databricks/databricks-sdk-go/service/mason" + mock "github.com/stretchr/testify/mock" +) + +// MockMasonInterface is an autogenerated mock type for the MasonInterface type +type MockMasonInterface struct { + mock.Mock +} + +type MockMasonInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *MockMasonInterface) EXPECT() *MockMasonInterface_Expecter { + return &MockMasonInterface_Expecter{mock: &_m.Mock} +} + +// AppendSessionItems provides a mock function with given fields: ctx, request +func (_m *MockMasonInterface) AppendSessionItems(ctx context.Context, request mason.AppendSessionItemsRequest) (*mason.AppendSessionItemsResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for AppendSessionItems") + } + + var r0 *mason.AppendSessionItemsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, mason.AppendSessionItemsRequest) (*mason.AppendSessionItemsResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, mason.AppendSessionItemsRequest) *mason.AppendSessionItemsResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*mason.AppendSessionItemsResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, mason.AppendSessionItemsRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockMasonInterface_AppendSessionItems_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AppendSessionItems' +type MockMasonInterface_AppendSessionItems_Call struct { + *mock.Call +} + +// AppendSessionItems is a helper method to define mock.On call +// - ctx context.Context +// - request mason.AppendSessionItemsRequest +func (_e *MockMasonInterface_Expecter) AppendSessionItems(ctx interface{}, request interface{}) *MockMasonInterface_AppendSessionItems_Call { + return &MockMasonInterface_AppendSessionItems_Call{Call: _e.mock.On("AppendSessionItems", ctx, request)} +} + +func (_c *MockMasonInterface_AppendSessionItems_Call) Run(run func(ctx context.Context, request mason.AppendSessionItemsRequest)) *MockMasonInterface_AppendSessionItems_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(mason.AppendSessionItemsRequest)) + }) + return _c +} + +func (_c *MockMasonInterface_AppendSessionItems_Call) Return(_a0 *mason.AppendSessionItemsResponse, _a1 error) *MockMasonInterface_AppendSessionItems_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockMasonInterface_AppendSessionItems_Call) RunAndReturn(run func(context.Context, mason.AppendSessionItemsRequest) (*mason.AppendSessionItemsResponse, error)) *MockMasonInterface_AppendSessionItems_Call { + _c.Call.Return(run) + return _c +} + +// ClearSessionItems provides a mock function with given fields: ctx, request +func (_m *MockMasonInterface) ClearSessionItems(ctx context.Context, request mason.ClearSessionItemsRequest) (*mason.ClearSessionItemsResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ClearSessionItems") + } + + var r0 *mason.ClearSessionItemsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, mason.ClearSessionItemsRequest) (*mason.ClearSessionItemsResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, mason.ClearSessionItemsRequest) *mason.ClearSessionItemsResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*mason.ClearSessionItemsResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, mason.ClearSessionItemsRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockMasonInterface_ClearSessionItems_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ClearSessionItems' +type MockMasonInterface_ClearSessionItems_Call struct { + *mock.Call +} + +// ClearSessionItems is a helper method to define mock.On call +// - ctx context.Context +// - request mason.ClearSessionItemsRequest +func (_e *MockMasonInterface_Expecter) ClearSessionItems(ctx interface{}, request interface{}) *MockMasonInterface_ClearSessionItems_Call { + return &MockMasonInterface_ClearSessionItems_Call{Call: _e.mock.On("ClearSessionItems", ctx, request)} +} + +func (_c *MockMasonInterface_ClearSessionItems_Call) Run(run func(ctx context.Context, request mason.ClearSessionItemsRequest)) *MockMasonInterface_ClearSessionItems_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(mason.ClearSessionItemsRequest)) + }) + return _c +} + +func (_c *MockMasonInterface_ClearSessionItems_Call) Return(_a0 *mason.ClearSessionItemsResponse, _a1 error) *MockMasonInterface_ClearSessionItems_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockMasonInterface_ClearSessionItems_Call) RunAndReturn(run func(context.Context, mason.ClearSessionItemsRequest) (*mason.ClearSessionItemsResponse, error)) *MockMasonInterface_ClearSessionItems_Call { + _c.Call.Return(run) + return _c +} + +// CreateMemory provides a mock function with given fields: ctx, request +func (_m *MockMasonInterface) CreateMemory(ctx context.Context, request mason.CreateManagedMemoryEntryRequest) (*mason.ManagedMemoryEntry, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for CreateMemory") + } + + var r0 *mason.ManagedMemoryEntry + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, mason.CreateManagedMemoryEntryRequest) (*mason.ManagedMemoryEntry, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, mason.CreateManagedMemoryEntryRequest) *mason.ManagedMemoryEntry); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*mason.ManagedMemoryEntry) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, mason.CreateManagedMemoryEntryRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockMasonInterface_CreateMemory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateMemory' +type MockMasonInterface_CreateMemory_Call struct { + *mock.Call +} + +// CreateMemory is a helper method to define mock.On call +// - ctx context.Context +// - request mason.CreateManagedMemoryEntryRequest +func (_e *MockMasonInterface_Expecter) CreateMemory(ctx interface{}, request interface{}) *MockMasonInterface_CreateMemory_Call { + return &MockMasonInterface_CreateMemory_Call{Call: _e.mock.On("CreateMemory", ctx, request)} +} + +func (_c *MockMasonInterface_CreateMemory_Call) Run(run func(ctx context.Context, request mason.CreateManagedMemoryEntryRequest)) *MockMasonInterface_CreateMemory_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(mason.CreateManagedMemoryEntryRequest)) + }) + return _c +} + +func (_c *MockMasonInterface_CreateMemory_Call) Return(_a0 *mason.ManagedMemoryEntry, _a1 error) *MockMasonInterface_CreateMemory_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockMasonInterface_CreateMemory_Call) RunAndReturn(run func(context.Context, mason.CreateManagedMemoryEntryRequest) (*mason.ManagedMemoryEntry, error)) *MockMasonInterface_CreateMemory_Call { + _c.Call.Return(run) + return _c +} + +// CreateMemoryStore provides a mock function with given fields: ctx, request +func (_m *MockMasonInterface) CreateMemoryStore(ctx context.Context, request mason.CreateManagedMemoryStoreRequest) (*mason.ManagedMemoryStore, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for CreateMemoryStore") + } + + var r0 *mason.ManagedMemoryStore + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, mason.CreateManagedMemoryStoreRequest) (*mason.ManagedMemoryStore, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, mason.CreateManagedMemoryStoreRequest) *mason.ManagedMemoryStore); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*mason.ManagedMemoryStore) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, mason.CreateManagedMemoryStoreRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockMasonInterface_CreateMemoryStore_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateMemoryStore' +type MockMasonInterface_CreateMemoryStore_Call struct { + *mock.Call +} + +// CreateMemoryStore is a helper method to define mock.On call +// - ctx context.Context +// - request mason.CreateManagedMemoryStoreRequest +func (_e *MockMasonInterface_Expecter) CreateMemoryStore(ctx interface{}, request interface{}) *MockMasonInterface_CreateMemoryStore_Call { + return &MockMasonInterface_CreateMemoryStore_Call{Call: _e.mock.On("CreateMemoryStore", ctx, request)} +} + +func (_c *MockMasonInterface_CreateMemoryStore_Call) Run(run func(ctx context.Context, request mason.CreateManagedMemoryStoreRequest)) *MockMasonInterface_CreateMemoryStore_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(mason.CreateManagedMemoryStoreRequest)) + }) + return _c +} + +func (_c *MockMasonInterface_CreateMemoryStore_Call) Return(_a0 *mason.ManagedMemoryStore, _a1 error) *MockMasonInterface_CreateMemoryStore_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockMasonInterface_CreateMemoryStore_Call) RunAndReturn(run func(context.Context, mason.CreateManagedMemoryStoreRequest) (*mason.ManagedMemoryStore, error)) *MockMasonInterface_CreateMemoryStore_Call { + _c.Call.Return(run) + return _c +} + +// CreateSession provides a mock function with given fields: ctx, request +func (_m *MockMasonInterface) CreateSession(ctx context.Context, request mason.CreateSessionRequest) (*mason.Session, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for CreateSession") + } + + var r0 *mason.Session + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, mason.CreateSessionRequest) (*mason.Session, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, mason.CreateSessionRequest) *mason.Session); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*mason.Session) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, mason.CreateSessionRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockMasonInterface_CreateSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateSession' +type MockMasonInterface_CreateSession_Call struct { + *mock.Call +} + +// CreateSession is a helper method to define mock.On call +// - ctx context.Context +// - request mason.CreateSessionRequest +func (_e *MockMasonInterface_Expecter) CreateSession(ctx interface{}, request interface{}) *MockMasonInterface_CreateSession_Call { + return &MockMasonInterface_CreateSession_Call{Call: _e.mock.On("CreateSession", ctx, request)} +} + +func (_c *MockMasonInterface_CreateSession_Call) Run(run func(ctx context.Context, request mason.CreateSessionRequest)) *MockMasonInterface_CreateSession_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(mason.CreateSessionRequest)) + }) + return _c +} + +func (_c *MockMasonInterface_CreateSession_Call) Return(_a0 *mason.Session, _a1 error) *MockMasonInterface_CreateSession_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockMasonInterface_CreateSession_Call) RunAndReturn(run func(context.Context, mason.CreateSessionRequest) (*mason.Session, error)) *MockMasonInterface_CreateSession_Call { + _c.Call.Return(run) + return _c +} + +// CreateSessionStore provides a mock function with given fields: ctx, request +func (_m *MockMasonInterface) CreateSessionStore(ctx context.Context, request mason.CreateSessionStoreRequest) (*mason.SessionStore, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for CreateSessionStore") + } + + var r0 *mason.SessionStore + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, mason.CreateSessionStoreRequest) (*mason.SessionStore, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, mason.CreateSessionStoreRequest) *mason.SessionStore); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*mason.SessionStore) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, mason.CreateSessionStoreRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockMasonInterface_CreateSessionStore_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateSessionStore' +type MockMasonInterface_CreateSessionStore_Call struct { + *mock.Call +} + +// CreateSessionStore is a helper method to define mock.On call +// - ctx context.Context +// - request mason.CreateSessionStoreRequest +func (_e *MockMasonInterface_Expecter) CreateSessionStore(ctx interface{}, request interface{}) *MockMasonInterface_CreateSessionStore_Call { + return &MockMasonInterface_CreateSessionStore_Call{Call: _e.mock.On("CreateSessionStore", ctx, request)} +} + +func (_c *MockMasonInterface_CreateSessionStore_Call) Run(run func(ctx context.Context, request mason.CreateSessionStoreRequest)) *MockMasonInterface_CreateSessionStore_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(mason.CreateSessionStoreRequest)) + }) + return _c +} + +func (_c *MockMasonInterface_CreateSessionStore_Call) Return(_a0 *mason.SessionStore, _a1 error) *MockMasonInterface_CreateSessionStore_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockMasonInterface_CreateSessionStore_Call) RunAndReturn(run func(context.Context, mason.CreateSessionStoreRequest) (*mason.SessionStore, error)) *MockMasonInterface_CreateSessionStore_Call { + _c.Call.Return(run) + return _c +} + +// DeleteMemory provides a mock function with given fields: ctx, request +func (_m *MockMasonInterface) DeleteMemory(ctx context.Context, request mason.DeleteManagedMemoryEntryRequest) error { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for DeleteMemory") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, mason.DeleteManagedMemoryEntryRequest) error); ok { + r0 = rf(ctx, request) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockMasonInterface_DeleteMemory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteMemory' +type MockMasonInterface_DeleteMemory_Call struct { + *mock.Call +} + +// DeleteMemory is a helper method to define mock.On call +// - ctx context.Context +// - request mason.DeleteManagedMemoryEntryRequest +func (_e *MockMasonInterface_Expecter) DeleteMemory(ctx interface{}, request interface{}) *MockMasonInterface_DeleteMemory_Call { + return &MockMasonInterface_DeleteMemory_Call{Call: _e.mock.On("DeleteMemory", ctx, request)} +} + +func (_c *MockMasonInterface_DeleteMemory_Call) Run(run func(ctx context.Context, request mason.DeleteManagedMemoryEntryRequest)) *MockMasonInterface_DeleteMemory_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(mason.DeleteManagedMemoryEntryRequest)) + }) + return _c +} + +func (_c *MockMasonInterface_DeleteMemory_Call) Return(_a0 error) *MockMasonInterface_DeleteMemory_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockMasonInterface_DeleteMemory_Call) RunAndReturn(run func(context.Context, mason.DeleteManagedMemoryEntryRequest) error) *MockMasonInterface_DeleteMemory_Call { + _c.Call.Return(run) + return _c +} + +// DeleteMemoryStore provides a mock function with given fields: ctx, request +func (_m *MockMasonInterface) DeleteMemoryStore(ctx context.Context, request mason.DeleteManagedMemoryStoreRequest) error { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for DeleteMemoryStore") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, mason.DeleteManagedMemoryStoreRequest) error); ok { + r0 = rf(ctx, request) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockMasonInterface_DeleteMemoryStore_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteMemoryStore' +type MockMasonInterface_DeleteMemoryStore_Call struct { + *mock.Call +} + +// DeleteMemoryStore is a helper method to define mock.On call +// - ctx context.Context +// - request mason.DeleteManagedMemoryStoreRequest +func (_e *MockMasonInterface_Expecter) DeleteMemoryStore(ctx interface{}, request interface{}) *MockMasonInterface_DeleteMemoryStore_Call { + return &MockMasonInterface_DeleteMemoryStore_Call{Call: _e.mock.On("DeleteMemoryStore", ctx, request)} +} + +func (_c *MockMasonInterface_DeleteMemoryStore_Call) Run(run func(ctx context.Context, request mason.DeleteManagedMemoryStoreRequest)) *MockMasonInterface_DeleteMemoryStore_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(mason.DeleteManagedMemoryStoreRequest)) + }) + return _c +} + +func (_c *MockMasonInterface_DeleteMemoryStore_Call) Return(_a0 error) *MockMasonInterface_DeleteMemoryStore_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockMasonInterface_DeleteMemoryStore_Call) RunAndReturn(run func(context.Context, mason.DeleteManagedMemoryStoreRequest) error) *MockMasonInterface_DeleteMemoryStore_Call { + _c.Call.Return(run) + return _c +} + +// DeleteSession provides a mock function with given fields: ctx, request +func (_m *MockMasonInterface) DeleteSession(ctx context.Context, request mason.DeleteSessionRequest) error { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for DeleteSession") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, mason.DeleteSessionRequest) error); ok { + r0 = rf(ctx, request) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockMasonInterface_DeleteSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteSession' +type MockMasonInterface_DeleteSession_Call struct { + *mock.Call +} + +// DeleteSession is a helper method to define mock.On call +// - ctx context.Context +// - request mason.DeleteSessionRequest +func (_e *MockMasonInterface_Expecter) DeleteSession(ctx interface{}, request interface{}) *MockMasonInterface_DeleteSession_Call { + return &MockMasonInterface_DeleteSession_Call{Call: _e.mock.On("DeleteSession", ctx, request)} +} + +func (_c *MockMasonInterface_DeleteSession_Call) Run(run func(ctx context.Context, request mason.DeleteSessionRequest)) *MockMasonInterface_DeleteSession_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(mason.DeleteSessionRequest)) + }) + return _c +} + +func (_c *MockMasonInterface_DeleteSession_Call) Return(_a0 error) *MockMasonInterface_DeleteSession_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockMasonInterface_DeleteSession_Call) RunAndReturn(run func(context.Context, mason.DeleteSessionRequest) error) *MockMasonInterface_DeleteSession_Call { + _c.Call.Return(run) + return _c +} + +// DeleteSessionStore provides a mock function with given fields: ctx, request +func (_m *MockMasonInterface) DeleteSessionStore(ctx context.Context, request mason.DeleteSessionStoreRequest) error { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for DeleteSessionStore") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, mason.DeleteSessionStoreRequest) error); ok { + r0 = rf(ctx, request) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockMasonInterface_DeleteSessionStore_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteSessionStore' +type MockMasonInterface_DeleteSessionStore_Call struct { + *mock.Call +} + +// DeleteSessionStore is a helper method to define mock.On call +// - ctx context.Context +// - request mason.DeleteSessionStoreRequest +func (_e *MockMasonInterface_Expecter) DeleteSessionStore(ctx interface{}, request interface{}) *MockMasonInterface_DeleteSessionStore_Call { + return &MockMasonInterface_DeleteSessionStore_Call{Call: _e.mock.On("DeleteSessionStore", ctx, request)} +} + +func (_c *MockMasonInterface_DeleteSessionStore_Call) Run(run func(ctx context.Context, request mason.DeleteSessionStoreRequest)) *MockMasonInterface_DeleteSessionStore_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(mason.DeleteSessionStoreRequest)) + }) + return _c +} + +func (_c *MockMasonInterface_DeleteSessionStore_Call) Return(_a0 error) *MockMasonInterface_DeleteSessionStore_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockMasonInterface_DeleteSessionStore_Call) RunAndReturn(run func(context.Context, mason.DeleteSessionStoreRequest) error) *MockMasonInterface_DeleteSessionStore_Call { + _c.Call.Return(run) + return _c +} + +// ExtractMemories provides a mock function with given fields: ctx, request +func (_m *MockMasonInterface) ExtractMemories(ctx context.Context, request mason.ExtractMemoriesRequest) (*mason.ExtractMemoriesResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ExtractMemories") + } + + var r0 *mason.ExtractMemoriesResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, mason.ExtractMemoriesRequest) (*mason.ExtractMemoriesResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, mason.ExtractMemoriesRequest) *mason.ExtractMemoriesResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*mason.ExtractMemoriesResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, mason.ExtractMemoriesRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockMasonInterface_ExtractMemories_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExtractMemories' +type MockMasonInterface_ExtractMemories_Call struct { + *mock.Call +} + +// ExtractMemories is a helper method to define mock.On call +// - ctx context.Context +// - request mason.ExtractMemoriesRequest +func (_e *MockMasonInterface_Expecter) ExtractMemories(ctx interface{}, request interface{}) *MockMasonInterface_ExtractMemories_Call { + return &MockMasonInterface_ExtractMemories_Call{Call: _e.mock.On("ExtractMemories", ctx, request)} +} + +func (_c *MockMasonInterface_ExtractMemories_Call) Run(run func(ctx context.Context, request mason.ExtractMemoriesRequest)) *MockMasonInterface_ExtractMemories_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(mason.ExtractMemoriesRequest)) + }) + return _c +} + +func (_c *MockMasonInterface_ExtractMemories_Call) Return(_a0 *mason.ExtractMemoriesResponse, _a1 error) *MockMasonInterface_ExtractMemories_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockMasonInterface_ExtractMemories_Call) RunAndReturn(run func(context.Context, mason.ExtractMemoriesRequest) (*mason.ExtractMemoriesResponse, error)) *MockMasonInterface_ExtractMemories_Call { + _c.Call.Return(run) + return _c +} + +// ForkSession provides a mock function with given fields: ctx, request +func (_m *MockMasonInterface) ForkSession(ctx context.Context, request mason.ForkSessionRequest) (*mason.ForkSessionResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ForkSession") + } + + var r0 *mason.ForkSessionResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, mason.ForkSessionRequest) (*mason.ForkSessionResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, mason.ForkSessionRequest) *mason.ForkSessionResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*mason.ForkSessionResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, mason.ForkSessionRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockMasonInterface_ForkSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ForkSession' +type MockMasonInterface_ForkSession_Call struct { + *mock.Call +} + +// ForkSession is a helper method to define mock.On call +// - ctx context.Context +// - request mason.ForkSessionRequest +func (_e *MockMasonInterface_Expecter) ForkSession(ctx interface{}, request interface{}) *MockMasonInterface_ForkSession_Call { + return &MockMasonInterface_ForkSession_Call{Call: _e.mock.On("ForkSession", ctx, request)} +} + +func (_c *MockMasonInterface_ForkSession_Call) Run(run func(ctx context.Context, request mason.ForkSessionRequest)) *MockMasonInterface_ForkSession_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(mason.ForkSessionRequest)) + }) + return _c +} + +func (_c *MockMasonInterface_ForkSession_Call) Return(_a0 *mason.ForkSessionResponse, _a1 error) *MockMasonInterface_ForkSession_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockMasonInterface_ForkSession_Call) RunAndReturn(run func(context.Context, mason.ForkSessionRequest) (*mason.ForkSessionResponse, error)) *MockMasonInterface_ForkSession_Call { + _c.Call.Return(run) + return _c +} + +// GetMemory provides a mock function with given fields: ctx, request +func (_m *MockMasonInterface) GetMemory(ctx context.Context, request mason.GetManagedMemoryEntryRequest) (*mason.ManagedMemoryEntry, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for GetMemory") + } + + var r0 *mason.ManagedMemoryEntry + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, mason.GetManagedMemoryEntryRequest) (*mason.ManagedMemoryEntry, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, mason.GetManagedMemoryEntryRequest) *mason.ManagedMemoryEntry); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*mason.ManagedMemoryEntry) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, mason.GetManagedMemoryEntryRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockMasonInterface_GetMemory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetMemory' +type MockMasonInterface_GetMemory_Call struct { + *mock.Call +} + +// GetMemory is a helper method to define mock.On call +// - ctx context.Context +// - request mason.GetManagedMemoryEntryRequest +func (_e *MockMasonInterface_Expecter) GetMemory(ctx interface{}, request interface{}) *MockMasonInterface_GetMemory_Call { + return &MockMasonInterface_GetMemory_Call{Call: _e.mock.On("GetMemory", ctx, request)} +} + +func (_c *MockMasonInterface_GetMemory_Call) Run(run func(ctx context.Context, request mason.GetManagedMemoryEntryRequest)) *MockMasonInterface_GetMemory_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(mason.GetManagedMemoryEntryRequest)) + }) + return _c +} + +func (_c *MockMasonInterface_GetMemory_Call) Return(_a0 *mason.ManagedMemoryEntry, _a1 error) *MockMasonInterface_GetMemory_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockMasonInterface_GetMemory_Call) RunAndReturn(run func(context.Context, mason.GetManagedMemoryEntryRequest) (*mason.ManagedMemoryEntry, error)) *MockMasonInterface_GetMemory_Call { + _c.Call.Return(run) + return _c +} + +// GetMemoryStore provides a mock function with given fields: ctx, request +func (_m *MockMasonInterface) GetMemoryStore(ctx context.Context, request mason.GetManagedMemoryStoreRequest) (*mason.ManagedMemoryStore, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for GetMemoryStore") + } + + var r0 *mason.ManagedMemoryStore + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, mason.GetManagedMemoryStoreRequest) (*mason.ManagedMemoryStore, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, mason.GetManagedMemoryStoreRequest) *mason.ManagedMemoryStore); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*mason.ManagedMemoryStore) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, mason.GetManagedMemoryStoreRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockMasonInterface_GetMemoryStore_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetMemoryStore' +type MockMasonInterface_GetMemoryStore_Call struct { + *mock.Call +} + +// GetMemoryStore is a helper method to define mock.On call +// - ctx context.Context +// - request mason.GetManagedMemoryStoreRequest +func (_e *MockMasonInterface_Expecter) GetMemoryStore(ctx interface{}, request interface{}) *MockMasonInterface_GetMemoryStore_Call { + return &MockMasonInterface_GetMemoryStore_Call{Call: _e.mock.On("GetMemoryStore", ctx, request)} +} + +func (_c *MockMasonInterface_GetMemoryStore_Call) Run(run func(ctx context.Context, request mason.GetManagedMemoryStoreRequest)) *MockMasonInterface_GetMemoryStore_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(mason.GetManagedMemoryStoreRequest)) + }) + return _c +} + +func (_c *MockMasonInterface_GetMemoryStore_Call) Return(_a0 *mason.ManagedMemoryStore, _a1 error) *MockMasonInterface_GetMemoryStore_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockMasonInterface_GetMemoryStore_Call) RunAndReturn(run func(context.Context, mason.GetManagedMemoryStoreRequest) (*mason.ManagedMemoryStore, error)) *MockMasonInterface_GetMemoryStore_Call { + _c.Call.Return(run) + return _c +} + +// GetSession provides a mock function with given fields: ctx, request +func (_m *MockMasonInterface) GetSession(ctx context.Context, request mason.GetSessionRequest) (*mason.Session, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for GetSession") + } + + var r0 *mason.Session + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, mason.GetSessionRequest) (*mason.Session, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, mason.GetSessionRequest) *mason.Session); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*mason.Session) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, mason.GetSessionRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockMasonInterface_GetSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSession' +type MockMasonInterface_GetSession_Call struct { + *mock.Call +} + +// GetSession is a helper method to define mock.On call +// - ctx context.Context +// - request mason.GetSessionRequest +func (_e *MockMasonInterface_Expecter) GetSession(ctx interface{}, request interface{}) *MockMasonInterface_GetSession_Call { + return &MockMasonInterface_GetSession_Call{Call: _e.mock.On("GetSession", ctx, request)} +} + +func (_c *MockMasonInterface_GetSession_Call) Run(run func(ctx context.Context, request mason.GetSessionRequest)) *MockMasonInterface_GetSession_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(mason.GetSessionRequest)) + }) + return _c +} + +func (_c *MockMasonInterface_GetSession_Call) Return(_a0 *mason.Session, _a1 error) *MockMasonInterface_GetSession_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockMasonInterface_GetSession_Call) RunAndReturn(run func(context.Context, mason.GetSessionRequest) (*mason.Session, error)) *MockMasonInterface_GetSession_Call { + _c.Call.Return(run) + return _c +} + +// GetSessionStore provides a mock function with given fields: ctx, request +func (_m *MockMasonInterface) GetSessionStore(ctx context.Context, request mason.GetSessionStoreRequest) (*mason.SessionStore, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for GetSessionStore") + } + + var r0 *mason.SessionStore + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, mason.GetSessionStoreRequest) (*mason.SessionStore, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, mason.GetSessionStoreRequest) *mason.SessionStore); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*mason.SessionStore) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, mason.GetSessionStoreRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockMasonInterface_GetSessionStore_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSessionStore' +type MockMasonInterface_GetSessionStore_Call struct { + *mock.Call +} + +// GetSessionStore is a helper method to define mock.On call +// - ctx context.Context +// - request mason.GetSessionStoreRequest +func (_e *MockMasonInterface_Expecter) GetSessionStore(ctx interface{}, request interface{}) *MockMasonInterface_GetSessionStore_Call { + return &MockMasonInterface_GetSessionStore_Call{Call: _e.mock.On("GetSessionStore", ctx, request)} +} + +func (_c *MockMasonInterface_GetSessionStore_Call) Run(run func(ctx context.Context, request mason.GetSessionStoreRequest)) *MockMasonInterface_GetSessionStore_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(mason.GetSessionStoreRequest)) + }) + return _c +} + +func (_c *MockMasonInterface_GetSessionStore_Call) Return(_a0 *mason.SessionStore, _a1 error) *MockMasonInterface_GetSessionStore_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockMasonInterface_GetSessionStore_Call) RunAndReturn(run func(context.Context, mason.GetSessionStoreRequest) (*mason.SessionStore, error)) *MockMasonInterface_GetSessionStore_Call { + _c.Call.Return(run) + return _c +} + +// ListMemories provides a mock function with given fields: ctx, request +func (_m *MockMasonInterface) ListMemories(ctx context.Context, request mason.ListManagedMemoryEntriesRequest) listing.Iterator[mason.ManagedMemoryEntry] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListMemories") + } + + var r0 listing.Iterator[mason.ManagedMemoryEntry] + if rf, ok := ret.Get(0).(func(context.Context, mason.ListManagedMemoryEntriesRequest) listing.Iterator[mason.ManagedMemoryEntry]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[mason.ManagedMemoryEntry]) + } + } + + return r0 +} + +// MockMasonInterface_ListMemories_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListMemories' +type MockMasonInterface_ListMemories_Call struct { + *mock.Call +} + +// ListMemories is a helper method to define mock.On call +// - ctx context.Context +// - request mason.ListManagedMemoryEntriesRequest +func (_e *MockMasonInterface_Expecter) ListMemories(ctx interface{}, request interface{}) *MockMasonInterface_ListMemories_Call { + return &MockMasonInterface_ListMemories_Call{Call: _e.mock.On("ListMemories", ctx, request)} +} + +func (_c *MockMasonInterface_ListMemories_Call) Run(run func(ctx context.Context, request mason.ListManagedMemoryEntriesRequest)) *MockMasonInterface_ListMemories_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(mason.ListManagedMemoryEntriesRequest)) + }) + return _c +} + +func (_c *MockMasonInterface_ListMemories_Call) Return(_a0 listing.Iterator[mason.ManagedMemoryEntry]) *MockMasonInterface_ListMemories_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockMasonInterface_ListMemories_Call) RunAndReturn(run func(context.Context, mason.ListManagedMemoryEntriesRequest) listing.Iterator[mason.ManagedMemoryEntry]) *MockMasonInterface_ListMemories_Call { + _c.Call.Return(run) + return _c +} + +// ListMemoriesAll provides a mock function with given fields: ctx, request +func (_m *MockMasonInterface) ListMemoriesAll(ctx context.Context, request mason.ListManagedMemoryEntriesRequest) ([]mason.ManagedMemoryEntry, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListMemoriesAll") + } + + var r0 []mason.ManagedMemoryEntry + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, mason.ListManagedMemoryEntriesRequest) ([]mason.ManagedMemoryEntry, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, mason.ListManagedMemoryEntriesRequest) []mason.ManagedMemoryEntry); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]mason.ManagedMemoryEntry) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, mason.ListManagedMemoryEntriesRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockMasonInterface_ListMemoriesAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListMemoriesAll' +type MockMasonInterface_ListMemoriesAll_Call struct { + *mock.Call +} + +// ListMemoriesAll is a helper method to define mock.On call +// - ctx context.Context +// - request mason.ListManagedMemoryEntriesRequest +func (_e *MockMasonInterface_Expecter) ListMemoriesAll(ctx interface{}, request interface{}) *MockMasonInterface_ListMemoriesAll_Call { + return &MockMasonInterface_ListMemoriesAll_Call{Call: _e.mock.On("ListMemoriesAll", ctx, request)} +} + +func (_c *MockMasonInterface_ListMemoriesAll_Call) Run(run func(ctx context.Context, request mason.ListManagedMemoryEntriesRequest)) *MockMasonInterface_ListMemoriesAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(mason.ListManagedMemoryEntriesRequest)) + }) + return _c +} + +func (_c *MockMasonInterface_ListMemoriesAll_Call) Return(_a0 []mason.ManagedMemoryEntry, _a1 error) *MockMasonInterface_ListMemoriesAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockMasonInterface_ListMemoriesAll_Call) RunAndReturn(run func(context.Context, mason.ListManagedMemoryEntriesRequest) ([]mason.ManagedMemoryEntry, error)) *MockMasonInterface_ListMemoriesAll_Call { + _c.Call.Return(run) + return _c +} + +// ListMemoryStores provides a mock function with given fields: ctx, request +func (_m *MockMasonInterface) ListMemoryStores(ctx context.Context, request mason.ListManagedMemoryStoresRequest) listing.Iterator[mason.ManagedMemoryStore] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListMemoryStores") + } + + var r0 listing.Iterator[mason.ManagedMemoryStore] + if rf, ok := ret.Get(0).(func(context.Context, mason.ListManagedMemoryStoresRequest) listing.Iterator[mason.ManagedMemoryStore]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[mason.ManagedMemoryStore]) + } + } + + return r0 +} + +// MockMasonInterface_ListMemoryStores_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListMemoryStores' +type MockMasonInterface_ListMemoryStores_Call struct { + *mock.Call +} + +// ListMemoryStores is a helper method to define mock.On call +// - ctx context.Context +// - request mason.ListManagedMemoryStoresRequest +func (_e *MockMasonInterface_Expecter) ListMemoryStores(ctx interface{}, request interface{}) *MockMasonInterface_ListMemoryStores_Call { + return &MockMasonInterface_ListMemoryStores_Call{Call: _e.mock.On("ListMemoryStores", ctx, request)} +} + +func (_c *MockMasonInterface_ListMemoryStores_Call) Run(run func(ctx context.Context, request mason.ListManagedMemoryStoresRequest)) *MockMasonInterface_ListMemoryStores_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(mason.ListManagedMemoryStoresRequest)) + }) + return _c +} + +func (_c *MockMasonInterface_ListMemoryStores_Call) Return(_a0 listing.Iterator[mason.ManagedMemoryStore]) *MockMasonInterface_ListMemoryStores_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockMasonInterface_ListMemoryStores_Call) RunAndReturn(run func(context.Context, mason.ListManagedMemoryStoresRequest) listing.Iterator[mason.ManagedMemoryStore]) *MockMasonInterface_ListMemoryStores_Call { + _c.Call.Return(run) + return _c +} + +// ListMemoryStoresAll provides a mock function with given fields: ctx, request +func (_m *MockMasonInterface) ListMemoryStoresAll(ctx context.Context, request mason.ListManagedMemoryStoresRequest) ([]mason.ManagedMemoryStore, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListMemoryStoresAll") + } + + var r0 []mason.ManagedMemoryStore + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, mason.ListManagedMemoryStoresRequest) ([]mason.ManagedMemoryStore, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, mason.ListManagedMemoryStoresRequest) []mason.ManagedMemoryStore); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]mason.ManagedMemoryStore) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, mason.ListManagedMemoryStoresRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockMasonInterface_ListMemoryStoresAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListMemoryStoresAll' +type MockMasonInterface_ListMemoryStoresAll_Call struct { + *mock.Call +} + +// ListMemoryStoresAll is a helper method to define mock.On call +// - ctx context.Context +// - request mason.ListManagedMemoryStoresRequest +func (_e *MockMasonInterface_Expecter) ListMemoryStoresAll(ctx interface{}, request interface{}) *MockMasonInterface_ListMemoryStoresAll_Call { + return &MockMasonInterface_ListMemoryStoresAll_Call{Call: _e.mock.On("ListMemoryStoresAll", ctx, request)} +} + +func (_c *MockMasonInterface_ListMemoryStoresAll_Call) Run(run func(ctx context.Context, request mason.ListManagedMemoryStoresRequest)) *MockMasonInterface_ListMemoryStoresAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(mason.ListManagedMemoryStoresRequest)) + }) + return _c +} + +func (_c *MockMasonInterface_ListMemoryStoresAll_Call) Return(_a0 []mason.ManagedMemoryStore, _a1 error) *MockMasonInterface_ListMemoryStoresAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockMasonInterface_ListMemoryStoresAll_Call) RunAndReturn(run func(context.Context, mason.ListManagedMemoryStoresRequest) ([]mason.ManagedMemoryStore, error)) *MockMasonInterface_ListMemoryStoresAll_Call { + _c.Call.Return(run) + return _c +} + +// ListSessionItems provides a mock function with given fields: ctx, request +func (_m *MockMasonInterface) ListSessionItems(ctx context.Context, request mason.ListSessionItemsRequest) listing.Iterator[mason.SessionItem] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListSessionItems") + } + + var r0 listing.Iterator[mason.SessionItem] + if rf, ok := ret.Get(0).(func(context.Context, mason.ListSessionItemsRequest) listing.Iterator[mason.SessionItem]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[mason.SessionItem]) + } + } + + return r0 +} + +// MockMasonInterface_ListSessionItems_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListSessionItems' +type MockMasonInterface_ListSessionItems_Call struct { + *mock.Call +} + +// ListSessionItems is a helper method to define mock.On call +// - ctx context.Context +// - request mason.ListSessionItemsRequest +func (_e *MockMasonInterface_Expecter) ListSessionItems(ctx interface{}, request interface{}) *MockMasonInterface_ListSessionItems_Call { + return &MockMasonInterface_ListSessionItems_Call{Call: _e.mock.On("ListSessionItems", ctx, request)} +} + +func (_c *MockMasonInterface_ListSessionItems_Call) Run(run func(ctx context.Context, request mason.ListSessionItemsRequest)) *MockMasonInterface_ListSessionItems_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(mason.ListSessionItemsRequest)) + }) + return _c +} + +func (_c *MockMasonInterface_ListSessionItems_Call) Return(_a0 listing.Iterator[mason.SessionItem]) *MockMasonInterface_ListSessionItems_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockMasonInterface_ListSessionItems_Call) RunAndReturn(run func(context.Context, mason.ListSessionItemsRequest) listing.Iterator[mason.SessionItem]) *MockMasonInterface_ListSessionItems_Call { + _c.Call.Return(run) + return _c +} + +// ListSessionItemsAll provides a mock function with given fields: ctx, request +func (_m *MockMasonInterface) ListSessionItemsAll(ctx context.Context, request mason.ListSessionItemsRequest) ([]mason.SessionItem, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListSessionItemsAll") + } + + var r0 []mason.SessionItem + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, mason.ListSessionItemsRequest) ([]mason.SessionItem, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, mason.ListSessionItemsRequest) []mason.SessionItem); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]mason.SessionItem) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, mason.ListSessionItemsRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockMasonInterface_ListSessionItemsAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListSessionItemsAll' +type MockMasonInterface_ListSessionItemsAll_Call struct { + *mock.Call +} + +// ListSessionItemsAll is a helper method to define mock.On call +// - ctx context.Context +// - request mason.ListSessionItemsRequest +func (_e *MockMasonInterface_Expecter) ListSessionItemsAll(ctx interface{}, request interface{}) *MockMasonInterface_ListSessionItemsAll_Call { + return &MockMasonInterface_ListSessionItemsAll_Call{Call: _e.mock.On("ListSessionItemsAll", ctx, request)} +} + +func (_c *MockMasonInterface_ListSessionItemsAll_Call) Run(run func(ctx context.Context, request mason.ListSessionItemsRequest)) *MockMasonInterface_ListSessionItemsAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(mason.ListSessionItemsRequest)) + }) + return _c +} + +func (_c *MockMasonInterface_ListSessionItemsAll_Call) Return(_a0 []mason.SessionItem, _a1 error) *MockMasonInterface_ListSessionItemsAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockMasonInterface_ListSessionItemsAll_Call) RunAndReturn(run func(context.Context, mason.ListSessionItemsRequest) ([]mason.SessionItem, error)) *MockMasonInterface_ListSessionItemsAll_Call { + _c.Call.Return(run) + return _c +} + +// ListSessionStores provides a mock function with given fields: ctx, request +func (_m *MockMasonInterface) ListSessionStores(ctx context.Context, request mason.ListSessionStoresRequest) listing.Iterator[mason.SessionStore] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListSessionStores") + } + + var r0 listing.Iterator[mason.SessionStore] + if rf, ok := ret.Get(0).(func(context.Context, mason.ListSessionStoresRequest) listing.Iterator[mason.SessionStore]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[mason.SessionStore]) + } + } + + return r0 +} + +// MockMasonInterface_ListSessionStores_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListSessionStores' +type MockMasonInterface_ListSessionStores_Call struct { + *mock.Call +} + +// ListSessionStores is a helper method to define mock.On call +// - ctx context.Context +// - request mason.ListSessionStoresRequest +func (_e *MockMasonInterface_Expecter) ListSessionStores(ctx interface{}, request interface{}) *MockMasonInterface_ListSessionStores_Call { + return &MockMasonInterface_ListSessionStores_Call{Call: _e.mock.On("ListSessionStores", ctx, request)} +} + +func (_c *MockMasonInterface_ListSessionStores_Call) Run(run func(ctx context.Context, request mason.ListSessionStoresRequest)) *MockMasonInterface_ListSessionStores_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(mason.ListSessionStoresRequest)) + }) + return _c +} + +func (_c *MockMasonInterface_ListSessionStores_Call) Return(_a0 listing.Iterator[mason.SessionStore]) *MockMasonInterface_ListSessionStores_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockMasonInterface_ListSessionStores_Call) RunAndReturn(run func(context.Context, mason.ListSessionStoresRequest) listing.Iterator[mason.SessionStore]) *MockMasonInterface_ListSessionStores_Call { + _c.Call.Return(run) + return _c +} + +// ListSessionStoresAll provides a mock function with given fields: ctx, request +func (_m *MockMasonInterface) ListSessionStoresAll(ctx context.Context, request mason.ListSessionStoresRequest) ([]mason.SessionStore, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListSessionStoresAll") + } + + var r0 []mason.SessionStore + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, mason.ListSessionStoresRequest) ([]mason.SessionStore, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, mason.ListSessionStoresRequest) []mason.SessionStore); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]mason.SessionStore) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, mason.ListSessionStoresRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockMasonInterface_ListSessionStoresAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListSessionStoresAll' +type MockMasonInterface_ListSessionStoresAll_Call struct { + *mock.Call +} + +// ListSessionStoresAll is a helper method to define mock.On call +// - ctx context.Context +// - request mason.ListSessionStoresRequest +func (_e *MockMasonInterface_Expecter) ListSessionStoresAll(ctx interface{}, request interface{}) *MockMasonInterface_ListSessionStoresAll_Call { + return &MockMasonInterface_ListSessionStoresAll_Call{Call: _e.mock.On("ListSessionStoresAll", ctx, request)} +} + +func (_c *MockMasonInterface_ListSessionStoresAll_Call) Run(run func(ctx context.Context, request mason.ListSessionStoresRequest)) *MockMasonInterface_ListSessionStoresAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(mason.ListSessionStoresRequest)) + }) + return _c +} + +func (_c *MockMasonInterface_ListSessionStoresAll_Call) Return(_a0 []mason.SessionStore, _a1 error) *MockMasonInterface_ListSessionStoresAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockMasonInterface_ListSessionStoresAll_Call) RunAndReturn(run func(context.Context, mason.ListSessionStoresRequest) ([]mason.SessionStore, error)) *MockMasonInterface_ListSessionStoresAll_Call { + _c.Call.Return(run) + return _c +} + +// ListSessions provides a mock function with given fields: ctx, request +func (_m *MockMasonInterface) ListSessions(ctx context.Context, request mason.ListSessionsRequest) listing.Iterator[mason.Session] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListSessions") + } + + var r0 listing.Iterator[mason.Session] + if rf, ok := ret.Get(0).(func(context.Context, mason.ListSessionsRequest) listing.Iterator[mason.Session]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[mason.Session]) + } + } + + return r0 +} + +// MockMasonInterface_ListSessions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListSessions' +type MockMasonInterface_ListSessions_Call struct { + *mock.Call +} + +// ListSessions is a helper method to define mock.On call +// - ctx context.Context +// - request mason.ListSessionsRequest +func (_e *MockMasonInterface_Expecter) ListSessions(ctx interface{}, request interface{}) *MockMasonInterface_ListSessions_Call { + return &MockMasonInterface_ListSessions_Call{Call: _e.mock.On("ListSessions", ctx, request)} +} + +func (_c *MockMasonInterface_ListSessions_Call) Run(run func(ctx context.Context, request mason.ListSessionsRequest)) *MockMasonInterface_ListSessions_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(mason.ListSessionsRequest)) + }) + return _c +} + +func (_c *MockMasonInterface_ListSessions_Call) Return(_a0 listing.Iterator[mason.Session]) *MockMasonInterface_ListSessions_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockMasonInterface_ListSessions_Call) RunAndReturn(run func(context.Context, mason.ListSessionsRequest) listing.Iterator[mason.Session]) *MockMasonInterface_ListSessions_Call { + _c.Call.Return(run) + return _c +} + +// ListSessionsAll provides a mock function with given fields: ctx, request +func (_m *MockMasonInterface) ListSessionsAll(ctx context.Context, request mason.ListSessionsRequest) ([]mason.Session, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListSessionsAll") + } + + var r0 []mason.Session + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, mason.ListSessionsRequest) ([]mason.Session, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, mason.ListSessionsRequest) []mason.Session); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]mason.Session) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, mason.ListSessionsRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockMasonInterface_ListSessionsAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListSessionsAll' +type MockMasonInterface_ListSessionsAll_Call struct { + *mock.Call +} + +// ListSessionsAll is a helper method to define mock.On call +// - ctx context.Context +// - request mason.ListSessionsRequest +func (_e *MockMasonInterface_Expecter) ListSessionsAll(ctx interface{}, request interface{}) *MockMasonInterface_ListSessionsAll_Call { + return &MockMasonInterface_ListSessionsAll_Call{Call: _e.mock.On("ListSessionsAll", ctx, request)} +} + +func (_c *MockMasonInterface_ListSessionsAll_Call) Run(run func(ctx context.Context, request mason.ListSessionsRequest)) *MockMasonInterface_ListSessionsAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(mason.ListSessionsRequest)) + }) + return _c +} + +func (_c *MockMasonInterface_ListSessionsAll_Call) Return(_a0 []mason.Session, _a1 error) *MockMasonInterface_ListSessionsAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockMasonInterface_ListSessionsAll_Call) RunAndReturn(run func(context.Context, mason.ListSessionsRequest) ([]mason.Session, error)) *MockMasonInterface_ListSessionsAll_Call { + _c.Call.Return(run) + return _c +} + +// PopSessionItem provides a mock function with given fields: ctx, request +func (_m *MockMasonInterface) PopSessionItem(ctx context.Context, request mason.PopSessionItemRequest) (*mason.PopSessionItemResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for PopSessionItem") + } + + var r0 *mason.PopSessionItemResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, mason.PopSessionItemRequest) (*mason.PopSessionItemResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, mason.PopSessionItemRequest) *mason.PopSessionItemResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*mason.PopSessionItemResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, mason.PopSessionItemRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockMasonInterface_PopSessionItem_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PopSessionItem' +type MockMasonInterface_PopSessionItem_Call struct { + *mock.Call +} + +// PopSessionItem is a helper method to define mock.On call +// - ctx context.Context +// - request mason.PopSessionItemRequest +func (_e *MockMasonInterface_Expecter) PopSessionItem(ctx interface{}, request interface{}) *MockMasonInterface_PopSessionItem_Call { + return &MockMasonInterface_PopSessionItem_Call{Call: _e.mock.On("PopSessionItem", ctx, request)} +} + +func (_c *MockMasonInterface_PopSessionItem_Call) Run(run func(ctx context.Context, request mason.PopSessionItemRequest)) *MockMasonInterface_PopSessionItem_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(mason.PopSessionItemRequest)) + }) + return _c +} + +func (_c *MockMasonInterface_PopSessionItem_Call) Return(_a0 *mason.PopSessionItemResponse, _a1 error) *MockMasonInterface_PopSessionItem_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockMasonInterface_PopSessionItem_Call) RunAndReturn(run func(context.Context, mason.PopSessionItemRequest) (*mason.PopSessionItemResponse, error)) *MockMasonInterface_PopSessionItem_Call { + _c.Call.Return(run) + return _c +} + +// SearchMemories provides a mock function with given fields: ctx, request +func (_m *MockMasonInterface) SearchMemories(ctx context.Context, request mason.SearchManagedMemoryEntriesRequest) listing.Iterator[mason.ManagedMemoryEntrySearchResult] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for SearchMemories") + } + + var r0 listing.Iterator[mason.ManagedMemoryEntrySearchResult] + if rf, ok := ret.Get(0).(func(context.Context, mason.SearchManagedMemoryEntriesRequest) listing.Iterator[mason.ManagedMemoryEntrySearchResult]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[mason.ManagedMemoryEntrySearchResult]) + } + } + + return r0 +} + +// MockMasonInterface_SearchMemories_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SearchMemories' +type MockMasonInterface_SearchMemories_Call struct { + *mock.Call +} + +// SearchMemories is a helper method to define mock.On call +// - ctx context.Context +// - request mason.SearchManagedMemoryEntriesRequest +func (_e *MockMasonInterface_Expecter) SearchMemories(ctx interface{}, request interface{}) *MockMasonInterface_SearchMemories_Call { + return &MockMasonInterface_SearchMemories_Call{Call: _e.mock.On("SearchMemories", ctx, request)} +} + +func (_c *MockMasonInterface_SearchMemories_Call) Run(run func(ctx context.Context, request mason.SearchManagedMemoryEntriesRequest)) *MockMasonInterface_SearchMemories_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(mason.SearchManagedMemoryEntriesRequest)) + }) + return _c +} + +func (_c *MockMasonInterface_SearchMemories_Call) Return(_a0 listing.Iterator[mason.ManagedMemoryEntrySearchResult]) *MockMasonInterface_SearchMemories_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockMasonInterface_SearchMemories_Call) RunAndReturn(run func(context.Context, mason.SearchManagedMemoryEntriesRequest) listing.Iterator[mason.ManagedMemoryEntrySearchResult]) *MockMasonInterface_SearchMemories_Call { + _c.Call.Return(run) + return _c +} + +// SearchMemoriesAll provides a mock function with given fields: ctx, request +func (_m *MockMasonInterface) SearchMemoriesAll(ctx context.Context, request mason.SearchManagedMemoryEntriesRequest) ([]mason.ManagedMemoryEntrySearchResult, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for SearchMemoriesAll") + } + + var r0 []mason.ManagedMemoryEntrySearchResult + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, mason.SearchManagedMemoryEntriesRequest) ([]mason.ManagedMemoryEntrySearchResult, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, mason.SearchManagedMemoryEntriesRequest) []mason.ManagedMemoryEntrySearchResult); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]mason.ManagedMemoryEntrySearchResult) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, mason.SearchManagedMemoryEntriesRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockMasonInterface_SearchMemoriesAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SearchMemoriesAll' +type MockMasonInterface_SearchMemoriesAll_Call struct { + *mock.Call +} + +// SearchMemoriesAll is a helper method to define mock.On call +// - ctx context.Context +// - request mason.SearchManagedMemoryEntriesRequest +func (_e *MockMasonInterface_Expecter) SearchMemoriesAll(ctx interface{}, request interface{}) *MockMasonInterface_SearchMemoriesAll_Call { + return &MockMasonInterface_SearchMemoriesAll_Call{Call: _e.mock.On("SearchMemoriesAll", ctx, request)} +} + +func (_c *MockMasonInterface_SearchMemoriesAll_Call) Run(run func(ctx context.Context, request mason.SearchManagedMemoryEntriesRequest)) *MockMasonInterface_SearchMemoriesAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(mason.SearchManagedMemoryEntriesRequest)) + }) + return _c +} + +func (_c *MockMasonInterface_SearchMemoriesAll_Call) Return(_a0 []mason.ManagedMemoryEntrySearchResult, _a1 error) *MockMasonInterface_SearchMemoriesAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockMasonInterface_SearchMemoriesAll_Call) RunAndReturn(run func(context.Context, mason.SearchManagedMemoryEntriesRequest) ([]mason.ManagedMemoryEntrySearchResult, error)) *MockMasonInterface_SearchMemoriesAll_Call { + _c.Call.Return(run) + return _c +} + +// UpdateMemory provides a mock function with given fields: ctx, request +func (_m *MockMasonInterface) UpdateMemory(ctx context.Context, request mason.UpdateManagedMemoryEntryRequest) (*mason.ManagedMemoryEntry, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for UpdateMemory") + } + + var r0 *mason.ManagedMemoryEntry + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, mason.UpdateManagedMemoryEntryRequest) (*mason.ManagedMemoryEntry, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, mason.UpdateManagedMemoryEntryRequest) *mason.ManagedMemoryEntry); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*mason.ManagedMemoryEntry) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, mason.UpdateManagedMemoryEntryRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockMasonInterface_UpdateMemory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateMemory' +type MockMasonInterface_UpdateMemory_Call struct { + *mock.Call +} + +// UpdateMemory is a helper method to define mock.On call +// - ctx context.Context +// - request mason.UpdateManagedMemoryEntryRequest +func (_e *MockMasonInterface_Expecter) UpdateMemory(ctx interface{}, request interface{}) *MockMasonInterface_UpdateMemory_Call { + return &MockMasonInterface_UpdateMemory_Call{Call: _e.mock.On("UpdateMemory", ctx, request)} +} + +func (_c *MockMasonInterface_UpdateMemory_Call) Run(run func(ctx context.Context, request mason.UpdateManagedMemoryEntryRequest)) *MockMasonInterface_UpdateMemory_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(mason.UpdateManagedMemoryEntryRequest)) + }) + return _c +} + +func (_c *MockMasonInterface_UpdateMemory_Call) Return(_a0 *mason.ManagedMemoryEntry, _a1 error) *MockMasonInterface_UpdateMemory_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockMasonInterface_UpdateMemory_Call) RunAndReturn(run func(context.Context, mason.UpdateManagedMemoryEntryRequest) (*mason.ManagedMemoryEntry, error)) *MockMasonInterface_UpdateMemory_Call { + _c.Call.Return(run) + return _c +} + +// UpdateMemoryStore provides a mock function with given fields: ctx, request +func (_m *MockMasonInterface) UpdateMemoryStore(ctx context.Context, request mason.UpdateManagedMemoryStoreRequest) (*mason.ManagedMemoryStore, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for UpdateMemoryStore") + } + + var r0 *mason.ManagedMemoryStore + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, mason.UpdateManagedMemoryStoreRequest) (*mason.ManagedMemoryStore, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, mason.UpdateManagedMemoryStoreRequest) *mason.ManagedMemoryStore); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*mason.ManagedMemoryStore) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, mason.UpdateManagedMemoryStoreRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockMasonInterface_UpdateMemoryStore_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateMemoryStore' +type MockMasonInterface_UpdateMemoryStore_Call struct { + *mock.Call +} + +// UpdateMemoryStore is a helper method to define mock.On call +// - ctx context.Context +// - request mason.UpdateManagedMemoryStoreRequest +func (_e *MockMasonInterface_Expecter) UpdateMemoryStore(ctx interface{}, request interface{}) *MockMasonInterface_UpdateMemoryStore_Call { + return &MockMasonInterface_UpdateMemoryStore_Call{Call: _e.mock.On("UpdateMemoryStore", ctx, request)} +} + +func (_c *MockMasonInterface_UpdateMemoryStore_Call) Run(run func(ctx context.Context, request mason.UpdateManagedMemoryStoreRequest)) *MockMasonInterface_UpdateMemoryStore_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(mason.UpdateManagedMemoryStoreRequest)) + }) + return _c +} + +func (_c *MockMasonInterface_UpdateMemoryStore_Call) Return(_a0 *mason.ManagedMemoryStore, _a1 error) *MockMasonInterface_UpdateMemoryStore_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockMasonInterface_UpdateMemoryStore_Call) RunAndReturn(run func(context.Context, mason.UpdateManagedMemoryStoreRequest) (*mason.ManagedMemoryStore, error)) *MockMasonInterface_UpdateMemoryStore_Call { + _c.Call.Return(run) + return _c +} + +// UpdateSession provides a mock function with given fields: ctx, request +func (_m *MockMasonInterface) UpdateSession(ctx context.Context, request mason.UpdateSessionRequest) (*mason.Session, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for UpdateSession") + } + + var r0 *mason.Session + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, mason.UpdateSessionRequest) (*mason.Session, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, mason.UpdateSessionRequest) *mason.Session); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*mason.Session) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, mason.UpdateSessionRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockMasonInterface_UpdateSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateSession' +type MockMasonInterface_UpdateSession_Call struct { + *mock.Call +} + +// UpdateSession is a helper method to define mock.On call +// - ctx context.Context +// - request mason.UpdateSessionRequest +func (_e *MockMasonInterface_Expecter) UpdateSession(ctx interface{}, request interface{}) *MockMasonInterface_UpdateSession_Call { + return &MockMasonInterface_UpdateSession_Call{Call: _e.mock.On("UpdateSession", ctx, request)} +} + +func (_c *MockMasonInterface_UpdateSession_Call) Run(run func(ctx context.Context, request mason.UpdateSessionRequest)) *MockMasonInterface_UpdateSession_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(mason.UpdateSessionRequest)) + }) + return _c +} + +func (_c *MockMasonInterface_UpdateSession_Call) Return(_a0 *mason.Session, _a1 error) *MockMasonInterface_UpdateSession_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockMasonInterface_UpdateSession_Call) RunAndReturn(run func(context.Context, mason.UpdateSessionRequest) (*mason.Session, error)) *MockMasonInterface_UpdateSession_Call { + _c.Call.Return(run) + return _c +} + +// UpdateSessionStore provides a mock function with given fields: ctx, request +func (_m *MockMasonInterface) UpdateSessionStore(ctx context.Context, request mason.UpdateSessionStoreRequest) (*mason.SessionStore, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for UpdateSessionStore") + } + + var r0 *mason.SessionStore + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, mason.UpdateSessionStoreRequest) (*mason.SessionStore, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, mason.UpdateSessionStoreRequest) *mason.SessionStore); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*mason.SessionStore) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, mason.UpdateSessionStoreRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockMasonInterface_UpdateSessionStore_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateSessionStore' +type MockMasonInterface_UpdateSessionStore_Call struct { + *mock.Call +} + +// UpdateSessionStore is a helper method to define mock.On call +// - ctx context.Context +// - request mason.UpdateSessionStoreRequest +func (_e *MockMasonInterface_Expecter) UpdateSessionStore(ctx interface{}, request interface{}) *MockMasonInterface_UpdateSessionStore_Call { + return &MockMasonInterface_UpdateSessionStore_Call{Call: _e.mock.On("UpdateSessionStore", ctx, request)} +} + +func (_c *MockMasonInterface_UpdateSessionStore_Call) Run(run func(ctx context.Context, request mason.UpdateSessionStoreRequest)) *MockMasonInterface_UpdateSessionStore_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(mason.UpdateSessionStoreRequest)) + }) + return _c +} + +func (_c *MockMasonInterface_UpdateSessionStore_Call) Return(_a0 *mason.SessionStore, _a1 error) *MockMasonInterface_UpdateSessionStore_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockMasonInterface_UpdateSessionStore_Call) RunAndReturn(run func(context.Context, mason.UpdateSessionStoreRequest) (*mason.SessionStore, error)) *MockMasonInterface_UpdateSessionStore_Call { + _c.Call.Return(run) + return _c +} + +// NewMockMasonInterface creates a new instance of MockMasonInterface. 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 NewMockMasonInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *MockMasonInterface { + mock := &MockMasonInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/service/aisearch/model.go b/service/aisearch/model.go index 66224dc08..dc1e889ca 100644 --- a/service/aisearch/model.go +++ b/service/aisearch/model.go @@ -853,7 +853,8 @@ type QueryIndexRequest struct { // 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. + // to 10. Prefer `page_size`; when both are set, `page_size` takes + // precedence. MaxResults int `json:"max_results,omitempty"` // Full resource name of the index to query. Format: // `workspaces/{workspace_id}/endpoints/{endpoint_id}/indexes/{index_id}` diff --git a/service/apps/api.go b/service/apps/api.go old mode 100755 new mode 100644 index 0af96a8a4..f6af24979 --- a/service/apps/api.go +++ b/service/apps/api.go @@ -180,7 +180,8 @@ type AppsInterface interface { // Deprecated: use [AppsAPIInterface.Stop].Get() or [AppsAPIInterface.WaitGetAppStopped] StopAndWait(ctx context.Context, stopAppRequest StopAppRequest, options ...retries.Option[App]) (*App, error) - // Updates the app with the supplied name. + // Updates the app with the supplied name. This is a full replacement: fields + // omitted from the request are cleared, so send the complete app. Update(ctx context.Context, request UpdateAppRequest) (*App, error) // Updates the thumbnail for an app. diff --git a/service/apps/interface.go b/service/apps/interface.go old mode 100755 new mode 100644 index 27897239b..4291077cc --- a/service/apps/interface.go +++ b/service/apps/interface.go @@ -79,7 +79,8 @@ type AppsService interface { // Stops the active deployment of the app in the workspace. Stop(ctx context.Context, request StopAppRequest) (*App, error) - // Updates the app with the supplied name. + // Updates the app with the supplied name. This is a full replacement: + // fields omitted from the request are cleared, so send the complete app. Update(ctx context.Context, request UpdateAppRequest) (*App, error) // Updates the thumbnail for an app. diff --git a/service/apps/model.go b/service/apps/model.go index 5b4f40b3f..57ccc95bf 100644 --- a/service/apps/model.go +++ b/service/apps/model.go @@ -19,11 +19,11 @@ type App struct { AppStatus *ApplicationStatus `json:"app_status,omitempty"` BudgetPolicyId string `json:"budget_policy_id,omitempty"` - // Maximum number of app instances. Must be set together with - // `compute_min_instances`. + // Maximum number of app instances the app is configured to run. Must be set + // together with `compute_min_instances`. ComputeMaxInstances int `json:"compute_max_instances,omitempty"` - // Minimum number of app instances. Must be set together with - // `compute_max_instances`. + // Minimum number of app instances the app is configured to run. Must be set + // together with `compute_max_instances`. ComputeMinInstances int `json:"compute_min_instances,omitempty"` ComputeSize ComputeSize `json:"compute_size,omitempty"` @@ -1454,11 +1454,11 @@ func (s AppThumbnail) MarshalJSON() ([]byte, error) { type AppUpdate struct { BudgetPolicyId string `json:"budget_policy_id,omitempty"` - // Maximum number of app instances. Must be set together with - // `compute_min_instances`. + // Maximum number of app instances the app is configured to run. Must be set + // together with `compute_min_instances`. ComputeMaxInstances int `json:"compute_max_instances,omitempty"` - // Minimum number of app instances. Must be set together with - // `compute_max_instances`. + // Minimum number of app instances the app is configured to run. Must be set + // together with `compute_max_instances`. ComputeMinInstances int `json:"compute_min_instances,omitempty"` ComputeSize ComputeSize `json:"compute_size,omitempty"` @@ -1596,7 +1596,7 @@ func (f *ApplicationState) Type() string { type ApplicationStatus struct { // Application status message Message string `json:"message,omitempty"` - // The number of running instances of this application. + // The number of app instances whose application process is running. RunningInstances int `json:"running_instances,omitempty"` // State of the application. State ApplicationState `json:"state,omitempty"` @@ -1727,7 +1727,8 @@ func (f *ComputeState) Type() string { } type ComputeStatus struct { - // The number of compute instances used and billed for this application. + // The number of active compute instances currently used and billed for this + // application. ActiveInstances int `json:"active_instances,omitempty"` // Compute status message Message string `json:"message,omitempty"` diff --git a/service/bundledeployments/model.go b/service/bundledeployments/model.go index be57dc230..7a98c1bf2 100644 --- a/service/bundledeployments/model.go +++ b/service/bundledeployments/model.go @@ -12,13 +12,11 @@ import ( // 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. + // The reason for completing the version. Must be VERSION_COMPLETE_SUCCESS + // or VERSION_COMPLETE_FAILURE. 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. + // original creator. Force bool `json:"force,omitempty"` // The name of the version to complete. Format: // deployments/{deployment_id}/versions/{version_id} diff --git a/service/catalog/model.go b/service/catalog/model.go index 049c5dcde..a506f8136 100644 --- a/service/catalog/model.go +++ b/service/catalog/model.go @@ -7054,6 +7054,14 @@ type ModelProviderServiceConfigGeminiEnterpriseProviderDirectConfig struct { // GCP region of the Gemini Enterprise endpoint (e.g., `us-central1`). // Required on Create. Region string `json:"region,omitempty"` + // Reference to a Unity Catalog service credential authorizing Gemini + // Enterprise requests. On Create, supply `service_credential.name` as + // `credentials/{name}`; required when using service-credential + // authentication and mutually exclusive with `api_key`. The credential is + // referenced by name; its value is not carried here. On read, the resolved + // `id` and `is_deleted` are also populated. Supported only on GCP-hosted + // workspaces. + ServiceCredential *ModelProviderServiceConfigServiceCredential `json:"service_credential,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -7178,6 +7186,13 @@ type ModelProviderServiceConfigProviderSecret struct { // reads. Get and List responses omit `plaintext`; the enclosing secret // object remains present to indicate that a secret is configured. Plaintext string `json:"plaintext,omitempty"` + // Reference to a customer-owned UC Secret that carries this secret value. + // The value is read at invoke time under the model provider service owner's + // access and is never copied onto the model provider service, so rotating + // the UC Secret takes effect with no change to the model provider service. + // On Create, supply `secret_reference.name` as + // `secrets/{catalog}.{schema}.{secret}`. + SecretReference *ModelProviderServiceConfigSecretReference `json:"secret_reference,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -7190,6 +7205,19 @@ func (s ModelProviderServiceConfigProviderSecret) MarshalJSON() ([]byte, error) return marshal.Marshal(s) } +// Reference to a customer-owned UC Secret backing a secret-bearing provider +// field, in the `ProviderSecret.secret_reference` arm. +type ModelProviderServiceConfigSecretReference struct { + // Resource name of the bound UC Secret, in the form + // `secrets/{catalog}.{schema}.{secret}`. On Create the caller supplies the + // name here. On read it reflects the secret's current name at read time. + Name string `json:"name"` +} + +func (s *ModelProviderServiceConfigSecretReference) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + // The customer-owned Unity Catalog service credential a model provider service // uses to authenticate to its provider, referenced by name. type ModelProviderServiceConfigServiceCredential struct { diff --git a/service/cleanrooms/model.go b/service/cleanrooms/model.go index d5bcaec37..8aa71a812 100644 --- a/service/cleanrooms/model.go +++ b/service/cleanrooms/model.go @@ -138,10 +138,10 @@ type CleanRoomAsset struct { // if and only if **asset_type** is **TABLE** or **STREAMING_TABLE** TableLocalDetails *CleanRoomAssetTableLocalDetails `json:"table_local_details,omitempty"` // View details available to all collaborators of the clean room. Present if - // and only if **asset_type** is **VIEW** + // and only if **asset_type** is **VIEW** or **METRIC_VIEW** View *CleanRoomAssetView `json:"view,omitempty"` // Local details for a view that are only available to its owner. Present if - // and only if **asset_type** is **VIEW** + // and only if **asset_type** is **VIEW** or **METRIC_VIEW** ViewLocalDetails *CleanRoomAssetViewLocalDetails `json:"view_local_details,omitempty"` // Local details for a volume that are only available to its owner. Present // if and only if **asset_type** is **VOLUME** @@ -235,7 +235,7 @@ type CleanRoomAssetJarAnalysis struct { // Optional description of the jar analysis shown to all collaborators. Description string `json:"description,omitempty"` // The serverless environment version used to execute the JAR analysis (e.g. - // "4"). Defaults to "4-scala-preview" if not specified. + // "4"). If not specified, uses the service-configured JAR analysis default. EnvironmentVersion string `json:"environment_version,omitempty"` // Server generated etag that represents the jar analysis version. Etag string `json:"etag,omitempty"` diff --git a/service/iamv2/api.go b/service/iamv2/api.go index 333f80e48..aca946cde 100644 --- a/service/iamv2/api.go +++ b/service/iamv2/api.go @@ -13,6 +13,9 @@ import ( type AccountIamV2Interface interface { // Creates a group membership (assigns a principal to a group). + // + // Authorization: the caller must be an account admin or a manager of the group + // (holds the `roles/group.manager` role on it). CreateDirectGroupMember(ctx context.Context, request CreateDirectGroupMemberRequest) (*DirectGroupMember, error) // Creates a local group in the Databricks account and returns the created @@ -59,9 +62,15 @@ type AccountIamV2Interface interface { CreateWorkspaceAssignmentDetail(ctx context.Context, request CreateWorkspaceAssignmentDetailRequest) (*WorkspaceAssignmentDetail, error) // Deletes a group membership (unassigns a principal from a group). + // + // Authorization: the caller must be an account admin or a manager of the group + // (holds the `roles/group.manager` role on it). DeleteDirectGroupMember(ctx context.Context, request DeleteDirectGroupMemberRequest) error // Deletes a group from the Databricks account by its internal ID. + // + // Authorization: the caller must be an account admin or a manager of the group + // (holds the `roles/group.manager` role on it). DeleteGroup(ctx context.Context, request DeleteGroupRequest) error // Deletes a service principal from the Databricks account by its internal ID. @@ -232,6 +241,9 @@ type AccountIamV2Interface interface { // When AIM is enabled and the group is an external identity (its external_id is // set), only external_id can be updated; its other fields are sourced from your // identity provider. + // + // Authorization: the caller must be an account admin or a manager of the group + // (holds the `roles/group.manager` role on it). UpdateGroup(ctx context.Context, request UpdateGroupRequest) (*Group, error) // Updates an existing service principal in the Databricks account. Only the diff --git a/service/iamv2/interface.go b/service/iamv2/interface.go index ec512c2ba..53e069917 100644 --- a/service/iamv2/interface.go +++ b/service/iamv2/interface.go @@ -13,6 +13,9 @@ import ( type AccountIamV2Service interface { // Creates a group membership (assigns a principal to a group). + // + // Authorization: the caller must be an account admin or a manager of the + // group (holds the `roles/group.manager` role on it). CreateDirectGroupMember(ctx context.Context, request CreateDirectGroupMemberRequest) (*DirectGroupMember, error) // Creates a local group in the Databricks account and returns the created @@ -59,9 +62,15 @@ type AccountIamV2Service interface { CreateWorkspaceAssignmentDetail(ctx context.Context, request CreateWorkspaceAssignmentDetailRequest) (*WorkspaceAssignmentDetail, error) // Deletes a group membership (unassigns a principal from a group). + // + // Authorization: the caller must be an account admin or a manager of the + // group (holds the `roles/group.manager` role on it). DeleteDirectGroupMember(ctx context.Context, request DeleteDirectGroupMemberRequest) error // Deletes a group from the Databricks account by its internal ID. + // + // Authorization: the caller must be an account admin or a manager of the + // group (holds the `roles/group.manager` role on it). DeleteGroup(ctx context.Context, request DeleteGroupRequest) error // Deletes a service principal from the Databricks account by its internal @@ -185,6 +194,9 @@ type AccountIamV2Service interface { // When AIM is enabled and the group is an external identity (its // external_id is set), only external_id can be updated; its other fields // are sourced from your identity provider. + // + // Authorization: the caller must be an account admin or a manager of the + // group (holds the `roles/group.manager` role on it). UpdateGroup(ctx context.Context, request UpdateGroupRequest) (*Group, error) // Updates an existing service principal in the Databricks account. Only the diff --git a/service/jobs/model.go b/service/jobs/model.go index df61f3aa3..e7b31bf21 100644 --- a/service/jobs/model.go +++ b/service/jobs/model.go @@ -2478,6 +2478,12 @@ type JobEmailNotifications struct { // `TIMED_OUT` result_state. If this is not specified on job creation, // reset, or update the list is empty, and notifications are not sent. OnFailure []string `json:"on_failure,omitempty"` + // A list of email addresses to notify when platform-initiated maintenance + // completes for a continuous job. + OnMaintenanceComplete []string `json:"on_maintenance_complete,omitempty"` + // A list of email addresses to notify when platform-initiated maintenance + // starts for a continuous job. + OnMaintenanceStart []string `json:"on_maintenance_start,omitempty"` // A list of email addresses to be notified when a run begins. If not // specified on job creation, reset, or update, the list is empty, and // notifications are not sent. @@ -6653,6 +6659,12 @@ type TaskEmailNotifications struct { // `TIMED_OUT` result_state. If this is not specified on job creation, // reset, or update the list is empty, and notifications are not sent. OnFailure []string `json:"on_failure,omitempty"` + // A list of email addresses to notify when platform-initiated maintenance + // completes for a continuous job. + OnMaintenanceComplete []string `json:"on_maintenance_complete,omitempty"` + // A list of email addresses to notify when platform-initiated maintenance + // starts for a continuous job. + OnMaintenanceStart []string `json:"on_maintenance_start,omitempty"` // A list of email addresses to be notified when a run begins. If not // specified on job creation, reset, or update, the list is empty, and // notifications are not sent. @@ -7400,6 +7412,15 @@ type WebhookNotifications struct { // An optional list of system notification IDs to call when the run fails. A // maximum of 3 destinations can be specified for the `on_failure` property. OnFailure []Webhook `json:"on_failure,omitempty"` + // An optional list of system notification IDs to call when + // platform-initiated maintenance completes for a continuous job. A maximum + // of 3 destinations can be specified for the `on_maintenance_complete` + // property. + OnMaintenanceComplete []Webhook `json:"on_maintenance_complete,omitempty"` + // An optional list of system notification IDs to call when + // platform-initiated maintenance starts for a continuous job. A maximum of + // 3 destinations can be specified for the `on_maintenance_start` property. + OnMaintenanceStart []Webhook `json:"on_maintenance_start,omitempty"` // An optional list of system notification IDs to call when the run starts. // A maximum of 3 destinations can be specified for the `on_start` property. OnStart []Webhook `json:"on_start,omitempty"` diff --git a/service/mason/api.go b/service/mason/api.go new file mode 100644 index 000000000..a082cf6e7 --- /dev/null +++ b/service/mason/api.go @@ -0,0 +1,173 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +// APIs for managing agent memory and durable session state. This interface is +// under active development and may change. +package mason + +import ( + "context" + + "github.com/databricks/databricks-sdk-go/client" + "github.com/databricks/databricks-sdk-go/listing" +) + +type MasonInterface interface { + + // Appends items to a session. + AppendSessionItems(ctx context.Context, request AppendSessionItemsRequest) (*AppendSessionItemsResponse, error) + + // Clears all items from a session. + ClearSessionItems(ctx context.Context, request ClearSessionItemsRequest) (*ClearSessionItemsResponse, error) + + // Creates a managed memory entry using exclusive-create semantics. Callers may + // choose the entry ID; the service generates one when it is omitted. Returns + // `ALREADY_EXISTS` when an entry with the same actor, session, and path already + // exists. Omitted `session_id` is its own uniqueness key: two omitted-session + // entries with the same actor and path conflict, but an omitted-session entry + // does not conflict with a session-scoped entry at the same actor and path. + CreateMemory(ctx context.Context, request CreateManagedMemoryEntryRequest) (*ManagedMemoryEntry, error) + + // Creates a managed memory store in the caller's workspace. + CreateMemoryStore(ctx context.Context, request CreateManagedMemoryStoreRequest) (*ManagedMemoryStore, error) + + // Creates a session within a session store. + CreateSession(ctx context.Context, request CreateSessionRequest) (*Session, error) + + // Creates a session store. + CreateSessionStore(ctx context.Context, request CreateSessionStoreRequest) (*SessionStore, error) + + // Deletes a managed memory entry by resource name. Returns `NOT_FOUND` when the + // entry does not exist in the caller's workspace. + DeleteMemory(ctx context.Context, request DeleteManagedMemoryEntryRequest) error + + // Deletes a managed memory store by resource name. Returns `NOT_FOUND` when the + // store does not exist in the caller's workspace. + DeleteMemoryStore(ctx context.Context, request DeleteManagedMemoryStoreRequest) error + + // Deletes a session, its items, and any descendant sessions recursively. + // Independently retained memory is not deleted. + DeleteSession(ctx context.Context, request DeleteSessionRequest) error + + // Deletes a session store, its sessions and items, and its service-managed + // storage. Memory entries retained by a separate Memory Store are not deleted. + DeleteSessionStore(ctx context.Context, request DeleteSessionStoreRequest) error + + // Synchronously extracts memories from a single session into the given memory + // store, returning the entries that were written. + ExtractMemories(ctx context.Context, request ExtractMemoriesRequest) (*ExtractMemoriesResponse, error) + + // Forks a session into an independent top-level copy. + ForkSession(ctx context.Context, request ForkSessionRequest) (*ForkSessionResponse, error) + + // Retrieves a managed memory entry, including its content, by resource name. + // Returns `NOT_FOUND` when the entry does not exist in the caller's workspace. + GetMemory(ctx context.Context, request GetManagedMemoryEntryRequest) (*ManagedMemoryEntry, error) + + // Retrieves a managed memory store by resource name. Returns `NOT_FOUND` when + // the store does not exist in the caller's workspace. + GetMemoryStore(ctx context.Context, request GetManagedMemoryStoreRequest) (*ManagedMemoryStore, error) + + // Gets a session by resource name. + GetSession(ctx context.Context, request GetSessionRequest) (*Session, error) + + // Gets a session store by resource name. + GetSessionStore(ctx context.Context, request GetSessionStoreRequest) (*SessionStore, error) + + // Lists managed memory entries for one actor. Optional `session_id` and + // `path_prefix` further restrict the actor partition; `read_mask` selects + // fields in each returned entry. + // + // This method is generated by Databricks SDK Code Generator. + ListMemories(ctx context.Context, request ListManagedMemoryEntriesRequest) listing.Iterator[ManagedMemoryEntry] + + // Lists managed memory entries for one actor. Optional `session_id` and + // `path_prefix` further restrict the actor partition; `read_mask` selects + // fields in each returned entry. + // + // This method is generated by Databricks SDK Code Generator. + ListMemoriesAll(ctx context.Context, request ListManagedMemoryEntriesRequest) ([]ManagedMemoryEntry, error) + + // Lists managed memory stores in the caller's workspace. + // + // This method is generated by Databricks SDK Code Generator. + ListMemoryStores(ctx context.Context, request ListManagedMemoryStoresRequest) listing.Iterator[ManagedMemoryStore] + + // Lists managed memory stores in the caller's workspace. + // + // This method is generated by Databricks SDK Code Generator. + ListMemoryStoresAll(ctx context.Context, request ListManagedMemoryStoresRequest) ([]ManagedMemoryStore, error) + + // Lists items in a session. + // + // This method is generated by Databricks SDK Code Generator. + ListSessionItems(ctx context.Context, request ListSessionItemsRequest) listing.Iterator[SessionItem] + + // Lists items in a session. + // + // This method is generated by Databricks SDK Code Generator. + ListSessionItemsAll(ctx context.Context, request ListSessionItemsRequest) ([]SessionItem, error) + + // Lists session stores. + // + // This method is generated by Databricks SDK Code Generator. + ListSessionStores(ctx context.Context, request ListSessionStoresRequest) listing.Iterator[SessionStore] + + // Lists session stores. + // + // This method is generated by Databricks SDK Code Generator. + ListSessionStoresAll(ctx context.Context, request ListSessionStoresRequest) ([]SessionStore, error) + + // Lists sessions within a session store. + // + // This method is generated by Databricks SDK Code Generator. + ListSessions(ctx context.Context, request ListSessionsRequest) listing.Iterator[Session] + + // Lists sessions within a session store. + // + // This method is generated by Databricks SDK Code Generator. + ListSessionsAll(ctx context.Context, request ListSessionsRequest) ([]Session, error) + + // Pops the newest item from a session. + PopSessionItem(ctx context.Context, request PopSessionItemRequest) (*PopSessionItemResponse, error) + + // Searches managed memory entries by text query for one actor. Returns matching + // entries and scores ranked by relevance; `read_mask` selects fields in each + // returned entry. + // + // This method is generated by Databricks SDK Code Generator. + SearchMemories(ctx context.Context, request SearchManagedMemoryEntriesRequest) listing.Iterator[ManagedMemoryEntrySearchResult] + + // Searches managed memory entries by text query for one actor. Returns matching + // entries and scores ranked by relevance; `read_mask` selects fields in each + // returned entry. + // + // This method is generated by Databricks SDK Code Generator. + SearchMemoriesAll(ctx context.Context, request SearchManagedMemoryEntriesRequest) ([]ManagedMemoryEntrySearchResult, error) + + // Updates selected mutable fields on a managed memory entry. Identity fields + // are immutable. + UpdateMemory(ctx context.Context, request UpdateManagedMemoryEntryRequest) (*ManagedMemoryEntry, error) + + // Updates a managed memory store's description. + UpdateMemoryStore(ctx context.Context, request UpdateManagedMemoryStoreRequest) (*ManagedMemoryStore, error) + + // Updates a session's mutable fields. + UpdateSession(ctx context.Context, request UpdateSessionRequest) (*Session, error) + + // Updates a session store's description and metadata. + UpdateSessionStore(ctx context.Context, request UpdateSessionStoreRequest) (*SessionStore, error) +} + +func NewMason(client *client.DatabricksClient) *MasonAPI { + return &MasonAPI{ + masonImpl: masonImpl{ + client: client, + }, + } +} + +// APIs for managing agent memory and durable session state. This interface is +// under active development and may change. +type MasonAPI struct { + masonImpl +} diff --git a/service/mason/impl.go b/service/mason/impl.go new file mode 100644 index 000000000..56d99df08 --- /dev/null +++ b/service/mason/impl.go @@ -0,0 +1,647 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package mason + +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 Mason API methods +type masonImpl struct { + client *client.DatabricksClient +} + +func (a *masonImpl) AppendSessionItems(ctx context.Context, request AppendSessionItemsRequest) (*AppendSessionItemsResponse, error) { + var appendSessionItemsResponse AppendSessionItemsResponse + path := fmt.Sprintf("/api/2.0/agents/%v/items:append", request.Parent) + 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, &appendSessionItemsResponse) + return &appendSessionItemsResponse, err +} + +func (a *masonImpl) ClearSessionItems(ctx context.Context, request ClearSessionItemsRequest) (*ClearSessionItemsResponse, error) { + var clearSessionItemsResponse ClearSessionItemsResponse + path := fmt.Sprintf("/api/2.0/agents/%v/items:clear", request.Parent) + 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, &clearSessionItemsResponse) + return &clearSessionItemsResponse, err +} + +func (a *masonImpl) CreateMemory(ctx context.Context, request CreateManagedMemoryEntryRequest) (*ManagedMemoryEntry, error) { + var managedMemoryEntry ManagedMemoryEntry + path := fmt.Sprintf("/api/2.0/agents/%v/entries", request.Parent) + queryParams := make(map[string]any) + + if request.ManagedMemoryEntryId != "" || slices.Contains(request.ForceSendFields, "ManagedMemoryEntryId") { + queryParams["managed_memory_entry_id"] = request.ManagedMemoryEntryId + } + 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.ManagedMemoryEntry, &managedMemoryEntry) + return &managedMemoryEntry, err +} + +func (a *masonImpl) CreateMemoryStore(ctx context.Context, request CreateManagedMemoryStoreRequest) (*ManagedMemoryStore, error) { + var managedMemoryStore ManagedMemoryStore + path := "/api/2.0/agents/memory-stores" + queryParams := make(map[string]any) + + if request.ManagedMemoryStoreId != "" { + queryParams["managed_memory_store_id"] = request.ManagedMemoryStoreId + } + 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.ManagedMemoryStore, &managedMemoryStore) + return &managedMemoryStore, err +} + +func (a *masonImpl) CreateSession(ctx context.Context, request CreateSessionRequest) (*Session, error) { + var session Session + path := fmt.Sprintf("/api/2.0/agents/%v/sessions", request.Parent) + queryParams := make(map[string]any) + + if request.SessionId != "" || slices.Contains(request.ForceSendFields, "SessionId") { + queryParams["session_id"] = request.SessionId + } + 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.Session, &session) + return &session, err +} + +func (a *masonImpl) CreateSessionStore(ctx context.Context, request CreateSessionStoreRequest) (*SessionStore, error) { + var sessionStore SessionStore + path := "/api/2.0/agents/session-stores" + queryParams := make(map[string]any) + + if request.SessionStoreId != "" { + queryParams["session_store_id"] = request.SessionStoreId + } + 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.SessionStore, &sessionStore) + return &sessionStore, err +} + +func (a *masonImpl) DeleteMemory(ctx context.Context, request DeleteManagedMemoryEntryRequest) error { + path := fmt.Sprintf("/api/2.0/agents/%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 *masonImpl) DeleteMemoryStore(ctx context.Context, request DeleteManagedMemoryStoreRequest) error { + path := fmt.Sprintf("/api/2.0/agents/%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 *masonImpl) DeleteSession(ctx context.Context, request DeleteSessionRequest) error { + path := fmt.Sprintf("/api/2.0/agents/%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 *masonImpl) DeleteSessionStore(ctx context.Context, request DeleteSessionStoreRequest) error { + path := fmt.Sprintf("/api/2.0/agents/%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 *masonImpl) ExtractMemories(ctx context.Context, request ExtractMemoriesRequest) (*ExtractMemoriesResponse, error) { + var extractMemoriesResponse ExtractMemoriesResponse + path := fmt.Sprintf("/api/2.0/agents/%v/sessions/%v/extractions", request.SessionStore, request.SessionId) + 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, &extractMemoriesResponse) + return &extractMemoriesResponse, err +} + +func (a *masonImpl) ForkSession(ctx context.Context, request ForkSessionRequest) (*ForkSessionResponse, error) { + var forkSessionResponse ForkSessionResponse + path := fmt.Sprintf("/api/2.0/agents/%v/sessions:fork", request.Parent) + 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, &forkSessionResponse) + return &forkSessionResponse, err +} + +func (a *masonImpl) GetMemory(ctx context.Context, request GetManagedMemoryEntryRequest) (*ManagedMemoryEntry, error) { + var managedMemoryEntry ManagedMemoryEntry + path := fmt.Sprintf("/api/2.0/agents/%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, &managedMemoryEntry) + return &managedMemoryEntry, err +} + +func (a *masonImpl) GetMemoryStore(ctx context.Context, request GetManagedMemoryStoreRequest) (*ManagedMemoryStore, error) { + var managedMemoryStore ManagedMemoryStore + path := fmt.Sprintf("/api/2.0/agents/%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, &managedMemoryStore) + return &managedMemoryStore, err +} + +func (a *masonImpl) GetSession(ctx context.Context, request GetSessionRequest) (*Session, error) { + var session Session + path := fmt.Sprintf("/api/2.0/agents/%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, &session) + return &session, err +} + +func (a *masonImpl) GetSessionStore(ctx context.Context, request GetSessionStoreRequest) (*SessionStore, error) { + var sessionStore SessionStore + path := fmt.Sprintf("/api/2.0/agents/%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, &sessionStore) + return &sessionStore, err +} + +// Lists managed memory entries for one actor. Optional `session_id` and +// `path_prefix` further restrict the actor partition; `read_mask` selects +// fields in each returned entry. +func (a *masonImpl) ListMemories(ctx context.Context, request ListManagedMemoryEntriesRequest) listing.Iterator[ManagedMemoryEntry] { + + getNextPage := func(ctx context.Context, req ListManagedMemoryEntriesRequest) (*ListManagedMemoryEntriesResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.internalListMemories(ctx, req) + } + getItems := func(resp *ListManagedMemoryEntriesResponse) []ManagedMemoryEntry { + return resp.ManagedMemoryEntries + } + getNextReq := func(resp *ListManagedMemoryEntriesResponse) *ListManagedMemoryEntriesRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// Lists managed memory entries for one actor. Optional `session_id` and +// `path_prefix` further restrict the actor partition; `read_mask` selects +// fields in each returned entry. +func (a *masonImpl) ListMemoriesAll(ctx context.Context, request ListManagedMemoryEntriesRequest) ([]ManagedMemoryEntry, error) { + iterator := a.ListMemories(ctx, request) + return listing.ToSlice[ManagedMemoryEntry](ctx, iterator) +} + +func (a *masonImpl) internalListMemories(ctx context.Context, request ListManagedMemoryEntriesRequest) (*ListManagedMemoryEntriesResponse, error) { + var listManagedMemoryEntriesResponse ListManagedMemoryEntriesResponse + path := fmt.Sprintf("/api/2.0/agents/%v/entries", 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, &listManagedMemoryEntriesResponse) + return &listManagedMemoryEntriesResponse, err +} + +// Lists managed memory stores in the caller's workspace. +func (a *masonImpl) ListMemoryStores(ctx context.Context, request ListManagedMemoryStoresRequest) listing.Iterator[ManagedMemoryStore] { + + getNextPage := func(ctx context.Context, req ListManagedMemoryStoresRequest) (*ListManagedMemoryStoresResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.internalListMemoryStores(ctx, req) + } + getItems := func(resp *ListManagedMemoryStoresResponse) []ManagedMemoryStore { + return resp.ManagedMemoryStores + } + getNextReq := func(resp *ListManagedMemoryStoresResponse) *ListManagedMemoryStoresRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// Lists managed memory stores in the caller's workspace. +func (a *masonImpl) ListMemoryStoresAll(ctx context.Context, request ListManagedMemoryStoresRequest) ([]ManagedMemoryStore, error) { + iterator := a.ListMemoryStores(ctx, request) + return listing.ToSlice[ManagedMemoryStore](ctx, iterator) +} + +func (a *masonImpl) internalListMemoryStores(ctx context.Context, request ListManagedMemoryStoresRequest) (*ListManagedMemoryStoresResponse, error) { + var listManagedMemoryStoresResponse ListManagedMemoryStoresResponse + path := "/api/2.0/agents/memory-stores" + 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, &listManagedMemoryStoresResponse) + return &listManagedMemoryStoresResponse, err +} + +// Lists items in a session. +func (a *masonImpl) ListSessionItems(ctx context.Context, request ListSessionItemsRequest) listing.Iterator[SessionItem] { + + getNextPage := func(ctx context.Context, req ListSessionItemsRequest) (*ListSessionItemsResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.internalListSessionItems(ctx, req) + } + getItems := func(resp *ListSessionItemsResponse) []SessionItem { + return resp.SessionItems + } + getNextReq := func(resp *ListSessionItemsResponse) *ListSessionItemsRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// Lists items in a session. +func (a *masonImpl) ListSessionItemsAll(ctx context.Context, request ListSessionItemsRequest) ([]SessionItem, error) { + iterator := a.ListSessionItems(ctx, request) + return listing.ToSlice[SessionItem](ctx, iterator) +} + +func (a *masonImpl) internalListSessionItems(ctx context.Context, request ListSessionItemsRequest) (*ListSessionItemsResponse, error) { + var listSessionItemsResponse ListSessionItemsResponse + path := fmt.Sprintf("/api/2.0/agents/%v/items", 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, &listSessionItemsResponse) + return &listSessionItemsResponse, err +} + +// Lists session stores. +func (a *masonImpl) ListSessionStores(ctx context.Context, request ListSessionStoresRequest) listing.Iterator[SessionStore] { + + getNextPage := func(ctx context.Context, req ListSessionStoresRequest) (*ListSessionStoresResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.internalListSessionStores(ctx, req) + } + getItems := func(resp *ListSessionStoresResponse) []SessionStore { + return resp.SessionStores + } + getNextReq := func(resp *ListSessionStoresResponse) *ListSessionStoresRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// Lists session stores. +func (a *masonImpl) ListSessionStoresAll(ctx context.Context, request ListSessionStoresRequest) ([]SessionStore, error) { + iterator := a.ListSessionStores(ctx, request) + return listing.ToSlice[SessionStore](ctx, iterator) +} + +func (a *masonImpl) internalListSessionStores(ctx context.Context, request ListSessionStoresRequest) (*ListSessionStoresResponse, error) { + var listSessionStoresResponse ListSessionStoresResponse + path := "/api/2.0/agents/session-stores" + 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, &listSessionStoresResponse) + return &listSessionStoresResponse, err +} + +// Lists sessions within a session store. +func (a *masonImpl) ListSessions(ctx context.Context, request ListSessionsRequest) listing.Iterator[Session] { + + getNextPage := func(ctx context.Context, req ListSessionsRequest) (*ListSessionsResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.internalListSessions(ctx, req) + } + getItems := func(resp *ListSessionsResponse) []Session { + return resp.Sessions + } + getNextReq := func(resp *ListSessionsResponse) *ListSessionsRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// Lists sessions within a session store. +func (a *masonImpl) ListSessionsAll(ctx context.Context, request ListSessionsRequest) ([]Session, error) { + iterator := a.ListSessions(ctx, request) + return listing.ToSlice[Session](ctx, iterator) +} + +func (a *masonImpl) internalListSessions(ctx context.Context, request ListSessionsRequest) (*ListSessionsResponse, error) { + var listSessionsResponse ListSessionsResponse + path := fmt.Sprintf("/api/2.0/agents/%v/sessions", 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, &listSessionsResponse) + return &listSessionsResponse, err +} + +func (a *masonImpl) PopSessionItem(ctx context.Context, request PopSessionItemRequest) (*PopSessionItemResponse, error) { + var popSessionItemResponse PopSessionItemResponse + path := fmt.Sprintf("/api/2.0/agents/%v/items:pop", request.Parent) + 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, &popSessionItemResponse) + return &popSessionItemResponse, err +} + +// Searches managed memory entries by text query for one actor. Returns matching +// entries and scores ranked by relevance; `read_mask` selects fields in each +// returned entry. +func (a *masonImpl) SearchMemories(ctx context.Context, request SearchManagedMemoryEntriesRequest) listing.Iterator[ManagedMemoryEntrySearchResult] { + + getNextPage := func(ctx context.Context, req SearchManagedMemoryEntriesRequest) (*SearchManagedMemoryEntriesResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.internalSearchMemories(ctx, req) + } + getItems := func(resp *SearchManagedMemoryEntriesResponse) []ManagedMemoryEntrySearchResult { + return resp.Results + } + getNextReq := func(resp *SearchManagedMemoryEntriesResponse) *SearchManagedMemoryEntriesRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// Searches managed memory entries by text query for one actor. Returns matching +// entries and scores ranked by relevance; `read_mask` selects fields in each +// returned entry. +func (a *masonImpl) SearchMemoriesAll(ctx context.Context, request SearchManagedMemoryEntriesRequest) ([]ManagedMemoryEntrySearchResult, error) { + iterator := a.SearchMemories(ctx, request) + return listing.ToSlice[ManagedMemoryEntrySearchResult](ctx, iterator) +} + +func (a *masonImpl) internalSearchMemories(ctx context.Context, request SearchManagedMemoryEntriesRequest) (*SearchManagedMemoryEntriesResponse, error) { + var searchManagedMemoryEntriesResponse SearchManagedMemoryEntriesResponse + path := fmt.Sprintf("/api/2.0/agents/%v/entries:search", request.Parent) + 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, &searchManagedMemoryEntriesResponse) + return &searchManagedMemoryEntriesResponse, err +} + +func (a *masonImpl) UpdateMemory(ctx context.Context, request UpdateManagedMemoryEntryRequest) (*ManagedMemoryEntry, error) { + var managedMemoryEntry ManagedMemoryEntry + path := fmt.Sprintf("/api/2.0/agents/%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.ManagedMemoryEntry, &managedMemoryEntry) + return &managedMemoryEntry, err +} + +func (a *masonImpl) UpdateMemoryStore(ctx context.Context, request UpdateManagedMemoryStoreRequest) (*ManagedMemoryStore, error) { + var managedMemoryStore ManagedMemoryStore + path := fmt.Sprintf("/api/2.0/agents/%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.ManagedMemoryStore, &managedMemoryStore) + return &managedMemoryStore, err +} + +func (a *masonImpl) UpdateSession(ctx context.Context, request UpdateSessionRequest) (*Session, error) { + var session Session + path := fmt.Sprintf("/api/2.0/agents/%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.Session, &session) + return &session, err +} + +func (a *masonImpl) UpdateSessionStore(ctx context.Context, request UpdateSessionStoreRequest) (*SessionStore, error) { + var sessionStore SessionStore + path := fmt.Sprintf("/api/2.0/agents/%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.SessionStore, &sessionStore) + return &sessionStore, err +} diff --git a/service/mason/interface.go b/service/mason/interface.go new file mode 100644 index 000000000..be5d89b8c --- /dev/null +++ b/service/mason/interface.go @@ -0,0 +1,115 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package mason + +import ( + "context" +) + +// APIs for managing agent memory and durable session state. This interface is +// under active development and may change. +// +// Deprecated: Do not use this interface, it will be removed in a future version of the SDK. +type MasonService interface { + + // Appends items to a session. + AppendSessionItems(ctx context.Context, request AppendSessionItemsRequest) (*AppendSessionItemsResponse, error) + + // Clears all items from a session. + ClearSessionItems(ctx context.Context, request ClearSessionItemsRequest) (*ClearSessionItemsResponse, error) + + // Creates a managed memory entry using exclusive-create semantics. Callers + // may choose the entry ID; the service generates one when it is omitted. + // Returns `ALREADY_EXISTS` when an entry with the same actor, session, and + // path already exists. Omitted `session_id` is its own uniqueness key: two + // omitted-session entries with the same actor and path conflict, but an + // omitted-session entry does not conflict with a session-scoped entry at + // the same actor and path. + CreateMemory(ctx context.Context, request CreateManagedMemoryEntryRequest) (*ManagedMemoryEntry, error) + + // Creates a managed memory store in the caller's workspace. + CreateMemoryStore(ctx context.Context, request CreateManagedMemoryStoreRequest) (*ManagedMemoryStore, error) + + // Creates a session within a session store. + CreateSession(ctx context.Context, request CreateSessionRequest) (*Session, error) + + // Creates a session store. + CreateSessionStore(ctx context.Context, request CreateSessionStoreRequest) (*SessionStore, error) + + // Deletes a managed memory entry by resource name. Returns `NOT_FOUND` when + // the entry does not exist in the caller's workspace. + DeleteMemory(ctx context.Context, request DeleteManagedMemoryEntryRequest) error + + // Deletes a managed memory store by resource name. Returns `NOT_FOUND` when + // the store does not exist in the caller's workspace. + DeleteMemoryStore(ctx context.Context, request DeleteManagedMemoryStoreRequest) error + + // Deletes a session, its items, and any descendant sessions recursively. + // Independently retained memory is not deleted. + DeleteSession(ctx context.Context, request DeleteSessionRequest) error + + // Deletes a session store, its sessions and items, and its service-managed + // storage. Memory entries retained by a separate Memory Store are not + // deleted. + DeleteSessionStore(ctx context.Context, request DeleteSessionStoreRequest) error + + // Synchronously extracts memories from a single session into the given + // memory store, returning the entries that were written. + ExtractMemories(ctx context.Context, request ExtractMemoriesRequest) (*ExtractMemoriesResponse, error) + + // Forks a session into an independent top-level copy. + ForkSession(ctx context.Context, request ForkSessionRequest) (*ForkSessionResponse, error) + + // Retrieves a managed memory entry, including its content, by resource + // name. Returns `NOT_FOUND` when the entry does not exist in the caller's + // workspace. + GetMemory(ctx context.Context, request GetManagedMemoryEntryRequest) (*ManagedMemoryEntry, error) + + // Retrieves a managed memory store by resource name. Returns `NOT_FOUND` + // when the store does not exist in the caller's workspace. + GetMemoryStore(ctx context.Context, request GetManagedMemoryStoreRequest) (*ManagedMemoryStore, error) + + // Gets a session by resource name. + GetSession(ctx context.Context, request GetSessionRequest) (*Session, error) + + // Gets a session store by resource name. + GetSessionStore(ctx context.Context, request GetSessionStoreRequest) (*SessionStore, error) + + // Lists managed memory entries for one actor. Optional `session_id` and + // `path_prefix` further restrict the actor partition; `read_mask` selects + // fields in each returned entry. + ListMemories(ctx context.Context, request ListManagedMemoryEntriesRequest) (*ListManagedMemoryEntriesResponse, error) + + // Lists managed memory stores in the caller's workspace. + ListMemoryStores(ctx context.Context, request ListManagedMemoryStoresRequest) (*ListManagedMemoryStoresResponse, error) + + // Lists items in a session. + ListSessionItems(ctx context.Context, request ListSessionItemsRequest) (*ListSessionItemsResponse, error) + + // Lists session stores. + ListSessionStores(ctx context.Context, request ListSessionStoresRequest) (*ListSessionStoresResponse, error) + + // Lists sessions within a session store. + ListSessions(ctx context.Context, request ListSessionsRequest) (*ListSessionsResponse, error) + + // Pops the newest item from a session. + PopSessionItem(ctx context.Context, request PopSessionItemRequest) (*PopSessionItemResponse, error) + + // Searches managed memory entries by text query for one actor. Returns + // matching entries and scores ranked by relevance; `read_mask` selects + // fields in each returned entry. + SearchMemories(ctx context.Context, request SearchManagedMemoryEntriesRequest) (*SearchManagedMemoryEntriesResponse, error) + + // Updates selected mutable fields on a managed memory entry. Identity + // fields are immutable. + UpdateMemory(ctx context.Context, request UpdateManagedMemoryEntryRequest) (*ManagedMemoryEntry, error) + + // Updates a managed memory store's description. + UpdateMemoryStore(ctx context.Context, request UpdateManagedMemoryStoreRequest) (*ManagedMemoryStore, error) + + // Updates a session's mutable fields. + UpdateSession(ctx context.Context, request UpdateSessionRequest) (*Session, error) + + // Updates a session store's description and metadata. + UpdateSessionStore(ctx context.Context, request UpdateSessionStoreRequest) (*SessionStore, error) +} diff --git a/service/mason/model.go b/service/mason/model.go new file mode 100644 index 000000000..bdeabd850 --- /dev/null +++ b/service/mason/model.go @@ -0,0 +1,954 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package mason + +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" +) + +// Request to append items to a session. +type AppendSessionItemsRequest struct { + // Items to append atomically in request order. Concurrent append requests + // are serialized into one committed order without exposing a numeric + // sequence in the public contract. + Items []SessionItem `json:"items"` + // Resource name of the containing session, in the form + // `session-stores/{session_store_id}/sessions/{session_id}`. + Parent string `json:"-" url:"-"` +} + +func (s *AppendSessionItemsRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +// Response containing appended items. +type AppendSessionItemsResponse struct { + // Persisted session items with service-assigned fields. + SessionItems []SessionItem `json:"session_items,omitempty"` +} + +func (s *AppendSessionItemsResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +// Request to clear all items from a session. +type ClearSessionItemsRequest struct { + // Resource name of the containing session, in the form + // `session-stores/{session_store_id}/sessions/{session_id}`. + Parent string `json:"-" url:"-"` +} + +func (s *ClearSessionItemsRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +// Response from clearing items from a session. +type ClearSessionItemsResponse struct { +} + +func (s *ClearSessionItemsResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +type CreateManagedMemoryEntryRequest struct { + // The managed memory entry to create. + ManagedMemoryEntry ManagedMemoryEntry `json:"managed_memory_entry"` + // Optional caller-selected managed memory entry ID. The service generates + // an ID when omitted. + ManagedMemoryEntryId string `json:"-" url:"managed_memory_entry_id,omitempty"` + // Managed memory store that will contain the entry, in the form + // `memory-stores/{managed_memory_store_id}`. + Parent string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *CreateManagedMemoryEntryRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s CreateManagedMemoryEntryRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type CreateManagedMemoryStoreRequest struct { + // The managed memory store to create. + ManagedMemoryStore ManagedMemoryStore `json:"managed_memory_store"` + // Caller-provided, workspace-unique managed memory store ID. It must be + // 3-56 characters, begin with a lowercase letter, contain only lowercase + // letters, digits, and hyphens, and end with a letter or digit. + ManagedMemoryStoreId string `json:"-" url:"managed_memory_store_id"` +} + +func (s *CreateManagedMemoryStoreRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +type CreateSessionRequest struct { + // Resource name of the containing session store, in the form + // `session-stores/{session_store_id}`. + Parent string `json:"-" url:"-"` + // The session to create. `actor_id` is required. A session with + // `parent_session_id` is a child and must use its parent's `actor_id`. + // Independent forks are created only through `ForkSession`. + Session Session `json:"session"` + // Optional caller-selected session ID. The service generates a UUID when + // this field is omitted. The ID must be unique; a collision returns + // `ALREADY_EXISTS`. + SessionId string `json:"-" url:"session_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *CreateSessionRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s CreateSessionRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type CreateSessionStoreRequest struct { + // The session store to create. + SessionStore SessionStore `json:"session_store"` + // Caller-provided, workspace-unique session store ID. It must be 3-55 + // characters, begin with a lowercase letter, and contain only lowercase + // letters, digits, and hyphens. + SessionStoreId string `json:"-" url:"session_store_id"` +} + +func (s *CreateSessionStoreRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +type DeleteManagedMemoryEntryRequest struct { + // Resource name in the form + // `memory-stores/{managed_memory_store_id}/entries/{managed_memory_entry_id}`. + Name string `json:"-" url:"-"` +} + +func (s *DeleteManagedMemoryEntryRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +type DeleteManagedMemoryStoreRequest struct { + // Resource name in the form `memory-stores/{managed_memory_store_id}`. + Name string `json:"-" url:"-"` +} + +func (s *DeleteManagedMemoryStoreRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +type DeleteSessionRequest struct { + // Resource name in the form + // `session-stores/{session_store_id}/sessions/{session_id}`. + Name string `json:"-" url:"-"` +} + +func (s *DeleteSessionRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +type DeleteSessionStoreRequest struct { + // Resource name in the form `session-stores/{session_store_id}`. + Name string `json:"-" url:"-"` +} + +func (s *DeleteSessionStoreRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +// Request to synchronously extract memories from a single session. +type ExtractMemoriesRequest struct { + // When true, extract and return the entries without writing them to the + // memory store. Defaults to false, which persists the extracted entries and + // returns them. + DryRun bool `json:"dry_run,omitempty"` + // Instructions steering what is extracted from the session. + Instructions string `json:"instructions,omitempty"` + // Managed memory store the extracted entries are written to, in the form + // `memory-stores/{managed_memory_store_id}`. + MemoryStore string `json:"memory_store"` + // Identifier of the session whose transcript is distilled into memories. + SessionId string `json:"-" url:"-"` + // Session store containing the session, in the form + // `session-stores/{session_store_id}`. + SessionStore string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ExtractMemoriesRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ExtractMemoriesRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Result of a single-session memory extraction. +type ExtractMemoriesResponse struct { + // The memory entries written by this extraction. + Entries []ManagedMemoryEntry `json:"entries,omitempty"` + // Correlation identifier for this extraction, for logging and tracing. Not + // a fetchable resource. + Name string `json:"name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ExtractMemoriesResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ExtractMemoriesResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Request to fork a session. +type ForkSessionRequest struct { + // Opaque caller-provided identifier for the application actor associated + // with the forked session. + ActorId string `json:"actor_id"` + // Optional metadata for the fork. + Metadata map[string]string `json:"metadata,omitempty"` + // Resource name of the containing session store, in the form + // `session-stores/{session_store_id}`. + Parent string `json:"-" url:"-"` + // Optional unique ID for the forked session. A collision returns + // `ALREADY_EXISTS`. + SessionId string `json:"session_id,omitempty"` + // ID of the session to copy. + SourceSessionId string `json:"source_session_id"` + // Optional last item ID to copy through, inclusively. When omitted, the + // fork atomically copies all items committed before the fork operation + // begins. + UpToItemId string `json:"up_to_item_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ForkSessionRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ForkSessionRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Response from forking a session. +type ForkSessionResponse struct { + // The newly-created independent top-level session. + Session *Session `json:"session,omitempty"` +} + +func (s *ForkSessionResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +type GetManagedMemoryEntryRequest struct { + // Resource name in the form + // `memory-stores/{managed_memory_store_id}/entries/{managed_memory_entry_id}`. + Name string `json:"-" url:"-"` + // Fields to return, using proto field names such as `content` (not + // `contents`). An omitted or empty mask returns the full entry, including + // `content`; a non-empty mask returns only the requested fields. + ReadMask *fieldmask.FieldMask `json:"-" url:"read_mask,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *GetManagedMemoryEntryRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s GetManagedMemoryEntryRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type GetManagedMemoryStoreRequest struct { + // Resource name in the form `memory-stores/{managed_memory_store_id}`. + Name string `json:"-" url:"-"` +} + +func (s *GetManagedMemoryStoreRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +type GetSessionRequest struct { + // Resource name in the form + // `session-stores/{session_store_id}/sessions/{session_id}`. + Name string `json:"-" url:"-"` +} + +func (s *GetSessionRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +type GetSessionStoreRequest struct { + // Resource name in the form `session-stores/{session_store_id}`. + Name string `json:"-" url:"-"` +} + +func (s *GetSessionStoreRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +type ListManagedMemoryEntriesRequest struct { + // Customer-provided identifier for the actor whose entries are listed. + ActorId string `json:"-" url:"actor_id"` + // Maximum number of entries to return. The service may return fewer entries + // than requested. Defaults to 10; must be between 1 and 100. + PageSize int `json:"-" url:"page_size,omitempty"` + // Opaque pagination token from a previous ListManagedMemoryEntries + // response. + PageToken string `json:"-" url:"page_token,omitempty"` + // Managed memory store whose entries are listed, in the form + // `memory-stores/{managed_memory_store_id}`. + Parent string `json:"-" url:"-"` + // Optional path prefix used to restrict entries within the actor partition. + PathPrefix string `json:"-" url:"path_prefix,omitempty"` + // Fields to return in each entry, using proto field names such as `content` + // (not `contents`). An omitted or empty mask returns each full entry, + // including `content`; a non-empty mask returns only the requested fields. + ReadMask *fieldmask.FieldMask `json:"-" url:"read_mask,omitempty"` + // Optional session identifier. When set, only entries with this exact + // `session_id` are returned. Omitted-session (cross-session) entries are + // not included. + SessionId string `json:"-" url:"session_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListManagedMemoryEntriesRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListManagedMemoryEntriesRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Response containing managed memory entries. +type ListManagedMemoryEntriesResponse struct { + // Managed memory entries matching the request and its read mask. + ManagedMemoryEntries []ManagedMemoryEntry `json:"managed_memory_entries,omitempty"` + // Opaque pagination token. This field is omitted when there are no more + // results. + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListManagedMemoryEntriesResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListManagedMemoryEntriesResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListManagedMemoryStoresRequest struct { + // Maximum number of stores to return. The service may return fewer stores + // than requested. Defaults to 10; must be between 1 and 100. + PageSize int `json:"-" url:"page_size,omitempty"` + // Opaque pagination token from a previous ListManagedMemoryStores response. + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListManagedMemoryStoresRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListManagedMemoryStoresRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Response containing managed memory stores in the caller's workspace. +type ListManagedMemoryStoresResponse struct { + // Managed memory stores in the caller's workspace. + ManagedMemoryStores []ManagedMemoryStore `json:"managed_memory_stores,omitempty"` + // Opaque pagination token. This field is omitted when there are no more + // results. + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListManagedMemoryStoresResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListManagedMemoryStoresResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListSessionItemsRequest struct { + // Sort order. Supported values are `create_time asc` and `create_time + // desc`. The default is `create_time desc`, which returns the most recently + // appended items first. Equal timestamps are resolved by committed append + // order in the requested direction. + OrderBy string `json:"-" url:"order_by,omitempty"` + // Maximum number of items to return. Defaults to 10; must be between 1 and + // 100. + PageSize int `json:"-" url:"page_size,omitempty"` + // Token returned by a previous list request. + PageToken string `json:"-" url:"page_token,omitempty"` + // Resource name of the containing session, in the form + // `session-stores/{session_store_id}/sessions/{session_id}`. + Parent string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListSessionItemsRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListSessionItemsRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Response containing a page of session items. +type ListSessionItemsResponse struct { + // Token to retrieve the next page. + NextPageToken string `json:"next_page_token,omitempty"` + // Session items in the requested page. + SessionItems []SessionItem `json:"session_items,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListSessionItemsResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListSessionItemsResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListSessionStoresRequest struct { + // Maximum number of session stores to return. Defaults to 10; must be + // between 1 and 100. + PageSize int `json:"-" url:"page_size,omitempty"` + // Token returned by a previous list request. + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListSessionStoresRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListSessionStoresRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Response containing a page of session stores. +type ListSessionStoresResponse struct { + // Token to retrieve the next page. + NextPageToken string `json:"next_page_token,omitempty"` + // Session stores in the requested page. + SessionStores []SessionStore `json:"session_stores,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListSessionStoresResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListSessionStoresResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListSessionsRequest struct { + // Filter expression. Supported fields include `actor_id` and `metadata`; + // for example, `actor_id = "support-customer-123"`. + Filter string `json:"-" url:"filter,omitempty"` + // Sort order. Defaults to `last_activity_time desc`. Page-token + // continuation is exactly-once when ordering by `create_time` (immutable); + // ordering by `last_activity_time` is best-effort, because that value + // changes as a session gains activity, so a session updated between page + // requests may be repeated or skipped. To enumerate every session exactly + // once, order by `create_time`. + OrderBy string `json:"-" url:"order_by,omitempty"` + // Maximum number of sessions to return. Defaults to 10; must be between 1 + // and 100. + PageSize int `json:"-" url:"page_size,omitempty"` + // Token returned by a previous list request. + PageToken string `json:"-" url:"page_token,omitempty"` + // Resource name of the containing session store, in the form + // `session-stores/{session_store_id}`. + Parent string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListSessionsRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListSessionsRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Response containing a page of sessions. +type ListSessionsResponse struct { + // Token to retrieve the next page. + NextPageToken string `json:"next_page_token,omitempty"` + // Sessions in the requested page. + Sessions []Session `json:"sessions,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListSessionsResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListSessionsResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// A workspace-scoped entry in a managed memory store. +type ManagedMemoryEntry struct { + // Customer-provided identifier for the actor whose memory this entry + // represents. + ActorId string `json:"actor_id"` + // Optional free-form memory content. + Content string `json:"content,omitempty"` + // Time when the entry was created. + CreateTime *time.Time `json:"create_time,omitempty"` + // Human-readable description of the memory entry. + Description string `json:"description,omitempty"` + // Resource name in the form + // `memory-stores/{managed_memory_store_id}/entries/{managed_memory_entry_id}`. + Name string `json:"name,omitempty"` + // Absolute, case-sensitive path identifying the entry within its actor and + // optional session. Paths must begin with `/` and must not contain empty, + // `.` or `..` segments. + Path string `json:"path"` + // Optional identifier for the session associated with this memory entry. + // When omitted, the entry applies across the actor's sessions. + SessionId string `json:"session_id,omitempty"` + // Which writer created this entry. Caller sets this on Create; immutable + // after creation. + SourceType ManagedMemoryEntrySourceType `json:"source_type,omitempty"` + // Time when the entry was last updated. + UpdateTime *time.Time `json:"update_time,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ManagedMemoryEntry) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ManagedMemoryEntry) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// One relevance-ranked managed memory search result. +type ManagedMemoryEntrySearchResult struct { + // Managed memory entry matching the query. + ManagedMemoryEntry *ManagedMemoryEntry `json:"managed_memory_entry,omitempty"` + // Relevance score for the result. Higher scores are more relevant. + Score float64 `json:"score,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ManagedMemoryEntrySearchResult) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ManagedMemoryEntrySearchResult) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Identifies the source that created a managed memory entry. +type ManagedMemoryEntrySourceType string + +const ManagedMemoryEntrySourceTypeManagedMemoryEntrySourceTypeAgent ManagedMemoryEntrySourceType = `MANAGED_MEMORY_ENTRY_SOURCE_TYPE_AGENT` + +const ManagedMemoryEntrySourceTypeManagedMemoryEntrySourceTypeDreamer ManagedMemoryEntrySourceType = `MANAGED_MEMORY_ENTRY_SOURCE_TYPE_DREAMER` + +// String representation for [fmt.Print] +func (f *ManagedMemoryEntrySourceType) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *ManagedMemoryEntrySourceType) Set(v string) error { + switch v { + case `MANAGED_MEMORY_ENTRY_SOURCE_TYPE_AGENT`, `MANAGED_MEMORY_ENTRY_SOURCE_TYPE_DREAMER`: + *f = ManagedMemoryEntrySourceType(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "MANAGED_MEMORY_ENTRY_SOURCE_TYPE_AGENT", "MANAGED_MEMORY_ENTRY_SOURCE_TYPE_DREAMER"`, v) + } +} + +// Values returns all possible values for ManagedMemoryEntrySourceType. +// +// There is no guarantee on the order of the values in the slice. +func (f *ManagedMemoryEntrySourceType) Values() []ManagedMemoryEntrySourceType { + return []ManagedMemoryEntrySourceType{ + ManagedMemoryEntrySourceTypeManagedMemoryEntrySourceTypeAgent, + ManagedMemoryEntrySourceTypeManagedMemoryEntrySourceTypeDreamer, + } +} + +// Type always returns ManagedMemoryEntrySourceType to satisfy [pflag.Value] interface +func (f *ManagedMemoryEntrySourceType) Type() string { + return "ManagedMemoryEntrySourceType" +} + +// A workspace-scoped managed memory store backed by service-managed storage. +type ManagedMemoryStore struct { + // Time when the store was created. + CreateTime *time.Time `json:"create_time,omitempty"` + // Workspace-local user ID of the authenticated principal that created the + // store. This is immutable server-set attribution and does not grant + // access; authorization is evaluated from the authenticated request + // context. + CreatorUserId string `json:"creator_user_id,omitempty"` + // Human-readable description of the memory store. + Description string `json:"description,omitempty"` + // Deprecated compatibility alias for the caller-provided managed memory + // store ID. Canonical clients provide the ID through + // `CreateMemoryStoreRequest.managed_memory_store_id` and use `name` as the + // resource identifier. + DisplayName string `json:"display_name,omitempty"` + // Resource name in the form `memory-stores/{managed_memory_store_id}`. + Name string `json:"name,omitempty"` + // Deprecated alias for `creator_user_id`. This identifies the original + // creator, not a transferable owner. Use `creator_user_id` instead. + OwnerUserId string `json:"owner_user_id,omitempty"` + // Service-managed storage backing this memory store. + StorageBackend *StorageBackend `json:"storage_backend,omitempty"` + // Time when the store was last updated. + UpdateTime *time.Time `json:"update_time,omitempty"` + // Workspace that owns the memory store. + WorkspaceId int64 `json:"workspace_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ManagedMemoryStore) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ManagedMemoryStore) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Request to pop an item from a session. +type PopSessionItemRequest struct { + // Resource name of the containing session, in the form + // `session-stores/{session_store_id}/sessions/{session_id}`. + Parent string `json:"-" url:"-"` +} + +func (s *PopSessionItemRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +// Response containing the popped item. +type PopSessionItemResponse struct { + // Removed item, if any. + Item *SessionItem `json:"item,omitempty"` +} + +func (s *PopSessionItemResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +// Request to search managed memory entries by text query for one actor. Search +// returns a relevance-ranked top-N result set and does not currently paginate. +type SearchManagedMemoryEntriesRequest struct { + // Customer-provided identifier for the actor whose entries are searched. + ActorId string `json:"actor_id"` + // Deprecated alias for `page_size`. When both fields are set, their values + // must match. + Limit int `json:"limit,omitempty"` + // Maximum number of relevance-ranked entries to return. Defaults to 10 and + // must be between 1 and 100. + PageSize int `json:"page_size,omitempty"` + // Reserved for pagination compatibility. The server currently ignores this + // field because Search returns a ranked top-N result set. + PageToken string `json:"page_token,omitempty"` + // Managed memory store whose entries are searched, in the form + // `memory-stores/{managed_memory_store_id}`. + Parent string `json:"-" url:"-"` + // Optional absolute, case-sensitive path prefix used to restrict searched + // entries within the actor partition. The prefix must begin with `/` and + // must not contain empty, `.` or `..` segments. + PathPrefix string `json:"path_prefix,omitempty"` + // Free-form search query. + Query string `json:"query"` + // Fields to return in each matching entry, using proto field names such as + // `content` (not `contents`). An omitted or empty mask returns each full + // entry, including `content`; a non-empty mask returns only the requested + // fields. Search scores are always returned. + // + // The field mask must be a single string, with multiple fields separated by + // commas (no spaces). The field path is relative to the resource object, + // using a dot (`.`) to navigate sub-fields (e.g., `author.given_name`). + // Specification of elements in sequence or map fields is not allowed, as + // only the entire collection field can be specified. Field names must + // exactly match the resource field names. + ReadMask *fieldmask.FieldMask `json:"read_mask,omitempty"` + // Optional session identifier. When set, only entries with this exact + // `session_id` are searched. Omitted-session (cross-session) entries are + // not included. + SessionId string `json:"session_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *SearchManagedMemoryEntriesRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s SearchManagedMemoryEntriesRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Response containing managed memory entries ranked by relevance. +type SearchManagedMemoryEntriesResponse struct { + // Deprecated compatibility alias for clients migrating to `results`. This + // contains the same entries in the same order, but omits their relevance + // scores. + ManagedMemoryEntries []ManagedMemoryEntry `json:"managed_memory_entries,omitempty"` + // Opaque pagination token. Search currently returns an unpaginated ranked + // top-N result set, so the server does not populate this field. + NextPageToken string `json:"next_page_token,omitempty"` + // Canonical matching entries and relevance scores, ordered most relevant + // first. + Results []ManagedMemoryEntrySearchResult `json:"results,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *SearchManagedMemoryEntriesResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s SearchManagedMemoryEntriesResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// A durable logical interaction stored within a Session Store. +type Session struct { + // Opaque caller-provided identifier for the application actor associated + // with the session. + // + // This is application data and has no Databricks authentication or + // authorization semantics. Use the same value as the Managed Memory Entry + // `actor_id` when storing memories associated with this actor. Every + // session must set it. A child session must use the same value as its + // parent. + ActorId string `json:"actor_id"` + // Time when the session was created. + CreateTime *time.Time `json:"create_time,omitempty"` + // Time when the session's item history was last mutated. + LastActivityTime *time.Time `json:"last_activity_time,omitempty"` + // Mutable caller-defined string labels. + Metadata map[string]string `json:"metadata,omitempty"` + // Resource name in the form + // `session-stores/{session_store_id}/sessions/{session_id}`. + Name string `json:"name,omitempty"` + // Immediate parent session ID. Set only at creation for child sessions, + // immutable thereafter, and restricted to the same store. + ParentSessionId string `json:"parent_session_id,omitempty"` + // Top-level session ID in the spawn tree. This equals `session_id` for a + // root or fork and is inherited transitively by child sessions. + RootSessionId string `json:"root_session_id,omitempty"` + // Unique session ID. The service generates a UUID unless the caller + // supplies `CreateSessionRequest.session_id`. + SessionId string `json:"session_id,omitempty"` + // Time when session resource fields last changed. + UpdateTime *time.Time `json:"update_time,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *Session) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s Session) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// A transcript entry in a session's history. +type SessionItem struct { + // Server-assigned time when the append commits. Values are nondecreasing + // within a session. Item listing orders by this timestamp; equal timestamps + // are resolved by committed append order. + CreateTime *time.Time `json:"create_time,omitempty"` + // Complete SDK-native, JSON-compatible item. The service stores and returns + // this value without interpreting provider-specific fields such as `type`, + // `role`, or `content`. + Data json.RawMessage `json:"data"` + // Stable service-generated item ID. + ItemId string `json:"item_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *SessionItem) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s SessionItem) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// A workspace-scoped session store. +type SessionStore struct { + // Time when the store was created. + CreateTime *time.Time `json:"create_time,omitempty"` + // Workspace-local user ID of the authenticated principal that created the + // store. This is immutable server-set attribution and does not grant + // access; authorization is evaluated from the authenticated request + // context. + CreatorUserId string `json:"creator_user_id,omitempty"` + // Human-readable description of the session store. + Description string `json:"description,omitempty"` + // Mutable caller-defined string labels. + Metadata map[string]string `json:"metadata,omitempty"` + // Resource name in the form `session-stores/{session_store_id}`. + Name string `json:"name,omitempty"` + // Time when the store was last updated. + UpdateTime *time.Time `json:"update_time,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *SessionStore) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s SessionStore) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Service-managed storage backing a managed memory store. +type StorageBackend struct { + // Backend-specific identifier. For Lakebase, this is the project ID. + BackendId string `json:"backend_id,omitempty"` + // Type of the storage backend. + BackendType StorageBackendType `json:"backend_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *StorageBackend) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s StorageBackend) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Type of service-managed storage backing a managed memory store. +type StorageBackendType string + +const StorageBackendTypeStorageBackendTypeLakebase StorageBackendType = `STORAGE_BACKEND_TYPE_LAKEBASE` + +// String representation for [fmt.Print] +func (f *StorageBackendType) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *StorageBackendType) Set(v string) error { + switch v { + case `STORAGE_BACKEND_TYPE_LAKEBASE`: + *f = StorageBackendType(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "STORAGE_BACKEND_TYPE_LAKEBASE"`, v) + } +} + +// Values returns all possible values for StorageBackendType. +// +// There is no guarantee on the order of the values in the slice. +func (f *StorageBackendType) Values() []StorageBackendType { + return []StorageBackendType{ + StorageBackendTypeStorageBackendTypeLakebase, + } +} + +// Type always returns StorageBackendType to satisfy [pflag.Value] interface +func (f *StorageBackendType) Type() string { + return "StorageBackendType" +} + +type UpdateManagedMemoryEntryRequest struct { + // The managed memory entry to update. + ManagedMemoryEntry ManagedMemoryEntry `json:"managed_memory_entry"` + // Resource name in the form + // `memory-stores/{managed_memory_store_id}/entries/{managed_memory_entry_id}`. + Name string `json:"-" url:"-"` + // Fields to update. Only `content` and `description` may be updated. + UpdateMask fieldmask.FieldMask `json:"-" url:"update_mask"` +} + +func (s *UpdateManagedMemoryEntryRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +type UpdateManagedMemoryStoreRequest struct { + // The managed memory store to update. `name` is taken from the URL. + ManagedMemoryStore ManagedMemoryStore `json:"managed_memory_store"` + // Resource name in the form `memory-stores/{managed_memory_store_id}`. + Name string `json:"-" url:"-"` + // Only `description` may be updated. + UpdateMask fieldmask.FieldMask `json:"-" url:"update_mask"` +} + +func (s *UpdateManagedMemoryStoreRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +type UpdateSessionRequest struct { + // Resource name in the form + // `session-stores/{session_store_id}/sessions/{session_id}`. + Name string `json:"-" url:"-"` + // Session to update. + Session Session `json:"session"` + // Fields to update. Only `metadata` is mutable; any other path returns + // `INVALID_PARAMETER_VALUE`. + UpdateMask fieldmask.FieldMask `json:"-" url:"update_mask"` +} + +func (s *UpdateSessionRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +type UpdateSessionStoreRequest struct { + // Resource name in the form `session-stores/{session_store_id}`. + Name string `json:"-" url:"-"` + // Session store to update. + SessionStore SessionStore `json:"session_store"` + // Fields to update. Only `description` and `metadata` are mutable; any + // other path returns `INVALID_PARAMETER_VALUE`. + UpdateMask fieldmask.FieldMask `json:"-" url:"update_mask"` +} + +func (s *UpdateSessionStoreRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} diff --git a/service/ml/model.go b/service/ml/model.go index f8c33cdd6..35ca1d520 100644 --- a/service/ml/model.go +++ b/service/ml/model.go @@ -364,10 +364,23 @@ func (s *AvgFunction) UnmarshalJSON(b []byte) error { type BackfillFeaturesRequest struct { // Output ranges to backfill. BackfillRanges []BackfillRange `json:"backfill_ranges"` + // The budget policy ID, in UUID format, used to attribute the serverless + // compute cost of this backfill. If not specified, a default budget policy + // may be applied. + BudgetPolicyId string `json:"budget_policy_id,omitempty"` // Full names of the features to backfill. FeatureFullNames []string `json:"feature_full_names"` // Idempotency token for the request. RequestId string `json:"request_id,omitempty"` + // Custom tags to associate with this backfill. They are applied to the + // backfill job and forwarded to the underlying compute as Databricks + // resource tags, so backfill cost can be attributed in the billing system + // tables. These tags apply only to the backfill compute; they are not + // applied to the Unity Catalog Feature resources themselves, whose tags are + // managed separately through the Unity Catalog tagging API. A maximum of 25 + // tags is supported; keys and values are subject to the same limitations as + // Databricks resource tags. + Tags map[string]string `json:"tags,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -4928,6 +4941,10 @@ func (f *PurgeFeatureEntitiesMetadataState) Type() string { // Request to purge materialized feature values for entities listed in a Unity // Catalog Delta table. type PurgeFeatureEntitiesRequest struct { + // The budget policy ID, in UUID format, used to attribute the serverless + // compute cost of this purge. If not specified, a default budget policy may + // be applied. + BudgetPolicyId string `json:"budget_policy_id,omitempty"` // Fully qualified name of the Unity Catalog Delta table containing the // entity keys to purge. The table may contain a subset of each feature's // entity-key columns. A partial key match deletes all feature rows matching @@ -4941,6 +4958,15 @@ type PurgeFeatureEntitiesRequest struct { Features []string `json:"features"` // Optional UUID4 idempotency token for the request. RequestId string `json:"request_id,omitempty"` + // Custom tags to associate with this purge. They are applied to the purge + // job and forwarded to the underlying compute as Databricks resource tags, + // so purge cost can be attributed in the billing system tables. These tags + // apply only to the purge compute; they are not applied to the Unity + // Catalog Feature resources themselves, whose tags are managed separately + // through the Unity Catalog tagging API. A maximum of 25 tags is supported; + // keys and values are subject to the same limitations as Databricks + // resource tags. + Tags map[string]string `json:"tags,omitempty"` ForceSendFields []string `json:"-" url:"-"` } diff --git a/service/oauth2/model.go b/service/oauth2/model.go index 683972616..efce5a8ed 100644 --- a/service/oauth2/model.go +++ b/service/oauth2/model.go @@ -232,7 +232,9 @@ type FederationPolicy struct { // which does not need to be specified in create or update requests. If // specified in a request, must match the value in the request URL. Name string `json:"name,omitempty"` - + // audit_mode INCLUDE is required on both this message field and its leaf + // fields so the OIDC policy configuration is captured in create/update + // audit logs (see go/auditlogs). OidcPolicy *OidcFederationPolicy `json:"oidc_policy,omitempty"` // The ID of the federation policy. Output only. PolicyId string `json:"policy_id,omitempty"` diff --git a/service/pipelines/model.go b/service/pipelines/model.go index 74887e324..aad4f3dc0 100644 --- a/service/pipelines/model.go +++ b/service/pipelines/model.go @@ -68,7 +68,7 @@ func (s AutoFullRefreshPolicy) MarshalJSON() ([]byte, error) { type AvroTransformerOptions struct { // (Optional) Parse mode for Avro data. Valid values: FAILFAST, PERMISSIVE. - // Defaults to FAILFAST. + // Defaults to PERMISSIVE. ParseMode ParseMode `json:"parse_mode,omitempty"` // Inline Avro JSON schema string. Schema string `json:"schema,omitempty"` @@ -3194,7 +3194,7 @@ type ProtobufTransformerOptions struct { // Required: fully-qualified message type name. MessageName string `json:"message_name,omitempty"` // (Optional) Parse mode for Protobuf data. Valid values: FAILFAST, - // PERMISSIVE. Defaults to FAILFAST. + // PERMISSIVE. Defaults to PERMISSIVE. ParseMode ParseMode `json:"parse_mode,omitempty"` // (Optional) Maximum expansion depth for recursive protobuf fields. Spark // SQL does not natively support recursive types, so recursive fields are diff --git a/service/pkg.go b/service/pkg.go index 0da9e56f1..6f04e68a0 100644 --- a/service/pkg.go +++ b/service/pkg.go @@ -196,6 +196,8 @@ // // - [billing.LogDeliveryAPI]: These APIs manage log delivery configurations for this account. // +// - [mason.MasonAPI]: APIs for managing agent memory and durable session state. +// // - [ml.MaterializedFeaturesAPI]: Materialized Features are columns in tables and views that can be directly used as features to train and serve ML models. // // - [catalog.AccountMetastoreAssignmentsAPI]: These APIs manage metastore assignments to a workspace. @@ -408,6 +410,7 @@ import ( "github.com/databricks/databricks-sdk-go/service/jobs" "github.com/databricks/databricks-sdk-go/service/knowledgeassistants" "github.com/databricks/databricks-sdk-go/service/marketplace" + "github.com/databricks/databricks-sdk-go/service/mason" "github.com/databricks/databricks-sdk-go/service/ml" "github.com/databricks/databricks-sdk-go/service/networking" "github.com/databricks/databricks-sdk-go/service/oauth2" @@ -530,6 +533,7 @@ var ( _ *settings.LlmProxyPartnerPoweredEnforceAPI = nil _ *settings.LlmProxyPartnerPoweredWorkspaceAPI = nil _ *billing.LogDeliveryAPI = nil + _ *mason.MasonAPI = nil _ *ml.MaterializedFeaturesAPI = nil _ *catalog.AccountMetastoreAssignmentsAPI = nil _ *catalog.MetastoresAPI = nil diff --git a/service/sql/model.go b/service/sql/model.go index 457a3137a..a077af718 100644 --- a/service/sql/model.go +++ b/service/sql/model.go @@ -5140,12 +5140,10 @@ func (f *SetWorkspaceWarehouseConfigRequestSecurityPolicy) Type() string { // The breakdown of how the EndpointSpotInstancePolicy converts to per cloud // configurations is: // -// +-------+--------------------------------------+--------------------------------+ -// | Cloud | COST_OPTIMIZED | RELIABILITY_OPTIMIZED | -// +-------+--------------------------------------+--------------------------------+ -// | AWS | On Demand Driver with Spot Executors | On Demand Driver and Executors -// | | AZURE | On Demand Driver and Executors | On Demand Driver and Executors | -// +-------+--------------------------------------+--------------------------------+ +// - AWS, COST_OPTIMIZED: On Demand Driver with Spot Executors. - AWS, +// RELIABILITY_OPTIMIZED: On Demand Driver and Executors. - AZURE, +// COST_OPTIMIZED: On Demand Driver and Executors. - AZURE, +// RELIABILITY_OPTIMIZED: On Demand Driver and Executors. type SpotInstancePolicy string const SpotInstancePolicyCostOptimized SpotInstancePolicy = `COST_OPTIMIZED` diff --git a/service/tags/model.go b/service/tags/model.go index 494b4a27f..64d79b850 100644 --- a/service/tags/model.go +++ b/service/tags/model.go @@ -27,7 +27,7 @@ type DeleteTagAssignmentRequest struct { // entity_id is the app name EntityId string `json:"-" url:"-"` // The type of entity to which the tag is assigned. Allowed values are apps, - // dashboards, designerfiles, geniespaces, notebooks + // dashboards, designer-files, geniespaces, notebooks EntityType string `json:"-" url:"-"` // The key of the tag. The characters , . : / - = and leading/trailing // spaces are not allowed @@ -51,7 +51,7 @@ type GetTagAssignmentRequest struct { // entity_id is the app name EntityId string `json:"-" url:"-"` // The type of entity to which the tag is assigned. Allowed values are apps, - // dashboards, designerfiles, geniespaces, notebooks + // dashboards, designer-files, geniespaces, notebooks EntityType string `json:"-" url:"-"` // The key of the tag. The characters , . : / - = and leading/trailing // spaces are not allowed @@ -75,7 +75,7 @@ type ListTagAssignmentsRequest struct { // entity_id is the app name EntityId string `json:"-" url:"-"` // The type of entity to which the tag is assigned. Allowed values are apps, - // dashboards, designerfiles, geniespaces, notebooks + // dashboards, designer-files, geniespaces, notebooks EntityType string `json:"-" url:"-"` // Optional. Maximum number of tag assignments to return in a single page PageSize int `json:"-" url:"page_size,omitempty"` @@ -152,7 +152,7 @@ type TagAssignment struct { // entity_id is the app name EntityId string `json:"entity_id"` // The type of entity to which the tag is assigned. Allowed values are apps, - // dashboards, designerfiles, geniespaces, notebooks + // dashboards, designer-files, geniespaces, notebooks EntityType string `json:"entity_type"` // The key of the tag. The characters , . : / - = and leading/trailing // spaces are not allowed @@ -201,7 +201,7 @@ type UpdateTagAssignmentRequest struct { // entity_id is the app name EntityId string `json:"-" url:"-"` // The type of entity to which the tag is assigned. Allowed values are apps, - // dashboards, designerfiles, geniespaces, notebooks + // dashboards, designer-files, geniespaces, notebooks EntityType string `json:"-" url:"-"` TagAssignment TagAssignment `json:"tag_assignment"` diff --git a/workspace_client.go b/workspace_client.go index 0de9f0ffc..1f4cd84ca 100644 --- a/workspace_client.go +++ b/workspace_client.go @@ -27,6 +27,7 @@ import ( "github.com/databricks/databricks-sdk-go/service/jobs" "github.com/databricks/databricks-sdk-go/service/knowledgeassistants" "github.com/databricks/databricks-sdk-go/service/marketplace" + "github.com/databricks/databricks-sdk-go/service/mason" "github.com/databricks/databricks-sdk-go/service/ml" "github.com/databricks/databricks-sdk-go/service/oauth2" "github.com/databricks/databricks-sdk-go/service/pipelines" @@ -593,6 +594,10 @@ type WorkspaceClient struct { // of the uninstalled library appears as Uninstall pending restart. Libraries compute.LibrariesInterface + // APIs for managing agent memory and durable session state. This interface + // is under active development and may change. + Mason mason.MasonInterface + // Materialized Features are columns in tables and views that can be // directly used as features to train and serve ML models. MaterializedFeatures ml.MaterializedFeaturesInterface @@ -1546,6 +1551,7 @@ func NewWorkspaceClient(c ...*Config) (*WorkspaceClient, error) { Lakeview: dashboards.NewLakeview(databricksClient), LakeviewEmbedded: dashboards.NewLakeviewEmbedded(databricksClient), Libraries: compute.NewLibraries(databricksClient), + Mason: mason.NewMason(databricksClient), MaterializedFeatures: ml.NewMaterializedFeatures(databricksClient), Metastores: catalog.NewMetastores(databricksClient), ModelRegistry: ml.NewModelRegistry(databricksClient),