From d3b31dfcd8c6f16b499279e0c55b16e122f74efe Mon Sep 17 00:00:00 2001 From: "gary.y" Date: Fri, 2 Aug 2024 05:54:41 +0800 Subject: [PATCH] fix(catalog): when delete catalog and file, also delete the artifact --- pkg/handler/knowledgebase.go | 42 +- pkg/handler/knowledgebasefiles.go | 33 +- pkg/milvus/milvus.go | 15 + pkg/milvus/milvus_test.go | 4 +- pkg/minio/knowledgebase.go | 52 +- pkg/minio/minio.go | 75 + pkg/mock/repository_i_mock.gen.go | 11500 ++++++++++++++++---------- pkg/repository/chunk.go | 31 + pkg/repository/convertedfile.go | 28 + pkg/repository/embedding.go | 29 + pkg/repository/knowledgebasefile.go | 13 + pkg/service/pipeline.go | 6 +- pkg/worker/worker.go | 8 +- 13 files changed, 7491 insertions(+), 4345 deletions(-) diff --git a/pkg/handler/knowledgebase.go b/pkg/handler/knowledgebase.go index 3e6e9ba..1a2aae3 100644 --- a/pkg/handler/knowledgebase.go +++ b/pkg/handler/knowledgebase.go @@ -351,16 +351,48 @@ func (ph *PublicHandler) DeleteCatalog(ctx context.Context, req *artifactpb.Dele return nil, fmt.Errorf(ErrorDeleteKnowledgeBaseMsg, customerror.ErrNoPermission) } - deletedKb, err := ph.service.Repository.DeleteKnowledgeBase(ctx, ns.NsUID.String(), req.CatalogId) - if err != nil { - return nil, err - } - err = ph.service.ACLClient.Purge(ctx, "knowledgebase", deletedKb.UID) + err = ph.service.ACLClient.Purge(ctx, "knowledgebase", kb.UID) if err != nil { log.Error("failed to purge catalog", zap.Error(err)) return nil, fmt.Errorf(ErrorDeleteKnowledgeBaseMsg, err) } + // delete collection milvus + err = ph.service.MilvusClient.DropKnowledgeBaseCollection(ctx, kb.UID.String()) + if err != nil { + log.Error("failed to drop collection in milvus", zap.Error(err)) + } + // delete files in minIO + err = <-ph.service.MinIO.DeleteKnowledgeBase(ctx, kb.UID.String()) + if err != nil { + log.Error("failed to delete files in minIO", zap.Error(err)) + } + // delete database in postgres + err = ph.service.Repository.DeleteAllKnowledgeBaseFiles(ctx, kb.UID.String()) + if err != nil { + log.Error("failed to delete files in postgres", zap.Error(err)) + } + // delete converted files in postgres + err = ph.service.Repository.DeleteAllConvertedFilesinKb(ctx, kb.UID) + if err != nil { + log.Error("failed to delete converted files in postgres", zap.Error(err)) + } + // delete all chunks in postgres + err = ph.service.Repository.HardDeleteChunksByKbUID(ctx, kb.UID) + if err != nil { + log.Error("failed to delete chunks in postgres", zap.Error(err)) + } + + // delete all embedding in postgres + err = ph.service.Repository.HardDeleteEmbeddingsByKbUID(ctx, kb.UID) + if err != nil { + log.Error("failed to delete embeddings in postgres", zap.Error(err)) + } + + deletedKb, err := ph.service.Repository.DeleteKnowledgeBase(ctx, ns.NsUID.String(), req.CatalogId) + if err != nil { + return nil, err + } return &artifactpb.DeleteCatalogResponse{ Catalog: &artifactpb.Catalog{ Name: deletedKb.Name, diff --git a/pkg/handler/knowledgebasefiles.go b/pkg/handler/knowledgebasefiles.go index 6f19114..d445ae5 100644 --- a/pkg/handler/knowledgebasefiles.go +++ b/pkg/handler/knowledgebasefiles.go @@ -336,11 +336,42 @@ func (ph *PublicHandler) DeleteCatalogFile( return nil, fmt.Errorf("file not found. err: %w", customerror.ErrNotFound) } + // delete the file from minio + objectPaths := []string{} + // kb file in minio + objectPaths = append(objectPaths, files[0].Destination) + // converted file in minio + cf, err := ph.service.Repository.GetConvertedFileByFileUID(ctx, fuid) + if err == nil { + objectPaths = append(objectPaths, cf.Destination) + } + // chunks in minio + chunks, _ := ph.service.Repository.ListChunksByKbFileUID(ctx, fuid) + if len(chunks) > 0 { + for _, chunk := range chunks { + objectPaths = append(objectPaths, chunk.ContentDest) + } + } + // delete the embeddings in milvus(need to delete first) + embUIDs := []string{} + embs, _ := ph.service.Repository.ListEmbeddingsByKbFileUID(ctx, fuid) + for _, emb := range embs { + embUIDs = append(embUIDs, emb.UID.String()) + } + _ = ph.service.MilvusClient.DeleteEmbeddingsInKb(ctx, files[0].KnowledgeBaseUID.String(), embUIDs) + + _ = ph.service.MinIO.DeleteFiles(ctx, objectPaths) + // delete the converted file in postgres + _ = ph.service.Repository.HardDeleteConvertedFileByFileUID(ctx, fuid) + // delete the chunks in postgres + _ = ph.service.Repository.HardDeleteChunksByKbFileUID(ctx, fuid) + // delete the embeddings in postgres + _ = ph.service.Repository.HardDeleteEmbeddingsByKbFileUID(ctx, fuid) + // delete the file in postgres err = ph.service.Repository.DeleteKnowledgeBaseFile(ctx, req.FileUid) if err != nil { return nil, err } - // decrease catalog usage err = ph.service.Repository.IncreaseKnowledgeBaseUsage(ctx, files[0].KnowledgeBaseUID.String(), int(-files[0].Size)) if err != nil { diff --git a/pkg/milvus/milvus.go b/pkg/milvus/milvus.go index 97eb532..5d4e8c9 100644 --- a/pkg/milvus/milvus.go +++ b/pkg/milvus/milvus.go @@ -19,10 +19,13 @@ type MilvusClientI interface { InsertVectorsToKnowledgeBaseCollection(ctx context.Context, kbUID string, embeddings []Embedding) error GetAllCollectionNames(ctx context.Context) ([]*entity.Collection, error) DeleteCollection(ctx context.Context, collectionName string) error + // drop knowledge base collection + DropKnowledgeBaseCollection(ctx context.Context, kbUID string) error ListEmbeddings(ctx context.Context, collectionName string) ([]Embedding, error) SearchSimilarEmbeddings(ctx context.Context, collectionName string, vectors [][]float32, topK int) ([][]SimilarEmbedding, error) SearchSimilarEmbeddingsInKB(ctx context.Context, kbUID string, vectors [][]float32, topK int) ([][]SimilarEmbedding, error) DeleteEmbedding(ctx context.Context, collectionName string, embeddingUID []string) error + DeleteEmbeddingsInKb(ctx context.Context, kbUID string, embeddingUID []string) error // GetKnowledgeBaseCollectionName returns the collection name for a knowledge base GetKnowledgeBaseCollectionName(kbUID string) string Close() @@ -304,6 +307,12 @@ func (m *MilvusClient) DeleteEmbedding(ctx context.Context, collectionName strin return err } +// DeleteEmbeddingsInKb +func (m *MilvusClient) DeleteEmbeddingsInKb(ctx context.Context, kbUID string, embeddingUID []string) error { + collectionName := m.GetKnowledgeBaseCollectionName(kbUID) + return m.DeleteEmbedding(ctx, collectionName, embeddingUID) +} + type SimilarEmbedding struct { Embedding Score float32 @@ -424,3 +433,9 @@ func (m *MilvusClient) SearchSimilarEmbeddingsInKB(ctx context.Context, kbUID st collectionName := m.GetKnowledgeBaseCollectionName(kbUID) return m.SearchSimilarEmbeddings(ctx, collectionName, vectors, topK) } + +// Drop KnowledgeBaseCollection +func (m *MilvusClient) DropKnowledgeBaseCollection(ctx context.Context, kbUID string) error { + collectionName := m.GetKnowledgeBaseCollectionName(kbUID) + return m.DeleteCollection(ctx, collectionName) +} diff --git a/pkg/milvus/milvus_test.go b/pkg/milvus/milvus_test.go index 834aa1b..e1a725a 100644 --- a/pkg/milvus/milvus_test.go +++ b/pkg/milvus/milvus_test.go @@ -207,7 +207,7 @@ package milvus // t.Fatalf("Failed to get Milvus version: %v", err) // } // fmt.Printf("Successfully connected to Milvus! Health: %v, Version: %v\n", h, v) -// err = mc.DeleteEmbedding(context.TODO(), "kb_gary_test_kb_1", []string{"5a51f2d5-9587-4472-9be2-67fd200145f3", "uid2"}) +// err = mc.DeleteEmbedding(context.TODO(), "kb_73f6b9aa_0399_4f16_bca7_6b8b75fede32", []string{"aa4631e3-f936-48e4-bc2e-06c4eb629376"}) // if err != nil { // t.Fatalf("Failed to delete embeddings: %v", err) // } @@ -240,7 +240,7 @@ package milvus // dummyVector[0] = 1 // topK := 2 // batchVector := [][]float32{dummyVector} -// embeddings, err := mc.SearchEmbeddings(context.TODO(), collectionName, batchVector, topK) +// embeddings, err := mc.SearchSimilarEmbeddings(context.TODO(), collectionName, batchVector, topK) // if err != nil { // t.Fatalf("Failed to search embeddings: %v", err) // } diff --git a/pkg/minio/knowledgebase.go b/pkg/minio/knowledgebase.go index 3d8b9d9..3c74ab9 100644 --- a/pkg/minio/knowledgebase.go +++ b/pkg/minio/knowledgebase.go @@ -19,8 +19,21 @@ type KnowledgeBaseI interface { GetConvertedFilePathInKnowledgeBase(kbUID, ConvertedFileUID, fileExt string) string // GetChunkPathInKnowledgeBase returns the path of the chunk in MinIO. GetChunkPathInKnowledgeBase(kbUID, chunkUID string) string + // DeleteKnowledgeBase deletes all files in the knowledge base. + DeleteKnowledgeBase(ctx context.Context, kbUID string) chan error + // DeleteAllConvertedFilesInKb deletes converted files in the knowledge base. + DeleteAllConvertedFilesInKb(ctx context.Context, kbUID string) chan error + // DeleteAllUploadedFilesInKb deletes uploaded files in the knowledge base. + DeleteAllUploadedFilesInKb(ctx context.Context, kbUID string) chan error + // DeleteAllChunksInKb deletes chunks in the knowledge base. + DeleteAllChunksInKb(ctx context.Context, kbUID string) chan error } +// prefix +const uploadedFilePrefix = "/uploaded-file/" +const convertedFilePrefix = "/converted-file/" +const chunkPrefix = "/chunk/" + // SaveConvertedFile saves a converted file to MinIO with the appropriate MIME type. func (m *Minio) SaveConvertedFile(ctx context.Context, kbUID, convertedFileUID, fileExt string, content []byte) error { filePathName := m.GetConvertedFilePathInKnowledgeBase(kbUID, convertedFileUID, fileExt) @@ -68,14 +81,47 @@ func (m *Minio) SaveChunks(ctx context.Context, kbUID string, chunks map[ChunkUI return nil } +// Delete all files in the knowledge base +func (m *Minio) DeleteKnowledgeBase(ctx context.Context, kbUID string) chan error { + // List all objects in the knowledge base + err := m.DeleteFilesWithPrefix(ctx, kbUID) + return err +} + +// Delete converted files in the knowledge base +func (m *Minio) DeleteAllConvertedFilesInKb(ctx context.Context, kbUID string) chan error { + // List all objects in the knowledge base + err := m.DeleteFilesWithPrefix(ctx, kbUID+convertedFilePrefix) + + return err +} + +// Delete uploaded files in the knowledge base +func (m *Minio) DeleteAllUploadedFilesInKb(ctx context.Context, kbUID string) chan error { + // List all objects in the knowledge base + err := m.DeleteFilesWithPrefix(ctx, kbUID+uploadedFilePrefix) + + return err +} + +// Delete chunks in the knowledge base +func (m *Minio) DeleteAllChunksInKb(ctx context.Context, kbUID string) chan error { + // List all objects in the knowledge base + err := m.DeleteFilesWithPrefix(ctx, kbUID+chunkPrefix) + + return err +} + + + func (m *Minio) GetUploadedFilePathInKnowledgeBase(kbUID, dest string) string { - return kbUID + "/uploaded-file/" + dest + return kbUID + uploadedFilePrefix + dest } func (m *Minio) GetConvertedFilePathInKnowledgeBase(kbUID, ConvertedFileUID, fileExt string) string { - return kbUID + "/converted-file/" + ConvertedFileUID + "." + fileExt + return kbUID + convertedFilePrefix + ConvertedFileUID + "." + fileExt } func (m *Minio) GetChunkPathInKnowledgeBase(kbUID, chunkUID string) string { - return kbUID + "/chunk/" + chunkUID + ".txt" + return kbUID + chunkPrefix + chunkUID + ".txt" } diff --git a/pkg/minio/minio.go b/pkg/minio/minio.go index 960cb8a..c2c3e4e 100644 --- a/pkg/minio/minio.go +++ b/pkg/minio/minio.go @@ -23,6 +23,10 @@ type MinioI interface { UploadBase64File(ctx context.Context, filePath string, base64Content string, fileMimeType string) (err error) // deleteFile DeleteFile(ctx context.Context, filePath string) (err error) + // deleteFiles + DeleteFiles(ctx context.Context, filePaths []string) chan error + // deleteFilesWithPrefix + DeleteFilesWithPrefix(ctx context.Context, prefix string) chan error // GetFile GetFile(ctx context.Context, filePath string) ([]byte, error) // GetFilesByPaths @@ -110,6 +114,32 @@ func (m *Minio) DeleteFile(ctx context.Context, filePathName string) (err error) return nil } +// delete bunch of files from minio +func (m *Minio) DeleteFiles(ctx context.Context, filePathNames []string) chan error { + errCh := make(chan error, len(filePathNames)) + log, err := log.GetZapLogger(ctx) + if err != nil { + errCh <- err + return errCh + } + // Delete the files from MinIO parallelly + var wg sync.WaitGroup + for _, filePathName := range filePathNames { + wg.Add(1) + go func(filePathName string, errCh chan error) { + defer wg.Done() + err := m.client.RemoveObject(m.bucket, filePathName) + if err != nil { + log.Error("Failed to delete file from MinIO", zap.Error(err)) + errCh <- err + return + } + }(filePathName, errCh) + } + wg.Wait() + return errCh +} + func (m *Minio) GetFile(ctx context.Context, filePathName string) ([]byte, error) { log, err := log.GetZapLogger(ctx) if err != nil { @@ -151,6 +181,7 @@ func (m *Minio) GetFilesByPaths(ctx context.Context, filePaths []string) ([]File var wg sync.WaitGroup files := make([]FileContent, len(filePaths)) errors := make([]error, len(filePaths)) + var mu sync.Mutex for i, path := range filePaths { wg.Add(1) @@ -160,7 +191,9 @@ func (m *Minio) GetFilesByPaths(ctx context.Context, filePaths []string) ([]File obj, err := m.client.GetObject(m.bucket, filePath, minio.GetObjectOptions{}) if err != nil { log.Error("Failed to get object from MinIO", zap.String("path", filePath), zap.Error(err)) + mu.Lock() errors[index] = err + mu.Unlock() return } defer obj.Close() @@ -191,3 +224,45 @@ func (m *Minio) GetFilesByPaths(ctx context.Context, filePaths []string) ([]File return files, nil } + +// delete all files with the same prefix from MinIO +func (m *Minio) DeleteFilesWithPrefix(ctx context.Context, prefix string) chan error { + errCh := make(chan error) + log, err := log.GetZapLogger(ctx) + if err != nil { + errCh <- err + close(errCh) + return errCh + } + + // List all objects with the given prefix + objectCh := m.client.ListObjects(m.bucket, prefix, true, nil) + + // Use a WaitGroup to wait for all deletions to complete + var wg sync.WaitGroup + for object := range objectCh { + if object.Err != nil { + log.Error("Failed to list object from MinIO", zap.Error(object.Err)) + errCh <- object.Err + continue + } + + wg.Add(1) + go func(objectName string) { + defer wg.Done() + err := m.client.RemoveObject(m.bucket, objectName) + if err != nil { + log.Error("Failed to delete object from MinIO", zap.String("object", objectName), zap.Error(err)) + errCh <- err + } + }(object.Key) + } + + // Wait for all deletions to complete + go func() { + wg.Wait() + close(errCh) + }() + + return errCh +} diff --git a/pkg/mock/repository_i_mock.gen.go b/pkg/mock/repository_i_mock.gen.go index 5392d7c..ec45efc 100644 --- a/pkg/mock/repository_i_mock.gen.go +++ b/pkg/mock/repository_i_mock.gen.go @@ -44,6 +44,18 @@ type RepositoryIMock struct { beforeCreateKnowledgeBaseFileCounter uint64 CreateKnowledgeBaseFileMock mRepositoryIMockCreateKnowledgeBaseFile + funcDeleteAllConvertedFilesinKb func(ctx context.Context, kbUID uuid.UUID) (err error) + inspectFuncDeleteAllConvertedFilesinKb func(ctx context.Context, kbUID uuid.UUID) + afterDeleteAllConvertedFilesinKbCounter uint64 + beforeDeleteAllConvertedFilesinKbCounter uint64 + DeleteAllConvertedFilesinKbMock mRepositoryIMockDeleteAllConvertedFilesinKb + + funcDeleteAllKnowledgeBaseFiles func(ctx context.Context, kbUID string) (err error) + inspectFuncDeleteAllKnowledgeBaseFiles func(ctx context.Context, kbUID string) + afterDeleteAllKnowledgeBaseFilesCounter uint64 + beforeDeleteAllKnowledgeBaseFilesCounter uint64 + DeleteAllKnowledgeBaseFilesMock mRepositoryIMockDeleteAllKnowledgeBaseFiles + funcDeleteAndCreateChunks func(ctx context.Context, sourceTable string, sourceUID uuid.UUID, chunks []*mm_repository.TextChunk, externalServiceCall func(chunkUIDs []string) (map[string]any, error)) (tpa1 []*mm_repository.TextChunk, err error) inspectFuncDeleteAndCreateChunks func(ctx context.Context, sourceTable string, sourceUID uuid.UUID, chunks []*mm_repository.TextChunk, externalServiceCall func(chunkUIDs []string) (map[string]any, error)) afterDeleteAndCreateChunksCounter uint64 @@ -203,6 +215,36 @@ type RepositoryIMock struct { beforeGetTruthSourceByFileUIDCounter uint64 GetTruthSourceByFileUIDMock mRepositoryIMockGetTruthSourceByFileUID + funcHardDeleteChunksByKbFileUID func(ctx context.Context, kbFileUID uuid.UUID) (err error) + inspectFuncHardDeleteChunksByKbFileUID func(ctx context.Context, kbFileUID uuid.UUID) + afterHardDeleteChunksByKbFileUIDCounter uint64 + beforeHardDeleteChunksByKbFileUIDCounter uint64 + HardDeleteChunksByKbFileUIDMock mRepositoryIMockHardDeleteChunksByKbFileUID + + funcHardDeleteChunksByKbUID func(ctx context.Context, kbUID uuid.UUID) (err error) + inspectFuncHardDeleteChunksByKbUID func(ctx context.Context, kbUID uuid.UUID) + afterHardDeleteChunksByKbUIDCounter uint64 + beforeHardDeleteChunksByKbUIDCounter uint64 + HardDeleteChunksByKbUIDMock mRepositoryIMockHardDeleteChunksByKbUID + + funcHardDeleteConvertedFileByFileUID func(ctx context.Context, fileUID uuid.UUID) (err error) + inspectFuncHardDeleteConvertedFileByFileUID func(ctx context.Context, fileUID uuid.UUID) + afterHardDeleteConvertedFileByFileUIDCounter uint64 + beforeHardDeleteConvertedFileByFileUIDCounter uint64 + HardDeleteConvertedFileByFileUIDMock mRepositoryIMockHardDeleteConvertedFileByFileUID + + funcHardDeleteEmbeddingsByKbFileUID func(ctx context.Context, kbFileUID uuid.UUID) (err error) + inspectFuncHardDeleteEmbeddingsByKbFileUID func(ctx context.Context, kbFileUID uuid.UUID) + afterHardDeleteEmbeddingsByKbFileUIDCounter uint64 + beforeHardDeleteEmbeddingsByKbFileUIDCounter uint64 + HardDeleteEmbeddingsByKbFileUIDMock mRepositoryIMockHardDeleteEmbeddingsByKbFileUID + + funcHardDeleteEmbeddingsByKbUID func(ctx context.Context, kbUID uuid.UUID) (err error) + inspectFuncHardDeleteEmbeddingsByKbUID func(ctx context.Context, kbUID uuid.UUID) + afterHardDeleteEmbeddingsByKbUIDCounter uint64 + beforeHardDeleteEmbeddingsByKbUIDCounter uint64 + HardDeleteEmbeddingsByKbUIDMock mRepositoryIMockHardDeleteEmbeddingsByKbUID + funcIncreaseKnowledgeBaseUsage func(ctx context.Context, kbUID string, amount int) (err error) inspectFuncIncreaseKnowledgeBaseUsage func(ctx context.Context, kbUID string, amount int) afterIncreaseKnowledgeBaseUsageCounter uint64 @@ -215,6 +257,18 @@ type RepositoryIMock struct { beforeKnowledgeBaseFileTableNameCounter uint64 KnowledgeBaseFileTableNameMock mRepositoryIMockKnowledgeBaseFileTableName + funcListChunksByKbFileUID func(ctx context.Context, kbFileUID uuid.UUID) (ta1 []mm_repository.TextChunk, err error) + inspectFuncListChunksByKbFileUID func(ctx context.Context, kbFileUID uuid.UUID) + afterListChunksByKbFileUIDCounter uint64 + beforeListChunksByKbFileUIDCounter uint64 + ListChunksByKbFileUIDMock mRepositoryIMockListChunksByKbFileUID + + funcListEmbeddingsByKbFileUID func(ctx context.Context, kbFileUID uuid.UUID) (ea1 []mm_repository.Embedding, err error) + inspectFuncListEmbeddingsByKbFileUID func(ctx context.Context, kbFileUID uuid.UUID) + afterListEmbeddingsByKbFileUIDCounter uint64 + beforeListEmbeddingsByKbFileUIDCounter uint64 + ListEmbeddingsByKbFileUIDMock mRepositoryIMockListEmbeddingsByKbFileUID + funcListKnowledgeBaseFiles func(ctx context.Context, uid string, ownerUID string, kbUID string, pageSize int32, nextPageToken string, filesUID []string) (ka1 []mm_repository.KnowledgeBaseFile, i1 int, s1 string, err error) inspectFuncListKnowledgeBaseFiles func(ctx context.Context, uid string, ownerUID string, kbUID string, pageSize int32, nextPageToken string, filesUID []string) afterListKnowledgeBaseFilesCounter uint64 @@ -289,6 +343,12 @@ func NewRepositoryIMock(t minimock.Tester) *RepositoryIMock { m.CreateKnowledgeBaseFileMock = mRepositoryIMockCreateKnowledgeBaseFile{mock: m} m.CreateKnowledgeBaseFileMock.callArgs = []*RepositoryIMockCreateKnowledgeBaseFileParams{} + m.DeleteAllConvertedFilesinKbMock = mRepositoryIMockDeleteAllConvertedFilesinKb{mock: m} + m.DeleteAllConvertedFilesinKbMock.callArgs = []*RepositoryIMockDeleteAllConvertedFilesinKbParams{} + + m.DeleteAllKnowledgeBaseFilesMock = mRepositoryIMockDeleteAllKnowledgeBaseFiles{mock: m} + m.DeleteAllKnowledgeBaseFilesMock.callArgs = []*RepositoryIMockDeleteAllKnowledgeBaseFilesParams{} + m.DeleteAndCreateChunksMock = mRepositoryIMockDeleteAndCreateChunks{mock: m} m.DeleteAndCreateChunksMock.callArgs = []*RepositoryIMockDeleteAndCreateChunksParams{} @@ -361,11 +421,32 @@ func NewRepositoryIMock(t minimock.Tester) *RepositoryIMock { m.GetTruthSourceByFileUIDMock = mRepositoryIMockGetTruthSourceByFileUID{mock: m} m.GetTruthSourceByFileUIDMock.callArgs = []*RepositoryIMockGetTruthSourceByFileUIDParams{} + m.HardDeleteChunksByKbFileUIDMock = mRepositoryIMockHardDeleteChunksByKbFileUID{mock: m} + m.HardDeleteChunksByKbFileUIDMock.callArgs = []*RepositoryIMockHardDeleteChunksByKbFileUIDParams{} + + m.HardDeleteChunksByKbUIDMock = mRepositoryIMockHardDeleteChunksByKbUID{mock: m} + m.HardDeleteChunksByKbUIDMock.callArgs = []*RepositoryIMockHardDeleteChunksByKbUIDParams{} + + m.HardDeleteConvertedFileByFileUIDMock = mRepositoryIMockHardDeleteConvertedFileByFileUID{mock: m} + m.HardDeleteConvertedFileByFileUIDMock.callArgs = []*RepositoryIMockHardDeleteConvertedFileByFileUIDParams{} + + m.HardDeleteEmbeddingsByKbFileUIDMock = mRepositoryIMockHardDeleteEmbeddingsByKbFileUID{mock: m} + m.HardDeleteEmbeddingsByKbFileUIDMock.callArgs = []*RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParams{} + + m.HardDeleteEmbeddingsByKbUIDMock = mRepositoryIMockHardDeleteEmbeddingsByKbUID{mock: m} + m.HardDeleteEmbeddingsByKbUIDMock.callArgs = []*RepositoryIMockHardDeleteEmbeddingsByKbUIDParams{} + m.IncreaseKnowledgeBaseUsageMock = mRepositoryIMockIncreaseKnowledgeBaseUsage{mock: m} m.IncreaseKnowledgeBaseUsageMock.callArgs = []*RepositoryIMockIncreaseKnowledgeBaseUsageParams{} m.KnowledgeBaseFileTableNameMock = mRepositoryIMockKnowledgeBaseFileTableName{mock: m} + m.ListChunksByKbFileUIDMock = mRepositoryIMockListChunksByKbFileUID{mock: m} + m.ListChunksByKbFileUIDMock.callArgs = []*RepositoryIMockListChunksByKbFileUIDParams{} + + m.ListEmbeddingsByKbFileUIDMock = mRepositoryIMockListEmbeddingsByKbFileUID{mock: m} + m.ListEmbeddingsByKbFileUIDMock.callArgs = []*RepositoryIMockListEmbeddingsByKbFileUIDParams{} + m.ListKnowledgeBaseFilesMock = mRepositoryIMockListKnowledgeBaseFiles{mock: m} m.ListKnowledgeBaseFilesMock.callArgs = []*RepositoryIMockListKnowledgeBaseFilesParams{} @@ -1559,8097 +1640,10835 @@ func (m *RepositoryIMock) MinimockCreateKnowledgeBaseFileInspect() { } } -type mRepositoryIMockDeleteAndCreateChunks struct { +type mRepositoryIMockDeleteAllConvertedFilesinKb struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockDeleteAndCreateChunksExpectation - expectations []*RepositoryIMockDeleteAndCreateChunksExpectation + defaultExpectation *RepositoryIMockDeleteAllConvertedFilesinKbExpectation + expectations []*RepositoryIMockDeleteAllConvertedFilesinKbExpectation - callArgs []*RepositoryIMockDeleteAndCreateChunksParams + callArgs []*RepositoryIMockDeleteAllConvertedFilesinKbParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockDeleteAndCreateChunksExpectation specifies expectation struct of the RepositoryI.DeleteAndCreateChunks -type RepositoryIMockDeleteAndCreateChunksExpectation struct { +// RepositoryIMockDeleteAllConvertedFilesinKbExpectation specifies expectation struct of the RepositoryI.DeleteAllConvertedFilesinKb +type RepositoryIMockDeleteAllConvertedFilesinKbExpectation struct { mock *RepositoryIMock - params *RepositoryIMockDeleteAndCreateChunksParams - paramPtrs *RepositoryIMockDeleteAndCreateChunksParamPtrs - results *RepositoryIMockDeleteAndCreateChunksResults + params *RepositoryIMockDeleteAllConvertedFilesinKbParams + paramPtrs *RepositoryIMockDeleteAllConvertedFilesinKbParamPtrs + results *RepositoryIMockDeleteAllConvertedFilesinKbResults Counter uint64 } -// RepositoryIMockDeleteAndCreateChunksParams contains parameters of the RepositoryI.DeleteAndCreateChunks -type RepositoryIMockDeleteAndCreateChunksParams struct { - ctx context.Context - sourceTable string - sourceUID uuid.UUID - chunks []*mm_repository.TextChunk - externalServiceCall func(chunkUIDs []string) (map[string]any, error) +// RepositoryIMockDeleteAllConvertedFilesinKbParams contains parameters of the RepositoryI.DeleteAllConvertedFilesinKb +type RepositoryIMockDeleteAllConvertedFilesinKbParams struct { + ctx context.Context + kbUID uuid.UUID } -// RepositoryIMockDeleteAndCreateChunksParamPtrs contains pointers to parameters of the RepositoryI.DeleteAndCreateChunks -type RepositoryIMockDeleteAndCreateChunksParamPtrs struct { - ctx *context.Context - sourceTable *string - sourceUID *uuid.UUID - chunks *[]*mm_repository.TextChunk - externalServiceCall *func(chunkUIDs []string) (map[string]any, error) +// RepositoryIMockDeleteAllConvertedFilesinKbParamPtrs contains pointers to parameters of the RepositoryI.DeleteAllConvertedFilesinKb +type RepositoryIMockDeleteAllConvertedFilesinKbParamPtrs struct { + ctx *context.Context + kbUID *uuid.UUID } -// RepositoryIMockDeleteAndCreateChunksResults contains results of the RepositoryI.DeleteAndCreateChunks -type RepositoryIMockDeleteAndCreateChunksResults struct { - tpa1 []*mm_repository.TextChunk - err error +// RepositoryIMockDeleteAllConvertedFilesinKbResults contains results of the RepositoryI.DeleteAllConvertedFilesinKb +type RepositoryIMockDeleteAllConvertedFilesinKbResults struct { + err error } -// Expect sets up expected params for RepositoryI.DeleteAndCreateChunks -func (mmDeleteAndCreateChunks *mRepositoryIMockDeleteAndCreateChunks) Expect(ctx context.Context, sourceTable string, sourceUID uuid.UUID, chunks []*mm_repository.TextChunk, externalServiceCall func(chunkUIDs []string) (map[string]any, error)) *mRepositoryIMockDeleteAndCreateChunks { - if mmDeleteAndCreateChunks.mock.funcDeleteAndCreateChunks != nil { - mmDeleteAndCreateChunks.mock.t.Fatalf("RepositoryIMock.DeleteAndCreateChunks mock is already set by Set") +// Expect sets up expected params for RepositoryI.DeleteAllConvertedFilesinKb +func (mmDeleteAllConvertedFilesinKb *mRepositoryIMockDeleteAllConvertedFilesinKb) Expect(ctx context.Context, kbUID uuid.UUID) *mRepositoryIMockDeleteAllConvertedFilesinKb { + if mmDeleteAllConvertedFilesinKb.mock.funcDeleteAllConvertedFilesinKb != nil { + mmDeleteAllConvertedFilesinKb.mock.t.Fatalf("RepositoryIMock.DeleteAllConvertedFilesinKb mock is already set by Set") } - if mmDeleteAndCreateChunks.defaultExpectation == nil { - mmDeleteAndCreateChunks.defaultExpectation = &RepositoryIMockDeleteAndCreateChunksExpectation{} + if mmDeleteAllConvertedFilesinKb.defaultExpectation == nil { + mmDeleteAllConvertedFilesinKb.defaultExpectation = &RepositoryIMockDeleteAllConvertedFilesinKbExpectation{} } - if mmDeleteAndCreateChunks.defaultExpectation.paramPtrs != nil { - mmDeleteAndCreateChunks.mock.t.Fatalf("RepositoryIMock.DeleteAndCreateChunks mock is already set by ExpectParams functions") + if mmDeleteAllConvertedFilesinKb.defaultExpectation.paramPtrs != nil { + mmDeleteAllConvertedFilesinKb.mock.t.Fatalf("RepositoryIMock.DeleteAllConvertedFilesinKb mock is already set by ExpectParams functions") } - mmDeleteAndCreateChunks.defaultExpectation.params = &RepositoryIMockDeleteAndCreateChunksParams{ctx, sourceTable, sourceUID, chunks, externalServiceCall} - for _, e := range mmDeleteAndCreateChunks.expectations { - if minimock.Equal(e.params, mmDeleteAndCreateChunks.defaultExpectation.params) { - mmDeleteAndCreateChunks.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmDeleteAndCreateChunks.defaultExpectation.params) + mmDeleteAllConvertedFilesinKb.defaultExpectation.params = &RepositoryIMockDeleteAllConvertedFilesinKbParams{ctx, kbUID} + for _, e := range mmDeleteAllConvertedFilesinKb.expectations { + if minimock.Equal(e.params, mmDeleteAllConvertedFilesinKb.defaultExpectation.params) { + mmDeleteAllConvertedFilesinKb.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmDeleteAllConvertedFilesinKb.defaultExpectation.params) } } - return mmDeleteAndCreateChunks -} - -// ExpectCtxParam1 sets up expected param ctx for RepositoryI.DeleteAndCreateChunks -func (mmDeleteAndCreateChunks *mRepositoryIMockDeleteAndCreateChunks) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockDeleteAndCreateChunks { - if mmDeleteAndCreateChunks.mock.funcDeleteAndCreateChunks != nil { - mmDeleteAndCreateChunks.mock.t.Fatalf("RepositoryIMock.DeleteAndCreateChunks mock is already set by Set") - } - - if mmDeleteAndCreateChunks.defaultExpectation == nil { - mmDeleteAndCreateChunks.defaultExpectation = &RepositoryIMockDeleteAndCreateChunksExpectation{} - } - - if mmDeleteAndCreateChunks.defaultExpectation.params != nil { - mmDeleteAndCreateChunks.mock.t.Fatalf("RepositoryIMock.DeleteAndCreateChunks mock is already set by Expect") - } - - if mmDeleteAndCreateChunks.defaultExpectation.paramPtrs == nil { - mmDeleteAndCreateChunks.defaultExpectation.paramPtrs = &RepositoryIMockDeleteAndCreateChunksParamPtrs{} - } - mmDeleteAndCreateChunks.defaultExpectation.paramPtrs.ctx = &ctx - - return mmDeleteAndCreateChunks -} - -// ExpectSourceTableParam2 sets up expected param sourceTable for RepositoryI.DeleteAndCreateChunks -func (mmDeleteAndCreateChunks *mRepositoryIMockDeleteAndCreateChunks) ExpectSourceTableParam2(sourceTable string) *mRepositoryIMockDeleteAndCreateChunks { - if mmDeleteAndCreateChunks.mock.funcDeleteAndCreateChunks != nil { - mmDeleteAndCreateChunks.mock.t.Fatalf("RepositoryIMock.DeleteAndCreateChunks mock is already set by Set") - } - - if mmDeleteAndCreateChunks.defaultExpectation == nil { - mmDeleteAndCreateChunks.defaultExpectation = &RepositoryIMockDeleteAndCreateChunksExpectation{} - } - - if mmDeleteAndCreateChunks.defaultExpectation.params != nil { - mmDeleteAndCreateChunks.mock.t.Fatalf("RepositoryIMock.DeleteAndCreateChunks mock is already set by Expect") - } - - if mmDeleteAndCreateChunks.defaultExpectation.paramPtrs == nil { - mmDeleteAndCreateChunks.defaultExpectation.paramPtrs = &RepositoryIMockDeleteAndCreateChunksParamPtrs{} - } - mmDeleteAndCreateChunks.defaultExpectation.paramPtrs.sourceTable = &sourceTable - - return mmDeleteAndCreateChunks -} - -// ExpectSourceUIDParam3 sets up expected param sourceUID for RepositoryI.DeleteAndCreateChunks -func (mmDeleteAndCreateChunks *mRepositoryIMockDeleteAndCreateChunks) ExpectSourceUIDParam3(sourceUID uuid.UUID) *mRepositoryIMockDeleteAndCreateChunks { - if mmDeleteAndCreateChunks.mock.funcDeleteAndCreateChunks != nil { - mmDeleteAndCreateChunks.mock.t.Fatalf("RepositoryIMock.DeleteAndCreateChunks mock is already set by Set") - } - - if mmDeleteAndCreateChunks.defaultExpectation == nil { - mmDeleteAndCreateChunks.defaultExpectation = &RepositoryIMockDeleteAndCreateChunksExpectation{} - } - - if mmDeleteAndCreateChunks.defaultExpectation.params != nil { - mmDeleteAndCreateChunks.mock.t.Fatalf("RepositoryIMock.DeleteAndCreateChunks mock is already set by Expect") - } - - if mmDeleteAndCreateChunks.defaultExpectation.paramPtrs == nil { - mmDeleteAndCreateChunks.defaultExpectation.paramPtrs = &RepositoryIMockDeleteAndCreateChunksParamPtrs{} - } - mmDeleteAndCreateChunks.defaultExpectation.paramPtrs.sourceUID = &sourceUID - - return mmDeleteAndCreateChunks + return mmDeleteAllConvertedFilesinKb } -// ExpectChunksParam4 sets up expected param chunks for RepositoryI.DeleteAndCreateChunks -func (mmDeleteAndCreateChunks *mRepositoryIMockDeleteAndCreateChunks) ExpectChunksParam4(chunks []*mm_repository.TextChunk) *mRepositoryIMockDeleteAndCreateChunks { - if mmDeleteAndCreateChunks.mock.funcDeleteAndCreateChunks != nil { - mmDeleteAndCreateChunks.mock.t.Fatalf("RepositoryIMock.DeleteAndCreateChunks mock is already set by Set") +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.DeleteAllConvertedFilesinKb +func (mmDeleteAllConvertedFilesinKb *mRepositoryIMockDeleteAllConvertedFilesinKb) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockDeleteAllConvertedFilesinKb { + if mmDeleteAllConvertedFilesinKb.mock.funcDeleteAllConvertedFilesinKb != nil { + mmDeleteAllConvertedFilesinKb.mock.t.Fatalf("RepositoryIMock.DeleteAllConvertedFilesinKb mock is already set by Set") } - if mmDeleteAndCreateChunks.defaultExpectation == nil { - mmDeleteAndCreateChunks.defaultExpectation = &RepositoryIMockDeleteAndCreateChunksExpectation{} + if mmDeleteAllConvertedFilesinKb.defaultExpectation == nil { + mmDeleteAllConvertedFilesinKb.defaultExpectation = &RepositoryIMockDeleteAllConvertedFilesinKbExpectation{} } - if mmDeleteAndCreateChunks.defaultExpectation.params != nil { - mmDeleteAndCreateChunks.mock.t.Fatalf("RepositoryIMock.DeleteAndCreateChunks mock is already set by Expect") + if mmDeleteAllConvertedFilesinKb.defaultExpectation.params != nil { + mmDeleteAllConvertedFilesinKb.mock.t.Fatalf("RepositoryIMock.DeleteAllConvertedFilesinKb mock is already set by Expect") } - if mmDeleteAndCreateChunks.defaultExpectation.paramPtrs == nil { - mmDeleteAndCreateChunks.defaultExpectation.paramPtrs = &RepositoryIMockDeleteAndCreateChunksParamPtrs{} + if mmDeleteAllConvertedFilesinKb.defaultExpectation.paramPtrs == nil { + mmDeleteAllConvertedFilesinKb.defaultExpectation.paramPtrs = &RepositoryIMockDeleteAllConvertedFilesinKbParamPtrs{} } - mmDeleteAndCreateChunks.defaultExpectation.paramPtrs.chunks = &chunks + mmDeleteAllConvertedFilesinKb.defaultExpectation.paramPtrs.ctx = &ctx - return mmDeleteAndCreateChunks + return mmDeleteAllConvertedFilesinKb } -// ExpectExternalServiceCallParam5 sets up expected param externalServiceCall for RepositoryI.DeleteAndCreateChunks -func (mmDeleteAndCreateChunks *mRepositoryIMockDeleteAndCreateChunks) ExpectExternalServiceCallParam5(externalServiceCall func(chunkUIDs []string) (map[string]any, error)) *mRepositoryIMockDeleteAndCreateChunks { - if mmDeleteAndCreateChunks.mock.funcDeleteAndCreateChunks != nil { - mmDeleteAndCreateChunks.mock.t.Fatalf("RepositoryIMock.DeleteAndCreateChunks mock is already set by Set") +// ExpectKbUIDParam2 sets up expected param kbUID for RepositoryI.DeleteAllConvertedFilesinKb +func (mmDeleteAllConvertedFilesinKb *mRepositoryIMockDeleteAllConvertedFilesinKb) ExpectKbUIDParam2(kbUID uuid.UUID) *mRepositoryIMockDeleteAllConvertedFilesinKb { + if mmDeleteAllConvertedFilesinKb.mock.funcDeleteAllConvertedFilesinKb != nil { + mmDeleteAllConvertedFilesinKb.mock.t.Fatalf("RepositoryIMock.DeleteAllConvertedFilesinKb mock is already set by Set") } - if mmDeleteAndCreateChunks.defaultExpectation == nil { - mmDeleteAndCreateChunks.defaultExpectation = &RepositoryIMockDeleteAndCreateChunksExpectation{} + if mmDeleteAllConvertedFilesinKb.defaultExpectation == nil { + mmDeleteAllConvertedFilesinKb.defaultExpectation = &RepositoryIMockDeleteAllConvertedFilesinKbExpectation{} } - if mmDeleteAndCreateChunks.defaultExpectation.params != nil { - mmDeleteAndCreateChunks.mock.t.Fatalf("RepositoryIMock.DeleteAndCreateChunks mock is already set by Expect") + if mmDeleteAllConvertedFilesinKb.defaultExpectation.params != nil { + mmDeleteAllConvertedFilesinKb.mock.t.Fatalf("RepositoryIMock.DeleteAllConvertedFilesinKb mock is already set by Expect") } - if mmDeleteAndCreateChunks.defaultExpectation.paramPtrs == nil { - mmDeleteAndCreateChunks.defaultExpectation.paramPtrs = &RepositoryIMockDeleteAndCreateChunksParamPtrs{} + if mmDeleteAllConvertedFilesinKb.defaultExpectation.paramPtrs == nil { + mmDeleteAllConvertedFilesinKb.defaultExpectation.paramPtrs = &RepositoryIMockDeleteAllConvertedFilesinKbParamPtrs{} } - mmDeleteAndCreateChunks.defaultExpectation.paramPtrs.externalServiceCall = &externalServiceCall + mmDeleteAllConvertedFilesinKb.defaultExpectation.paramPtrs.kbUID = &kbUID - return mmDeleteAndCreateChunks + return mmDeleteAllConvertedFilesinKb } -// Inspect accepts an inspector function that has same arguments as the RepositoryI.DeleteAndCreateChunks -func (mmDeleteAndCreateChunks *mRepositoryIMockDeleteAndCreateChunks) Inspect(f func(ctx context.Context, sourceTable string, sourceUID uuid.UUID, chunks []*mm_repository.TextChunk, externalServiceCall func(chunkUIDs []string) (map[string]any, error))) *mRepositoryIMockDeleteAndCreateChunks { - if mmDeleteAndCreateChunks.mock.inspectFuncDeleteAndCreateChunks != nil { - mmDeleteAndCreateChunks.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.DeleteAndCreateChunks") +// Inspect accepts an inspector function that has same arguments as the RepositoryI.DeleteAllConvertedFilesinKb +func (mmDeleteAllConvertedFilesinKb *mRepositoryIMockDeleteAllConvertedFilesinKb) Inspect(f func(ctx context.Context, kbUID uuid.UUID)) *mRepositoryIMockDeleteAllConvertedFilesinKb { + if mmDeleteAllConvertedFilesinKb.mock.inspectFuncDeleteAllConvertedFilesinKb != nil { + mmDeleteAllConvertedFilesinKb.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.DeleteAllConvertedFilesinKb") } - mmDeleteAndCreateChunks.mock.inspectFuncDeleteAndCreateChunks = f + mmDeleteAllConvertedFilesinKb.mock.inspectFuncDeleteAllConvertedFilesinKb = f - return mmDeleteAndCreateChunks + return mmDeleteAllConvertedFilesinKb } -// Return sets up results that will be returned by RepositoryI.DeleteAndCreateChunks -func (mmDeleteAndCreateChunks *mRepositoryIMockDeleteAndCreateChunks) Return(tpa1 []*mm_repository.TextChunk, err error) *RepositoryIMock { - if mmDeleteAndCreateChunks.mock.funcDeleteAndCreateChunks != nil { - mmDeleteAndCreateChunks.mock.t.Fatalf("RepositoryIMock.DeleteAndCreateChunks mock is already set by Set") +// Return sets up results that will be returned by RepositoryI.DeleteAllConvertedFilesinKb +func (mmDeleteAllConvertedFilesinKb *mRepositoryIMockDeleteAllConvertedFilesinKb) Return(err error) *RepositoryIMock { + if mmDeleteAllConvertedFilesinKb.mock.funcDeleteAllConvertedFilesinKb != nil { + mmDeleteAllConvertedFilesinKb.mock.t.Fatalf("RepositoryIMock.DeleteAllConvertedFilesinKb mock is already set by Set") } - if mmDeleteAndCreateChunks.defaultExpectation == nil { - mmDeleteAndCreateChunks.defaultExpectation = &RepositoryIMockDeleteAndCreateChunksExpectation{mock: mmDeleteAndCreateChunks.mock} + if mmDeleteAllConvertedFilesinKb.defaultExpectation == nil { + mmDeleteAllConvertedFilesinKb.defaultExpectation = &RepositoryIMockDeleteAllConvertedFilesinKbExpectation{mock: mmDeleteAllConvertedFilesinKb.mock} } - mmDeleteAndCreateChunks.defaultExpectation.results = &RepositoryIMockDeleteAndCreateChunksResults{tpa1, err} - return mmDeleteAndCreateChunks.mock + mmDeleteAllConvertedFilesinKb.defaultExpectation.results = &RepositoryIMockDeleteAllConvertedFilesinKbResults{err} + return mmDeleteAllConvertedFilesinKb.mock } -// Set uses given function f to mock the RepositoryI.DeleteAndCreateChunks method -func (mmDeleteAndCreateChunks *mRepositoryIMockDeleteAndCreateChunks) Set(f func(ctx context.Context, sourceTable string, sourceUID uuid.UUID, chunks []*mm_repository.TextChunk, externalServiceCall func(chunkUIDs []string) (map[string]any, error)) (tpa1 []*mm_repository.TextChunk, err error)) *RepositoryIMock { - if mmDeleteAndCreateChunks.defaultExpectation != nil { - mmDeleteAndCreateChunks.mock.t.Fatalf("Default expectation is already set for the RepositoryI.DeleteAndCreateChunks method") +// Set uses given function f to mock the RepositoryI.DeleteAllConvertedFilesinKb method +func (mmDeleteAllConvertedFilesinKb *mRepositoryIMockDeleteAllConvertedFilesinKb) Set(f func(ctx context.Context, kbUID uuid.UUID) (err error)) *RepositoryIMock { + if mmDeleteAllConvertedFilesinKb.defaultExpectation != nil { + mmDeleteAllConvertedFilesinKb.mock.t.Fatalf("Default expectation is already set for the RepositoryI.DeleteAllConvertedFilesinKb method") } - if len(mmDeleteAndCreateChunks.expectations) > 0 { - mmDeleteAndCreateChunks.mock.t.Fatalf("Some expectations are already set for the RepositoryI.DeleteAndCreateChunks method") + if len(mmDeleteAllConvertedFilesinKb.expectations) > 0 { + mmDeleteAllConvertedFilesinKb.mock.t.Fatalf("Some expectations are already set for the RepositoryI.DeleteAllConvertedFilesinKb method") } - mmDeleteAndCreateChunks.mock.funcDeleteAndCreateChunks = f - return mmDeleteAndCreateChunks.mock + mmDeleteAllConvertedFilesinKb.mock.funcDeleteAllConvertedFilesinKb = f + return mmDeleteAllConvertedFilesinKb.mock } -// When sets expectation for the RepositoryI.DeleteAndCreateChunks which will trigger the result defined by the following +// When sets expectation for the RepositoryI.DeleteAllConvertedFilesinKb which will trigger the result defined by the following // Then helper -func (mmDeleteAndCreateChunks *mRepositoryIMockDeleteAndCreateChunks) When(ctx context.Context, sourceTable string, sourceUID uuid.UUID, chunks []*mm_repository.TextChunk, externalServiceCall func(chunkUIDs []string) (map[string]any, error)) *RepositoryIMockDeleteAndCreateChunksExpectation { - if mmDeleteAndCreateChunks.mock.funcDeleteAndCreateChunks != nil { - mmDeleteAndCreateChunks.mock.t.Fatalf("RepositoryIMock.DeleteAndCreateChunks mock is already set by Set") +func (mmDeleteAllConvertedFilesinKb *mRepositoryIMockDeleteAllConvertedFilesinKb) When(ctx context.Context, kbUID uuid.UUID) *RepositoryIMockDeleteAllConvertedFilesinKbExpectation { + if mmDeleteAllConvertedFilesinKb.mock.funcDeleteAllConvertedFilesinKb != nil { + mmDeleteAllConvertedFilesinKb.mock.t.Fatalf("RepositoryIMock.DeleteAllConvertedFilesinKb mock is already set by Set") } - expectation := &RepositoryIMockDeleteAndCreateChunksExpectation{ - mock: mmDeleteAndCreateChunks.mock, - params: &RepositoryIMockDeleteAndCreateChunksParams{ctx, sourceTable, sourceUID, chunks, externalServiceCall}, + expectation := &RepositoryIMockDeleteAllConvertedFilesinKbExpectation{ + mock: mmDeleteAllConvertedFilesinKb.mock, + params: &RepositoryIMockDeleteAllConvertedFilesinKbParams{ctx, kbUID}, } - mmDeleteAndCreateChunks.expectations = append(mmDeleteAndCreateChunks.expectations, expectation) + mmDeleteAllConvertedFilesinKb.expectations = append(mmDeleteAllConvertedFilesinKb.expectations, expectation) return expectation } -// Then sets up RepositoryI.DeleteAndCreateChunks return parameters for the expectation previously defined by the When method -func (e *RepositoryIMockDeleteAndCreateChunksExpectation) Then(tpa1 []*mm_repository.TextChunk, err error) *RepositoryIMock { - e.results = &RepositoryIMockDeleteAndCreateChunksResults{tpa1, err} +// Then sets up RepositoryI.DeleteAllConvertedFilesinKb return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockDeleteAllConvertedFilesinKbExpectation) Then(err error) *RepositoryIMock { + e.results = &RepositoryIMockDeleteAllConvertedFilesinKbResults{err} return e.mock } -// Times sets number of times RepositoryI.DeleteAndCreateChunks should be invoked -func (mmDeleteAndCreateChunks *mRepositoryIMockDeleteAndCreateChunks) Times(n uint64) *mRepositoryIMockDeleteAndCreateChunks { +// Times sets number of times RepositoryI.DeleteAllConvertedFilesinKb should be invoked +func (mmDeleteAllConvertedFilesinKb *mRepositoryIMockDeleteAllConvertedFilesinKb) Times(n uint64) *mRepositoryIMockDeleteAllConvertedFilesinKb { if n == 0 { - mmDeleteAndCreateChunks.mock.t.Fatalf("Times of RepositoryIMock.DeleteAndCreateChunks mock can not be zero") + mmDeleteAllConvertedFilesinKb.mock.t.Fatalf("Times of RepositoryIMock.DeleteAllConvertedFilesinKb mock can not be zero") } - mm_atomic.StoreUint64(&mmDeleteAndCreateChunks.expectedInvocations, n) - return mmDeleteAndCreateChunks + mm_atomic.StoreUint64(&mmDeleteAllConvertedFilesinKb.expectedInvocations, n) + return mmDeleteAllConvertedFilesinKb } -func (mmDeleteAndCreateChunks *mRepositoryIMockDeleteAndCreateChunks) invocationsDone() bool { - if len(mmDeleteAndCreateChunks.expectations) == 0 && mmDeleteAndCreateChunks.defaultExpectation == nil && mmDeleteAndCreateChunks.mock.funcDeleteAndCreateChunks == nil { +func (mmDeleteAllConvertedFilesinKb *mRepositoryIMockDeleteAllConvertedFilesinKb) invocationsDone() bool { + if len(mmDeleteAllConvertedFilesinKb.expectations) == 0 && mmDeleteAllConvertedFilesinKb.defaultExpectation == nil && mmDeleteAllConvertedFilesinKb.mock.funcDeleteAllConvertedFilesinKb == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmDeleteAndCreateChunks.mock.afterDeleteAndCreateChunksCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmDeleteAndCreateChunks.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmDeleteAllConvertedFilesinKb.mock.afterDeleteAllConvertedFilesinKbCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmDeleteAllConvertedFilesinKb.expectedInvocations) return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) } -// DeleteAndCreateChunks implements repository.RepositoryI -func (mmDeleteAndCreateChunks *RepositoryIMock) DeleteAndCreateChunks(ctx context.Context, sourceTable string, sourceUID uuid.UUID, chunks []*mm_repository.TextChunk, externalServiceCall func(chunkUIDs []string) (map[string]any, error)) (tpa1 []*mm_repository.TextChunk, err error) { - mm_atomic.AddUint64(&mmDeleteAndCreateChunks.beforeDeleteAndCreateChunksCounter, 1) - defer mm_atomic.AddUint64(&mmDeleteAndCreateChunks.afterDeleteAndCreateChunksCounter, 1) +// DeleteAllConvertedFilesinKb implements repository.RepositoryI +func (mmDeleteAllConvertedFilesinKb *RepositoryIMock) DeleteAllConvertedFilesinKb(ctx context.Context, kbUID uuid.UUID) (err error) { + mm_atomic.AddUint64(&mmDeleteAllConvertedFilesinKb.beforeDeleteAllConvertedFilesinKbCounter, 1) + defer mm_atomic.AddUint64(&mmDeleteAllConvertedFilesinKb.afterDeleteAllConvertedFilesinKbCounter, 1) - if mmDeleteAndCreateChunks.inspectFuncDeleteAndCreateChunks != nil { - mmDeleteAndCreateChunks.inspectFuncDeleteAndCreateChunks(ctx, sourceTable, sourceUID, chunks, externalServiceCall) + if mmDeleteAllConvertedFilesinKb.inspectFuncDeleteAllConvertedFilesinKb != nil { + mmDeleteAllConvertedFilesinKb.inspectFuncDeleteAllConvertedFilesinKb(ctx, kbUID) } - mm_params := RepositoryIMockDeleteAndCreateChunksParams{ctx, sourceTable, sourceUID, chunks, externalServiceCall} + mm_params := RepositoryIMockDeleteAllConvertedFilesinKbParams{ctx, kbUID} // Record call args - mmDeleteAndCreateChunks.DeleteAndCreateChunksMock.mutex.Lock() - mmDeleteAndCreateChunks.DeleteAndCreateChunksMock.callArgs = append(mmDeleteAndCreateChunks.DeleteAndCreateChunksMock.callArgs, &mm_params) - mmDeleteAndCreateChunks.DeleteAndCreateChunksMock.mutex.Unlock() + mmDeleteAllConvertedFilesinKb.DeleteAllConvertedFilesinKbMock.mutex.Lock() + mmDeleteAllConvertedFilesinKb.DeleteAllConvertedFilesinKbMock.callArgs = append(mmDeleteAllConvertedFilesinKb.DeleteAllConvertedFilesinKbMock.callArgs, &mm_params) + mmDeleteAllConvertedFilesinKb.DeleteAllConvertedFilesinKbMock.mutex.Unlock() - for _, e := range mmDeleteAndCreateChunks.DeleteAndCreateChunksMock.expectations { + for _, e := range mmDeleteAllConvertedFilesinKb.DeleteAllConvertedFilesinKbMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.tpa1, e.results.err + return e.results.err } } - if mmDeleteAndCreateChunks.DeleteAndCreateChunksMock.defaultExpectation != nil { - mm_atomic.AddUint64(&mmDeleteAndCreateChunks.DeleteAndCreateChunksMock.defaultExpectation.Counter, 1) - mm_want := mmDeleteAndCreateChunks.DeleteAndCreateChunksMock.defaultExpectation.params - mm_want_ptrs := mmDeleteAndCreateChunks.DeleteAndCreateChunksMock.defaultExpectation.paramPtrs + if mmDeleteAllConvertedFilesinKb.DeleteAllConvertedFilesinKbMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmDeleteAllConvertedFilesinKb.DeleteAllConvertedFilesinKbMock.defaultExpectation.Counter, 1) + mm_want := mmDeleteAllConvertedFilesinKb.DeleteAllConvertedFilesinKbMock.defaultExpectation.params + mm_want_ptrs := mmDeleteAllConvertedFilesinKb.DeleteAllConvertedFilesinKbMock.defaultExpectation.paramPtrs - mm_got := RepositoryIMockDeleteAndCreateChunksParams{ctx, sourceTable, sourceUID, chunks, externalServiceCall} + mm_got := RepositoryIMockDeleteAllConvertedFilesinKbParams{ctx, kbUID} if mm_want_ptrs != nil { if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { - mmDeleteAndCreateChunks.t.Errorf("RepositoryIMock.DeleteAndCreateChunks got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) - } - - if mm_want_ptrs.sourceTable != nil && !minimock.Equal(*mm_want_ptrs.sourceTable, mm_got.sourceTable) { - mmDeleteAndCreateChunks.t.Errorf("RepositoryIMock.DeleteAndCreateChunks got unexpected parameter sourceTable, want: %#v, got: %#v%s\n", *mm_want_ptrs.sourceTable, mm_got.sourceTable, minimock.Diff(*mm_want_ptrs.sourceTable, mm_got.sourceTable)) - } - - if mm_want_ptrs.sourceUID != nil && !minimock.Equal(*mm_want_ptrs.sourceUID, mm_got.sourceUID) { - mmDeleteAndCreateChunks.t.Errorf("RepositoryIMock.DeleteAndCreateChunks got unexpected parameter sourceUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.sourceUID, mm_got.sourceUID, minimock.Diff(*mm_want_ptrs.sourceUID, mm_got.sourceUID)) - } - - if mm_want_ptrs.chunks != nil && !minimock.Equal(*mm_want_ptrs.chunks, mm_got.chunks) { - mmDeleteAndCreateChunks.t.Errorf("RepositoryIMock.DeleteAndCreateChunks got unexpected parameter chunks, want: %#v, got: %#v%s\n", *mm_want_ptrs.chunks, mm_got.chunks, minimock.Diff(*mm_want_ptrs.chunks, mm_got.chunks)) + mmDeleteAllConvertedFilesinKb.t.Errorf("RepositoryIMock.DeleteAllConvertedFilesinKb got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) } - if mm_want_ptrs.externalServiceCall != nil && !minimock.Equal(*mm_want_ptrs.externalServiceCall, mm_got.externalServiceCall) { - mmDeleteAndCreateChunks.t.Errorf("RepositoryIMock.DeleteAndCreateChunks got unexpected parameter externalServiceCall, want: %#v, got: %#v%s\n", *mm_want_ptrs.externalServiceCall, mm_got.externalServiceCall, minimock.Diff(*mm_want_ptrs.externalServiceCall, mm_got.externalServiceCall)) + if mm_want_ptrs.kbUID != nil && !minimock.Equal(*mm_want_ptrs.kbUID, mm_got.kbUID) { + mmDeleteAllConvertedFilesinKb.t.Errorf("RepositoryIMock.DeleteAllConvertedFilesinKb got unexpected parameter kbUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.kbUID, mm_got.kbUID, minimock.Diff(*mm_want_ptrs.kbUID, mm_got.kbUID)) } } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { - mmDeleteAndCreateChunks.t.Errorf("RepositoryIMock.DeleteAndCreateChunks got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + mmDeleteAllConvertedFilesinKb.t.Errorf("RepositoryIMock.DeleteAllConvertedFilesinKb got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) } - mm_results := mmDeleteAndCreateChunks.DeleteAndCreateChunksMock.defaultExpectation.results + mm_results := mmDeleteAllConvertedFilesinKb.DeleteAllConvertedFilesinKbMock.defaultExpectation.results if mm_results == nil { - mmDeleteAndCreateChunks.t.Fatal("No results are set for the RepositoryIMock.DeleteAndCreateChunks") + mmDeleteAllConvertedFilesinKb.t.Fatal("No results are set for the RepositoryIMock.DeleteAllConvertedFilesinKb") } - return (*mm_results).tpa1, (*mm_results).err + return (*mm_results).err } - if mmDeleteAndCreateChunks.funcDeleteAndCreateChunks != nil { - return mmDeleteAndCreateChunks.funcDeleteAndCreateChunks(ctx, sourceTable, sourceUID, chunks, externalServiceCall) + if mmDeleteAllConvertedFilesinKb.funcDeleteAllConvertedFilesinKb != nil { + return mmDeleteAllConvertedFilesinKb.funcDeleteAllConvertedFilesinKb(ctx, kbUID) } - mmDeleteAndCreateChunks.t.Fatalf("Unexpected call to RepositoryIMock.DeleteAndCreateChunks. %v %v %v %v %v", ctx, sourceTable, sourceUID, chunks, externalServiceCall) + mmDeleteAllConvertedFilesinKb.t.Fatalf("Unexpected call to RepositoryIMock.DeleteAllConvertedFilesinKb. %v %v", ctx, kbUID) return } -// DeleteAndCreateChunksAfterCounter returns a count of finished RepositoryIMock.DeleteAndCreateChunks invocations -func (mmDeleteAndCreateChunks *RepositoryIMock) DeleteAndCreateChunksAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmDeleteAndCreateChunks.afterDeleteAndCreateChunksCounter) +// DeleteAllConvertedFilesinKbAfterCounter returns a count of finished RepositoryIMock.DeleteAllConvertedFilesinKb invocations +func (mmDeleteAllConvertedFilesinKb *RepositoryIMock) DeleteAllConvertedFilesinKbAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmDeleteAllConvertedFilesinKb.afterDeleteAllConvertedFilesinKbCounter) } -// DeleteAndCreateChunksBeforeCounter returns a count of RepositoryIMock.DeleteAndCreateChunks invocations -func (mmDeleteAndCreateChunks *RepositoryIMock) DeleteAndCreateChunksBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmDeleteAndCreateChunks.beforeDeleteAndCreateChunksCounter) +// DeleteAllConvertedFilesinKbBeforeCounter returns a count of RepositoryIMock.DeleteAllConvertedFilesinKb invocations +func (mmDeleteAllConvertedFilesinKb *RepositoryIMock) DeleteAllConvertedFilesinKbBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmDeleteAllConvertedFilesinKb.beforeDeleteAllConvertedFilesinKbCounter) } -// Calls returns a list of arguments used in each call to RepositoryIMock.DeleteAndCreateChunks. +// Calls returns a list of arguments used in each call to RepositoryIMock.DeleteAllConvertedFilesinKb. // The list is in the same order as the calls were made (i.e. recent calls have a higher index) -func (mmDeleteAndCreateChunks *mRepositoryIMockDeleteAndCreateChunks) Calls() []*RepositoryIMockDeleteAndCreateChunksParams { - mmDeleteAndCreateChunks.mutex.RLock() +func (mmDeleteAllConvertedFilesinKb *mRepositoryIMockDeleteAllConvertedFilesinKb) Calls() []*RepositoryIMockDeleteAllConvertedFilesinKbParams { + mmDeleteAllConvertedFilesinKb.mutex.RLock() - argCopy := make([]*RepositoryIMockDeleteAndCreateChunksParams, len(mmDeleteAndCreateChunks.callArgs)) - copy(argCopy, mmDeleteAndCreateChunks.callArgs) + argCopy := make([]*RepositoryIMockDeleteAllConvertedFilesinKbParams, len(mmDeleteAllConvertedFilesinKb.callArgs)) + copy(argCopy, mmDeleteAllConvertedFilesinKb.callArgs) - mmDeleteAndCreateChunks.mutex.RUnlock() + mmDeleteAllConvertedFilesinKb.mutex.RUnlock() return argCopy } -// MinimockDeleteAndCreateChunksDone returns true if the count of the DeleteAndCreateChunks invocations corresponds +// MinimockDeleteAllConvertedFilesinKbDone returns true if the count of the DeleteAllConvertedFilesinKb invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockDeleteAndCreateChunksDone() bool { - for _, e := range m.DeleteAndCreateChunksMock.expectations { +func (m *RepositoryIMock) MinimockDeleteAllConvertedFilesinKbDone() bool { + for _, e := range m.DeleteAllConvertedFilesinKbMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.DeleteAndCreateChunksMock.invocationsDone() + return m.DeleteAllConvertedFilesinKbMock.invocationsDone() } -// MinimockDeleteAndCreateChunksInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockDeleteAndCreateChunksInspect() { - for _, e := range m.DeleteAndCreateChunksMock.expectations { +// MinimockDeleteAllConvertedFilesinKbInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockDeleteAllConvertedFilesinKbInspect() { + for _, e := range m.DeleteAllConvertedFilesinKbMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { - m.t.Errorf("Expected call to RepositoryIMock.DeleteAndCreateChunks with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.DeleteAllConvertedFilesinKb with params: %#v", *e.params) } } - afterDeleteAndCreateChunksCounter := mm_atomic.LoadUint64(&m.afterDeleteAndCreateChunksCounter) + afterDeleteAllConvertedFilesinKbCounter := mm_atomic.LoadUint64(&m.afterDeleteAllConvertedFilesinKbCounter) // if default expectation was set then invocations count should be greater than zero - if m.DeleteAndCreateChunksMock.defaultExpectation != nil && afterDeleteAndCreateChunksCounter < 1 { - if m.DeleteAndCreateChunksMock.defaultExpectation.params == nil { - m.t.Error("Expected call to RepositoryIMock.DeleteAndCreateChunks") + if m.DeleteAllConvertedFilesinKbMock.defaultExpectation != nil && afterDeleteAllConvertedFilesinKbCounter < 1 { + if m.DeleteAllConvertedFilesinKbMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.DeleteAllConvertedFilesinKb") } else { - m.t.Errorf("Expected call to RepositoryIMock.DeleteAndCreateChunks with params: %#v", *m.DeleteAndCreateChunksMock.defaultExpectation.params) + m.t.Errorf("Expected call to RepositoryIMock.DeleteAllConvertedFilesinKb with params: %#v", *m.DeleteAllConvertedFilesinKbMock.defaultExpectation.params) } } // if func was set then invocations count should be greater than zero - if m.funcDeleteAndCreateChunks != nil && afterDeleteAndCreateChunksCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.DeleteAndCreateChunks") + if m.funcDeleteAllConvertedFilesinKb != nil && afterDeleteAllConvertedFilesinKbCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.DeleteAllConvertedFilesinKb") } - if !m.DeleteAndCreateChunksMock.invocationsDone() && afterDeleteAndCreateChunksCounter > 0 { - m.t.Errorf("Expected %d calls to RepositoryIMock.DeleteAndCreateChunks but found %d calls", - mm_atomic.LoadUint64(&m.DeleteAndCreateChunksMock.expectedInvocations), afterDeleteAndCreateChunksCounter) + if !m.DeleteAllConvertedFilesinKbMock.invocationsDone() && afterDeleteAllConvertedFilesinKbCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.DeleteAllConvertedFilesinKb but found %d calls", + mm_atomic.LoadUint64(&m.DeleteAllConvertedFilesinKbMock.expectedInvocations), afterDeleteAllConvertedFilesinKbCounter) } } -type mRepositoryIMockDeleteChunksBySource struct { +type mRepositoryIMockDeleteAllKnowledgeBaseFiles struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockDeleteChunksBySourceExpectation - expectations []*RepositoryIMockDeleteChunksBySourceExpectation + defaultExpectation *RepositoryIMockDeleteAllKnowledgeBaseFilesExpectation + expectations []*RepositoryIMockDeleteAllKnowledgeBaseFilesExpectation - callArgs []*RepositoryIMockDeleteChunksBySourceParams + callArgs []*RepositoryIMockDeleteAllKnowledgeBaseFilesParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockDeleteChunksBySourceExpectation specifies expectation struct of the RepositoryI.DeleteChunksBySource -type RepositoryIMockDeleteChunksBySourceExpectation struct { +// RepositoryIMockDeleteAllKnowledgeBaseFilesExpectation specifies expectation struct of the RepositoryI.DeleteAllKnowledgeBaseFiles +type RepositoryIMockDeleteAllKnowledgeBaseFilesExpectation struct { mock *RepositoryIMock - params *RepositoryIMockDeleteChunksBySourceParams - paramPtrs *RepositoryIMockDeleteChunksBySourceParamPtrs - results *RepositoryIMockDeleteChunksBySourceResults + params *RepositoryIMockDeleteAllKnowledgeBaseFilesParams + paramPtrs *RepositoryIMockDeleteAllKnowledgeBaseFilesParamPtrs + results *RepositoryIMockDeleteAllKnowledgeBaseFilesResults Counter uint64 } -// RepositoryIMockDeleteChunksBySourceParams contains parameters of the RepositoryI.DeleteChunksBySource -type RepositoryIMockDeleteChunksBySourceParams struct { - ctx context.Context - sourceTable string - sourceUID uuid.UUID +// RepositoryIMockDeleteAllKnowledgeBaseFilesParams contains parameters of the RepositoryI.DeleteAllKnowledgeBaseFiles +type RepositoryIMockDeleteAllKnowledgeBaseFilesParams struct { + ctx context.Context + kbUID string } -// RepositoryIMockDeleteChunksBySourceParamPtrs contains pointers to parameters of the RepositoryI.DeleteChunksBySource -type RepositoryIMockDeleteChunksBySourceParamPtrs struct { - ctx *context.Context - sourceTable *string - sourceUID *uuid.UUID +// RepositoryIMockDeleteAllKnowledgeBaseFilesParamPtrs contains pointers to parameters of the RepositoryI.DeleteAllKnowledgeBaseFiles +type RepositoryIMockDeleteAllKnowledgeBaseFilesParamPtrs struct { + ctx *context.Context + kbUID *string } -// RepositoryIMockDeleteChunksBySourceResults contains results of the RepositoryI.DeleteChunksBySource -type RepositoryIMockDeleteChunksBySourceResults struct { +// RepositoryIMockDeleteAllKnowledgeBaseFilesResults contains results of the RepositoryI.DeleteAllKnowledgeBaseFiles +type RepositoryIMockDeleteAllKnowledgeBaseFilesResults struct { err error } -// Expect sets up expected params for RepositoryI.DeleteChunksBySource -func (mmDeleteChunksBySource *mRepositoryIMockDeleteChunksBySource) Expect(ctx context.Context, sourceTable string, sourceUID uuid.UUID) *mRepositoryIMockDeleteChunksBySource { - if mmDeleteChunksBySource.mock.funcDeleteChunksBySource != nil { - mmDeleteChunksBySource.mock.t.Fatalf("RepositoryIMock.DeleteChunksBySource mock is already set by Set") +// Expect sets up expected params for RepositoryI.DeleteAllKnowledgeBaseFiles +func (mmDeleteAllKnowledgeBaseFiles *mRepositoryIMockDeleteAllKnowledgeBaseFiles) Expect(ctx context.Context, kbUID string) *mRepositoryIMockDeleteAllKnowledgeBaseFiles { + if mmDeleteAllKnowledgeBaseFiles.mock.funcDeleteAllKnowledgeBaseFiles != nil { + mmDeleteAllKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.DeleteAllKnowledgeBaseFiles mock is already set by Set") } - if mmDeleteChunksBySource.defaultExpectation == nil { - mmDeleteChunksBySource.defaultExpectation = &RepositoryIMockDeleteChunksBySourceExpectation{} + if mmDeleteAllKnowledgeBaseFiles.defaultExpectation == nil { + mmDeleteAllKnowledgeBaseFiles.defaultExpectation = &RepositoryIMockDeleteAllKnowledgeBaseFilesExpectation{} } - if mmDeleteChunksBySource.defaultExpectation.paramPtrs != nil { - mmDeleteChunksBySource.mock.t.Fatalf("RepositoryIMock.DeleteChunksBySource mock is already set by ExpectParams functions") + if mmDeleteAllKnowledgeBaseFiles.defaultExpectation.paramPtrs != nil { + mmDeleteAllKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.DeleteAllKnowledgeBaseFiles mock is already set by ExpectParams functions") } - mmDeleteChunksBySource.defaultExpectation.params = &RepositoryIMockDeleteChunksBySourceParams{ctx, sourceTable, sourceUID} - for _, e := range mmDeleteChunksBySource.expectations { - if minimock.Equal(e.params, mmDeleteChunksBySource.defaultExpectation.params) { - mmDeleteChunksBySource.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmDeleteChunksBySource.defaultExpectation.params) + mmDeleteAllKnowledgeBaseFiles.defaultExpectation.params = &RepositoryIMockDeleteAllKnowledgeBaseFilesParams{ctx, kbUID} + for _, e := range mmDeleteAllKnowledgeBaseFiles.expectations { + if minimock.Equal(e.params, mmDeleteAllKnowledgeBaseFiles.defaultExpectation.params) { + mmDeleteAllKnowledgeBaseFiles.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmDeleteAllKnowledgeBaseFiles.defaultExpectation.params) } } - return mmDeleteChunksBySource -} - -// ExpectCtxParam1 sets up expected param ctx for RepositoryI.DeleteChunksBySource -func (mmDeleteChunksBySource *mRepositoryIMockDeleteChunksBySource) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockDeleteChunksBySource { - if mmDeleteChunksBySource.mock.funcDeleteChunksBySource != nil { - mmDeleteChunksBySource.mock.t.Fatalf("RepositoryIMock.DeleteChunksBySource mock is already set by Set") - } - - if mmDeleteChunksBySource.defaultExpectation == nil { - mmDeleteChunksBySource.defaultExpectation = &RepositoryIMockDeleteChunksBySourceExpectation{} - } - - if mmDeleteChunksBySource.defaultExpectation.params != nil { - mmDeleteChunksBySource.mock.t.Fatalf("RepositoryIMock.DeleteChunksBySource mock is already set by Expect") - } - - if mmDeleteChunksBySource.defaultExpectation.paramPtrs == nil { - mmDeleteChunksBySource.defaultExpectation.paramPtrs = &RepositoryIMockDeleteChunksBySourceParamPtrs{} - } - mmDeleteChunksBySource.defaultExpectation.paramPtrs.ctx = &ctx - - return mmDeleteChunksBySource + return mmDeleteAllKnowledgeBaseFiles } -// ExpectSourceTableParam2 sets up expected param sourceTable for RepositoryI.DeleteChunksBySource -func (mmDeleteChunksBySource *mRepositoryIMockDeleteChunksBySource) ExpectSourceTableParam2(sourceTable string) *mRepositoryIMockDeleteChunksBySource { - if mmDeleteChunksBySource.mock.funcDeleteChunksBySource != nil { - mmDeleteChunksBySource.mock.t.Fatalf("RepositoryIMock.DeleteChunksBySource mock is already set by Set") +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.DeleteAllKnowledgeBaseFiles +func (mmDeleteAllKnowledgeBaseFiles *mRepositoryIMockDeleteAllKnowledgeBaseFiles) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockDeleteAllKnowledgeBaseFiles { + if mmDeleteAllKnowledgeBaseFiles.mock.funcDeleteAllKnowledgeBaseFiles != nil { + mmDeleteAllKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.DeleteAllKnowledgeBaseFiles mock is already set by Set") } - if mmDeleteChunksBySource.defaultExpectation == nil { - mmDeleteChunksBySource.defaultExpectation = &RepositoryIMockDeleteChunksBySourceExpectation{} + if mmDeleteAllKnowledgeBaseFiles.defaultExpectation == nil { + mmDeleteAllKnowledgeBaseFiles.defaultExpectation = &RepositoryIMockDeleteAllKnowledgeBaseFilesExpectation{} } - if mmDeleteChunksBySource.defaultExpectation.params != nil { - mmDeleteChunksBySource.mock.t.Fatalf("RepositoryIMock.DeleteChunksBySource mock is already set by Expect") + if mmDeleteAllKnowledgeBaseFiles.defaultExpectation.params != nil { + mmDeleteAllKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.DeleteAllKnowledgeBaseFiles mock is already set by Expect") } - if mmDeleteChunksBySource.defaultExpectation.paramPtrs == nil { - mmDeleteChunksBySource.defaultExpectation.paramPtrs = &RepositoryIMockDeleteChunksBySourceParamPtrs{} + if mmDeleteAllKnowledgeBaseFiles.defaultExpectation.paramPtrs == nil { + mmDeleteAllKnowledgeBaseFiles.defaultExpectation.paramPtrs = &RepositoryIMockDeleteAllKnowledgeBaseFilesParamPtrs{} } - mmDeleteChunksBySource.defaultExpectation.paramPtrs.sourceTable = &sourceTable + mmDeleteAllKnowledgeBaseFiles.defaultExpectation.paramPtrs.ctx = &ctx - return mmDeleteChunksBySource + return mmDeleteAllKnowledgeBaseFiles } -// ExpectSourceUIDParam3 sets up expected param sourceUID for RepositoryI.DeleteChunksBySource -func (mmDeleteChunksBySource *mRepositoryIMockDeleteChunksBySource) ExpectSourceUIDParam3(sourceUID uuid.UUID) *mRepositoryIMockDeleteChunksBySource { - if mmDeleteChunksBySource.mock.funcDeleteChunksBySource != nil { - mmDeleteChunksBySource.mock.t.Fatalf("RepositoryIMock.DeleteChunksBySource mock is already set by Set") +// ExpectKbUIDParam2 sets up expected param kbUID for RepositoryI.DeleteAllKnowledgeBaseFiles +func (mmDeleteAllKnowledgeBaseFiles *mRepositoryIMockDeleteAllKnowledgeBaseFiles) ExpectKbUIDParam2(kbUID string) *mRepositoryIMockDeleteAllKnowledgeBaseFiles { + if mmDeleteAllKnowledgeBaseFiles.mock.funcDeleteAllKnowledgeBaseFiles != nil { + mmDeleteAllKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.DeleteAllKnowledgeBaseFiles mock is already set by Set") } - if mmDeleteChunksBySource.defaultExpectation == nil { - mmDeleteChunksBySource.defaultExpectation = &RepositoryIMockDeleteChunksBySourceExpectation{} + if mmDeleteAllKnowledgeBaseFiles.defaultExpectation == nil { + mmDeleteAllKnowledgeBaseFiles.defaultExpectation = &RepositoryIMockDeleteAllKnowledgeBaseFilesExpectation{} } - if mmDeleteChunksBySource.defaultExpectation.params != nil { - mmDeleteChunksBySource.mock.t.Fatalf("RepositoryIMock.DeleteChunksBySource mock is already set by Expect") + if mmDeleteAllKnowledgeBaseFiles.defaultExpectation.params != nil { + mmDeleteAllKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.DeleteAllKnowledgeBaseFiles mock is already set by Expect") } - if mmDeleteChunksBySource.defaultExpectation.paramPtrs == nil { - mmDeleteChunksBySource.defaultExpectation.paramPtrs = &RepositoryIMockDeleteChunksBySourceParamPtrs{} + if mmDeleteAllKnowledgeBaseFiles.defaultExpectation.paramPtrs == nil { + mmDeleteAllKnowledgeBaseFiles.defaultExpectation.paramPtrs = &RepositoryIMockDeleteAllKnowledgeBaseFilesParamPtrs{} } - mmDeleteChunksBySource.defaultExpectation.paramPtrs.sourceUID = &sourceUID + mmDeleteAllKnowledgeBaseFiles.defaultExpectation.paramPtrs.kbUID = &kbUID - return mmDeleteChunksBySource + return mmDeleteAllKnowledgeBaseFiles } -// Inspect accepts an inspector function that has same arguments as the RepositoryI.DeleteChunksBySource -func (mmDeleteChunksBySource *mRepositoryIMockDeleteChunksBySource) Inspect(f func(ctx context.Context, sourceTable string, sourceUID uuid.UUID)) *mRepositoryIMockDeleteChunksBySource { - if mmDeleteChunksBySource.mock.inspectFuncDeleteChunksBySource != nil { - mmDeleteChunksBySource.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.DeleteChunksBySource") +// Inspect accepts an inspector function that has same arguments as the RepositoryI.DeleteAllKnowledgeBaseFiles +func (mmDeleteAllKnowledgeBaseFiles *mRepositoryIMockDeleteAllKnowledgeBaseFiles) Inspect(f func(ctx context.Context, kbUID string)) *mRepositoryIMockDeleteAllKnowledgeBaseFiles { + if mmDeleteAllKnowledgeBaseFiles.mock.inspectFuncDeleteAllKnowledgeBaseFiles != nil { + mmDeleteAllKnowledgeBaseFiles.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.DeleteAllKnowledgeBaseFiles") } - mmDeleteChunksBySource.mock.inspectFuncDeleteChunksBySource = f + mmDeleteAllKnowledgeBaseFiles.mock.inspectFuncDeleteAllKnowledgeBaseFiles = f - return mmDeleteChunksBySource + return mmDeleteAllKnowledgeBaseFiles } -// Return sets up results that will be returned by RepositoryI.DeleteChunksBySource -func (mmDeleteChunksBySource *mRepositoryIMockDeleteChunksBySource) Return(err error) *RepositoryIMock { - if mmDeleteChunksBySource.mock.funcDeleteChunksBySource != nil { - mmDeleteChunksBySource.mock.t.Fatalf("RepositoryIMock.DeleteChunksBySource mock is already set by Set") +// Return sets up results that will be returned by RepositoryI.DeleteAllKnowledgeBaseFiles +func (mmDeleteAllKnowledgeBaseFiles *mRepositoryIMockDeleteAllKnowledgeBaseFiles) Return(err error) *RepositoryIMock { + if mmDeleteAllKnowledgeBaseFiles.mock.funcDeleteAllKnowledgeBaseFiles != nil { + mmDeleteAllKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.DeleteAllKnowledgeBaseFiles mock is already set by Set") } - if mmDeleteChunksBySource.defaultExpectation == nil { - mmDeleteChunksBySource.defaultExpectation = &RepositoryIMockDeleteChunksBySourceExpectation{mock: mmDeleteChunksBySource.mock} + if mmDeleteAllKnowledgeBaseFiles.defaultExpectation == nil { + mmDeleteAllKnowledgeBaseFiles.defaultExpectation = &RepositoryIMockDeleteAllKnowledgeBaseFilesExpectation{mock: mmDeleteAllKnowledgeBaseFiles.mock} } - mmDeleteChunksBySource.defaultExpectation.results = &RepositoryIMockDeleteChunksBySourceResults{err} - return mmDeleteChunksBySource.mock + mmDeleteAllKnowledgeBaseFiles.defaultExpectation.results = &RepositoryIMockDeleteAllKnowledgeBaseFilesResults{err} + return mmDeleteAllKnowledgeBaseFiles.mock } -// Set uses given function f to mock the RepositoryI.DeleteChunksBySource method -func (mmDeleteChunksBySource *mRepositoryIMockDeleteChunksBySource) Set(f func(ctx context.Context, sourceTable string, sourceUID uuid.UUID) (err error)) *RepositoryIMock { - if mmDeleteChunksBySource.defaultExpectation != nil { - mmDeleteChunksBySource.mock.t.Fatalf("Default expectation is already set for the RepositoryI.DeleteChunksBySource method") +// Set uses given function f to mock the RepositoryI.DeleteAllKnowledgeBaseFiles method +func (mmDeleteAllKnowledgeBaseFiles *mRepositoryIMockDeleteAllKnowledgeBaseFiles) Set(f func(ctx context.Context, kbUID string) (err error)) *RepositoryIMock { + if mmDeleteAllKnowledgeBaseFiles.defaultExpectation != nil { + mmDeleteAllKnowledgeBaseFiles.mock.t.Fatalf("Default expectation is already set for the RepositoryI.DeleteAllKnowledgeBaseFiles method") } - if len(mmDeleteChunksBySource.expectations) > 0 { - mmDeleteChunksBySource.mock.t.Fatalf("Some expectations are already set for the RepositoryI.DeleteChunksBySource method") + if len(mmDeleteAllKnowledgeBaseFiles.expectations) > 0 { + mmDeleteAllKnowledgeBaseFiles.mock.t.Fatalf("Some expectations are already set for the RepositoryI.DeleteAllKnowledgeBaseFiles method") } - mmDeleteChunksBySource.mock.funcDeleteChunksBySource = f - return mmDeleteChunksBySource.mock + mmDeleteAllKnowledgeBaseFiles.mock.funcDeleteAllKnowledgeBaseFiles = f + return mmDeleteAllKnowledgeBaseFiles.mock } -// When sets expectation for the RepositoryI.DeleteChunksBySource which will trigger the result defined by the following +// When sets expectation for the RepositoryI.DeleteAllKnowledgeBaseFiles which will trigger the result defined by the following // Then helper -func (mmDeleteChunksBySource *mRepositoryIMockDeleteChunksBySource) When(ctx context.Context, sourceTable string, sourceUID uuid.UUID) *RepositoryIMockDeleteChunksBySourceExpectation { - if mmDeleteChunksBySource.mock.funcDeleteChunksBySource != nil { - mmDeleteChunksBySource.mock.t.Fatalf("RepositoryIMock.DeleteChunksBySource mock is already set by Set") +func (mmDeleteAllKnowledgeBaseFiles *mRepositoryIMockDeleteAllKnowledgeBaseFiles) When(ctx context.Context, kbUID string) *RepositoryIMockDeleteAllKnowledgeBaseFilesExpectation { + if mmDeleteAllKnowledgeBaseFiles.mock.funcDeleteAllKnowledgeBaseFiles != nil { + mmDeleteAllKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.DeleteAllKnowledgeBaseFiles mock is already set by Set") } - expectation := &RepositoryIMockDeleteChunksBySourceExpectation{ - mock: mmDeleteChunksBySource.mock, - params: &RepositoryIMockDeleteChunksBySourceParams{ctx, sourceTable, sourceUID}, + expectation := &RepositoryIMockDeleteAllKnowledgeBaseFilesExpectation{ + mock: mmDeleteAllKnowledgeBaseFiles.mock, + params: &RepositoryIMockDeleteAllKnowledgeBaseFilesParams{ctx, kbUID}, } - mmDeleteChunksBySource.expectations = append(mmDeleteChunksBySource.expectations, expectation) + mmDeleteAllKnowledgeBaseFiles.expectations = append(mmDeleteAllKnowledgeBaseFiles.expectations, expectation) return expectation } -// Then sets up RepositoryI.DeleteChunksBySource return parameters for the expectation previously defined by the When method -func (e *RepositoryIMockDeleteChunksBySourceExpectation) Then(err error) *RepositoryIMock { - e.results = &RepositoryIMockDeleteChunksBySourceResults{err} +// Then sets up RepositoryI.DeleteAllKnowledgeBaseFiles return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockDeleteAllKnowledgeBaseFilesExpectation) Then(err error) *RepositoryIMock { + e.results = &RepositoryIMockDeleteAllKnowledgeBaseFilesResults{err} return e.mock } -// Times sets number of times RepositoryI.DeleteChunksBySource should be invoked -func (mmDeleteChunksBySource *mRepositoryIMockDeleteChunksBySource) Times(n uint64) *mRepositoryIMockDeleteChunksBySource { +// Times sets number of times RepositoryI.DeleteAllKnowledgeBaseFiles should be invoked +func (mmDeleteAllKnowledgeBaseFiles *mRepositoryIMockDeleteAllKnowledgeBaseFiles) Times(n uint64) *mRepositoryIMockDeleteAllKnowledgeBaseFiles { if n == 0 { - mmDeleteChunksBySource.mock.t.Fatalf("Times of RepositoryIMock.DeleteChunksBySource mock can not be zero") + mmDeleteAllKnowledgeBaseFiles.mock.t.Fatalf("Times of RepositoryIMock.DeleteAllKnowledgeBaseFiles mock can not be zero") } - mm_atomic.StoreUint64(&mmDeleteChunksBySource.expectedInvocations, n) - return mmDeleteChunksBySource + mm_atomic.StoreUint64(&mmDeleteAllKnowledgeBaseFiles.expectedInvocations, n) + return mmDeleteAllKnowledgeBaseFiles } -func (mmDeleteChunksBySource *mRepositoryIMockDeleteChunksBySource) invocationsDone() bool { - if len(mmDeleteChunksBySource.expectations) == 0 && mmDeleteChunksBySource.defaultExpectation == nil && mmDeleteChunksBySource.mock.funcDeleteChunksBySource == nil { +func (mmDeleteAllKnowledgeBaseFiles *mRepositoryIMockDeleteAllKnowledgeBaseFiles) invocationsDone() bool { + if len(mmDeleteAllKnowledgeBaseFiles.expectations) == 0 && mmDeleteAllKnowledgeBaseFiles.defaultExpectation == nil && mmDeleteAllKnowledgeBaseFiles.mock.funcDeleteAllKnowledgeBaseFiles == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmDeleteChunksBySource.mock.afterDeleteChunksBySourceCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmDeleteChunksBySource.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmDeleteAllKnowledgeBaseFiles.mock.afterDeleteAllKnowledgeBaseFilesCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmDeleteAllKnowledgeBaseFiles.expectedInvocations) return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) } -// DeleteChunksBySource implements repository.RepositoryI -func (mmDeleteChunksBySource *RepositoryIMock) DeleteChunksBySource(ctx context.Context, sourceTable string, sourceUID uuid.UUID) (err error) { - mm_atomic.AddUint64(&mmDeleteChunksBySource.beforeDeleteChunksBySourceCounter, 1) - defer mm_atomic.AddUint64(&mmDeleteChunksBySource.afterDeleteChunksBySourceCounter, 1) +// DeleteAllKnowledgeBaseFiles implements repository.RepositoryI +func (mmDeleteAllKnowledgeBaseFiles *RepositoryIMock) DeleteAllKnowledgeBaseFiles(ctx context.Context, kbUID string) (err error) { + mm_atomic.AddUint64(&mmDeleteAllKnowledgeBaseFiles.beforeDeleteAllKnowledgeBaseFilesCounter, 1) + defer mm_atomic.AddUint64(&mmDeleteAllKnowledgeBaseFiles.afterDeleteAllKnowledgeBaseFilesCounter, 1) - if mmDeleteChunksBySource.inspectFuncDeleteChunksBySource != nil { - mmDeleteChunksBySource.inspectFuncDeleteChunksBySource(ctx, sourceTable, sourceUID) + if mmDeleteAllKnowledgeBaseFiles.inspectFuncDeleteAllKnowledgeBaseFiles != nil { + mmDeleteAllKnowledgeBaseFiles.inspectFuncDeleteAllKnowledgeBaseFiles(ctx, kbUID) } - mm_params := RepositoryIMockDeleteChunksBySourceParams{ctx, sourceTable, sourceUID} + mm_params := RepositoryIMockDeleteAllKnowledgeBaseFilesParams{ctx, kbUID} // Record call args - mmDeleteChunksBySource.DeleteChunksBySourceMock.mutex.Lock() - mmDeleteChunksBySource.DeleteChunksBySourceMock.callArgs = append(mmDeleteChunksBySource.DeleteChunksBySourceMock.callArgs, &mm_params) - mmDeleteChunksBySource.DeleteChunksBySourceMock.mutex.Unlock() + mmDeleteAllKnowledgeBaseFiles.DeleteAllKnowledgeBaseFilesMock.mutex.Lock() + mmDeleteAllKnowledgeBaseFiles.DeleteAllKnowledgeBaseFilesMock.callArgs = append(mmDeleteAllKnowledgeBaseFiles.DeleteAllKnowledgeBaseFilesMock.callArgs, &mm_params) + mmDeleteAllKnowledgeBaseFiles.DeleteAllKnowledgeBaseFilesMock.mutex.Unlock() - for _, e := range mmDeleteChunksBySource.DeleteChunksBySourceMock.expectations { + for _, e := range mmDeleteAllKnowledgeBaseFiles.DeleteAllKnowledgeBaseFilesMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) return e.results.err } } - if mmDeleteChunksBySource.DeleteChunksBySourceMock.defaultExpectation != nil { - mm_atomic.AddUint64(&mmDeleteChunksBySource.DeleteChunksBySourceMock.defaultExpectation.Counter, 1) - mm_want := mmDeleteChunksBySource.DeleteChunksBySourceMock.defaultExpectation.params - mm_want_ptrs := mmDeleteChunksBySource.DeleteChunksBySourceMock.defaultExpectation.paramPtrs + if mmDeleteAllKnowledgeBaseFiles.DeleteAllKnowledgeBaseFilesMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmDeleteAllKnowledgeBaseFiles.DeleteAllKnowledgeBaseFilesMock.defaultExpectation.Counter, 1) + mm_want := mmDeleteAllKnowledgeBaseFiles.DeleteAllKnowledgeBaseFilesMock.defaultExpectation.params + mm_want_ptrs := mmDeleteAllKnowledgeBaseFiles.DeleteAllKnowledgeBaseFilesMock.defaultExpectation.paramPtrs - mm_got := RepositoryIMockDeleteChunksBySourceParams{ctx, sourceTable, sourceUID} + mm_got := RepositoryIMockDeleteAllKnowledgeBaseFilesParams{ctx, kbUID} if mm_want_ptrs != nil { if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { - mmDeleteChunksBySource.t.Errorf("RepositoryIMock.DeleteChunksBySource got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) - } - - if mm_want_ptrs.sourceTable != nil && !minimock.Equal(*mm_want_ptrs.sourceTable, mm_got.sourceTable) { - mmDeleteChunksBySource.t.Errorf("RepositoryIMock.DeleteChunksBySource got unexpected parameter sourceTable, want: %#v, got: %#v%s\n", *mm_want_ptrs.sourceTable, mm_got.sourceTable, minimock.Diff(*mm_want_ptrs.sourceTable, mm_got.sourceTable)) + mmDeleteAllKnowledgeBaseFiles.t.Errorf("RepositoryIMock.DeleteAllKnowledgeBaseFiles got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) } - if mm_want_ptrs.sourceUID != nil && !minimock.Equal(*mm_want_ptrs.sourceUID, mm_got.sourceUID) { - mmDeleteChunksBySource.t.Errorf("RepositoryIMock.DeleteChunksBySource got unexpected parameter sourceUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.sourceUID, mm_got.sourceUID, minimock.Diff(*mm_want_ptrs.sourceUID, mm_got.sourceUID)) + if mm_want_ptrs.kbUID != nil && !minimock.Equal(*mm_want_ptrs.kbUID, mm_got.kbUID) { + mmDeleteAllKnowledgeBaseFiles.t.Errorf("RepositoryIMock.DeleteAllKnowledgeBaseFiles got unexpected parameter kbUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.kbUID, mm_got.kbUID, minimock.Diff(*mm_want_ptrs.kbUID, mm_got.kbUID)) } } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { - mmDeleteChunksBySource.t.Errorf("RepositoryIMock.DeleteChunksBySource got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + mmDeleteAllKnowledgeBaseFiles.t.Errorf("RepositoryIMock.DeleteAllKnowledgeBaseFiles got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) } - mm_results := mmDeleteChunksBySource.DeleteChunksBySourceMock.defaultExpectation.results + mm_results := mmDeleteAllKnowledgeBaseFiles.DeleteAllKnowledgeBaseFilesMock.defaultExpectation.results if mm_results == nil { - mmDeleteChunksBySource.t.Fatal("No results are set for the RepositoryIMock.DeleteChunksBySource") + mmDeleteAllKnowledgeBaseFiles.t.Fatal("No results are set for the RepositoryIMock.DeleteAllKnowledgeBaseFiles") } return (*mm_results).err } - if mmDeleteChunksBySource.funcDeleteChunksBySource != nil { - return mmDeleteChunksBySource.funcDeleteChunksBySource(ctx, sourceTable, sourceUID) + if mmDeleteAllKnowledgeBaseFiles.funcDeleteAllKnowledgeBaseFiles != nil { + return mmDeleteAllKnowledgeBaseFiles.funcDeleteAllKnowledgeBaseFiles(ctx, kbUID) } - mmDeleteChunksBySource.t.Fatalf("Unexpected call to RepositoryIMock.DeleteChunksBySource. %v %v %v", ctx, sourceTable, sourceUID) + mmDeleteAllKnowledgeBaseFiles.t.Fatalf("Unexpected call to RepositoryIMock.DeleteAllKnowledgeBaseFiles. %v %v", ctx, kbUID) return } -// DeleteChunksBySourceAfterCounter returns a count of finished RepositoryIMock.DeleteChunksBySource invocations -func (mmDeleteChunksBySource *RepositoryIMock) DeleteChunksBySourceAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmDeleteChunksBySource.afterDeleteChunksBySourceCounter) +// DeleteAllKnowledgeBaseFilesAfterCounter returns a count of finished RepositoryIMock.DeleteAllKnowledgeBaseFiles invocations +func (mmDeleteAllKnowledgeBaseFiles *RepositoryIMock) DeleteAllKnowledgeBaseFilesAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmDeleteAllKnowledgeBaseFiles.afterDeleteAllKnowledgeBaseFilesCounter) } -// DeleteChunksBySourceBeforeCounter returns a count of RepositoryIMock.DeleteChunksBySource invocations -func (mmDeleteChunksBySource *RepositoryIMock) DeleteChunksBySourceBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmDeleteChunksBySource.beforeDeleteChunksBySourceCounter) +// DeleteAllKnowledgeBaseFilesBeforeCounter returns a count of RepositoryIMock.DeleteAllKnowledgeBaseFiles invocations +func (mmDeleteAllKnowledgeBaseFiles *RepositoryIMock) DeleteAllKnowledgeBaseFilesBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmDeleteAllKnowledgeBaseFiles.beforeDeleteAllKnowledgeBaseFilesCounter) } -// Calls returns a list of arguments used in each call to RepositoryIMock.DeleteChunksBySource. +// Calls returns a list of arguments used in each call to RepositoryIMock.DeleteAllKnowledgeBaseFiles. // The list is in the same order as the calls were made (i.e. recent calls have a higher index) -func (mmDeleteChunksBySource *mRepositoryIMockDeleteChunksBySource) Calls() []*RepositoryIMockDeleteChunksBySourceParams { - mmDeleteChunksBySource.mutex.RLock() +func (mmDeleteAllKnowledgeBaseFiles *mRepositoryIMockDeleteAllKnowledgeBaseFiles) Calls() []*RepositoryIMockDeleteAllKnowledgeBaseFilesParams { + mmDeleteAllKnowledgeBaseFiles.mutex.RLock() - argCopy := make([]*RepositoryIMockDeleteChunksBySourceParams, len(mmDeleteChunksBySource.callArgs)) - copy(argCopy, mmDeleteChunksBySource.callArgs) + argCopy := make([]*RepositoryIMockDeleteAllKnowledgeBaseFilesParams, len(mmDeleteAllKnowledgeBaseFiles.callArgs)) + copy(argCopy, mmDeleteAllKnowledgeBaseFiles.callArgs) - mmDeleteChunksBySource.mutex.RUnlock() + mmDeleteAllKnowledgeBaseFiles.mutex.RUnlock() return argCopy } -// MinimockDeleteChunksBySourceDone returns true if the count of the DeleteChunksBySource invocations corresponds +// MinimockDeleteAllKnowledgeBaseFilesDone returns true if the count of the DeleteAllKnowledgeBaseFiles invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockDeleteChunksBySourceDone() bool { - for _, e := range m.DeleteChunksBySourceMock.expectations { +func (m *RepositoryIMock) MinimockDeleteAllKnowledgeBaseFilesDone() bool { + for _, e := range m.DeleteAllKnowledgeBaseFilesMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.DeleteChunksBySourceMock.invocationsDone() + return m.DeleteAllKnowledgeBaseFilesMock.invocationsDone() } -// MinimockDeleteChunksBySourceInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockDeleteChunksBySourceInspect() { - for _, e := range m.DeleteChunksBySourceMock.expectations { +// MinimockDeleteAllKnowledgeBaseFilesInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockDeleteAllKnowledgeBaseFilesInspect() { + for _, e := range m.DeleteAllKnowledgeBaseFilesMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { - m.t.Errorf("Expected call to RepositoryIMock.DeleteChunksBySource with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.DeleteAllKnowledgeBaseFiles with params: %#v", *e.params) } } - afterDeleteChunksBySourceCounter := mm_atomic.LoadUint64(&m.afterDeleteChunksBySourceCounter) + afterDeleteAllKnowledgeBaseFilesCounter := mm_atomic.LoadUint64(&m.afterDeleteAllKnowledgeBaseFilesCounter) // if default expectation was set then invocations count should be greater than zero - if m.DeleteChunksBySourceMock.defaultExpectation != nil && afterDeleteChunksBySourceCounter < 1 { - if m.DeleteChunksBySourceMock.defaultExpectation.params == nil { - m.t.Error("Expected call to RepositoryIMock.DeleteChunksBySource") + if m.DeleteAllKnowledgeBaseFilesMock.defaultExpectation != nil && afterDeleteAllKnowledgeBaseFilesCounter < 1 { + if m.DeleteAllKnowledgeBaseFilesMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.DeleteAllKnowledgeBaseFiles") } else { - m.t.Errorf("Expected call to RepositoryIMock.DeleteChunksBySource with params: %#v", *m.DeleteChunksBySourceMock.defaultExpectation.params) + m.t.Errorf("Expected call to RepositoryIMock.DeleteAllKnowledgeBaseFiles with params: %#v", *m.DeleteAllKnowledgeBaseFilesMock.defaultExpectation.params) } } // if func was set then invocations count should be greater than zero - if m.funcDeleteChunksBySource != nil && afterDeleteChunksBySourceCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.DeleteChunksBySource") + if m.funcDeleteAllKnowledgeBaseFiles != nil && afterDeleteAllKnowledgeBaseFilesCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.DeleteAllKnowledgeBaseFiles") } - if !m.DeleteChunksBySourceMock.invocationsDone() && afterDeleteChunksBySourceCounter > 0 { - m.t.Errorf("Expected %d calls to RepositoryIMock.DeleteChunksBySource but found %d calls", - mm_atomic.LoadUint64(&m.DeleteChunksBySourceMock.expectedInvocations), afterDeleteChunksBySourceCounter) + if !m.DeleteAllKnowledgeBaseFilesMock.invocationsDone() && afterDeleteAllKnowledgeBaseFilesCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.DeleteAllKnowledgeBaseFiles but found %d calls", + mm_atomic.LoadUint64(&m.DeleteAllKnowledgeBaseFilesMock.expectedInvocations), afterDeleteAllKnowledgeBaseFilesCounter) } } -type mRepositoryIMockDeleteChunksByUIDs struct { +type mRepositoryIMockDeleteAndCreateChunks struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockDeleteChunksByUIDsExpectation - expectations []*RepositoryIMockDeleteChunksByUIDsExpectation + defaultExpectation *RepositoryIMockDeleteAndCreateChunksExpectation + expectations []*RepositoryIMockDeleteAndCreateChunksExpectation - callArgs []*RepositoryIMockDeleteChunksByUIDsParams + callArgs []*RepositoryIMockDeleteAndCreateChunksParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockDeleteChunksByUIDsExpectation specifies expectation struct of the RepositoryI.DeleteChunksByUIDs -type RepositoryIMockDeleteChunksByUIDsExpectation struct { +// RepositoryIMockDeleteAndCreateChunksExpectation specifies expectation struct of the RepositoryI.DeleteAndCreateChunks +type RepositoryIMockDeleteAndCreateChunksExpectation struct { mock *RepositoryIMock - params *RepositoryIMockDeleteChunksByUIDsParams - paramPtrs *RepositoryIMockDeleteChunksByUIDsParamPtrs - results *RepositoryIMockDeleteChunksByUIDsResults + params *RepositoryIMockDeleteAndCreateChunksParams + paramPtrs *RepositoryIMockDeleteAndCreateChunksParamPtrs + results *RepositoryIMockDeleteAndCreateChunksResults Counter uint64 } -// RepositoryIMockDeleteChunksByUIDsParams contains parameters of the RepositoryI.DeleteChunksByUIDs -type RepositoryIMockDeleteChunksByUIDsParams struct { - ctx context.Context - chunkUIDs []uuid.UUID +// RepositoryIMockDeleteAndCreateChunksParams contains parameters of the RepositoryI.DeleteAndCreateChunks +type RepositoryIMockDeleteAndCreateChunksParams struct { + ctx context.Context + sourceTable string + sourceUID uuid.UUID + chunks []*mm_repository.TextChunk + externalServiceCall func(chunkUIDs []string) (map[string]any, error) } -// RepositoryIMockDeleteChunksByUIDsParamPtrs contains pointers to parameters of the RepositoryI.DeleteChunksByUIDs -type RepositoryIMockDeleteChunksByUIDsParamPtrs struct { - ctx *context.Context - chunkUIDs *[]uuid.UUID +// RepositoryIMockDeleteAndCreateChunksParamPtrs contains pointers to parameters of the RepositoryI.DeleteAndCreateChunks +type RepositoryIMockDeleteAndCreateChunksParamPtrs struct { + ctx *context.Context + sourceTable *string + sourceUID *uuid.UUID + chunks *[]*mm_repository.TextChunk + externalServiceCall *func(chunkUIDs []string) (map[string]any, error) } -// RepositoryIMockDeleteChunksByUIDsResults contains results of the RepositoryI.DeleteChunksByUIDs -type RepositoryIMockDeleteChunksByUIDsResults struct { - err error +// RepositoryIMockDeleteAndCreateChunksResults contains results of the RepositoryI.DeleteAndCreateChunks +type RepositoryIMockDeleteAndCreateChunksResults struct { + tpa1 []*mm_repository.TextChunk + err error } -// Expect sets up expected params for RepositoryI.DeleteChunksByUIDs -func (mmDeleteChunksByUIDs *mRepositoryIMockDeleteChunksByUIDs) Expect(ctx context.Context, chunkUIDs []uuid.UUID) *mRepositoryIMockDeleteChunksByUIDs { - if mmDeleteChunksByUIDs.mock.funcDeleteChunksByUIDs != nil { - mmDeleteChunksByUIDs.mock.t.Fatalf("RepositoryIMock.DeleteChunksByUIDs mock is already set by Set") +// Expect sets up expected params for RepositoryI.DeleteAndCreateChunks +func (mmDeleteAndCreateChunks *mRepositoryIMockDeleteAndCreateChunks) Expect(ctx context.Context, sourceTable string, sourceUID uuid.UUID, chunks []*mm_repository.TextChunk, externalServiceCall func(chunkUIDs []string) (map[string]any, error)) *mRepositoryIMockDeleteAndCreateChunks { + if mmDeleteAndCreateChunks.mock.funcDeleteAndCreateChunks != nil { + mmDeleteAndCreateChunks.mock.t.Fatalf("RepositoryIMock.DeleteAndCreateChunks mock is already set by Set") } - if mmDeleteChunksByUIDs.defaultExpectation == nil { - mmDeleteChunksByUIDs.defaultExpectation = &RepositoryIMockDeleteChunksByUIDsExpectation{} + if mmDeleteAndCreateChunks.defaultExpectation == nil { + mmDeleteAndCreateChunks.defaultExpectation = &RepositoryIMockDeleteAndCreateChunksExpectation{} } - if mmDeleteChunksByUIDs.defaultExpectation.paramPtrs != nil { - mmDeleteChunksByUIDs.mock.t.Fatalf("RepositoryIMock.DeleteChunksByUIDs mock is already set by ExpectParams functions") + if mmDeleteAndCreateChunks.defaultExpectation.paramPtrs != nil { + mmDeleteAndCreateChunks.mock.t.Fatalf("RepositoryIMock.DeleteAndCreateChunks mock is already set by ExpectParams functions") } - mmDeleteChunksByUIDs.defaultExpectation.params = &RepositoryIMockDeleteChunksByUIDsParams{ctx, chunkUIDs} - for _, e := range mmDeleteChunksByUIDs.expectations { - if minimock.Equal(e.params, mmDeleteChunksByUIDs.defaultExpectation.params) { - mmDeleteChunksByUIDs.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmDeleteChunksByUIDs.defaultExpectation.params) - } + mmDeleteAndCreateChunks.defaultExpectation.params = &RepositoryIMockDeleteAndCreateChunksParams{ctx, sourceTable, sourceUID, chunks, externalServiceCall} + for _, e := range mmDeleteAndCreateChunks.expectations { + if minimock.Equal(e.params, mmDeleteAndCreateChunks.defaultExpectation.params) { + mmDeleteAndCreateChunks.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmDeleteAndCreateChunks.defaultExpectation.params) + } } - return mmDeleteChunksByUIDs + return mmDeleteAndCreateChunks } -// ExpectCtxParam1 sets up expected param ctx for RepositoryI.DeleteChunksByUIDs -func (mmDeleteChunksByUIDs *mRepositoryIMockDeleteChunksByUIDs) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockDeleteChunksByUIDs { - if mmDeleteChunksByUIDs.mock.funcDeleteChunksByUIDs != nil { - mmDeleteChunksByUIDs.mock.t.Fatalf("RepositoryIMock.DeleteChunksByUIDs mock is already set by Set") +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.DeleteAndCreateChunks +func (mmDeleteAndCreateChunks *mRepositoryIMockDeleteAndCreateChunks) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockDeleteAndCreateChunks { + if mmDeleteAndCreateChunks.mock.funcDeleteAndCreateChunks != nil { + mmDeleteAndCreateChunks.mock.t.Fatalf("RepositoryIMock.DeleteAndCreateChunks mock is already set by Set") } - if mmDeleteChunksByUIDs.defaultExpectation == nil { - mmDeleteChunksByUIDs.defaultExpectation = &RepositoryIMockDeleteChunksByUIDsExpectation{} + if mmDeleteAndCreateChunks.defaultExpectation == nil { + mmDeleteAndCreateChunks.defaultExpectation = &RepositoryIMockDeleteAndCreateChunksExpectation{} } - if mmDeleteChunksByUIDs.defaultExpectation.params != nil { - mmDeleteChunksByUIDs.mock.t.Fatalf("RepositoryIMock.DeleteChunksByUIDs mock is already set by Expect") + if mmDeleteAndCreateChunks.defaultExpectation.params != nil { + mmDeleteAndCreateChunks.mock.t.Fatalf("RepositoryIMock.DeleteAndCreateChunks mock is already set by Expect") } - if mmDeleteChunksByUIDs.defaultExpectation.paramPtrs == nil { - mmDeleteChunksByUIDs.defaultExpectation.paramPtrs = &RepositoryIMockDeleteChunksByUIDsParamPtrs{} + if mmDeleteAndCreateChunks.defaultExpectation.paramPtrs == nil { + mmDeleteAndCreateChunks.defaultExpectation.paramPtrs = &RepositoryIMockDeleteAndCreateChunksParamPtrs{} } - mmDeleteChunksByUIDs.defaultExpectation.paramPtrs.ctx = &ctx + mmDeleteAndCreateChunks.defaultExpectation.paramPtrs.ctx = &ctx - return mmDeleteChunksByUIDs + return mmDeleteAndCreateChunks } -// ExpectChunkUIDsParam2 sets up expected param chunkUIDs for RepositoryI.DeleteChunksByUIDs -func (mmDeleteChunksByUIDs *mRepositoryIMockDeleteChunksByUIDs) ExpectChunkUIDsParam2(chunkUIDs []uuid.UUID) *mRepositoryIMockDeleteChunksByUIDs { - if mmDeleteChunksByUIDs.mock.funcDeleteChunksByUIDs != nil { - mmDeleteChunksByUIDs.mock.t.Fatalf("RepositoryIMock.DeleteChunksByUIDs mock is already set by Set") +// ExpectSourceTableParam2 sets up expected param sourceTable for RepositoryI.DeleteAndCreateChunks +func (mmDeleteAndCreateChunks *mRepositoryIMockDeleteAndCreateChunks) ExpectSourceTableParam2(sourceTable string) *mRepositoryIMockDeleteAndCreateChunks { + if mmDeleteAndCreateChunks.mock.funcDeleteAndCreateChunks != nil { + mmDeleteAndCreateChunks.mock.t.Fatalf("RepositoryIMock.DeleteAndCreateChunks mock is already set by Set") } - if mmDeleteChunksByUIDs.defaultExpectation == nil { - mmDeleteChunksByUIDs.defaultExpectation = &RepositoryIMockDeleteChunksByUIDsExpectation{} + if mmDeleteAndCreateChunks.defaultExpectation == nil { + mmDeleteAndCreateChunks.defaultExpectation = &RepositoryIMockDeleteAndCreateChunksExpectation{} } - if mmDeleteChunksByUIDs.defaultExpectation.params != nil { - mmDeleteChunksByUIDs.mock.t.Fatalf("RepositoryIMock.DeleteChunksByUIDs mock is already set by Expect") + if mmDeleteAndCreateChunks.defaultExpectation.params != nil { + mmDeleteAndCreateChunks.mock.t.Fatalf("RepositoryIMock.DeleteAndCreateChunks mock is already set by Expect") } - if mmDeleteChunksByUIDs.defaultExpectation.paramPtrs == nil { - mmDeleteChunksByUIDs.defaultExpectation.paramPtrs = &RepositoryIMockDeleteChunksByUIDsParamPtrs{} + if mmDeleteAndCreateChunks.defaultExpectation.paramPtrs == nil { + mmDeleteAndCreateChunks.defaultExpectation.paramPtrs = &RepositoryIMockDeleteAndCreateChunksParamPtrs{} } - mmDeleteChunksByUIDs.defaultExpectation.paramPtrs.chunkUIDs = &chunkUIDs + mmDeleteAndCreateChunks.defaultExpectation.paramPtrs.sourceTable = &sourceTable - return mmDeleteChunksByUIDs + return mmDeleteAndCreateChunks } -// Inspect accepts an inspector function that has same arguments as the RepositoryI.DeleteChunksByUIDs -func (mmDeleteChunksByUIDs *mRepositoryIMockDeleteChunksByUIDs) Inspect(f func(ctx context.Context, chunkUIDs []uuid.UUID)) *mRepositoryIMockDeleteChunksByUIDs { - if mmDeleteChunksByUIDs.mock.inspectFuncDeleteChunksByUIDs != nil { - mmDeleteChunksByUIDs.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.DeleteChunksByUIDs") +// ExpectSourceUIDParam3 sets up expected param sourceUID for RepositoryI.DeleteAndCreateChunks +func (mmDeleteAndCreateChunks *mRepositoryIMockDeleteAndCreateChunks) ExpectSourceUIDParam3(sourceUID uuid.UUID) *mRepositoryIMockDeleteAndCreateChunks { + if mmDeleteAndCreateChunks.mock.funcDeleteAndCreateChunks != nil { + mmDeleteAndCreateChunks.mock.t.Fatalf("RepositoryIMock.DeleteAndCreateChunks mock is already set by Set") } - mmDeleteChunksByUIDs.mock.inspectFuncDeleteChunksByUIDs = f + if mmDeleteAndCreateChunks.defaultExpectation == nil { + mmDeleteAndCreateChunks.defaultExpectation = &RepositoryIMockDeleteAndCreateChunksExpectation{} + } - return mmDeleteChunksByUIDs + if mmDeleteAndCreateChunks.defaultExpectation.params != nil { + mmDeleteAndCreateChunks.mock.t.Fatalf("RepositoryIMock.DeleteAndCreateChunks mock is already set by Expect") + } + + if mmDeleteAndCreateChunks.defaultExpectation.paramPtrs == nil { + mmDeleteAndCreateChunks.defaultExpectation.paramPtrs = &RepositoryIMockDeleteAndCreateChunksParamPtrs{} + } + mmDeleteAndCreateChunks.defaultExpectation.paramPtrs.sourceUID = &sourceUID + + return mmDeleteAndCreateChunks } -// Return sets up results that will be returned by RepositoryI.DeleteChunksByUIDs -func (mmDeleteChunksByUIDs *mRepositoryIMockDeleteChunksByUIDs) Return(err error) *RepositoryIMock { - if mmDeleteChunksByUIDs.mock.funcDeleteChunksByUIDs != nil { - mmDeleteChunksByUIDs.mock.t.Fatalf("RepositoryIMock.DeleteChunksByUIDs mock is already set by Set") +// ExpectChunksParam4 sets up expected param chunks for RepositoryI.DeleteAndCreateChunks +func (mmDeleteAndCreateChunks *mRepositoryIMockDeleteAndCreateChunks) ExpectChunksParam4(chunks []*mm_repository.TextChunk) *mRepositoryIMockDeleteAndCreateChunks { + if mmDeleteAndCreateChunks.mock.funcDeleteAndCreateChunks != nil { + mmDeleteAndCreateChunks.mock.t.Fatalf("RepositoryIMock.DeleteAndCreateChunks mock is already set by Set") } - if mmDeleteChunksByUIDs.defaultExpectation == nil { - mmDeleteChunksByUIDs.defaultExpectation = &RepositoryIMockDeleteChunksByUIDsExpectation{mock: mmDeleteChunksByUIDs.mock} + if mmDeleteAndCreateChunks.defaultExpectation == nil { + mmDeleteAndCreateChunks.defaultExpectation = &RepositoryIMockDeleteAndCreateChunksExpectation{} } - mmDeleteChunksByUIDs.defaultExpectation.results = &RepositoryIMockDeleteChunksByUIDsResults{err} - return mmDeleteChunksByUIDs.mock + + if mmDeleteAndCreateChunks.defaultExpectation.params != nil { + mmDeleteAndCreateChunks.mock.t.Fatalf("RepositoryIMock.DeleteAndCreateChunks mock is already set by Expect") + } + + if mmDeleteAndCreateChunks.defaultExpectation.paramPtrs == nil { + mmDeleteAndCreateChunks.defaultExpectation.paramPtrs = &RepositoryIMockDeleteAndCreateChunksParamPtrs{} + } + mmDeleteAndCreateChunks.defaultExpectation.paramPtrs.chunks = &chunks + + return mmDeleteAndCreateChunks } -// Set uses given function f to mock the RepositoryI.DeleteChunksByUIDs method -func (mmDeleteChunksByUIDs *mRepositoryIMockDeleteChunksByUIDs) Set(f func(ctx context.Context, chunkUIDs []uuid.UUID) (err error)) *RepositoryIMock { - if mmDeleteChunksByUIDs.defaultExpectation != nil { - mmDeleteChunksByUIDs.mock.t.Fatalf("Default expectation is already set for the RepositoryI.DeleteChunksByUIDs method") +// ExpectExternalServiceCallParam5 sets up expected param externalServiceCall for RepositoryI.DeleteAndCreateChunks +func (mmDeleteAndCreateChunks *mRepositoryIMockDeleteAndCreateChunks) ExpectExternalServiceCallParam5(externalServiceCall func(chunkUIDs []string) (map[string]any, error)) *mRepositoryIMockDeleteAndCreateChunks { + if mmDeleteAndCreateChunks.mock.funcDeleteAndCreateChunks != nil { + mmDeleteAndCreateChunks.mock.t.Fatalf("RepositoryIMock.DeleteAndCreateChunks mock is already set by Set") } - if len(mmDeleteChunksByUIDs.expectations) > 0 { - mmDeleteChunksByUIDs.mock.t.Fatalf("Some expectations are already set for the RepositoryI.DeleteChunksByUIDs method") + if mmDeleteAndCreateChunks.defaultExpectation == nil { + mmDeleteAndCreateChunks.defaultExpectation = &RepositoryIMockDeleteAndCreateChunksExpectation{} } - mmDeleteChunksByUIDs.mock.funcDeleteChunksByUIDs = f - return mmDeleteChunksByUIDs.mock + if mmDeleteAndCreateChunks.defaultExpectation.params != nil { + mmDeleteAndCreateChunks.mock.t.Fatalf("RepositoryIMock.DeleteAndCreateChunks mock is already set by Expect") + } + + if mmDeleteAndCreateChunks.defaultExpectation.paramPtrs == nil { + mmDeleteAndCreateChunks.defaultExpectation.paramPtrs = &RepositoryIMockDeleteAndCreateChunksParamPtrs{} + } + mmDeleteAndCreateChunks.defaultExpectation.paramPtrs.externalServiceCall = &externalServiceCall + + return mmDeleteAndCreateChunks } -// When sets expectation for the RepositoryI.DeleteChunksByUIDs which will trigger the result defined by the following +// Inspect accepts an inspector function that has same arguments as the RepositoryI.DeleteAndCreateChunks +func (mmDeleteAndCreateChunks *mRepositoryIMockDeleteAndCreateChunks) Inspect(f func(ctx context.Context, sourceTable string, sourceUID uuid.UUID, chunks []*mm_repository.TextChunk, externalServiceCall func(chunkUIDs []string) (map[string]any, error))) *mRepositoryIMockDeleteAndCreateChunks { + if mmDeleteAndCreateChunks.mock.inspectFuncDeleteAndCreateChunks != nil { + mmDeleteAndCreateChunks.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.DeleteAndCreateChunks") + } + + mmDeleteAndCreateChunks.mock.inspectFuncDeleteAndCreateChunks = f + + return mmDeleteAndCreateChunks +} + +// Return sets up results that will be returned by RepositoryI.DeleteAndCreateChunks +func (mmDeleteAndCreateChunks *mRepositoryIMockDeleteAndCreateChunks) Return(tpa1 []*mm_repository.TextChunk, err error) *RepositoryIMock { + if mmDeleteAndCreateChunks.mock.funcDeleteAndCreateChunks != nil { + mmDeleteAndCreateChunks.mock.t.Fatalf("RepositoryIMock.DeleteAndCreateChunks mock is already set by Set") + } + + if mmDeleteAndCreateChunks.defaultExpectation == nil { + mmDeleteAndCreateChunks.defaultExpectation = &RepositoryIMockDeleteAndCreateChunksExpectation{mock: mmDeleteAndCreateChunks.mock} + } + mmDeleteAndCreateChunks.defaultExpectation.results = &RepositoryIMockDeleteAndCreateChunksResults{tpa1, err} + return mmDeleteAndCreateChunks.mock +} + +// Set uses given function f to mock the RepositoryI.DeleteAndCreateChunks method +func (mmDeleteAndCreateChunks *mRepositoryIMockDeleteAndCreateChunks) Set(f func(ctx context.Context, sourceTable string, sourceUID uuid.UUID, chunks []*mm_repository.TextChunk, externalServiceCall func(chunkUIDs []string) (map[string]any, error)) (tpa1 []*mm_repository.TextChunk, err error)) *RepositoryIMock { + if mmDeleteAndCreateChunks.defaultExpectation != nil { + mmDeleteAndCreateChunks.mock.t.Fatalf("Default expectation is already set for the RepositoryI.DeleteAndCreateChunks method") + } + + if len(mmDeleteAndCreateChunks.expectations) > 0 { + mmDeleteAndCreateChunks.mock.t.Fatalf("Some expectations are already set for the RepositoryI.DeleteAndCreateChunks method") + } + + mmDeleteAndCreateChunks.mock.funcDeleteAndCreateChunks = f + return mmDeleteAndCreateChunks.mock +} + +// When sets expectation for the RepositoryI.DeleteAndCreateChunks which will trigger the result defined by the following // Then helper -func (mmDeleteChunksByUIDs *mRepositoryIMockDeleteChunksByUIDs) When(ctx context.Context, chunkUIDs []uuid.UUID) *RepositoryIMockDeleteChunksByUIDsExpectation { - if mmDeleteChunksByUIDs.mock.funcDeleteChunksByUIDs != nil { - mmDeleteChunksByUIDs.mock.t.Fatalf("RepositoryIMock.DeleteChunksByUIDs mock is already set by Set") +func (mmDeleteAndCreateChunks *mRepositoryIMockDeleteAndCreateChunks) When(ctx context.Context, sourceTable string, sourceUID uuid.UUID, chunks []*mm_repository.TextChunk, externalServiceCall func(chunkUIDs []string) (map[string]any, error)) *RepositoryIMockDeleteAndCreateChunksExpectation { + if mmDeleteAndCreateChunks.mock.funcDeleteAndCreateChunks != nil { + mmDeleteAndCreateChunks.mock.t.Fatalf("RepositoryIMock.DeleteAndCreateChunks mock is already set by Set") } - expectation := &RepositoryIMockDeleteChunksByUIDsExpectation{ - mock: mmDeleteChunksByUIDs.mock, - params: &RepositoryIMockDeleteChunksByUIDsParams{ctx, chunkUIDs}, + expectation := &RepositoryIMockDeleteAndCreateChunksExpectation{ + mock: mmDeleteAndCreateChunks.mock, + params: &RepositoryIMockDeleteAndCreateChunksParams{ctx, sourceTable, sourceUID, chunks, externalServiceCall}, } - mmDeleteChunksByUIDs.expectations = append(mmDeleteChunksByUIDs.expectations, expectation) + mmDeleteAndCreateChunks.expectations = append(mmDeleteAndCreateChunks.expectations, expectation) return expectation } -// Then sets up RepositoryI.DeleteChunksByUIDs return parameters for the expectation previously defined by the When method -func (e *RepositoryIMockDeleteChunksByUIDsExpectation) Then(err error) *RepositoryIMock { - e.results = &RepositoryIMockDeleteChunksByUIDsResults{err} +// Then sets up RepositoryI.DeleteAndCreateChunks return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockDeleteAndCreateChunksExpectation) Then(tpa1 []*mm_repository.TextChunk, err error) *RepositoryIMock { + e.results = &RepositoryIMockDeleteAndCreateChunksResults{tpa1, err} return e.mock } -// Times sets number of times RepositoryI.DeleteChunksByUIDs should be invoked -func (mmDeleteChunksByUIDs *mRepositoryIMockDeleteChunksByUIDs) Times(n uint64) *mRepositoryIMockDeleteChunksByUIDs { +// Times sets number of times RepositoryI.DeleteAndCreateChunks should be invoked +func (mmDeleteAndCreateChunks *mRepositoryIMockDeleteAndCreateChunks) Times(n uint64) *mRepositoryIMockDeleteAndCreateChunks { if n == 0 { - mmDeleteChunksByUIDs.mock.t.Fatalf("Times of RepositoryIMock.DeleteChunksByUIDs mock can not be zero") + mmDeleteAndCreateChunks.mock.t.Fatalf("Times of RepositoryIMock.DeleteAndCreateChunks mock can not be zero") } - mm_atomic.StoreUint64(&mmDeleteChunksByUIDs.expectedInvocations, n) - return mmDeleteChunksByUIDs + mm_atomic.StoreUint64(&mmDeleteAndCreateChunks.expectedInvocations, n) + return mmDeleteAndCreateChunks } -func (mmDeleteChunksByUIDs *mRepositoryIMockDeleteChunksByUIDs) invocationsDone() bool { - if len(mmDeleteChunksByUIDs.expectations) == 0 && mmDeleteChunksByUIDs.defaultExpectation == nil && mmDeleteChunksByUIDs.mock.funcDeleteChunksByUIDs == nil { +func (mmDeleteAndCreateChunks *mRepositoryIMockDeleteAndCreateChunks) invocationsDone() bool { + if len(mmDeleteAndCreateChunks.expectations) == 0 && mmDeleteAndCreateChunks.defaultExpectation == nil && mmDeleteAndCreateChunks.mock.funcDeleteAndCreateChunks == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmDeleteChunksByUIDs.mock.afterDeleteChunksByUIDsCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmDeleteChunksByUIDs.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmDeleteAndCreateChunks.mock.afterDeleteAndCreateChunksCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmDeleteAndCreateChunks.expectedInvocations) return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) } -// DeleteChunksByUIDs implements repository.RepositoryI -func (mmDeleteChunksByUIDs *RepositoryIMock) DeleteChunksByUIDs(ctx context.Context, chunkUIDs []uuid.UUID) (err error) { - mm_atomic.AddUint64(&mmDeleteChunksByUIDs.beforeDeleteChunksByUIDsCounter, 1) - defer mm_atomic.AddUint64(&mmDeleteChunksByUIDs.afterDeleteChunksByUIDsCounter, 1) +// DeleteAndCreateChunks implements repository.RepositoryI +func (mmDeleteAndCreateChunks *RepositoryIMock) DeleteAndCreateChunks(ctx context.Context, sourceTable string, sourceUID uuid.UUID, chunks []*mm_repository.TextChunk, externalServiceCall func(chunkUIDs []string) (map[string]any, error)) (tpa1 []*mm_repository.TextChunk, err error) { + mm_atomic.AddUint64(&mmDeleteAndCreateChunks.beforeDeleteAndCreateChunksCounter, 1) + defer mm_atomic.AddUint64(&mmDeleteAndCreateChunks.afterDeleteAndCreateChunksCounter, 1) - if mmDeleteChunksByUIDs.inspectFuncDeleteChunksByUIDs != nil { - mmDeleteChunksByUIDs.inspectFuncDeleteChunksByUIDs(ctx, chunkUIDs) + if mmDeleteAndCreateChunks.inspectFuncDeleteAndCreateChunks != nil { + mmDeleteAndCreateChunks.inspectFuncDeleteAndCreateChunks(ctx, sourceTable, sourceUID, chunks, externalServiceCall) } - mm_params := RepositoryIMockDeleteChunksByUIDsParams{ctx, chunkUIDs} + mm_params := RepositoryIMockDeleteAndCreateChunksParams{ctx, sourceTable, sourceUID, chunks, externalServiceCall} // Record call args - mmDeleteChunksByUIDs.DeleteChunksByUIDsMock.mutex.Lock() - mmDeleteChunksByUIDs.DeleteChunksByUIDsMock.callArgs = append(mmDeleteChunksByUIDs.DeleteChunksByUIDsMock.callArgs, &mm_params) - mmDeleteChunksByUIDs.DeleteChunksByUIDsMock.mutex.Unlock() + mmDeleteAndCreateChunks.DeleteAndCreateChunksMock.mutex.Lock() + mmDeleteAndCreateChunks.DeleteAndCreateChunksMock.callArgs = append(mmDeleteAndCreateChunks.DeleteAndCreateChunksMock.callArgs, &mm_params) + mmDeleteAndCreateChunks.DeleteAndCreateChunksMock.mutex.Unlock() - for _, e := range mmDeleteChunksByUIDs.DeleteChunksByUIDsMock.expectations { + for _, e := range mmDeleteAndCreateChunks.DeleteAndCreateChunksMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.err + return e.results.tpa1, e.results.err } } - if mmDeleteChunksByUIDs.DeleteChunksByUIDsMock.defaultExpectation != nil { - mm_atomic.AddUint64(&mmDeleteChunksByUIDs.DeleteChunksByUIDsMock.defaultExpectation.Counter, 1) - mm_want := mmDeleteChunksByUIDs.DeleteChunksByUIDsMock.defaultExpectation.params - mm_want_ptrs := mmDeleteChunksByUIDs.DeleteChunksByUIDsMock.defaultExpectation.paramPtrs + if mmDeleteAndCreateChunks.DeleteAndCreateChunksMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmDeleteAndCreateChunks.DeleteAndCreateChunksMock.defaultExpectation.Counter, 1) + mm_want := mmDeleteAndCreateChunks.DeleteAndCreateChunksMock.defaultExpectation.params + mm_want_ptrs := mmDeleteAndCreateChunks.DeleteAndCreateChunksMock.defaultExpectation.paramPtrs - mm_got := RepositoryIMockDeleteChunksByUIDsParams{ctx, chunkUIDs} + mm_got := RepositoryIMockDeleteAndCreateChunksParams{ctx, sourceTable, sourceUID, chunks, externalServiceCall} if mm_want_ptrs != nil { if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { - mmDeleteChunksByUIDs.t.Errorf("RepositoryIMock.DeleteChunksByUIDs got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) + mmDeleteAndCreateChunks.t.Errorf("RepositoryIMock.DeleteAndCreateChunks got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) } - if mm_want_ptrs.chunkUIDs != nil && !minimock.Equal(*mm_want_ptrs.chunkUIDs, mm_got.chunkUIDs) { - mmDeleteChunksByUIDs.t.Errorf("RepositoryIMock.DeleteChunksByUIDs got unexpected parameter chunkUIDs, want: %#v, got: %#v%s\n", *mm_want_ptrs.chunkUIDs, mm_got.chunkUIDs, minimock.Diff(*mm_want_ptrs.chunkUIDs, mm_got.chunkUIDs)) + if mm_want_ptrs.sourceTable != nil && !minimock.Equal(*mm_want_ptrs.sourceTable, mm_got.sourceTable) { + mmDeleteAndCreateChunks.t.Errorf("RepositoryIMock.DeleteAndCreateChunks got unexpected parameter sourceTable, want: %#v, got: %#v%s\n", *mm_want_ptrs.sourceTable, mm_got.sourceTable, minimock.Diff(*mm_want_ptrs.sourceTable, mm_got.sourceTable)) } - } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { - mmDeleteChunksByUIDs.t.Errorf("RepositoryIMock.DeleteChunksByUIDs got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) - } + if mm_want_ptrs.sourceUID != nil && !minimock.Equal(*mm_want_ptrs.sourceUID, mm_got.sourceUID) { + mmDeleteAndCreateChunks.t.Errorf("RepositoryIMock.DeleteAndCreateChunks got unexpected parameter sourceUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.sourceUID, mm_got.sourceUID, minimock.Diff(*mm_want_ptrs.sourceUID, mm_got.sourceUID)) + } - mm_results := mmDeleteChunksByUIDs.DeleteChunksByUIDsMock.defaultExpectation.results - if mm_results == nil { - mmDeleteChunksByUIDs.t.Fatal("No results are set for the RepositoryIMock.DeleteChunksByUIDs") - } - return (*mm_results).err + if mm_want_ptrs.chunks != nil && !minimock.Equal(*mm_want_ptrs.chunks, mm_got.chunks) { + mmDeleteAndCreateChunks.t.Errorf("RepositoryIMock.DeleteAndCreateChunks got unexpected parameter chunks, want: %#v, got: %#v%s\n", *mm_want_ptrs.chunks, mm_got.chunks, minimock.Diff(*mm_want_ptrs.chunks, mm_got.chunks)) + } + + if mm_want_ptrs.externalServiceCall != nil && !minimock.Equal(*mm_want_ptrs.externalServiceCall, mm_got.externalServiceCall) { + mmDeleteAndCreateChunks.t.Errorf("RepositoryIMock.DeleteAndCreateChunks got unexpected parameter externalServiceCall, want: %#v, got: %#v%s\n", *mm_want_ptrs.externalServiceCall, mm_got.externalServiceCall, minimock.Diff(*mm_want_ptrs.externalServiceCall, mm_got.externalServiceCall)) + } + + } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { + mmDeleteAndCreateChunks.t.Errorf("RepositoryIMock.DeleteAndCreateChunks got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + } + + mm_results := mmDeleteAndCreateChunks.DeleteAndCreateChunksMock.defaultExpectation.results + if mm_results == nil { + mmDeleteAndCreateChunks.t.Fatal("No results are set for the RepositoryIMock.DeleteAndCreateChunks") + } + return (*mm_results).tpa1, (*mm_results).err } - if mmDeleteChunksByUIDs.funcDeleteChunksByUIDs != nil { - return mmDeleteChunksByUIDs.funcDeleteChunksByUIDs(ctx, chunkUIDs) + if mmDeleteAndCreateChunks.funcDeleteAndCreateChunks != nil { + return mmDeleteAndCreateChunks.funcDeleteAndCreateChunks(ctx, sourceTable, sourceUID, chunks, externalServiceCall) } - mmDeleteChunksByUIDs.t.Fatalf("Unexpected call to RepositoryIMock.DeleteChunksByUIDs. %v %v", ctx, chunkUIDs) + mmDeleteAndCreateChunks.t.Fatalf("Unexpected call to RepositoryIMock.DeleteAndCreateChunks. %v %v %v %v %v", ctx, sourceTable, sourceUID, chunks, externalServiceCall) return } -// DeleteChunksByUIDsAfterCounter returns a count of finished RepositoryIMock.DeleteChunksByUIDs invocations -func (mmDeleteChunksByUIDs *RepositoryIMock) DeleteChunksByUIDsAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmDeleteChunksByUIDs.afterDeleteChunksByUIDsCounter) +// DeleteAndCreateChunksAfterCounter returns a count of finished RepositoryIMock.DeleteAndCreateChunks invocations +func (mmDeleteAndCreateChunks *RepositoryIMock) DeleteAndCreateChunksAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmDeleteAndCreateChunks.afterDeleteAndCreateChunksCounter) } -// DeleteChunksByUIDsBeforeCounter returns a count of RepositoryIMock.DeleteChunksByUIDs invocations -func (mmDeleteChunksByUIDs *RepositoryIMock) DeleteChunksByUIDsBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmDeleteChunksByUIDs.beforeDeleteChunksByUIDsCounter) +// DeleteAndCreateChunksBeforeCounter returns a count of RepositoryIMock.DeleteAndCreateChunks invocations +func (mmDeleteAndCreateChunks *RepositoryIMock) DeleteAndCreateChunksBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmDeleteAndCreateChunks.beforeDeleteAndCreateChunksCounter) } -// Calls returns a list of arguments used in each call to RepositoryIMock.DeleteChunksByUIDs. +// Calls returns a list of arguments used in each call to RepositoryIMock.DeleteAndCreateChunks. // The list is in the same order as the calls were made (i.e. recent calls have a higher index) -func (mmDeleteChunksByUIDs *mRepositoryIMockDeleteChunksByUIDs) Calls() []*RepositoryIMockDeleteChunksByUIDsParams { - mmDeleteChunksByUIDs.mutex.RLock() +func (mmDeleteAndCreateChunks *mRepositoryIMockDeleteAndCreateChunks) Calls() []*RepositoryIMockDeleteAndCreateChunksParams { + mmDeleteAndCreateChunks.mutex.RLock() - argCopy := make([]*RepositoryIMockDeleteChunksByUIDsParams, len(mmDeleteChunksByUIDs.callArgs)) - copy(argCopy, mmDeleteChunksByUIDs.callArgs) + argCopy := make([]*RepositoryIMockDeleteAndCreateChunksParams, len(mmDeleteAndCreateChunks.callArgs)) + copy(argCopy, mmDeleteAndCreateChunks.callArgs) - mmDeleteChunksByUIDs.mutex.RUnlock() + mmDeleteAndCreateChunks.mutex.RUnlock() return argCopy } -// MinimockDeleteChunksByUIDsDone returns true if the count of the DeleteChunksByUIDs invocations corresponds +// MinimockDeleteAndCreateChunksDone returns true if the count of the DeleteAndCreateChunks invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockDeleteChunksByUIDsDone() bool { - for _, e := range m.DeleteChunksByUIDsMock.expectations { +func (m *RepositoryIMock) MinimockDeleteAndCreateChunksDone() bool { + for _, e := range m.DeleteAndCreateChunksMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.DeleteChunksByUIDsMock.invocationsDone() + return m.DeleteAndCreateChunksMock.invocationsDone() } -// MinimockDeleteChunksByUIDsInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockDeleteChunksByUIDsInspect() { - for _, e := range m.DeleteChunksByUIDsMock.expectations { +// MinimockDeleteAndCreateChunksInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockDeleteAndCreateChunksInspect() { + for _, e := range m.DeleteAndCreateChunksMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { - m.t.Errorf("Expected call to RepositoryIMock.DeleteChunksByUIDs with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.DeleteAndCreateChunks with params: %#v", *e.params) } } - afterDeleteChunksByUIDsCounter := mm_atomic.LoadUint64(&m.afterDeleteChunksByUIDsCounter) + afterDeleteAndCreateChunksCounter := mm_atomic.LoadUint64(&m.afterDeleteAndCreateChunksCounter) // if default expectation was set then invocations count should be greater than zero - if m.DeleteChunksByUIDsMock.defaultExpectation != nil && afterDeleteChunksByUIDsCounter < 1 { - if m.DeleteChunksByUIDsMock.defaultExpectation.params == nil { - m.t.Error("Expected call to RepositoryIMock.DeleteChunksByUIDs") + if m.DeleteAndCreateChunksMock.defaultExpectation != nil && afterDeleteAndCreateChunksCounter < 1 { + if m.DeleteAndCreateChunksMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.DeleteAndCreateChunks") } else { - m.t.Errorf("Expected call to RepositoryIMock.DeleteChunksByUIDs with params: %#v", *m.DeleteChunksByUIDsMock.defaultExpectation.params) + m.t.Errorf("Expected call to RepositoryIMock.DeleteAndCreateChunks with params: %#v", *m.DeleteAndCreateChunksMock.defaultExpectation.params) } } // if func was set then invocations count should be greater than zero - if m.funcDeleteChunksByUIDs != nil && afterDeleteChunksByUIDsCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.DeleteChunksByUIDs") + if m.funcDeleteAndCreateChunks != nil && afterDeleteAndCreateChunksCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.DeleteAndCreateChunks") } - if !m.DeleteChunksByUIDsMock.invocationsDone() && afterDeleteChunksByUIDsCounter > 0 { - m.t.Errorf("Expected %d calls to RepositoryIMock.DeleteChunksByUIDs but found %d calls", - mm_atomic.LoadUint64(&m.DeleteChunksByUIDsMock.expectedInvocations), afterDeleteChunksByUIDsCounter) + if !m.DeleteAndCreateChunksMock.invocationsDone() && afterDeleteAndCreateChunksCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.DeleteAndCreateChunks but found %d calls", + mm_atomic.LoadUint64(&m.DeleteAndCreateChunksMock.expectedInvocations), afterDeleteAndCreateChunksCounter) } } -type mRepositoryIMockDeleteConvertedFile struct { +type mRepositoryIMockDeleteChunksBySource struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockDeleteConvertedFileExpectation - expectations []*RepositoryIMockDeleteConvertedFileExpectation + defaultExpectation *RepositoryIMockDeleteChunksBySourceExpectation + expectations []*RepositoryIMockDeleteChunksBySourceExpectation - callArgs []*RepositoryIMockDeleteConvertedFileParams + callArgs []*RepositoryIMockDeleteChunksBySourceParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockDeleteConvertedFileExpectation specifies expectation struct of the RepositoryI.DeleteConvertedFile -type RepositoryIMockDeleteConvertedFileExpectation struct { +// RepositoryIMockDeleteChunksBySourceExpectation specifies expectation struct of the RepositoryI.DeleteChunksBySource +type RepositoryIMockDeleteChunksBySourceExpectation struct { mock *RepositoryIMock - params *RepositoryIMockDeleteConvertedFileParams - paramPtrs *RepositoryIMockDeleteConvertedFileParamPtrs - results *RepositoryIMockDeleteConvertedFileResults + params *RepositoryIMockDeleteChunksBySourceParams + paramPtrs *RepositoryIMockDeleteChunksBySourceParamPtrs + results *RepositoryIMockDeleteChunksBySourceResults Counter uint64 } -// RepositoryIMockDeleteConvertedFileParams contains parameters of the RepositoryI.DeleteConvertedFile -type RepositoryIMockDeleteConvertedFileParams struct { - ctx context.Context - uid uuid.UUID +// RepositoryIMockDeleteChunksBySourceParams contains parameters of the RepositoryI.DeleteChunksBySource +type RepositoryIMockDeleteChunksBySourceParams struct { + ctx context.Context + sourceTable string + sourceUID uuid.UUID } -// RepositoryIMockDeleteConvertedFileParamPtrs contains pointers to parameters of the RepositoryI.DeleteConvertedFile -type RepositoryIMockDeleteConvertedFileParamPtrs struct { - ctx *context.Context - uid *uuid.UUID +// RepositoryIMockDeleteChunksBySourceParamPtrs contains pointers to parameters of the RepositoryI.DeleteChunksBySource +type RepositoryIMockDeleteChunksBySourceParamPtrs struct { + ctx *context.Context + sourceTable *string + sourceUID *uuid.UUID } -// RepositoryIMockDeleteConvertedFileResults contains results of the RepositoryI.DeleteConvertedFile -type RepositoryIMockDeleteConvertedFileResults struct { +// RepositoryIMockDeleteChunksBySourceResults contains results of the RepositoryI.DeleteChunksBySource +type RepositoryIMockDeleteChunksBySourceResults struct { err error } -// Expect sets up expected params for RepositoryI.DeleteConvertedFile -func (mmDeleteConvertedFile *mRepositoryIMockDeleteConvertedFile) Expect(ctx context.Context, uid uuid.UUID) *mRepositoryIMockDeleteConvertedFile { - if mmDeleteConvertedFile.mock.funcDeleteConvertedFile != nil { - mmDeleteConvertedFile.mock.t.Fatalf("RepositoryIMock.DeleteConvertedFile mock is already set by Set") +// Expect sets up expected params for RepositoryI.DeleteChunksBySource +func (mmDeleteChunksBySource *mRepositoryIMockDeleteChunksBySource) Expect(ctx context.Context, sourceTable string, sourceUID uuid.UUID) *mRepositoryIMockDeleteChunksBySource { + if mmDeleteChunksBySource.mock.funcDeleteChunksBySource != nil { + mmDeleteChunksBySource.mock.t.Fatalf("RepositoryIMock.DeleteChunksBySource mock is already set by Set") } - if mmDeleteConvertedFile.defaultExpectation == nil { - mmDeleteConvertedFile.defaultExpectation = &RepositoryIMockDeleteConvertedFileExpectation{} + if mmDeleteChunksBySource.defaultExpectation == nil { + mmDeleteChunksBySource.defaultExpectation = &RepositoryIMockDeleteChunksBySourceExpectation{} } - if mmDeleteConvertedFile.defaultExpectation.paramPtrs != nil { - mmDeleteConvertedFile.mock.t.Fatalf("RepositoryIMock.DeleteConvertedFile mock is already set by ExpectParams functions") + if mmDeleteChunksBySource.defaultExpectation.paramPtrs != nil { + mmDeleteChunksBySource.mock.t.Fatalf("RepositoryIMock.DeleteChunksBySource mock is already set by ExpectParams functions") } - mmDeleteConvertedFile.defaultExpectation.params = &RepositoryIMockDeleteConvertedFileParams{ctx, uid} - for _, e := range mmDeleteConvertedFile.expectations { - if minimock.Equal(e.params, mmDeleteConvertedFile.defaultExpectation.params) { - mmDeleteConvertedFile.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmDeleteConvertedFile.defaultExpectation.params) + mmDeleteChunksBySource.defaultExpectation.params = &RepositoryIMockDeleteChunksBySourceParams{ctx, sourceTable, sourceUID} + for _, e := range mmDeleteChunksBySource.expectations { + if minimock.Equal(e.params, mmDeleteChunksBySource.defaultExpectation.params) { + mmDeleteChunksBySource.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmDeleteChunksBySource.defaultExpectation.params) } } - return mmDeleteConvertedFile + return mmDeleteChunksBySource } -// ExpectCtxParam1 sets up expected param ctx for RepositoryI.DeleteConvertedFile -func (mmDeleteConvertedFile *mRepositoryIMockDeleteConvertedFile) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockDeleteConvertedFile { - if mmDeleteConvertedFile.mock.funcDeleteConvertedFile != nil { - mmDeleteConvertedFile.mock.t.Fatalf("RepositoryIMock.DeleteConvertedFile mock is already set by Set") +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.DeleteChunksBySource +func (mmDeleteChunksBySource *mRepositoryIMockDeleteChunksBySource) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockDeleteChunksBySource { + if mmDeleteChunksBySource.mock.funcDeleteChunksBySource != nil { + mmDeleteChunksBySource.mock.t.Fatalf("RepositoryIMock.DeleteChunksBySource mock is already set by Set") } - if mmDeleteConvertedFile.defaultExpectation == nil { - mmDeleteConvertedFile.defaultExpectation = &RepositoryIMockDeleteConvertedFileExpectation{} + if mmDeleteChunksBySource.defaultExpectation == nil { + mmDeleteChunksBySource.defaultExpectation = &RepositoryIMockDeleteChunksBySourceExpectation{} } - if mmDeleteConvertedFile.defaultExpectation.params != nil { - mmDeleteConvertedFile.mock.t.Fatalf("RepositoryIMock.DeleteConvertedFile mock is already set by Expect") + if mmDeleteChunksBySource.defaultExpectation.params != nil { + mmDeleteChunksBySource.mock.t.Fatalf("RepositoryIMock.DeleteChunksBySource mock is already set by Expect") } - if mmDeleteConvertedFile.defaultExpectation.paramPtrs == nil { - mmDeleteConvertedFile.defaultExpectation.paramPtrs = &RepositoryIMockDeleteConvertedFileParamPtrs{} + if mmDeleteChunksBySource.defaultExpectation.paramPtrs == nil { + mmDeleteChunksBySource.defaultExpectation.paramPtrs = &RepositoryIMockDeleteChunksBySourceParamPtrs{} } - mmDeleteConvertedFile.defaultExpectation.paramPtrs.ctx = &ctx + mmDeleteChunksBySource.defaultExpectation.paramPtrs.ctx = &ctx - return mmDeleteConvertedFile + return mmDeleteChunksBySource } -// ExpectUidParam2 sets up expected param uid for RepositoryI.DeleteConvertedFile -func (mmDeleteConvertedFile *mRepositoryIMockDeleteConvertedFile) ExpectUidParam2(uid uuid.UUID) *mRepositoryIMockDeleteConvertedFile { - if mmDeleteConvertedFile.mock.funcDeleteConvertedFile != nil { - mmDeleteConvertedFile.mock.t.Fatalf("RepositoryIMock.DeleteConvertedFile mock is already set by Set") +// ExpectSourceTableParam2 sets up expected param sourceTable for RepositoryI.DeleteChunksBySource +func (mmDeleteChunksBySource *mRepositoryIMockDeleteChunksBySource) ExpectSourceTableParam2(sourceTable string) *mRepositoryIMockDeleteChunksBySource { + if mmDeleteChunksBySource.mock.funcDeleteChunksBySource != nil { + mmDeleteChunksBySource.mock.t.Fatalf("RepositoryIMock.DeleteChunksBySource mock is already set by Set") } - if mmDeleteConvertedFile.defaultExpectation == nil { - mmDeleteConvertedFile.defaultExpectation = &RepositoryIMockDeleteConvertedFileExpectation{} + if mmDeleteChunksBySource.defaultExpectation == nil { + mmDeleteChunksBySource.defaultExpectation = &RepositoryIMockDeleteChunksBySourceExpectation{} } - if mmDeleteConvertedFile.defaultExpectation.params != nil { - mmDeleteConvertedFile.mock.t.Fatalf("RepositoryIMock.DeleteConvertedFile mock is already set by Expect") + if mmDeleteChunksBySource.defaultExpectation.params != nil { + mmDeleteChunksBySource.mock.t.Fatalf("RepositoryIMock.DeleteChunksBySource mock is already set by Expect") } - if mmDeleteConvertedFile.defaultExpectation.paramPtrs == nil { - mmDeleteConvertedFile.defaultExpectation.paramPtrs = &RepositoryIMockDeleteConvertedFileParamPtrs{} + if mmDeleteChunksBySource.defaultExpectation.paramPtrs == nil { + mmDeleteChunksBySource.defaultExpectation.paramPtrs = &RepositoryIMockDeleteChunksBySourceParamPtrs{} } - mmDeleteConvertedFile.defaultExpectation.paramPtrs.uid = &uid + mmDeleteChunksBySource.defaultExpectation.paramPtrs.sourceTable = &sourceTable - return mmDeleteConvertedFile + return mmDeleteChunksBySource } -// Inspect accepts an inspector function that has same arguments as the RepositoryI.DeleteConvertedFile -func (mmDeleteConvertedFile *mRepositoryIMockDeleteConvertedFile) Inspect(f func(ctx context.Context, uid uuid.UUID)) *mRepositoryIMockDeleteConvertedFile { - if mmDeleteConvertedFile.mock.inspectFuncDeleteConvertedFile != nil { - mmDeleteConvertedFile.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.DeleteConvertedFile") +// ExpectSourceUIDParam3 sets up expected param sourceUID for RepositoryI.DeleteChunksBySource +func (mmDeleteChunksBySource *mRepositoryIMockDeleteChunksBySource) ExpectSourceUIDParam3(sourceUID uuid.UUID) *mRepositoryIMockDeleteChunksBySource { + if mmDeleteChunksBySource.mock.funcDeleteChunksBySource != nil { + mmDeleteChunksBySource.mock.t.Fatalf("RepositoryIMock.DeleteChunksBySource mock is already set by Set") } - mmDeleteConvertedFile.mock.inspectFuncDeleteConvertedFile = f - - return mmDeleteConvertedFile -} + if mmDeleteChunksBySource.defaultExpectation == nil { + mmDeleteChunksBySource.defaultExpectation = &RepositoryIMockDeleteChunksBySourceExpectation{} + } -// Return sets up results that will be returned by RepositoryI.DeleteConvertedFile -func (mmDeleteConvertedFile *mRepositoryIMockDeleteConvertedFile) Return(err error) *RepositoryIMock { - if mmDeleteConvertedFile.mock.funcDeleteConvertedFile != nil { - mmDeleteConvertedFile.mock.t.Fatalf("RepositoryIMock.DeleteConvertedFile mock is already set by Set") + if mmDeleteChunksBySource.defaultExpectation.params != nil { + mmDeleteChunksBySource.mock.t.Fatalf("RepositoryIMock.DeleteChunksBySource mock is already set by Expect") } - if mmDeleteConvertedFile.defaultExpectation == nil { - mmDeleteConvertedFile.defaultExpectation = &RepositoryIMockDeleteConvertedFileExpectation{mock: mmDeleteConvertedFile.mock} + if mmDeleteChunksBySource.defaultExpectation.paramPtrs == nil { + mmDeleteChunksBySource.defaultExpectation.paramPtrs = &RepositoryIMockDeleteChunksBySourceParamPtrs{} } - mmDeleteConvertedFile.defaultExpectation.results = &RepositoryIMockDeleteConvertedFileResults{err} - return mmDeleteConvertedFile.mock + mmDeleteChunksBySource.defaultExpectation.paramPtrs.sourceUID = &sourceUID + + return mmDeleteChunksBySource } -// Set uses given function f to mock the RepositoryI.DeleteConvertedFile method -func (mmDeleteConvertedFile *mRepositoryIMockDeleteConvertedFile) Set(f func(ctx context.Context, uid uuid.UUID) (err error)) *RepositoryIMock { - if mmDeleteConvertedFile.defaultExpectation != nil { - mmDeleteConvertedFile.mock.t.Fatalf("Default expectation is already set for the RepositoryI.DeleteConvertedFile method") +// Inspect accepts an inspector function that has same arguments as the RepositoryI.DeleteChunksBySource +func (mmDeleteChunksBySource *mRepositoryIMockDeleteChunksBySource) Inspect(f func(ctx context.Context, sourceTable string, sourceUID uuid.UUID)) *mRepositoryIMockDeleteChunksBySource { + if mmDeleteChunksBySource.mock.inspectFuncDeleteChunksBySource != nil { + mmDeleteChunksBySource.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.DeleteChunksBySource") } - if len(mmDeleteConvertedFile.expectations) > 0 { - mmDeleteConvertedFile.mock.t.Fatalf("Some expectations are already set for the RepositoryI.DeleteConvertedFile method") - } + mmDeleteChunksBySource.mock.inspectFuncDeleteChunksBySource = f - mmDeleteConvertedFile.mock.funcDeleteConvertedFile = f - return mmDeleteConvertedFile.mock + return mmDeleteChunksBySource } -// When sets expectation for the RepositoryI.DeleteConvertedFile which will trigger the result defined by the following -// Then helper -func (mmDeleteConvertedFile *mRepositoryIMockDeleteConvertedFile) When(ctx context.Context, uid uuid.UUID) *RepositoryIMockDeleteConvertedFileExpectation { - if mmDeleteConvertedFile.mock.funcDeleteConvertedFile != nil { - mmDeleteConvertedFile.mock.t.Fatalf("RepositoryIMock.DeleteConvertedFile mock is already set by Set") +// Return sets up results that will be returned by RepositoryI.DeleteChunksBySource +func (mmDeleteChunksBySource *mRepositoryIMockDeleteChunksBySource) Return(err error) *RepositoryIMock { + if mmDeleteChunksBySource.mock.funcDeleteChunksBySource != nil { + mmDeleteChunksBySource.mock.t.Fatalf("RepositoryIMock.DeleteChunksBySource mock is already set by Set") } - expectation := &RepositoryIMockDeleteConvertedFileExpectation{ - mock: mmDeleteConvertedFile.mock, - params: &RepositoryIMockDeleteConvertedFileParams{ctx, uid}, + if mmDeleteChunksBySource.defaultExpectation == nil { + mmDeleteChunksBySource.defaultExpectation = &RepositoryIMockDeleteChunksBySourceExpectation{mock: mmDeleteChunksBySource.mock} } - mmDeleteConvertedFile.expectations = append(mmDeleteConvertedFile.expectations, expectation) + mmDeleteChunksBySource.defaultExpectation.results = &RepositoryIMockDeleteChunksBySourceResults{err} + return mmDeleteChunksBySource.mock +} + +// Set uses given function f to mock the RepositoryI.DeleteChunksBySource method +func (mmDeleteChunksBySource *mRepositoryIMockDeleteChunksBySource) Set(f func(ctx context.Context, sourceTable string, sourceUID uuid.UUID) (err error)) *RepositoryIMock { + if mmDeleteChunksBySource.defaultExpectation != nil { + mmDeleteChunksBySource.mock.t.Fatalf("Default expectation is already set for the RepositoryI.DeleteChunksBySource method") + } + + if len(mmDeleteChunksBySource.expectations) > 0 { + mmDeleteChunksBySource.mock.t.Fatalf("Some expectations are already set for the RepositoryI.DeleteChunksBySource method") + } + + mmDeleteChunksBySource.mock.funcDeleteChunksBySource = f + return mmDeleteChunksBySource.mock +} + +// When sets expectation for the RepositoryI.DeleteChunksBySource which will trigger the result defined by the following +// Then helper +func (mmDeleteChunksBySource *mRepositoryIMockDeleteChunksBySource) When(ctx context.Context, sourceTable string, sourceUID uuid.UUID) *RepositoryIMockDeleteChunksBySourceExpectation { + if mmDeleteChunksBySource.mock.funcDeleteChunksBySource != nil { + mmDeleteChunksBySource.mock.t.Fatalf("RepositoryIMock.DeleteChunksBySource mock is already set by Set") + } + + expectation := &RepositoryIMockDeleteChunksBySourceExpectation{ + mock: mmDeleteChunksBySource.mock, + params: &RepositoryIMockDeleteChunksBySourceParams{ctx, sourceTable, sourceUID}, + } + mmDeleteChunksBySource.expectations = append(mmDeleteChunksBySource.expectations, expectation) return expectation } -// Then sets up RepositoryI.DeleteConvertedFile return parameters for the expectation previously defined by the When method -func (e *RepositoryIMockDeleteConvertedFileExpectation) Then(err error) *RepositoryIMock { - e.results = &RepositoryIMockDeleteConvertedFileResults{err} +// Then sets up RepositoryI.DeleteChunksBySource return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockDeleteChunksBySourceExpectation) Then(err error) *RepositoryIMock { + e.results = &RepositoryIMockDeleteChunksBySourceResults{err} return e.mock } -// Times sets number of times RepositoryI.DeleteConvertedFile should be invoked -func (mmDeleteConvertedFile *mRepositoryIMockDeleteConvertedFile) Times(n uint64) *mRepositoryIMockDeleteConvertedFile { +// Times sets number of times RepositoryI.DeleteChunksBySource should be invoked +func (mmDeleteChunksBySource *mRepositoryIMockDeleteChunksBySource) Times(n uint64) *mRepositoryIMockDeleteChunksBySource { if n == 0 { - mmDeleteConvertedFile.mock.t.Fatalf("Times of RepositoryIMock.DeleteConvertedFile mock can not be zero") + mmDeleteChunksBySource.mock.t.Fatalf("Times of RepositoryIMock.DeleteChunksBySource mock can not be zero") } - mm_atomic.StoreUint64(&mmDeleteConvertedFile.expectedInvocations, n) - return mmDeleteConvertedFile + mm_atomic.StoreUint64(&mmDeleteChunksBySource.expectedInvocations, n) + return mmDeleteChunksBySource } -func (mmDeleteConvertedFile *mRepositoryIMockDeleteConvertedFile) invocationsDone() bool { - if len(mmDeleteConvertedFile.expectations) == 0 && mmDeleteConvertedFile.defaultExpectation == nil && mmDeleteConvertedFile.mock.funcDeleteConvertedFile == nil { +func (mmDeleteChunksBySource *mRepositoryIMockDeleteChunksBySource) invocationsDone() bool { + if len(mmDeleteChunksBySource.expectations) == 0 && mmDeleteChunksBySource.defaultExpectation == nil && mmDeleteChunksBySource.mock.funcDeleteChunksBySource == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmDeleteConvertedFile.mock.afterDeleteConvertedFileCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmDeleteConvertedFile.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmDeleteChunksBySource.mock.afterDeleteChunksBySourceCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmDeleteChunksBySource.expectedInvocations) return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) } -// DeleteConvertedFile implements repository.RepositoryI -func (mmDeleteConvertedFile *RepositoryIMock) DeleteConvertedFile(ctx context.Context, uid uuid.UUID) (err error) { - mm_atomic.AddUint64(&mmDeleteConvertedFile.beforeDeleteConvertedFileCounter, 1) - defer mm_atomic.AddUint64(&mmDeleteConvertedFile.afterDeleteConvertedFileCounter, 1) +// DeleteChunksBySource implements repository.RepositoryI +func (mmDeleteChunksBySource *RepositoryIMock) DeleteChunksBySource(ctx context.Context, sourceTable string, sourceUID uuid.UUID) (err error) { + mm_atomic.AddUint64(&mmDeleteChunksBySource.beforeDeleteChunksBySourceCounter, 1) + defer mm_atomic.AddUint64(&mmDeleteChunksBySource.afterDeleteChunksBySourceCounter, 1) - if mmDeleteConvertedFile.inspectFuncDeleteConvertedFile != nil { - mmDeleteConvertedFile.inspectFuncDeleteConvertedFile(ctx, uid) + if mmDeleteChunksBySource.inspectFuncDeleteChunksBySource != nil { + mmDeleteChunksBySource.inspectFuncDeleteChunksBySource(ctx, sourceTable, sourceUID) } - mm_params := RepositoryIMockDeleteConvertedFileParams{ctx, uid} + mm_params := RepositoryIMockDeleteChunksBySourceParams{ctx, sourceTable, sourceUID} // Record call args - mmDeleteConvertedFile.DeleteConvertedFileMock.mutex.Lock() - mmDeleteConvertedFile.DeleteConvertedFileMock.callArgs = append(mmDeleteConvertedFile.DeleteConvertedFileMock.callArgs, &mm_params) - mmDeleteConvertedFile.DeleteConvertedFileMock.mutex.Unlock() + mmDeleteChunksBySource.DeleteChunksBySourceMock.mutex.Lock() + mmDeleteChunksBySource.DeleteChunksBySourceMock.callArgs = append(mmDeleteChunksBySource.DeleteChunksBySourceMock.callArgs, &mm_params) + mmDeleteChunksBySource.DeleteChunksBySourceMock.mutex.Unlock() - for _, e := range mmDeleteConvertedFile.DeleteConvertedFileMock.expectations { + for _, e := range mmDeleteChunksBySource.DeleteChunksBySourceMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) return e.results.err } } - if mmDeleteConvertedFile.DeleteConvertedFileMock.defaultExpectation != nil { - mm_atomic.AddUint64(&mmDeleteConvertedFile.DeleteConvertedFileMock.defaultExpectation.Counter, 1) - mm_want := mmDeleteConvertedFile.DeleteConvertedFileMock.defaultExpectation.params - mm_want_ptrs := mmDeleteConvertedFile.DeleteConvertedFileMock.defaultExpectation.paramPtrs + if mmDeleteChunksBySource.DeleteChunksBySourceMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmDeleteChunksBySource.DeleteChunksBySourceMock.defaultExpectation.Counter, 1) + mm_want := mmDeleteChunksBySource.DeleteChunksBySourceMock.defaultExpectation.params + mm_want_ptrs := mmDeleteChunksBySource.DeleteChunksBySourceMock.defaultExpectation.paramPtrs - mm_got := RepositoryIMockDeleteConvertedFileParams{ctx, uid} + mm_got := RepositoryIMockDeleteChunksBySourceParams{ctx, sourceTable, sourceUID} if mm_want_ptrs != nil { if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { - mmDeleteConvertedFile.t.Errorf("RepositoryIMock.DeleteConvertedFile got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) + mmDeleteChunksBySource.t.Errorf("RepositoryIMock.DeleteChunksBySource got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) } - if mm_want_ptrs.uid != nil && !minimock.Equal(*mm_want_ptrs.uid, mm_got.uid) { - mmDeleteConvertedFile.t.Errorf("RepositoryIMock.DeleteConvertedFile got unexpected parameter uid, want: %#v, got: %#v%s\n", *mm_want_ptrs.uid, mm_got.uid, minimock.Diff(*mm_want_ptrs.uid, mm_got.uid)) + if mm_want_ptrs.sourceTable != nil && !minimock.Equal(*mm_want_ptrs.sourceTable, mm_got.sourceTable) { + mmDeleteChunksBySource.t.Errorf("RepositoryIMock.DeleteChunksBySource got unexpected parameter sourceTable, want: %#v, got: %#v%s\n", *mm_want_ptrs.sourceTable, mm_got.sourceTable, minimock.Diff(*mm_want_ptrs.sourceTable, mm_got.sourceTable)) + } + + if mm_want_ptrs.sourceUID != nil && !minimock.Equal(*mm_want_ptrs.sourceUID, mm_got.sourceUID) { + mmDeleteChunksBySource.t.Errorf("RepositoryIMock.DeleteChunksBySource got unexpected parameter sourceUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.sourceUID, mm_got.sourceUID, minimock.Diff(*mm_want_ptrs.sourceUID, mm_got.sourceUID)) } } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { - mmDeleteConvertedFile.t.Errorf("RepositoryIMock.DeleteConvertedFile got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + mmDeleteChunksBySource.t.Errorf("RepositoryIMock.DeleteChunksBySource got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) } - mm_results := mmDeleteConvertedFile.DeleteConvertedFileMock.defaultExpectation.results + mm_results := mmDeleteChunksBySource.DeleteChunksBySourceMock.defaultExpectation.results if mm_results == nil { - mmDeleteConvertedFile.t.Fatal("No results are set for the RepositoryIMock.DeleteConvertedFile") + mmDeleteChunksBySource.t.Fatal("No results are set for the RepositoryIMock.DeleteChunksBySource") } return (*mm_results).err } - if mmDeleteConvertedFile.funcDeleteConvertedFile != nil { - return mmDeleteConvertedFile.funcDeleteConvertedFile(ctx, uid) + if mmDeleteChunksBySource.funcDeleteChunksBySource != nil { + return mmDeleteChunksBySource.funcDeleteChunksBySource(ctx, sourceTable, sourceUID) } - mmDeleteConvertedFile.t.Fatalf("Unexpected call to RepositoryIMock.DeleteConvertedFile. %v %v", ctx, uid) + mmDeleteChunksBySource.t.Fatalf("Unexpected call to RepositoryIMock.DeleteChunksBySource. %v %v %v", ctx, sourceTable, sourceUID) return } -// DeleteConvertedFileAfterCounter returns a count of finished RepositoryIMock.DeleteConvertedFile invocations -func (mmDeleteConvertedFile *RepositoryIMock) DeleteConvertedFileAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmDeleteConvertedFile.afterDeleteConvertedFileCounter) +// DeleteChunksBySourceAfterCounter returns a count of finished RepositoryIMock.DeleteChunksBySource invocations +func (mmDeleteChunksBySource *RepositoryIMock) DeleteChunksBySourceAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmDeleteChunksBySource.afterDeleteChunksBySourceCounter) } -// DeleteConvertedFileBeforeCounter returns a count of RepositoryIMock.DeleteConvertedFile invocations -func (mmDeleteConvertedFile *RepositoryIMock) DeleteConvertedFileBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmDeleteConvertedFile.beforeDeleteConvertedFileCounter) +// DeleteChunksBySourceBeforeCounter returns a count of RepositoryIMock.DeleteChunksBySource invocations +func (mmDeleteChunksBySource *RepositoryIMock) DeleteChunksBySourceBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmDeleteChunksBySource.beforeDeleteChunksBySourceCounter) } -// Calls returns a list of arguments used in each call to RepositoryIMock.DeleteConvertedFile. +// Calls returns a list of arguments used in each call to RepositoryIMock.DeleteChunksBySource. // The list is in the same order as the calls were made (i.e. recent calls have a higher index) -func (mmDeleteConvertedFile *mRepositoryIMockDeleteConvertedFile) Calls() []*RepositoryIMockDeleteConvertedFileParams { - mmDeleteConvertedFile.mutex.RLock() +func (mmDeleteChunksBySource *mRepositoryIMockDeleteChunksBySource) Calls() []*RepositoryIMockDeleteChunksBySourceParams { + mmDeleteChunksBySource.mutex.RLock() - argCopy := make([]*RepositoryIMockDeleteConvertedFileParams, len(mmDeleteConvertedFile.callArgs)) - copy(argCopy, mmDeleteConvertedFile.callArgs) + argCopy := make([]*RepositoryIMockDeleteChunksBySourceParams, len(mmDeleteChunksBySource.callArgs)) + copy(argCopy, mmDeleteChunksBySource.callArgs) - mmDeleteConvertedFile.mutex.RUnlock() + mmDeleteChunksBySource.mutex.RUnlock() return argCopy } -// MinimockDeleteConvertedFileDone returns true if the count of the DeleteConvertedFile invocations corresponds +// MinimockDeleteChunksBySourceDone returns true if the count of the DeleteChunksBySource invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockDeleteConvertedFileDone() bool { - for _, e := range m.DeleteConvertedFileMock.expectations { +func (m *RepositoryIMock) MinimockDeleteChunksBySourceDone() bool { + for _, e := range m.DeleteChunksBySourceMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.DeleteConvertedFileMock.invocationsDone() + return m.DeleteChunksBySourceMock.invocationsDone() } -// MinimockDeleteConvertedFileInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockDeleteConvertedFileInspect() { - for _, e := range m.DeleteConvertedFileMock.expectations { +// MinimockDeleteChunksBySourceInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockDeleteChunksBySourceInspect() { + for _, e := range m.DeleteChunksBySourceMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { - m.t.Errorf("Expected call to RepositoryIMock.DeleteConvertedFile with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.DeleteChunksBySource with params: %#v", *e.params) } } - afterDeleteConvertedFileCounter := mm_atomic.LoadUint64(&m.afterDeleteConvertedFileCounter) + afterDeleteChunksBySourceCounter := mm_atomic.LoadUint64(&m.afterDeleteChunksBySourceCounter) // if default expectation was set then invocations count should be greater than zero - if m.DeleteConvertedFileMock.defaultExpectation != nil && afterDeleteConvertedFileCounter < 1 { - if m.DeleteConvertedFileMock.defaultExpectation.params == nil { - m.t.Error("Expected call to RepositoryIMock.DeleteConvertedFile") + if m.DeleteChunksBySourceMock.defaultExpectation != nil && afterDeleteChunksBySourceCounter < 1 { + if m.DeleteChunksBySourceMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.DeleteChunksBySource") } else { - m.t.Errorf("Expected call to RepositoryIMock.DeleteConvertedFile with params: %#v", *m.DeleteConvertedFileMock.defaultExpectation.params) + m.t.Errorf("Expected call to RepositoryIMock.DeleteChunksBySource with params: %#v", *m.DeleteChunksBySourceMock.defaultExpectation.params) } } // if func was set then invocations count should be greater than zero - if m.funcDeleteConvertedFile != nil && afterDeleteConvertedFileCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.DeleteConvertedFile") + if m.funcDeleteChunksBySource != nil && afterDeleteChunksBySourceCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.DeleteChunksBySource") } - if !m.DeleteConvertedFileMock.invocationsDone() && afterDeleteConvertedFileCounter > 0 { - m.t.Errorf("Expected %d calls to RepositoryIMock.DeleteConvertedFile but found %d calls", - mm_atomic.LoadUint64(&m.DeleteConvertedFileMock.expectedInvocations), afterDeleteConvertedFileCounter) + if !m.DeleteChunksBySourceMock.invocationsDone() && afterDeleteChunksBySourceCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.DeleteChunksBySource but found %d calls", + mm_atomic.LoadUint64(&m.DeleteChunksBySourceMock.expectedInvocations), afterDeleteChunksBySourceCounter) } } -type mRepositoryIMockDeleteEmbeddingsBySource struct { +type mRepositoryIMockDeleteChunksByUIDs struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockDeleteEmbeddingsBySourceExpectation - expectations []*RepositoryIMockDeleteEmbeddingsBySourceExpectation + defaultExpectation *RepositoryIMockDeleteChunksByUIDsExpectation + expectations []*RepositoryIMockDeleteChunksByUIDsExpectation - callArgs []*RepositoryIMockDeleteEmbeddingsBySourceParams + callArgs []*RepositoryIMockDeleteChunksByUIDsParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockDeleteEmbeddingsBySourceExpectation specifies expectation struct of the RepositoryI.DeleteEmbeddingsBySource -type RepositoryIMockDeleteEmbeddingsBySourceExpectation struct { +// RepositoryIMockDeleteChunksByUIDsExpectation specifies expectation struct of the RepositoryI.DeleteChunksByUIDs +type RepositoryIMockDeleteChunksByUIDsExpectation struct { mock *RepositoryIMock - params *RepositoryIMockDeleteEmbeddingsBySourceParams - paramPtrs *RepositoryIMockDeleteEmbeddingsBySourceParamPtrs - results *RepositoryIMockDeleteEmbeddingsBySourceResults + params *RepositoryIMockDeleteChunksByUIDsParams + paramPtrs *RepositoryIMockDeleteChunksByUIDsParamPtrs + results *RepositoryIMockDeleteChunksByUIDsResults Counter uint64 } -// RepositoryIMockDeleteEmbeddingsBySourceParams contains parameters of the RepositoryI.DeleteEmbeddingsBySource -type RepositoryIMockDeleteEmbeddingsBySourceParams struct { - ctx context.Context - sourceTable string - sourceUID uuid.UUID +// RepositoryIMockDeleteChunksByUIDsParams contains parameters of the RepositoryI.DeleteChunksByUIDs +type RepositoryIMockDeleteChunksByUIDsParams struct { + ctx context.Context + chunkUIDs []uuid.UUID } -// RepositoryIMockDeleteEmbeddingsBySourceParamPtrs contains pointers to parameters of the RepositoryI.DeleteEmbeddingsBySource -type RepositoryIMockDeleteEmbeddingsBySourceParamPtrs struct { - ctx *context.Context - sourceTable *string - sourceUID *uuid.UUID +// RepositoryIMockDeleteChunksByUIDsParamPtrs contains pointers to parameters of the RepositoryI.DeleteChunksByUIDs +type RepositoryIMockDeleteChunksByUIDsParamPtrs struct { + ctx *context.Context + chunkUIDs *[]uuid.UUID } -// RepositoryIMockDeleteEmbeddingsBySourceResults contains results of the RepositoryI.DeleteEmbeddingsBySource -type RepositoryIMockDeleteEmbeddingsBySourceResults struct { +// RepositoryIMockDeleteChunksByUIDsResults contains results of the RepositoryI.DeleteChunksByUIDs +type RepositoryIMockDeleteChunksByUIDsResults struct { err error } -// Expect sets up expected params for RepositoryI.DeleteEmbeddingsBySource -func (mmDeleteEmbeddingsBySource *mRepositoryIMockDeleteEmbeddingsBySource) Expect(ctx context.Context, sourceTable string, sourceUID uuid.UUID) *mRepositoryIMockDeleteEmbeddingsBySource { - if mmDeleteEmbeddingsBySource.mock.funcDeleteEmbeddingsBySource != nil { - mmDeleteEmbeddingsBySource.mock.t.Fatalf("RepositoryIMock.DeleteEmbeddingsBySource mock is already set by Set") +// Expect sets up expected params for RepositoryI.DeleteChunksByUIDs +func (mmDeleteChunksByUIDs *mRepositoryIMockDeleteChunksByUIDs) Expect(ctx context.Context, chunkUIDs []uuid.UUID) *mRepositoryIMockDeleteChunksByUIDs { + if mmDeleteChunksByUIDs.mock.funcDeleteChunksByUIDs != nil { + mmDeleteChunksByUIDs.mock.t.Fatalf("RepositoryIMock.DeleteChunksByUIDs mock is already set by Set") } - if mmDeleteEmbeddingsBySource.defaultExpectation == nil { - mmDeleteEmbeddingsBySource.defaultExpectation = &RepositoryIMockDeleteEmbeddingsBySourceExpectation{} + if mmDeleteChunksByUIDs.defaultExpectation == nil { + mmDeleteChunksByUIDs.defaultExpectation = &RepositoryIMockDeleteChunksByUIDsExpectation{} } - if mmDeleteEmbeddingsBySource.defaultExpectation.paramPtrs != nil { - mmDeleteEmbeddingsBySource.mock.t.Fatalf("RepositoryIMock.DeleteEmbeddingsBySource mock is already set by ExpectParams functions") + if mmDeleteChunksByUIDs.defaultExpectation.paramPtrs != nil { + mmDeleteChunksByUIDs.mock.t.Fatalf("RepositoryIMock.DeleteChunksByUIDs mock is already set by ExpectParams functions") } - mmDeleteEmbeddingsBySource.defaultExpectation.params = &RepositoryIMockDeleteEmbeddingsBySourceParams{ctx, sourceTable, sourceUID} - for _, e := range mmDeleteEmbeddingsBySource.expectations { - if minimock.Equal(e.params, mmDeleteEmbeddingsBySource.defaultExpectation.params) { - mmDeleteEmbeddingsBySource.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmDeleteEmbeddingsBySource.defaultExpectation.params) + mmDeleteChunksByUIDs.defaultExpectation.params = &RepositoryIMockDeleteChunksByUIDsParams{ctx, chunkUIDs} + for _, e := range mmDeleteChunksByUIDs.expectations { + if minimock.Equal(e.params, mmDeleteChunksByUIDs.defaultExpectation.params) { + mmDeleteChunksByUIDs.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmDeleteChunksByUIDs.defaultExpectation.params) } } - return mmDeleteEmbeddingsBySource + return mmDeleteChunksByUIDs } -// ExpectCtxParam1 sets up expected param ctx for RepositoryI.DeleteEmbeddingsBySource -func (mmDeleteEmbeddingsBySource *mRepositoryIMockDeleteEmbeddingsBySource) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockDeleteEmbeddingsBySource { - if mmDeleteEmbeddingsBySource.mock.funcDeleteEmbeddingsBySource != nil { - mmDeleteEmbeddingsBySource.mock.t.Fatalf("RepositoryIMock.DeleteEmbeddingsBySource mock is already set by Set") +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.DeleteChunksByUIDs +func (mmDeleteChunksByUIDs *mRepositoryIMockDeleteChunksByUIDs) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockDeleteChunksByUIDs { + if mmDeleteChunksByUIDs.mock.funcDeleteChunksByUIDs != nil { + mmDeleteChunksByUIDs.mock.t.Fatalf("RepositoryIMock.DeleteChunksByUIDs mock is already set by Set") } - if mmDeleteEmbeddingsBySource.defaultExpectation == nil { - mmDeleteEmbeddingsBySource.defaultExpectation = &RepositoryIMockDeleteEmbeddingsBySourceExpectation{} + if mmDeleteChunksByUIDs.defaultExpectation == nil { + mmDeleteChunksByUIDs.defaultExpectation = &RepositoryIMockDeleteChunksByUIDsExpectation{} } - if mmDeleteEmbeddingsBySource.defaultExpectation.params != nil { - mmDeleteEmbeddingsBySource.mock.t.Fatalf("RepositoryIMock.DeleteEmbeddingsBySource mock is already set by Expect") + if mmDeleteChunksByUIDs.defaultExpectation.params != nil { + mmDeleteChunksByUIDs.mock.t.Fatalf("RepositoryIMock.DeleteChunksByUIDs mock is already set by Expect") } - if mmDeleteEmbeddingsBySource.defaultExpectation.paramPtrs == nil { - mmDeleteEmbeddingsBySource.defaultExpectation.paramPtrs = &RepositoryIMockDeleteEmbeddingsBySourceParamPtrs{} + if mmDeleteChunksByUIDs.defaultExpectation.paramPtrs == nil { + mmDeleteChunksByUIDs.defaultExpectation.paramPtrs = &RepositoryIMockDeleteChunksByUIDsParamPtrs{} } - mmDeleteEmbeddingsBySource.defaultExpectation.paramPtrs.ctx = &ctx - - return mmDeleteEmbeddingsBySource -} - -// ExpectSourceTableParam2 sets up expected param sourceTable for RepositoryI.DeleteEmbeddingsBySource -func (mmDeleteEmbeddingsBySource *mRepositoryIMockDeleteEmbeddingsBySource) ExpectSourceTableParam2(sourceTable string) *mRepositoryIMockDeleteEmbeddingsBySource { - if mmDeleteEmbeddingsBySource.mock.funcDeleteEmbeddingsBySource != nil { - mmDeleteEmbeddingsBySource.mock.t.Fatalf("RepositoryIMock.DeleteEmbeddingsBySource mock is already set by Set") - } - - if mmDeleteEmbeddingsBySource.defaultExpectation == nil { - mmDeleteEmbeddingsBySource.defaultExpectation = &RepositoryIMockDeleteEmbeddingsBySourceExpectation{} - } - - if mmDeleteEmbeddingsBySource.defaultExpectation.params != nil { - mmDeleteEmbeddingsBySource.mock.t.Fatalf("RepositoryIMock.DeleteEmbeddingsBySource mock is already set by Expect") - } - - if mmDeleteEmbeddingsBySource.defaultExpectation.paramPtrs == nil { - mmDeleteEmbeddingsBySource.defaultExpectation.paramPtrs = &RepositoryIMockDeleteEmbeddingsBySourceParamPtrs{} - } - mmDeleteEmbeddingsBySource.defaultExpectation.paramPtrs.sourceTable = &sourceTable + mmDeleteChunksByUIDs.defaultExpectation.paramPtrs.ctx = &ctx - return mmDeleteEmbeddingsBySource + return mmDeleteChunksByUIDs } -// ExpectSourceUIDParam3 sets up expected param sourceUID for RepositoryI.DeleteEmbeddingsBySource -func (mmDeleteEmbeddingsBySource *mRepositoryIMockDeleteEmbeddingsBySource) ExpectSourceUIDParam3(sourceUID uuid.UUID) *mRepositoryIMockDeleteEmbeddingsBySource { - if mmDeleteEmbeddingsBySource.mock.funcDeleteEmbeddingsBySource != nil { - mmDeleteEmbeddingsBySource.mock.t.Fatalf("RepositoryIMock.DeleteEmbeddingsBySource mock is already set by Set") +// ExpectChunkUIDsParam2 sets up expected param chunkUIDs for RepositoryI.DeleteChunksByUIDs +func (mmDeleteChunksByUIDs *mRepositoryIMockDeleteChunksByUIDs) ExpectChunkUIDsParam2(chunkUIDs []uuid.UUID) *mRepositoryIMockDeleteChunksByUIDs { + if mmDeleteChunksByUIDs.mock.funcDeleteChunksByUIDs != nil { + mmDeleteChunksByUIDs.mock.t.Fatalf("RepositoryIMock.DeleteChunksByUIDs mock is already set by Set") } - if mmDeleteEmbeddingsBySource.defaultExpectation == nil { - mmDeleteEmbeddingsBySource.defaultExpectation = &RepositoryIMockDeleteEmbeddingsBySourceExpectation{} + if mmDeleteChunksByUIDs.defaultExpectation == nil { + mmDeleteChunksByUIDs.defaultExpectation = &RepositoryIMockDeleteChunksByUIDsExpectation{} } - if mmDeleteEmbeddingsBySource.defaultExpectation.params != nil { - mmDeleteEmbeddingsBySource.mock.t.Fatalf("RepositoryIMock.DeleteEmbeddingsBySource mock is already set by Expect") + if mmDeleteChunksByUIDs.defaultExpectation.params != nil { + mmDeleteChunksByUIDs.mock.t.Fatalf("RepositoryIMock.DeleteChunksByUIDs mock is already set by Expect") } - if mmDeleteEmbeddingsBySource.defaultExpectation.paramPtrs == nil { - mmDeleteEmbeddingsBySource.defaultExpectation.paramPtrs = &RepositoryIMockDeleteEmbeddingsBySourceParamPtrs{} + if mmDeleteChunksByUIDs.defaultExpectation.paramPtrs == nil { + mmDeleteChunksByUIDs.defaultExpectation.paramPtrs = &RepositoryIMockDeleteChunksByUIDsParamPtrs{} } - mmDeleteEmbeddingsBySource.defaultExpectation.paramPtrs.sourceUID = &sourceUID + mmDeleteChunksByUIDs.defaultExpectation.paramPtrs.chunkUIDs = &chunkUIDs - return mmDeleteEmbeddingsBySource + return mmDeleteChunksByUIDs } -// Inspect accepts an inspector function that has same arguments as the RepositoryI.DeleteEmbeddingsBySource -func (mmDeleteEmbeddingsBySource *mRepositoryIMockDeleteEmbeddingsBySource) Inspect(f func(ctx context.Context, sourceTable string, sourceUID uuid.UUID)) *mRepositoryIMockDeleteEmbeddingsBySource { - if mmDeleteEmbeddingsBySource.mock.inspectFuncDeleteEmbeddingsBySource != nil { - mmDeleteEmbeddingsBySource.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.DeleteEmbeddingsBySource") +// Inspect accepts an inspector function that has same arguments as the RepositoryI.DeleteChunksByUIDs +func (mmDeleteChunksByUIDs *mRepositoryIMockDeleteChunksByUIDs) Inspect(f func(ctx context.Context, chunkUIDs []uuid.UUID)) *mRepositoryIMockDeleteChunksByUIDs { + if mmDeleteChunksByUIDs.mock.inspectFuncDeleteChunksByUIDs != nil { + mmDeleteChunksByUIDs.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.DeleteChunksByUIDs") } - mmDeleteEmbeddingsBySource.mock.inspectFuncDeleteEmbeddingsBySource = f + mmDeleteChunksByUIDs.mock.inspectFuncDeleteChunksByUIDs = f - return mmDeleteEmbeddingsBySource + return mmDeleteChunksByUIDs } -// Return sets up results that will be returned by RepositoryI.DeleteEmbeddingsBySource -func (mmDeleteEmbeddingsBySource *mRepositoryIMockDeleteEmbeddingsBySource) Return(err error) *RepositoryIMock { - if mmDeleteEmbeddingsBySource.mock.funcDeleteEmbeddingsBySource != nil { - mmDeleteEmbeddingsBySource.mock.t.Fatalf("RepositoryIMock.DeleteEmbeddingsBySource mock is already set by Set") +// Return sets up results that will be returned by RepositoryI.DeleteChunksByUIDs +func (mmDeleteChunksByUIDs *mRepositoryIMockDeleteChunksByUIDs) Return(err error) *RepositoryIMock { + if mmDeleteChunksByUIDs.mock.funcDeleteChunksByUIDs != nil { + mmDeleteChunksByUIDs.mock.t.Fatalf("RepositoryIMock.DeleteChunksByUIDs mock is already set by Set") } - if mmDeleteEmbeddingsBySource.defaultExpectation == nil { - mmDeleteEmbeddingsBySource.defaultExpectation = &RepositoryIMockDeleteEmbeddingsBySourceExpectation{mock: mmDeleteEmbeddingsBySource.mock} + if mmDeleteChunksByUIDs.defaultExpectation == nil { + mmDeleteChunksByUIDs.defaultExpectation = &RepositoryIMockDeleteChunksByUIDsExpectation{mock: mmDeleteChunksByUIDs.mock} } - mmDeleteEmbeddingsBySource.defaultExpectation.results = &RepositoryIMockDeleteEmbeddingsBySourceResults{err} - return mmDeleteEmbeddingsBySource.mock + mmDeleteChunksByUIDs.defaultExpectation.results = &RepositoryIMockDeleteChunksByUIDsResults{err} + return mmDeleteChunksByUIDs.mock } -// Set uses given function f to mock the RepositoryI.DeleteEmbeddingsBySource method -func (mmDeleteEmbeddingsBySource *mRepositoryIMockDeleteEmbeddingsBySource) Set(f func(ctx context.Context, sourceTable string, sourceUID uuid.UUID) (err error)) *RepositoryIMock { - if mmDeleteEmbeddingsBySource.defaultExpectation != nil { - mmDeleteEmbeddingsBySource.mock.t.Fatalf("Default expectation is already set for the RepositoryI.DeleteEmbeddingsBySource method") +// Set uses given function f to mock the RepositoryI.DeleteChunksByUIDs method +func (mmDeleteChunksByUIDs *mRepositoryIMockDeleteChunksByUIDs) Set(f func(ctx context.Context, chunkUIDs []uuid.UUID) (err error)) *RepositoryIMock { + if mmDeleteChunksByUIDs.defaultExpectation != nil { + mmDeleteChunksByUIDs.mock.t.Fatalf("Default expectation is already set for the RepositoryI.DeleteChunksByUIDs method") } - if len(mmDeleteEmbeddingsBySource.expectations) > 0 { - mmDeleteEmbeddingsBySource.mock.t.Fatalf("Some expectations are already set for the RepositoryI.DeleteEmbeddingsBySource method") + if len(mmDeleteChunksByUIDs.expectations) > 0 { + mmDeleteChunksByUIDs.mock.t.Fatalf("Some expectations are already set for the RepositoryI.DeleteChunksByUIDs method") } - mmDeleteEmbeddingsBySource.mock.funcDeleteEmbeddingsBySource = f - return mmDeleteEmbeddingsBySource.mock + mmDeleteChunksByUIDs.mock.funcDeleteChunksByUIDs = f + return mmDeleteChunksByUIDs.mock } -// When sets expectation for the RepositoryI.DeleteEmbeddingsBySource which will trigger the result defined by the following +// When sets expectation for the RepositoryI.DeleteChunksByUIDs which will trigger the result defined by the following // Then helper -func (mmDeleteEmbeddingsBySource *mRepositoryIMockDeleteEmbeddingsBySource) When(ctx context.Context, sourceTable string, sourceUID uuid.UUID) *RepositoryIMockDeleteEmbeddingsBySourceExpectation { - if mmDeleteEmbeddingsBySource.mock.funcDeleteEmbeddingsBySource != nil { - mmDeleteEmbeddingsBySource.mock.t.Fatalf("RepositoryIMock.DeleteEmbeddingsBySource mock is already set by Set") +func (mmDeleteChunksByUIDs *mRepositoryIMockDeleteChunksByUIDs) When(ctx context.Context, chunkUIDs []uuid.UUID) *RepositoryIMockDeleteChunksByUIDsExpectation { + if mmDeleteChunksByUIDs.mock.funcDeleteChunksByUIDs != nil { + mmDeleteChunksByUIDs.mock.t.Fatalf("RepositoryIMock.DeleteChunksByUIDs mock is already set by Set") } - expectation := &RepositoryIMockDeleteEmbeddingsBySourceExpectation{ - mock: mmDeleteEmbeddingsBySource.mock, - params: &RepositoryIMockDeleteEmbeddingsBySourceParams{ctx, sourceTable, sourceUID}, + expectation := &RepositoryIMockDeleteChunksByUIDsExpectation{ + mock: mmDeleteChunksByUIDs.mock, + params: &RepositoryIMockDeleteChunksByUIDsParams{ctx, chunkUIDs}, } - mmDeleteEmbeddingsBySource.expectations = append(mmDeleteEmbeddingsBySource.expectations, expectation) + mmDeleteChunksByUIDs.expectations = append(mmDeleteChunksByUIDs.expectations, expectation) return expectation } -// Then sets up RepositoryI.DeleteEmbeddingsBySource return parameters for the expectation previously defined by the When method -func (e *RepositoryIMockDeleteEmbeddingsBySourceExpectation) Then(err error) *RepositoryIMock { - e.results = &RepositoryIMockDeleteEmbeddingsBySourceResults{err} +// Then sets up RepositoryI.DeleteChunksByUIDs return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockDeleteChunksByUIDsExpectation) Then(err error) *RepositoryIMock { + e.results = &RepositoryIMockDeleteChunksByUIDsResults{err} return e.mock } -// Times sets number of times RepositoryI.DeleteEmbeddingsBySource should be invoked -func (mmDeleteEmbeddingsBySource *mRepositoryIMockDeleteEmbeddingsBySource) Times(n uint64) *mRepositoryIMockDeleteEmbeddingsBySource { +// Times sets number of times RepositoryI.DeleteChunksByUIDs should be invoked +func (mmDeleteChunksByUIDs *mRepositoryIMockDeleteChunksByUIDs) Times(n uint64) *mRepositoryIMockDeleteChunksByUIDs { if n == 0 { - mmDeleteEmbeddingsBySource.mock.t.Fatalf("Times of RepositoryIMock.DeleteEmbeddingsBySource mock can not be zero") + mmDeleteChunksByUIDs.mock.t.Fatalf("Times of RepositoryIMock.DeleteChunksByUIDs mock can not be zero") } - mm_atomic.StoreUint64(&mmDeleteEmbeddingsBySource.expectedInvocations, n) - return mmDeleteEmbeddingsBySource + mm_atomic.StoreUint64(&mmDeleteChunksByUIDs.expectedInvocations, n) + return mmDeleteChunksByUIDs } -func (mmDeleteEmbeddingsBySource *mRepositoryIMockDeleteEmbeddingsBySource) invocationsDone() bool { - if len(mmDeleteEmbeddingsBySource.expectations) == 0 && mmDeleteEmbeddingsBySource.defaultExpectation == nil && mmDeleteEmbeddingsBySource.mock.funcDeleteEmbeddingsBySource == nil { +func (mmDeleteChunksByUIDs *mRepositoryIMockDeleteChunksByUIDs) invocationsDone() bool { + if len(mmDeleteChunksByUIDs.expectations) == 0 && mmDeleteChunksByUIDs.defaultExpectation == nil && mmDeleteChunksByUIDs.mock.funcDeleteChunksByUIDs == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmDeleteEmbeddingsBySource.mock.afterDeleteEmbeddingsBySourceCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmDeleteEmbeddingsBySource.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmDeleteChunksByUIDs.mock.afterDeleteChunksByUIDsCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmDeleteChunksByUIDs.expectedInvocations) return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) } -// DeleteEmbeddingsBySource implements repository.RepositoryI -func (mmDeleteEmbeddingsBySource *RepositoryIMock) DeleteEmbeddingsBySource(ctx context.Context, sourceTable string, sourceUID uuid.UUID) (err error) { - mm_atomic.AddUint64(&mmDeleteEmbeddingsBySource.beforeDeleteEmbeddingsBySourceCounter, 1) - defer mm_atomic.AddUint64(&mmDeleteEmbeddingsBySource.afterDeleteEmbeddingsBySourceCounter, 1) +// DeleteChunksByUIDs implements repository.RepositoryI +func (mmDeleteChunksByUIDs *RepositoryIMock) DeleteChunksByUIDs(ctx context.Context, chunkUIDs []uuid.UUID) (err error) { + mm_atomic.AddUint64(&mmDeleteChunksByUIDs.beforeDeleteChunksByUIDsCounter, 1) + defer mm_atomic.AddUint64(&mmDeleteChunksByUIDs.afterDeleteChunksByUIDsCounter, 1) - if mmDeleteEmbeddingsBySource.inspectFuncDeleteEmbeddingsBySource != nil { - mmDeleteEmbeddingsBySource.inspectFuncDeleteEmbeddingsBySource(ctx, sourceTable, sourceUID) + if mmDeleteChunksByUIDs.inspectFuncDeleteChunksByUIDs != nil { + mmDeleteChunksByUIDs.inspectFuncDeleteChunksByUIDs(ctx, chunkUIDs) } - mm_params := RepositoryIMockDeleteEmbeddingsBySourceParams{ctx, sourceTable, sourceUID} + mm_params := RepositoryIMockDeleteChunksByUIDsParams{ctx, chunkUIDs} // Record call args - mmDeleteEmbeddingsBySource.DeleteEmbeddingsBySourceMock.mutex.Lock() - mmDeleteEmbeddingsBySource.DeleteEmbeddingsBySourceMock.callArgs = append(mmDeleteEmbeddingsBySource.DeleteEmbeddingsBySourceMock.callArgs, &mm_params) - mmDeleteEmbeddingsBySource.DeleteEmbeddingsBySourceMock.mutex.Unlock() + mmDeleteChunksByUIDs.DeleteChunksByUIDsMock.mutex.Lock() + mmDeleteChunksByUIDs.DeleteChunksByUIDsMock.callArgs = append(mmDeleteChunksByUIDs.DeleteChunksByUIDsMock.callArgs, &mm_params) + mmDeleteChunksByUIDs.DeleteChunksByUIDsMock.mutex.Unlock() - for _, e := range mmDeleteEmbeddingsBySource.DeleteEmbeddingsBySourceMock.expectations { + for _, e := range mmDeleteChunksByUIDs.DeleteChunksByUIDsMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) return e.results.err } } - if mmDeleteEmbeddingsBySource.DeleteEmbeddingsBySourceMock.defaultExpectation != nil { - mm_atomic.AddUint64(&mmDeleteEmbeddingsBySource.DeleteEmbeddingsBySourceMock.defaultExpectation.Counter, 1) - mm_want := mmDeleteEmbeddingsBySource.DeleteEmbeddingsBySourceMock.defaultExpectation.params - mm_want_ptrs := mmDeleteEmbeddingsBySource.DeleteEmbeddingsBySourceMock.defaultExpectation.paramPtrs + if mmDeleteChunksByUIDs.DeleteChunksByUIDsMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmDeleteChunksByUIDs.DeleteChunksByUIDsMock.defaultExpectation.Counter, 1) + mm_want := mmDeleteChunksByUIDs.DeleteChunksByUIDsMock.defaultExpectation.params + mm_want_ptrs := mmDeleteChunksByUIDs.DeleteChunksByUIDsMock.defaultExpectation.paramPtrs - mm_got := RepositoryIMockDeleteEmbeddingsBySourceParams{ctx, sourceTable, sourceUID} + mm_got := RepositoryIMockDeleteChunksByUIDsParams{ctx, chunkUIDs} if mm_want_ptrs != nil { if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { - mmDeleteEmbeddingsBySource.t.Errorf("RepositoryIMock.DeleteEmbeddingsBySource got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) - } - - if mm_want_ptrs.sourceTable != nil && !minimock.Equal(*mm_want_ptrs.sourceTable, mm_got.sourceTable) { - mmDeleteEmbeddingsBySource.t.Errorf("RepositoryIMock.DeleteEmbeddingsBySource got unexpected parameter sourceTable, want: %#v, got: %#v%s\n", *mm_want_ptrs.sourceTable, mm_got.sourceTable, minimock.Diff(*mm_want_ptrs.sourceTable, mm_got.sourceTable)) + mmDeleteChunksByUIDs.t.Errorf("RepositoryIMock.DeleteChunksByUIDs got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) } - if mm_want_ptrs.sourceUID != nil && !minimock.Equal(*mm_want_ptrs.sourceUID, mm_got.sourceUID) { - mmDeleteEmbeddingsBySource.t.Errorf("RepositoryIMock.DeleteEmbeddingsBySource got unexpected parameter sourceUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.sourceUID, mm_got.sourceUID, minimock.Diff(*mm_want_ptrs.sourceUID, mm_got.sourceUID)) + if mm_want_ptrs.chunkUIDs != nil && !minimock.Equal(*mm_want_ptrs.chunkUIDs, mm_got.chunkUIDs) { + mmDeleteChunksByUIDs.t.Errorf("RepositoryIMock.DeleteChunksByUIDs got unexpected parameter chunkUIDs, want: %#v, got: %#v%s\n", *mm_want_ptrs.chunkUIDs, mm_got.chunkUIDs, minimock.Diff(*mm_want_ptrs.chunkUIDs, mm_got.chunkUIDs)) } } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { - mmDeleteEmbeddingsBySource.t.Errorf("RepositoryIMock.DeleteEmbeddingsBySource got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + mmDeleteChunksByUIDs.t.Errorf("RepositoryIMock.DeleteChunksByUIDs got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) } - mm_results := mmDeleteEmbeddingsBySource.DeleteEmbeddingsBySourceMock.defaultExpectation.results + mm_results := mmDeleteChunksByUIDs.DeleteChunksByUIDsMock.defaultExpectation.results if mm_results == nil { - mmDeleteEmbeddingsBySource.t.Fatal("No results are set for the RepositoryIMock.DeleteEmbeddingsBySource") + mmDeleteChunksByUIDs.t.Fatal("No results are set for the RepositoryIMock.DeleteChunksByUIDs") } return (*mm_results).err } - if mmDeleteEmbeddingsBySource.funcDeleteEmbeddingsBySource != nil { - return mmDeleteEmbeddingsBySource.funcDeleteEmbeddingsBySource(ctx, sourceTable, sourceUID) + if mmDeleteChunksByUIDs.funcDeleteChunksByUIDs != nil { + return mmDeleteChunksByUIDs.funcDeleteChunksByUIDs(ctx, chunkUIDs) } - mmDeleteEmbeddingsBySource.t.Fatalf("Unexpected call to RepositoryIMock.DeleteEmbeddingsBySource. %v %v %v", ctx, sourceTable, sourceUID) + mmDeleteChunksByUIDs.t.Fatalf("Unexpected call to RepositoryIMock.DeleteChunksByUIDs. %v %v", ctx, chunkUIDs) return } -// DeleteEmbeddingsBySourceAfterCounter returns a count of finished RepositoryIMock.DeleteEmbeddingsBySource invocations -func (mmDeleteEmbeddingsBySource *RepositoryIMock) DeleteEmbeddingsBySourceAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmDeleteEmbeddingsBySource.afterDeleteEmbeddingsBySourceCounter) +// DeleteChunksByUIDsAfterCounter returns a count of finished RepositoryIMock.DeleteChunksByUIDs invocations +func (mmDeleteChunksByUIDs *RepositoryIMock) DeleteChunksByUIDsAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmDeleteChunksByUIDs.afterDeleteChunksByUIDsCounter) } -// DeleteEmbeddingsBySourceBeforeCounter returns a count of RepositoryIMock.DeleteEmbeddingsBySource invocations -func (mmDeleteEmbeddingsBySource *RepositoryIMock) DeleteEmbeddingsBySourceBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmDeleteEmbeddingsBySource.beforeDeleteEmbeddingsBySourceCounter) +// DeleteChunksByUIDsBeforeCounter returns a count of RepositoryIMock.DeleteChunksByUIDs invocations +func (mmDeleteChunksByUIDs *RepositoryIMock) DeleteChunksByUIDsBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmDeleteChunksByUIDs.beforeDeleteChunksByUIDsCounter) } -// Calls returns a list of arguments used in each call to RepositoryIMock.DeleteEmbeddingsBySource. +// Calls returns a list of arguments used in each call to RepositoryIMock.DeleteChunksByUIDs. // The list is in the same order as the calls were made (i.e. recent calls have a higher index) -func (mmDeleteEmbeddingsBySource *mRepositoryIMockDeleteEmbeddingsBySource) Calls() []*RepositoryIMockDeleteEmbeddingsBySourceParams { - mmDeleteEmbeddingsBySource.mutex.RLock() +func (mmDeleteChunksByUIDs *mRepositoryIMockDeleteChunksByUIDs) Calls() []*RepositoryIMockDeleteChunksByUIDsParams { + mmDeleteChunksByUIDs.mutex.RLock() - argCopy := make([]*RepositoryIMockDeleteEmbeddingsBySourceParams, len(mmDeleteEmbeddingsBySource.callArgs)) - copy(argCopy, mmDeleteEmbeddingsBySource.callArgs) + argCopy := make([]*RepositoryIMockDeleteChunksByUIDsParams, len(mmDeleteChunksByUIDs.callArgs)) + copy(argCopy, mmDeleteChunksByUIDs.callArgs) - mmDeleteEmbeddingsBySource.mutex.RUnlock() + mmDeleteChunksByUIDs.mutex.RUnlock() return argCopy } -// MinimockDeleteEmbeddingsBySourceDone returns true if the count of the DeleteEmbeddingsBySource invocations corresponds +// MinimockDeleteChunksByUIDsDone returns true if the count of the DeleteChunksByUIDs invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockDeleteEmbeddingsBySourceDone() bool { - for _, e := range m.DeleteEmbeddingsBySourceMock.expectations { +func (m *RepositoryIMock) MinimockDeleteChunksByUIDsDone() bool { + for _, e := range m.DeleteChunksByUIDsMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.DeleteEmbeddingsBySourceMock.invocationsDone() + return m.DeleteChunksByUIDsMock.invocationsDone() } -// MinimockDeleteEmbeddingsBySourceInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockDeleteEmbeddingsBySourceInspect() { - for _, e := range m.DeleteEmbeddingsBySourceMock.expectations { +// MinimockDeleteChunksByUIDsInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockDeleteChunksByUIDsInspect() { + for _, e := range m.DeleteChunksByUIDsMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { - m.t.Errorf("Expected call to RepositoryIMock.DeleteEmbeddingsBySource with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.DeleteChunksByUIDs with params: %#v", *e.params) } } - afterDeleteEmbeddingsBySourceCounter := mm_atomic.LoadUint64(&m.afterDeleteEmbeddingsBySourceCounter) + afterDeleteChunksByUIDsCounter := mm_atomic.LoadUint64(&m.afterDeleteChunksByUIDsCounter) // if default expectation was set then invocations count should be greater than zero - if m.DeleteEmbeddingsBySourceMock.defaultExpectation != nil && afterDeleteEmbeddingsBySourceCounter < 1 { - if m.DeleteEmbeddingsBySourceMock.defaultExpectation.params == nil { - m.t.Error("Expected call to RepositoryIMock.DeleteEmbeddingsBySource") + if m.DeleteChunksByUIDsMock.defaultExpectation != nil && afterDeleteChunksByUIDsCounter < 1 { + if m.DeleteChunksByUIDsMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.DeleteChunksByUIDs") } else { - m.t.Errorf("Expected call to RepositoryIMock.DeleteEmbeddingsBySource with params: %#v", *m.DeleteEmbeddingsBySourceMock.defaultExpectation.params) + m.t.Errorf("Expected call to RepositoryIMock.DeleteChunksByUIDs with params: %#v", *m.DeleteChunksByUIDsMock.defaultExpectation.params) } } // if func was set then invocations count should be greater than zero - if m.funcDeleteEmbeddingsBySource != nil && afterDeleteEmbeddingsBySourceCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.DeleteEmbeddingsBySource") + if m.funcDeleteChunksByUIDs != nil && afterDeleteChunksByUIDsCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.DeleteChunksByUIDs") } - if !m.DeleteEmbeddingsBySourceMock.invocationsDone() && afterDeleteEmbeddingsBySourceCounter > 0 { - m.t.Errorf("Expected %d calls to RepositoryIMock.DeleteEmbeddingsBySource but found %d calls", - mm_atomic.LoadUint64(&m.DeleteEmbeddingsBySourceMock.expectedInvocations), afterDeleteEmbeddingsBySourceCounter) + if !m.DeleteChunksByUIDsMock.invocationsDone() && afterDeleteChunksByUIDsCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.DeleteChunksByUIDs but found %d calls", + mm_atomic.LoadUint64(&m.DeleteChunksByUIDsMock.expectedInvocations), afterDeleteChunksByUIDsCounter) } } -type mRepositoryIMockDeleteEmbeddingsByUIDs struct { +type mRepositoryIMockDeleteConvertedFile struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockDeleteEmbeddingsByUIDsExpectation - expectations []*RepositoryIMockDeleteEmbeddingsByUIDsExpectation + defaultExpectation *RepositoryIMockDeleteConvertedFileExpectation + expectations []*RepositoryIMockDeleteConvertedFileExpectation - callArgs []*RepositoryIMockDeleteEmbeddingsByUIDsParams + callArgs []*RepositoryIMockDeleteConvertedFileParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockDeleteEmbeddingsByUIDsExpectation specifies expectation struct of the RepositoryI.DeleteEmbeddingsByUIDs -type RepositoryIMockDeleteEmbeddingsByUIDsExpectation struct { +// RepositoryIMockDeleteConvertedFileExpectation specifies expectation struct of the RepositoryI.DeleteConvertedFile +type RepositoryIMockDeleteConvertedFileExpectation struct { mock *RepositoryIMock - params *RepositoryIMockDeleteEmbeddingsByUIDsParams - paramPtrs *RepositoryIMockDeleteEmbeddingsByUIDsParamPtrs - results *RepositoryIMockDeleteEmbeddingsByUIDsResults + params *RepositoryIMockDeleteConvertedFileParams + paramPtrs *RepositoryIMockDeleteConvertedFileParamPtrs + results *RepositoryIMockDeleteConvertedFileResults Counter uint64 } -// RepositoryIMockDeleteEmbeddingsByUIDsParams contains parameters of the RepositoryI.DeleteEmbeddingsByUIDs -type RepositoryIMockDeleteEmbeddingsByUIDsParams struct { - ctx context.Context - embUIDs []uuid.UUID +// RepositoryIMockDeleteConvertedFileParams contains parameters of the RepositoryI.DeleteConvertedFile +type RepositoryIMockDeleteConvertedFileParams struct { + ctx context.Context + uid uuid.UUID } -// RepositoryIMockDeleteEmbeddingsByUIDsParamPtrs contains pointers to parameters of the RepositoryI.DeleteEmbeddingsByUIDs -type RepositoryIMockDeleteEmbeddingsByUIDsParamPtrs struct { - ctx *context.Context - embUIDs *[]uuid.UUID +// RepositoryIMockDeleteConvertedFileParamPtrs contains pointers to parameters of the RepositoryI.DeleteConvertedFile +type RepositoryIMockDeleteConvertedFileParamPtrs struct { + ctx *context.Context + uid *uuid.UUID } -// RepositoryIMockDeleteEmbeddingsByUIDsResults contains results of the RepositoryI.DeleteEmbeddingsByUIDs -type RepositoryIMockDeleteEmbeddingsByUIDsResults struct { +// RepositoryIMockDeleteConvertedFileResults contains results of the RepositoryI.DeleteConvertedFile +type RepositoryIMockDeleteConvertedFileResults struct { err error } -// Expect sets up expected params for RepositoryI.DeleteEmbeddingsByUIDs -func (mmDeleteEmbeddingsByUIDs *mRepositoryIMockDeleteEmbeddingsByUIDs) Expect(ctx context.Context, embUIDs []uuid.UUID) *mRepositoryIMockDeleteEmbeddingsByUIDs { - if mmDeleteEmbeddingsByUIDs.mock.funcDeleteEmbeddingsByUIDs != nil { - mmDeleteEmbeddingsByUIDs.mock.t.Fatalf("RepositoryIMock.DeleteEmbeddingsByUIDs mock is already set by Set") +// Expect sets up expected params for RepositoryI.DeleteConvertedFile +func (mmDeleteConvertedFile *mRepositoryIMockDeleteConvertedFile) Expect(ctx context.Context, uid uuid.UUID) *mRepositoryIMockDeleteConvertedFile { + if mmDeleteConvertedFile.mock.funcDeleteConvertedFile != nil { + mmDeleteConvertedFile.mock.t.Fatalf("RepositoryIMock.DeleteConvertedFile mock is already set by Set") } - if mmDeleteEmbeddingsByUIDs.defaultExpectation == nil { - mmDeleteEmbeddingsByUIDs.defaultExpectation = &RepositoryIMockDeleteEmbeddingsByUIDsExpectation{} + if mmDeleteConvertedFile.defaultExpectation == nil { + mmDeleteConvertedFile.defaultExpectation = &RepositoryIMockDeleteConvertedFileExpectation{} } - if mmDeleteEmbeddingsByUIDs.defaultExpectation.paramPtrs != nil { - mmDeleteEmbeddingsByUIDs.mock.t.Fatalf("RepositoryIMock.DeleteEmbeddingsByUIDs mock is already set by ExpectParams functions") + if mmDeleteConvertedFile.defaultExpectation.paramPtrs != nil { + mmDeleteConvertedFile.mock.t.Fatalf("RepositoryIMock.DeleteConvertedFile mock is already set by ExpectParams functions") } - mmDeleteEmbeddingsByUIDs.defaultExpectation.params = &RepositoryIMockDeleteEmbeddingsByUIDsParams{ctx, embUIDs} - for _, e := range mmDeleteEmbeddingsByUIDs.expectations { - if minimock.Equal(e.params, mmDeleteEmbeddingsByUIDs.defaultExpectation.params) { - mmDeleteEmbeddingsByUIDs.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmDeleteEmbeddingsByUIDs.defaultExpectation.params) + mmDeleteConvertedFile.defaultExpectation.params = &RepositoryIMockDeleteConvertedFileParams{ctx, uid} + for _, e := range mmDeleteConvertedFile.expectations { + if minimock.Equal(e.params, mmDeleteConvertedFile.defaultExpectation.params) { + mmDeleteConvertedFile.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmDeleteConvertedFile.defaultExpectation.params) } } - return mmDeleteEmbeddingsByUIDs + return mmDeleteConvertedFile } -// ExpectCtxParam1 sets up expected param ctx for RepositoryI.DeleteEmbeddingsByUIDs -func (mmDeleteEmbeddingsByUIDs *mRepositoryIMockDeleteEmbeddingsByUIDs) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockDeleteEmbeddingsByUIDs { - if mmDeleteEmbeddingsByUIDs.mock.funcDeleteEmbeddingsByUIDs != nil { - mmDeleteEmbeddingsByUIDs.mock.t.Fatalf("RepositoryIMock.DeleteEmbeddingsByUIDs mock is already set by Set") +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.DeleteConvertedFile +func (mmDeleteConvertedFile *mRepositoryIMockDeleteConvertedFile) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockDeleteConvertedFile { + if mmDeleteConvertedFile.mock.funcDeleteConvertedFile != nil { + mmDeleteConvertedFile.mock.t.Fatalf("RepositoryIMock.DeleteConvertedFile mock is already set by Set") } - if mmDeleteEmbeddingsByUIDs.defaultExpectation == nil { - mmDeleteEmbeddingsByUIDs.defaultExpectation = &RepositoryIMockDeleteEmbeddingsByUIDsExpectation{} + if mmDeleteConvertedFile.defaultExpectation == nil { + mmDeleteConvertedFile.defaultExpectation = &RepositoryIMockDeleteConvertedFileExpectation{} } - if mmDeleteEmbeddingsByUIDs.defaultExpectation.params != nil { - mmDeleteEmbeddingsByUIDs.mock.t.Fatalf("RepositoryIMock.DeleteEmbeddingsByUIDs mock is already set by Expect") + if mmDeleteConvertedFile.defaultExpectation.params != nil { + mmDeleteConvertedFile.mock.t.Fatalf("RepositoryIMock.DeleteConvertedFile mock is already set by Expect") } - if mmDeleteEmbeddingsByUIDs.defaultExpectation.paramPtrs == nil { - mmDeleteEmbeddingsByUIDs.defaultExpectation.paramPtrs = &RepositoryIMockDeleteEmbeddingsByUIDsParamPtrs{} + if mmDeleteConvertedFile.defaultExpectation.paramPtrs == nil { + mmDeleteConvertedFile.defaultExpectation.paramPtrs = &RepositoryIMockDeleteConvertedFileParamPtrs{} } - mmDeleteEmbeddingsByUIDs.defaultExpectation.paramPtrs.ctx = &ctx + mmDeleteConvertedFile.defaultExpectation.paramPtrs.ctx = &ctx - return mmDeleteEmbeddingsByUIDs + return mmDeleteConvertedFile } -// ExpectEmbUIDsParam2 sets up expected param embUIDs for RepositoryI.DeleteEmbeddingsByUIDs -func (mmDeleteEmbeddingsByUIDs *mRepositoryIMockDeleteEmbeddingsByUIDs) ExpectEmbUIDsParam2(embUIDs []uuid.UUID) *mRepositoryIMockDeleteEmbeddingsByUIDs { - if mmDeleteEmbeddingsByUIDs.mock.funcDeleteEmbeddingsByUIDs != nil { - mmDeleteEmbeddingsByUIDs.mock.t.Fatalf("RepositoryIMock.DeleteEmbeddingsByUIDs mock is already set by Set") +// ExpectUidParam2 sets up expected param uid for RepositoryI.DeleteConvertedFile +func (mmDeleteConvertedFile *mRepositoryIMockDeleteConvertedFile) ExpectUidParam2(uid uuid.UUID) *mRepositoryIMockDeleteConvertedFile { + if mmDeleteConvertedFile.mock.funcDeleteConvertedFile != nil { + mmDeleteConvertedFile.mock.t.Fatalf("RepositoryIMock.DeleteConvertedFile mock is already set by Set") } - if mmDeleteEmbeddingsByUIDs.defaultExpectation == nil { - mmDeleteEmbeddingsByUIDs.defaultExpectation = &RepositoryIMockDeleteEmbeddingsByUIDsExpectation{} + if mmDeleteConvertedFile.defaultExpectation == nil { + mmDeleteConvertedFile.defaultExpectation = &RepositoryIMockDeleteConvertedFileExpectation{} } - if mmDeleteEmbeddingsByUIDs.defaultExpectation.params != nil { - mmDeleteEmbeddingsByUIDs.mock.t.Fatalf("RepositoryIMock.DeleteEmbeddingsByUIDs mock is already set by Expect") + if mmDeleteConvertedFile.defaultExpectation.params != nil { + mmDeleteConvertedFile.mock.t.Fatalf("RepositoryIMock.DeleteConvertedFile mock is already set by Expect") } - if mmDeleteEmbeddingsByUIDs.defaultExpectation.paramPtrs == nil { - mmDeleteEmbeddingsByUIDs.defaultExpectation.paramPtrs = &RepositoryIMockDeleteEmbeddingsByUIDsParamPtrs{} + if mmDeleteConvertedFile.defaultExpectation.paramPtrs == nil { + mmDeleteConvertedFile.defaultExpectation.paramPtrs = &RepositoryIMockDeleteConvertedFileParamPtrs{} } - mmDeleteEmbeddingsByUIDs.defaultExpectation.paramPtrs.embUIDs = &embUIDs + mmDeleteConvertedFile.defaultExpectation.paramPtrs.uid = &uid - return mmDeleteEmbeddingsByUIDs + return mmDeleteConvertedFile } -// Inspect accepts an inspector function that has same arguments as the RepositoryI.DeleteEmbeddingsByUIDs -func (mmDeleteEmbeddingsByUIDs *mRepositoryIMockDeleteEmbeddingsByUIDs) Inspect(f func(ctx context.Context, embUIDs []uuid.UUID)) *mRepositoryIMockDeleteEmbeddingsByUIDs { - if mmDeleteEmbeddingsByUIDs.mock.inspectFuncDeleteEmbeddingsByUIDs != nil { - mmDeleteEmbeddingsByUIDs.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.DeleteEmbeddingsByUIDs") +// Inspect accepts an inspector function that has same arguments as the RepositoryI.DeleteConvertedFile +func (mmDeleteConvertedFile *mRepositoryIMockDeleteConvertedFile) Inspect(f func(ctx context.Context, uid uuid.UUID)) *mRepositoryIMockDeleteConvertedFile { + if mmDeleteConvertedFile.mock.inspectFuncDeleteConvertedFile != nil { + mmDeleteConvertedFile.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.DeleteConvertedFile") } - mmDeleteEmbeddingsByUIDs.mock.inspectFuncDeleteEmbeddingsByUIDs = f + mmDeleteConvertedFile.mock.inspectFuncDeleteConvertedFile = f - return mmDeleteEmbeddingsByUIDs + return mmDeleteConvertedFile } -// Return sets up results that will be returned by RepositoryI.DeleteEmbeddingsByUIDs -func (mmDeleteEmbeddingsByUIDs *mRepositoryIMockDeleteEmbeddingsByUIDs) Return(err error) *RepositoryIMock { - if mmDeleteEmbeddingsByUIDs.mock.funcDeleteEmbeddingsByUIDs != nil { - mmDeleteEmbeddingsByUIDs.mock.t.Fatalf("RepositoryIMock.DeleteEmbeddingsByUIDs mock is already set by Set") +// Return sets up results that will be returned by RepositoryI.DeleteConvertedFile +func (mmDeleteConvertedFile *mRepositoryIMockDeleteConvertedFile) Return(err error) *RepositoryIMock { + if mmDeleteConvertedFile.mock.funcDeleteConvertedFile != nil { + mmDeleteConvertedFile.mock.t.Fatalf("RepositoryIMock.DeleteConvertedFile mock is already set by Set") } - if mmDeleteEmbeddingsByUIDs.defaultExpectation == nil { - mmDeleteEmbeddingsByUIDs.defaultExpectation = &RepositoryIMockDeleteEmbeddingsByUIDsExpectation{mock: mmDeleteEmbeddingsByUIDs.mock} + if mmDeleteConvertedFile.defaultExpectation == nil { + mmDeleteConvertedFile.defaultExpectation = &RepositoryIMockDeleteConvertedFileExpectation{mock: mmDeleteConvertedFile.mock} } - mmDeleteEmbeddingsByUIDs.defaultExpectation.results = &RepositoryIMockDeleteEmbeddingsByUIDsResults{err} - return mmDeleteEmbeddingsByUIDs.mock + mmDeleteConvertedFile.defaultExpectation.results = &RepositoryIMockDeleteConvertedFileResults{err} + return mmDeleteConvertedFile.mock } -// Set uses given function f to mock the RepositoryI.DeleteEmbeddingsByUIDs method -func (mmDeleteEmbeddingsByUIDs *mRepositoryIMockDeleteEmbeddingsByUIDs) Set(f func(ctx context.Context, embUIDs []uuid.UUID) (err error)) *RepositoryIMock { - if mmDeleteEmbeddingsByUIDs.defaultExpectation != nil { - mmDeleteEmbeddingsByUIDs.mock.t.Fatalf("Default expectation is already set for the RepositoryI.DeleteEmbeddingsByUIDs method") +// Set uses given function f to mock the RepositoryI.DeleteConvertedFile method +func (mmDeleteConvertedFile *mRepositoryIMockDeleteConvertedFile) Set(f func(ctx context.Context, uid uuid.UUID) (err error)) *RepositoryIMock { + if mmDeleteConvertedFile.defaultExpectation != nil { + mmDeleteConvertedFile.mock.t.Fatalf("Default expectation is already set for the RepositoryI.DeleteConvertedFile method") } - if len(mmDeleteEmbeddingsByUIDs.expectations) > 0 { - mmDeleteEmbeddingsByUIDs.mock.t.Fatalf("Some expectations are already set for the RepositoryI.DeleteEmbeddingsByUIDs method") + if len(mmDeleteConvertedFile.expectations) > 0 { + mmDeleteConvertedFile.mock.t.Fatalf("Some expectations are already set for the RepositoryI.DeleteConvertedFile method") } - mmDeleteEmbeddingsByUIDs.mock.funcDeleteEmbeddingsByUIDs = f - return mmDeleteEmbeddingsByUIDs.mock + mmDeleteConvertedFile.mock.funcDeleteConvertedFile = f + return mmDeleteConvertedFile.mock } -// When sets expectation for the RepositoryI.DeleteEmbeddingsByUIDs which will trigger the result defined by the following +// When sets expectation for the RepositoryI.DeleteConvertedFile which will trigger the result defined by the following // Then helper -func (mmDeleteEmbeddingsByUIDs *mRepositoryIMockDeleteEmbeddingsByUIDs) When(ctx context.Context, embUIDs []uuid.UUID) *RepositoryIMockDeleteEmbeddingsByUIDsExpectation { - if mmDeleteEmbeddingsByUIDs.mock.funcDeleteEmbeddingsByUIDs != nil { - mmDeleteEmbeddingsByUIDs.mock.t.Fatalf("RepositoryIMock.DeleteEmbeddingsByUIDs mock is already set by Set") +func (mmDeleteConvertedFile *mRepositoryIMockDeleteConvertedFile) When(ctx context.Context, uid uuid.UUID) *RepositoryIMockDeleteConvertedFileExpectation { + if mmDeleteConvertedFile.mock.funcDeleteConvertedFile != nil { + mmDeleteConvertedFile.mock.t.Fatalf("RepositoryIMock.DeleteConvertedFile mock is already set by Set") } - expectation := &RepositoryIMockDeleteEmbeddingsByUIDsExpectation{ - mock: mmDeleteEmbeddingsByUIDs.mock, - params: &RepositoryIMockDeleteEmbeddingsByUIDsParams{ctx, embUIDs}, + expectation := &RepositoryIMockDeleteConvertedFileExpectation{ + mock: mmDeleteConvertedFile.mock, + params: &RepositoryIMockDeleteConvertedFileParams{ctx, uid}, } - mmDeleteEmbeddingsByUIDs.expectations = append(mmDeleteEmbeddingsByUIDs.expectations, expectation) + mmDeleteConvertedFile.expectations = append(mmDeleteConvertedFile.expectations, expectation) return expectation } -// Then sets up RepositoryI.DeleteEmbeddingsByUIDs return parameters for the expectation previously defined by the When method -func (e *RepositoryIMockDeleteEmbeddingsByUIDsExpectation) Then(err error) *RepositoryIMock { - e.results = &RepositoryIMockDeleteEmbeddingsByUIDsResults{err} +// Then sets up RepositoryI.DeleteConvertedFile return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockDeleteConvertedFileExpectation) Then(err error) *RepositoryIMock { + e.results = &RepositoryIMockDeleteConvertedFileResults{err} return e.mock } -// Times sets number of times RepositoryI.DeleteEmbeddingsByUIDs should be invoked -func (mmDeleteEmbeddingsByUIDs *mRepositoryIMockDeleteEmbeddingsByUIDs) Times(n uint64) *mRepositoryIMockDeleteEmbeddingsByUIDs { +// Times sets number of times RepositoryI.DeleteConvertedFile should be invoked +func (mmDeleteConvertedFile *mRepositoryIMockDeleteConvertedFile) Times(n uint64) *mRepositoryIMockDeleteConvertedFile { if n == 0 { - mmDeleteEmbeddingsByUIDs.mock.t.Fatalf("Times of RepositoryIMock.DeleteEmbeddingsByUIDs mock can not be zero") + mmDeleteConvertedFile.mock.t.Fatalf("Times of RepositoryIMock.DeleteConvertedFile mock can not be zero") } - mm_atomic.StoreUint64(&mmDeleteEmbeddingsByUIDs.expectedInvocations, n) - return mmDeleteEmbeddingsByUIDs + mm_atomic.StoreUint64(&mmDeleteConvertedFile.expectedInvocations, n) + return mmDeleteConvertedFile } -func (mmDeleteEmbeddingsByUIDs *mRepositoryIMockDeleteEmbeddingsByUIDs) invocationsDone() bool { - if len(mmDeleteEmbeddingsByUIDs.expectations) == 0 && mmDeleteEmbeddingsByUIDs.defaultExpectation == nil && mmDeleteEmbeddingsByUIDs.mock.funcDeleteEmbeddingsByUIDs == nil { +func (mmDeleteConvertedFile *mRepositoryIMockDeleteConvertedFile) invocationsDone() bool { + if len(mmDeleteConvertedFile.expectations) == 0 && mmDeleteConvertedFile.defaultExpectation == nil && mmDeleteConvertedFile.mock.funcDeleteConvertedFile == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmDeleteEmbeddingsByUIDs.mock.afterDeleteEmbeddingsByUIDsCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmDeleteEmbeddingsByUIDs.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmDeleteConvertedFile.mock.afterDeleteConvertedFileCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmDeleteConvertedFile.expectedInvocations) return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) } -// DeleteEmbeddingsByUIDs implements repository.RepositoryI -func (mmDeleteEmbeddingsByUIDs *RepositoryIMock) DeleteEmbeddingsByUIDs(ctx context.Context, embUIDs []uuid.UUID) (err error) { - mm_atomic.AddUint64(&mmDeleteEmbeddingsByUIDs.beforeDeleteEmbeddingsByUIDsCounter, 1) - defer mm_atomic.AddUint64(&mmDeleteEmbeddingsByUIDs.afterDeleteEmbeddingsByUIDsCounter, 1) +// DeleteConvertedFile implements repository.RepositoryI +func (mmDeleteConvertedFile *RepositoryIMock) DeleteConvertedFile(ctx context.Context, uid uuid.UUID) (err error) { + mm_atomic.AddUint64(&mmDeleteConvertedFile.beforeDeleteConvertedFileCounter, 1) + defer mm_atomic.AddUint64(&mmDeleteConvertedFile.afterDeleteConvertedFileCounter, 1) - if mmDeleteEmbeddingsByUIDs.inspectFuncDeleteEmbeddingsByUIDs != nil { - mmDeleteEmbeddingsByUIDs.inspectFuncDeleteEmbeddingsByUIDs(ctx, embUIDs) + if mmDeleteConvertedFile.inspectFuncDeleteConvertedFile != nil { + mmDeleteConvertedFile.inspectFuncDeleteConvertedFile(ctx, uid) } - mm_params := RepositoryIMockDeleteEmbeddingsByUIDsParams{ctx, embUIDs} + mm_params := RepositoryIMockDeleteConvertedFileParams{ctx, uid} // Record call args - mmDeleteEmbeddingsByUIDs.DeleteEmbeddingsByUIDsMock.mutex.Lock() - mmDeleteEmbeddingsByUIDs.DeleteEmbeddingsByUIDsMock.callArgs = append(mmDeleteEmbeddingsByUIDs.DeleteEmbeddingsByUIDsMock.callArgs, &mm_params) - mmDeleteEmbeddingsByUIDs.DeleteEmbeddingsByUIDsMock.mutex.Unlock() + mmDeleteConvertedFile.DeleteConvertedFileMock.mutex.Lock() + mmDeleteConvertedFile.DeleteConvertedFileMock.callArgs = append(mmDeleteConvertedFile.DeleteConvertedFileMock.callArgs, &mm_params) + mmDeleteConvertedFile.DeleteConvertedFileMock.mutex.Unlock() - for _, e := range mmDeleteEmbeddingsByUIDs.DeleteEmbeddingsByUIDsMock.expectations { + for _, e := range mmDeleteConvertedFile.DeleteConvertedFileMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) return e.results.err } } - if mmDeleteEmbeddingsByUIDs.DeleteEmbeddingsByUIDsMock.defaultExpectation != nil { - mm_atomic.AddUint64(&mmDeleteEmbeddingsByUIDs.DeleteEmbeddingsByUIDsMock.defaultExpectation.Counter, 1) - mm_want := mmDeleteEmbeddingsByUIDs.DeleteEmbeddingsByUIDsMock.defaultExpectation.params - mm_want_ptrs := mmDeleteEmbeddingsByUIDs.DeleteEmbeddingsByUIDsMock.defaultExpectation.paramPtrs + if mmDeleteConvertedFile.DeleteConvertedFileMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmDeleteConvertedFile.DeleteConvertedFileMock.defaultExpectation.Counter, 1) + mm_want := mmDeleteConvertedFile.DeleteConvertedFileMock.defaultExpectation.params + mm_want_ptrs := mmDeleteConvertedFile.DeleteConvertedFileMock.defaultExpectation.paramPtrs - mm_got := RepositoryIMockDeleteEmbeddingsByUIDsParams{ctx, embUIDs} + mm_got := RepositoryIMockDeleteConvertedFileParams{ctx, uid} if mm_want_ptrs != nil { if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { - mmDeleteEmbeddingsByUIDs.t.Errorf("RepositoryIMock.DeleteEmbeddingsByUIDs got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) + mmDeleteConvertedFile.t.Errorf("RepositoryIMock.DeleteConvertedFile got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) } - if mm_want_ptrs.embUIDs != nil && !minimock.Equal(*mm_want_ptrs.embUIDs, mm_got.embUIDs) { - mmDeleteEmbeddingsByUIDs.t.Errorf("RepositoryIMock.DeleteEmbeddingsByUIDs got unexpected parameter embUIDs, want: %#v, got: %#v%s\n", *mm_want_ptrs.embUIDs, mm_got.embUIDs, minimock.Diff(*mm_want_ptrs.embUIDs, mm_got.embUIDs)) + if mm_want_ptrs.uid != nil && !minimock.Equal(*mm_want_ptrs.uid, mm_got.uid) { + mmDeleteConvertedFile.t.Errorf("RepositoryIMock.DeleteConvertedFile got unexpected parameter uid, want: %#v, got: %#v%s\n", *mm_want_ptrs.uid, mm_got.uid, minimock.Diff(*mm_want_ptrs.uid, mm_got.uid)) } } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { - mmDeleteEmbeddingsByUIDs.t.Errorf("RepositoryIMock.DeleteEmbeddingsByUIDs got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + mmDeleteConvertedFile.t.Errorf("RepositoryIMock.DeleteConvertedFile got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) } - mm_results := mmDeleteEmbeddingsByUIDs.DeleteEmbeddingsByUIDsMock.defaultExpectation.results + mm_results := mmDeleteConvertedFile.DeleteConvertedFileMock.defaultExpectation.results if mm_results == nil { - mmDeleteEmbeddingsByUIDs.t.Fatal("No results are set for the RepositoryIMock.DeleteEmbeddingsByUIDs") + mmDeleteConvertedFile.t.Fatal("No results are set for the RepositoryIMock.DeleteConvertedFile") } return (*mm_results).err } - if mmDeleteEmbeddingsByUIDs.funcDeleteEmbeddingsByUIDs != nil { - return mmDeleteEmbeddingsByUIDs.funcDeleteEmbeddingsByUIDs(ctx, embUIDs) + if mmDeleteConvertedFile.funcDeleteConvertedFile != nil { + return mmDeleteConvertedFile.funcDeleteConvertedFile(ctx, uid) } - mmDeleteEmbeddingsByUIDs.t.Fatalf("Unexpected call to RepositoryIMock.DeleteEmbeddingsByUIDs. %v %v", ctx, embUIDs) + mmDeleteConvertedFile.t.Fatalf("Unexpected call to RepositoryIMock.DeleteConvertedFile. %v %v", ctx, uid) return } -// DeleteEmbeddingsByUIDsAfterCounter returns a count of finished RepositoryIMock.DeleteEmbeddingsByUIDs invocations -func (mmDeleteEmbeddingsByUIDs *RepositoryIMock) DeleteEmbeddingsByUIDsAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmDeleteEmbeddingsByUIDs.afterDeleteEmbeddingsByUIDsCounter) +// DeleteConvertedFileAfterCounter returns a count of finished RepositoryIMock.DeleteConvertedFile invocations +func (mmDeleteConvertedFile *RepositoryIMock) DeleteConvertedFileAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmDeleteConvertedFile.afterDeleteConvertedFileCounter) } -// DeleteEmbeddingsByUIDsBeforeCounter returns a count of RepositoryIMock.DeleteEmbeddingsByUIDs invocations -func (mmDeleteEmbeddingsByUIDs *RepositoryIMock) DeleteEmbeddingsByUIDsBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmDeleteEmbeddingsByUIDs.beforeDeleteEmbeddingsByUIDsCounter) +// DeleteConvertedFileBeforeCounter returns a count of RepositoryIMock.DeleteConvertedFile invocations +func (mmDeleteConvertedFile *RepositoryIMock) DeleteConvertedFileBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmDeleteConvertedFile.beforeDeleteConvertedFileCounter) } -// Calls returns a list of arguments used in each call to RepositoryIMock.DeleteEmbeddingsByUIDs. +// Calls returns a list of arguments used in each call to RepositoryIMock.DeleteConvertedFile. // The list is in the same order as the calls were made (i.e. recent calls have a higher index) -func (mmDeleteEmbeddingsByUIDs *mRepositoryIMockDeleteEmbeddingsByUIDs) Calls() []*RepositoryIMockDeleteEmbeddingsByUIDsParams { - mmDeleteEmbeddingsByUIDs.mutex.RLock() +func (mmDeleteConvertedFile *mRepositoryIMockDeleteConvertedFile) Calls() []*RepositoryIMockDeleteConvertedFileParams { + mmDeleteConvertedFile.mutex.RLock() - argCopy := make([]*RepositoryIMockDeleteEmbeddingsByUIDsParams, len(mmDeleteEmbeddingsByUIDs.callArgs)) - copy(argCopy, mmDeleteEmbeddingsByUIDs.callArgs) + argCopy := make([]*RepositoryIMockDeleteConvertedFileParams, len(mmDeleteConvertedFile.callArgs)) + copy(argCopy, mmDeleteConvertedFile.callArgs) - mmDeleteEmbeddingsByUIDs.mutex.RUnlock() + mmDeleteConvertedFile.mutex.RUnlock() return argCopy } -// MinimockDeleteEmbeddingsByUIDsDone returns true if the count of the DeleteEmbeddingsByUIDs invocations corresponds +// MinimockDeleteConvertedFileDone returns true if the count of the DeleteConvertedFile invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockDeleteEmbeddingsByUIDsDone() bool { - for _, e := range m.DeleteEmbeddingsByUIDsMock.expectations { +func (m *RepositoryIMock) MinimockDeleteConvertedFileDone() bool { + for _, e := range m.DeleteConvertedFileMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.DeleteEmbeddingsByUIDsMock.invocationsDone() + return m.DeleteConvertedFileMock.invocationsDone() } -// MinimockDeleteEmbeddingsByUIDsInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockDeleteEmbeddingsByUIDsInspect() { - for _, e := range m.DeleteEmbeddingsByUIDsMock.expectations { +// MinimockDeleteConvertedFileInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockDeleteConvertedFileInspect() { + for _, e := range m.DeleteConvertedFileMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { - m.t.Errorf("Expected call to RepositoryIMock.DeleteEmbeddingsByUIDs with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.DeleteConvertedFile with params: %#v", *e.params) } } - afterDeleteEmbeddingsByUIDsCounter := mm_atomic.LoadUint64(&m.afterDeleteEmbeddingsByUIDsCounter) + afterDeleteConvertedFileCounter := mm_atomic.LoadUint64(&m.afterDeleteConvertedFileCounter) // if default expectation was set then invocations count should be greater than zero - if m.DeleteEmbeddingsByUIDsMock.defaultExpectation != nil && afterDeleteEmbeddingsByUIDsCounter < 1 { - if m.DeleteEmbeddingsByUIDsMock.defaultExpectation.params == nil { - m.t.Error("Expected call to RepositoryIMock.DeleteEmbeddingsByUIDs") + if m.DeleteConvertedFileMock.defaultExpectation != nil && afterDeleteConvertedFileCounter < 1 { + if m.DeleteConvertedFileMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.DeleteConvertedFile") } else { - m.t.Errorf("Expected call to RepositoryIMock.DeleteEmbeddingsByUIDs with params: %#v", *m.DeleteEmbeddingsByUIDsMock.defaultExpectation.params) + m.t.Errorf("Expected call to RepositoryIMock.DeleteConvertedFile with params: %#v", *m.DeleteConvertedFileMock.defaultExpectation.params) } } // if func was set then invocations count should be greater than zero - if m.funcDeleteEmbeddingsByUIDs != nil && afterDeleteEmbeddingsByUIDsCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.DeleteEmbeddingsByUIDs") + if m.funcDeleteConvertedFile != nil && afterDeleteConvertedFileCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.DeleteConvertedFile") } - if !m.DeleteEmbeddingsByUIDsMock.invocationsDone() && afterDeleteEmbeddingsByUIDsCounter > 0 { - m.t.Errorf("Expected %d calls to RepositoryIMock.DeleteEmbeddingsByUIDs but found %d calls", - mm_atomic.LoadUint64(&m.DeleteEmbeddingsByUIDsMock.expectedInvocations), afterDeleteEmbeddingsByUIDsCounter) + if !m.DeleteConvertedFileMock.invocationsDone() && afterDeleteConvertedFileCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.DeleteConvertedFile but found %d calls", + mm_atomic.LoadUint64(&m.DeleteConvertedFileMock.expectedInvocations), afterDeleteConvertedFileCounter) } } -type mRepositoryIMockDeleteKnowledgeBase struct { +type mRepositoryIMockDeleteEmbeddingsBySource struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockDeleteKnowledgeBaseExpectation - expectations []*RepositoryIMockDeleteKnowledgeBaseExpectation + defaultExpectation *RepositoryIMockDeleteEmbeddingsBySourceExpectation + expectations []*RepositoryIMockDeleteEmbeddingsBySourceExpectation - callArgs []*RepositoryIMockDeleteKnowledgeBaseParams + callArgs []*RepositoryIMockDeleteEmbeddingsBySourceParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockDeleteKnowledgeBaseExpectation specifies expectation struct of the RepositoryI.DeleteKnowledgeBase -type RepositoryIMockDeleteKnowledgeBaseExpectation struct { +// RepositoryIMockDeleteEmbeddingsBySourceExpectation specifies expectation struct of the RepositoryI.DeleteEmbeddingsBySource +type RepositoryIMockDeleteEmbeddingsBySourceExpectation struct { mock *RepositoryIMock - params *RepositoryIMockDeleteKnowledgeBaseParams - paramPtrs *RepositoryIMockDeleteKnowledgeBaseParamPtrs - results *RepositoryIMockDeleteKnowledgeBaseResults + params *RepositoryIMockDeleteEmbeddingsBySourceParams + paramPtrs *RepositoryIMockDeleteEmbeddingsBySourceParamPtrs + results *RepositoryIMockDeleteEmbeddingsBySourceResults Counter uint64 } -// RepositoryIMockDeleteKnowledgeBaseParams contains parameters of the RepositoryI.DeleteKnowledgeBase -type RepositoryIMockDeleteKnowledgeBaseParams struct { - ctx context.Context - ownerUID string - kbID string +// RepositoryIMockDeleteEmbeddingsBySourceParams contains parameters of the RepositoryI.DeleteEmbeddingsBySource +type RepositoryIMockDeleteEmbeddingsBySourceParams struct { + ctx context.Context + sourceTable string + sourceUID uuid.UUID } -// RepositoryIMockDeleteKnowledgeBaseParamPtrs contains pointers to parameters of the RepositoryI.DeleteKnowledgeBase -type RepositoryIMockDeleteKnowledgeBaseParamPtrs struct { - ctx *context.Context - ownerUID *string - kbID *string +// RepositoryIMockDeleteEmbeddingsBySourceParamPtrs contains pointers to parameters of the RepositoryI.DeleteEmbeddingsBySource +type RepositoryIMockDeleteEmbeddingsBySourceParamPtrs struct { + ctx *context.Context + sourceTable *string + sourceUID *uuid.UUID } -// RepositoryIMockDeleteKnowledgeBaseResults contains results of the RepositoryI.DeleteKnowledgeBase -type RepositoryIMockDeleteKnowledgeBaseResults struct { - kp1 *mm_repository.KnowledgeBase +// RepositoryIMockDeleteEmbeddingsBySourceResults contains results of the RepositoryI.DeleteEmbeddingsBySource +type RepositoryIMockDeleteEmbeddingsBySourceResults struct { err error } -// Expect sets up expected params for RepositoryI.DeleteKnowledgeBase -func (mmDeleteKnowledgeBase *mRepositoryIMockDeleteKnowledgeBase) Expect(ctx context.Context, ownerUID string, kbID string) *mRepositoryIMockDeleteKnowledgeBase { - if mmDeleteKnowledgeBase.mock.funcDeleteKnowledgeBase != nil { - mmDeleteKnowledgeBase.mock.t.Fatalf("RepositoryIMock.DeleteKnowledgeBase mock is already set by Set") +// Expect sets up expected params for RepositoryI.DeleteEmbeddingsBySource +func (mmDeleteEmbeddingsBySource *mRepositoryIMockDeleteEmbeddingsBySource) Expect(ctx context.Context, sourceTable string, sourceUID uuid.UUID) *mRepositoryIMockDeleteEmbeddingsBySource { + if mmDeleteEmbeddingsBySource.mock.funcDeleteEmbeddingsBySource != nil { + mmDeleteEmbeddingsBySource.mock.t.Fatalf("RepositoryIMock.DeleteEmbeddingsBySource mock is already set by Set") } - if mmDeleteKnowledgeBase.defaultExpectation == nil { - mmDeleteKnowledgeBase.defaultExpectation = &RepositoryIMockDeleteKnowledgeBaseExpectation{} + if mmDeleteEmbeddingsBySource.defaultExpectation == nil { + mmDeleteEmbeddingsBySource.defaultExpectation = &RepositoryIMockDeleteEmbeddingsBySourceExpectation{} } - if mmDeleteKnowledgeBase.defaultExpectation.paramPtrs != nil { - mmDeleteKnowledgeBase.mock.t.Fatalf("RepositoryIMock.DeleteKnowledgeBase mock is already set by ExpectParams functions") + if mmDeleteEmbeddingsBySource.defaultExpectation.paramPtrs != nil { + mmDeleteEmbeddingsBySource.mock.t.Fatalf("RepositoryIMock.DeleteEmbeddingsBySource mock is already set by ExpectParams functions") } - mmDeleteKnowledgeBase.defaultExpectation.params = &RepositoryIMockDeleteKnowledgeBaseParams{ctx, ownerUID, kbID} - for _, e := range mmDeleteKnowledgeBase.expectations { - if minimock.Equal(e.params, mmDeleteKnowledgeBase.defaultExpectation.params) { - mmDeleteKnowledgeBase.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmDeleteKnowledgeBase.defaultExpectation.params) + mmDeleteEmbeddingsBySource.defaultExpectation.params = &RepositoryIMockDeleteEmbeddingsBySourceParams{ctx, sourceTable, sourceUID} + for _, e := range mmDeleteEmbeddingsBySource.expectations { + if minimock.Equal(e.params, mmDeleteEmbeddingsBySource.defaultExpectation.params) { + mmDeleteEmbeddingsBySource.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmDeleteEmbeddingsBySource.defaultExpectation.params) } } - return mmDeleteKnowledgeBase + return mmDeleteEmbeddingsBySource } -// ExpectCtxParam1 sets up expected param ctx for RepositoryI.DeleteKnowledgeBase -func (mmDeleteKnowledgeBase *mRepositoryIMockDeleteKnowledgeBase) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockDeleteKnowledgeBase { - if mmDeleteKnowledgeBase.mock.funcDeleteKnowledgeBase != nil { - mmDeleteKnowledgeBase.mock.t.Fatalf("RepositoryIMock.DeleteKnowledgeBase mock is already set by Set") +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.DeleteEmbeddingsBySource +func (mmDeleteEmbeddingsBySource *mRepositoryIMockDeleteEmbeddingsBySource) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockDeleteEmbeddingsBySource { + if mmDeleteEmbeddingsBySource.mock.funcDeleteEmbeddingsBySource != nil { + mmDeleteEmbeddingsBySource.mock.t.Fatalf("RepositoryIMock.DeleteEmbeddingsBySource mock is already set by Set") } - if mmDeleteKnowledgeBase.defaultExpectation == nil { - mmDeleteKnowledgeBase.defaultExpectation = &RepositoryIMockDeleteKnowledgeBaseExpectation{} + if mmDeleteEmbeddingsBySource.defaultExpectation == nil { + mmDeleteEmbeddingsBySource.defaultExpectation = &RepositoryIMockDeleteEmbeddingsBySourceExpectation{} } - if mmDeleteKnowledgeBase.defaultExpectation.params != nil { - mmDeleteKnowledgeBase.mock.t.Fatalf("RepositoryIMock.DeleteKnowledgeBase mock is already set by Expect") + if mmDeleteEmbeddingsBySource.defaultExpectation.params != nil { + mmDeleteEmbeddingsBySource.mock.t.Fatalf("RepositoryIMock.DeleteEmbeddingsBySource mock is already set by Expect") } - if mmDeleteKnowledgeBase.defaultExpectation.paramPtrs == nil { - mmDeleteKnowledgeBase.defaultExpectation.paramPtrs = &RepositoryIMockDeleteKnowledgeBaseParamPtrs{} + if mmDeleteEmbeddingsBySource.defaultExpectation.paramPtrs == nil { + mmDeleteEmbeddingsBySource.defaultExpectation.paramPtrs = &RepositoryIMockDeleteEmbeddingsBySourceParamPtrs{} } - mmDeleteKnowledgeBase.defaultExpectation.paramPtrs.ctx = &ctx + mmDeleteEmbeddingsBySource.defaultExpectation.paramPtrs.ctx = &ctx - return mmDeleteKnowledgeBase + return mmDeleteEmbeddingsBySource } -// ExpectOwnerUIDParam2 sets up expected param ownerUID for RepositoryI.DeleteKnowledgeBase -func (mmDeleteKnowledgeBase *mRepositoryIMockDeleteKnowledgeBase) ExpectOwnerUIDParam2(ownerUID string) *mRepositoryIMockDeleteKnowledgeBase { - if mmDeleteKnowledgeBase.mock.funcDeleteKnowledgeBase != nil { - mmDeleteKnowledgeBase.mock.t.Fatalf("RepositoryIMock.DeleteKnowledgeBase mock is already set by Set") +// ExpectSourceTableParam2 sets up expected param sourceTable for RepositoryI.DeleteEmbeddingsBySource +func (mmDeleteEmbeddingsBySource *mRepositoryIMockDeleteEmbeddingsBySource) ExpectSourceTableParam2(sourceTable string) *mRepositoryIMockDeleteEmbeddingsBySource { + if mmDeleteEmbeddingsBySource.mock.funcDeleteEmbeddingsBySource != nil { + mmDeleteEmbeddingsBySource.mock.t.Fatalf("RepositoryIMock.DeleteEmbeddingsBySource mock is already set by Set") } - if mmDeleteKnowledgeBase.defaultExpectation == nil { - mmDeleteKnowledgeBase.defaultExpectation = &RepositoryIMockDeleteKnowledgeBaseExpectation{} + if mmDeleteEmbeddingsBySource.defaultExpectation == nil { + mmDeleteEmbeddingsBySource.defaultExpectation = &RepositoryIMockDeleteEmbeddingsBySourceExpectation{} } - if mmDeleteKnowledgeBase.defaultExpectation.params != nil { - mmDeleteKnowledgeBase.mock.t.Fatalf("RepositoryIMock.DeleteKnowledgeBase mock is already set by Expect") + if mmDeleteEmbeddingsBySource.defaultExpectation.params != nil { + mmDeleteEmbeddingsBySource.mock.t.Fatalf("RepositoryIMock.DeleteEmbeddingsBySource mock is already set by Expect") } - if mmDeleteKnowledgeBase.defaultExpectation.paramPtrs == nil { - mmDeleteKnowledgeBase.defaultExpectation.paramPtrs = &RepositoryIMockDeleteKnowledgeBaseParamPtrs{} + if mmDeleteEmbeddingsBySource.defaultExpectation.paramPtrs == nil { + mmDeleteEmbeddingsBySource.defaultExpectation.paramPtrs = &RepositoryIMockDeleteEmbeddingsBySourceParamPtrs{} } - mmDeleteKnowledgeBase.defaultExpectation.paramPtrs.ownerUID = &ownerUID + mmDeleteEmbeddingsBySource.defaultExpectation.paramPtrs.sourceTable = &sourceTable - return mmDeleteKnowledgeBase + return mmDeleteEmbeddingsBySource } -// ExpectKbIDParam3 sets up expected param kbID for RepositoryI.DeleteKnowledgeBase -func (mmDeleteKnowledgeBase *mRepositoryIMockDeleteKnowledgeBase) ExpectKbIDParam3(kbID string) *mRepositoryIMockDeleteKnowledgeBase { - if mmDeleteKnowledgeBase.mock.funcDeleteKnowledgeBase != nil { - mmDeleteKnowledgeBase.mock.t.Fatalf("RepositoryIMock.DeleteKnowledgeBase mock is already set by Set") +// ExpectSourceUIDParam3 sets up expected param sourceUID for RepositoryI.DeleteEmbeddingsBySource +func (mmDeleteEmbeddingsBySource *mRepositoryIMockDeleteEmbeddingsBySource) ExpectSourceUIDParam3(sourceUID uuid.UUID) *mRepositoryIMockDeleteEmbeddingsBySource { + if mmDeleteEmbeddingsBySource.mock.funcDeleteEmbeddingsBySource != nil { + mmDeleteEmbeddingsBySource.mock.t.Fatalf("RepositoryIMock.DeleteEmbeddingsBySource mock is already set by Set") } - if mmDeleteKnowledgeBase.defaultExpectation == nil { - mmDeleteKnowledgeBase.defaultExpectation = &RepositoryIMockDeleteKnowledgeBaseExpectation{} + if mmDeleteEmbeddingsBySource.defaultExpectation == nil { + mmDeleteEmbeddingsBySource.defaultExpectation = &RepositoryIMockDeleteEmbeddingsBySourceExpectation{} } - if mmDeleteKnowledgeBase.defaultExpectation.params != nil { - mmDeleteKnowledgeBase.mock.t.Fatalf("RepositoryIMock.DeleteKnowledgeBase mock is already set by Expect") + if mmDeleteEmbeddingsBySource.defaultExpectation.params != nil { + mmDeleteEmbeddingsBySource.mock.t.Fatalf("RepositoryIMock.DeleteEmbeddingsBySource mock is already set by Expect") } - if mmDeleteKnowledgeBase.defaultExpectation.paramPtrs == nil { - mmDeleteKnowledgeBase.defaultExpectation.paramPtrs = &RepositoryIMockDeleteKnowledgeBaseParamPtrs{} + if mmDeleteEmbeddingsBySource.defaultExpectation.paramPtrs == nil { + mmDeleteEmbeddingsBySource.defaultExpectation.paramPtrs = &RepositoryIMockDeleteEmbeddingsBySourceParamPtrs{} } - mmDeleteKnowledgeBase.defaultExpectation.paramPtrs.kbID = &kbID + mmDeleteEmbeddingsBySource.defaultExpectation.paramPtrs.sourceUID = &sourceUID - return mmDeleteKnowledgeBase + return mmDeleteEmbeddingsBySource } -// Inspect accepts an inspector function that has same arguments as the RepositoryI.DeleteKnowledgeBase -func (mmDeleteKnowledgeBase *mRepositoryIMockDeleteKnowledgeBase) Inspect(f func(ctx context.Context, ownerUID string, kbID string)) *mRepositoryIMockDeleteKnowledgeBase { - if mmDeleteKnowledgeBase.mock.inspectFuncDeleteKnowledgeBase != nil { - mmDeleteKnowledgeBase.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.DeleteKnowledgeBase") +// Inspect accepts an inspector function that has same arguments as the RepositoryI.DeleteEmbeddingsBySource +func (mmDeleteEmbeddingsBySource *mRepositoryIMockDeleteEmbeddingsBySource) Inspect(f func(ctx context.Context, sourceTable string, sourceUID uuid.UUID)) *mRepositoryIMockDeleteEmbeddingsBySource { + if mmDeleteEmbeddingsBySource.mock.inspectFuncDeleteEmbeddingsBySource != nil { + mmDeleteEmbeddingsBySource.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.DeleteEmbeddingsBySource") } - mmDeleteKnowledgeBase.mock.inspectFuncDeleteKnowledgeBase = f + mmDeleteEmbeddingsBySource.mock.inspectFuncDeleteEmbeddingsBySource = f - return mmDeleteKnowledgeBase + return mmDeleteEmbeddingsBySource } -// Return sets up results that will be returned by RepositoryI.DeleteKnowledgeBase -func (mmDeleteKnowledgeBase *mRepositoryIMockDeleteKnowledgeBase) Return(kp1 *mm_repository.KnowledgeBase, err error) *RepositoryIMock { - if mmDeleteKnowledgeBase.mock.funcDeleteKnowledgeBase != nil { - mmDeleteKnowledgeBase.mock.t.Fatalf("RepositoryIMock.DeleteKnowledgeBase mock is already set by Set") +// Return sets up results that will be returned by RepositoryI.DeleteEmbeddingsBySource +func (mmDeleteEmbeddingsBySource *mRepositoryIMockDeleteEmbeddingsBySource) Return(err error) *RepositoryIMock { + if mmDeleteEmbeddingsBySource.mock.funcDeleteEmbeddingsBySource != nil { + mmDeleteEmbeddingsBySource.mock.t.Fatalf("RepositoryIMock.DeleteEmbeddingsBySource mock is already set by Set") } - if mmDeleteKnowledgeBase.defaultExpectation == nil { - mmDeleteKnowledgeBase.defaultExpectation = &RepositoryIMockDeleteKnowledgeBaseExpectation{mock: mmDeleteKnowledgeBase.mock} + if mmDeleteEmbeddingsBySource.defaultExpectation == nil { + mmDeleteEmbeddingsBySource.defaultExpectation = &RepositoryIMockDeleteEmbeddingsBySourceExpectation{mock: mmDeleteEmbeddingsBySource.mock} } - mmDeleteKnowledgeBase.defaultExpectation.results = &RepositoryIMockDeleteKnowledgeBaseResults{kp1, err} - return mmDeleteKnowledgeBase.mock + mmDeleteEmbeddingsBySource.defaultExpectation.results = &RepositoryIMockDeleteEmbeddingsBySourceResults{err} + return mmDeleteEmbeddingsBySource.mock } -// Set uses given function f to mock the RepositoryI.DeleteKnowledgeBase method -func (mmDeleteKnowledgeBase *mRepositoryIMockDeleteKnowledgeBase) Set(f func(ctx context.Context, ownerUID string, kbID string) (kp1 *mm_repository.KnowledgeBase, err error)) *RepositoryIMock { - if mmDeleteKnowledgeBase.defaultExpectation != nil { - mmDeleteKnowledgeBase.mock.t.Fatalf("Default expectation is already set for the RepositoryI.DeleteKnowledgeBase method") +// Set uses given function f to mock the RepositoryI.DeleteEmbeddingsBySource method +func (mmDeleteEmbeddingsBySource *mRepositoryIMockDeleteEmbeddingsBySource) Set(f func(ctx context.Context, sourceTable string, sourceUID uuid.UUID) (err error)) *RepositoryIMock { + if mmDeleteEmbeddingsBySource.defaultExpectation != nil { + mmDeleteEmbeddingsBySource.mock.t.Fatalf("Default expectation is already set for the RepositoryI.DeleteEmbeddingsBySource method") } - if len(mmDeleteKnowledgeBase.expectations) > 0 { - mmDeleteKnowledgeBase.mock.t.Fatalf("Some expectations are already set for the RepositoryI.DeleteKnowledgeBase method") + if len(mmDeleteEmbeddingsBySource.expectations) > 0 { + mmDeleteEmbeddingsBySource.mock.t.Fatalf("Some expectations are already set for the RepositoryI.DeleteEmbeddingsBySource method") } - mmDeleteKnowledgeBase.mock.funcDeleteKnowledgeBase = f - return mmDeleteKnowledgeBase.mock + mmDeleteEmbeddingsBySource.mock.funcDeleteEmbeddingsBySource = f + return mmDeleteEmbeddingsBySource.mock } -// When sets expectation for the RepositoryI.DeleteKnowledgeBase which will trigger the result defined by the following +// When sets expectation for the RepositoryI.DeleteEmbeddingsBySource which will trigger the result defined by the following // Then helper -func (mmDeleteKnowledgeBase *mRepositoryIMockDeleteKnowledgeBase) When(ctx context.Context, ownerUID string, kbID string) *RepositoryIMockDeleteKnowledgeBaseExpectation { - if mmDeleteKnowledgeBase.mock.funcDeleteKnowledgeBase != nil { - mmDeleteKnowledgeBase.mock.t.Fatalf("RepositoryIMock.DeleteKnowledgeBase mock is already set by Set") +func (mmDeleteEmbeddingsBySource *mRepositoryIMockDeleteEmbeddingsBySource) When(ctx context.Context, sourceTable string, sourceUID uuid.UUID) *RepositoryIMockDeleteEmbeddingsBySourceExpectation { + if mmDeleteEmbeddingsBySource.mock.funcDeleteEmbeddingsBySource != nil { + mmDeleteEmbeddingsBySource.mock.t.Fatalf("RepositoryIMock.DeleteEmbeddingsBySource mock is already set by Set") } - expectation := &RepositoryIMockDeleteKnowledgeBaseExpectation{ - mock: mmDeleteKnowledgeBase.mock, - params: &RepositoryIMockDeleteKnowledgeBaseParams{ctx, ownerUID, kbID}, + expectation := &RepositoryIMockDeleteEmbeddingsBySourceExpectation{ + mock: mmDeleteEmbeddingsBySource.mock, + params: &RepositoryIMockDeleteEmbeddingsBySourceParams{ctx, sourceTable, sourceUID}, } - mmDeleteKnowledgeBase.expectations = append(mmDeleteKnowledgeBase.expectations, expectation) + mmDeleteEmbeddingsBySource.expectations = append(mmDeleteEmbeddingsBySource.expectations, expectation) return expectation } -// Then sets up RepositoryI.DeleteKnowledgeBase return parameters for the expectation previously defined by the When method -func (e *RepositoryIMockDeleteKnowledgeBaseExpectation) Then(kp1 *mm_repository.KnowledgeBase, err error) *RepositoryIMock { - e.results = &RepositoryIMockDeleteKnowledgeBaseResults{kp1, err} +// Then sets up RepositoryI.DeleteEmbeddingsBySource return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockDeleteEmbeddingsBySourceExpectation) Then(err error) *RepositoryIMock { + e.results = &RepositoryIMockDeleteEmbeddingsBySourceResults{err} return e.mock } -// Times sets number of times RepositoryI.DeleteKnowledgeBase should be invoked -func (mmDeleteKnowledgeBase *mRepositoryIMockDeleteKnowledgeBase) Times(n uint64) *mRepositoryIMockDeleteKnowledgeBase { +// Times sets number of times RepositoryI.DeleteEmbeddingsBySource should be invoked +func (mmDeleteEmbeddingsBySource *mRepositoryIMockDeleteEmbeddingsBySource) Times(n uint64) *mRepositoryIMockDeleteEmbeddingsBySource { if n == 0 { - mmDeleteKnowledgeBase.mock.t.Fatalf("Times of RepositoryIMock.DeleteKnowledgeBase mock can not be zero") + mmDeleteEmbeddingsBySource.mock.t.Fatalf("Times of RepositoryIMock.DeleteEmbeddingsBySource mock can not be zero") } - mm_atomic.StoreUint64(&mmDeleteKnowledgeBase.expectedInvocations, n) - return mmDeleteKnowledgeBase + mm_atomic.StoreUint64(&mmDeleteEmbeddingsBySource.expectedInvocations, n) + return mmDeleteEmbeddingsBySource } -func (mmDeleteKnowledgeBase *mRepositoryIMockDeleteKnowledgeBase) invocationsDone() bool { - if len(mmDeleteKnowledgeBase.expectations) == 0 && mmDeleteKnowledgeBase.defaultExpectation == nil && mmDeleteKnowledgeBase.mock.funcDeleteKnowledgeBase == nil { +func (mmDeleteEmbeddingsBySource *mRepositoryIMockDeleteEmbeddingsBySource) invocationsDone() bool { + if len(mmDeleteEmbeddingsBySource.expectations) == 0 && mmDeleteEmbeddingsBySource.defaultExpectation == nil && mmDeleteEmbeddingsBySource.mock.funcDeleteEmbeddingsBySource == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmDeleteKnowledgeBase.mock.afterDeleteKnowledgeBaseCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmDeleteKnowledgeBase.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmDeleteEmbeddingsBySource.mock.afterDeleteEmbeddingsBySourceCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmDeleteEmbeddingsBySource.expectedInvocations) return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) } -// DeleteKnowledgeBase implements repository.RepositoryI -func (mmDeleteKnowledgeBase *RepositoryIMock) DeleteKnowledgeBase(ctx context.Context, ownerUID string, kbID string) (kp1 *mm_repository.KnowledgeBase, err error) { - mm_atomic.AddUint64(&mmDeleteKnowledgeBase.beforeDeleteKnowledgeBaseCounter, 1) - defer mm_atomic.AddUint64(&mmDeleteKnowledgeBase.afterDeleteKnowledgeBaseCounter, 1) +// DeleteEmbeddingsBySource implements repository.RepositoryI +func (mmDeleteEmbeddingsBySource *RepositoryIMock) DeleteEmbeddingsBySource(ctx context.Context, sourceTable string, sourceUID uuid.UUID) (err error) { + mm_atomic.AddUint64(&mmDeleteEmbeddingsBySource.beforeDeleteEmbeddingsBySourceCounter, 1) + defer mm_atomic.AddUint64(&mmDeleteEmbeddingsBySource.afterDeleteEmbeddingsBySourceCounter, 1) - if mmDeleteKnowledgeBase.inspectFuncDeleteKnowledgeBase != nil { - mmDeleteKnowledgeBase.inspectFuncDeleteKnowledgeBase(ctx, ownerUID, kbID) + if mmDeleteEmbeddingsBySource.inspectFuncDeleteEmbeddingsBySource != nil { + mmDeleteEmbeddingsBySource.inspectFuncDeleteEmbeddingsBySource(ctx, sourceTable, sourceUID) } - mm_params := RepositoryIMockDeleteKnowledgeBaseParams{ctx, ownerUID, kbID} + mm_params := RepositoryIMockDeleteEmbeddingsBySourceParams{ctx, sourceTable, sourceUID} // Record call args - mmDeleteKnowledgeBase.DeleteKnowledgeBaseMock.mutex.Lock() - mmDeleteKnowledgeBase.DeleteKnowledgeBaseMock.callArgs = append(mmDeleteKnowledgeBase.DeleteKnowledgeBaseMock.callArgs, &mm_params) - mmDeleteKnowledgeBase.DeleteKnowledgeBaseMock.mutex.Unlock() + mmDeleteEmbeddingsBySource.DeleteEmbeddingsBySourceMock.mutex.Lock() + mmDeleteEmbeddingsBySource.DeleteEmbeddingsBySourceMock.callArgs = append(mmDeleteEmbeddingsBySource.DeleteEmbeddingsBySourceMock.callArgs, &mm_params) + mmDeleteEmbeddingsBySource.DeleteEmbeddingsBySourceMock.mutex.Unlock() - for _, e := range mmDeleteKnowledgeBase.DeleteKnowledgeBaseMock.expectations { + for _, e := range mmDeleteEmbeddingsBySource.DeleteEmbeddingsBySourceMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.kp1, e.results.err + return e.results.err } } - if mmDeleteKnowledgeBase.DeleteKnowledgeBaseMock.defaultExpectation != nil { - mm_atomic.AddUint64(&mmDeleteKnowledgeBase.DeleteKnowledgeBaseMock.defaultExpectation.Counter, 1) - mm_want := mmDeleteKnowledgeBase.DeleteKnowledgeBaseMock.defaultExpectation.params - mm_want_ptrs := mmDeleteKnowledgeBase.DeleteKnowledgeBaseMock.defaultExpectation.paramPtrs + if mmDeleteEmbeddingsBySource.DeleteEmbeddingsBySourceMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmDeleteEmbeddingsBySource.DeleteEmbeddingsBySourceMock.defaultExpectation.Counter, 1) + mm_want := mmDeleteEmbeddingsBySource.DeleteEmbeddingsBySourceMock.defaultExpectation.params + mm_want_ptrs := mmDeleteEmbeddingsBySource.DeleteEmbeddingsBySourceMock.defaultExpectation.paramPtrs - mm_got := RepositoryIMockDeleteKnowledgeBaseParams{ctx, ownerUID, kbID} + mm_got := RepositoryIMockDeleteEmbeddingsBySourceParams{ctx, sourceTable, sourceUID} if mm_want_ptrs != nil { if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { - mmDeleteKnowledgeBase.t.Errorf("RepositoryIMock.DeleteKnowledgeBase got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) + mmDeleteEmbeddingsBySource.t.Errorf("RepositoryIMock.DeleteEmbeddingsBySource got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) } - if mm_want_ptrs.ownerUID != nil && !minimock.Equal(*mm_want_ptrs.ownerUID, mm_got.ownerUID) { - mmDeleteKnowledgeBase.t.Errorf("RepositoryIMock.DeleteKnowledgeBase got unexpected parameter ownerUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.ownerUID, mm_got.ownerUID, minimock.Diff(*mm_want_ptrs.ownerUID, mm_got.ownerUID)) + if mm_want_ptrs.sourceTable != nil && !minimock.Equal(*mm_want_ptrs.sourceTable, mm_got.sourceTable) { + mmDeleteEmbeddingsBySource.t.Errorf("RepositoryIMock.DeleteEmbeddingsBySource got unexpected parameter sourceTable, want: %#v, got: %#v%s\n", *mm_want_ptrs.sourceTable, mm_got.sourceTable, minimock.Diff(*mm_want_ptrs.sourceTable, mm_got.sourceTable)) } - if mm_want_ptrs.kbID != nil && !minimock.Equal(*mm_want_ptrs.kbID, mm_got.kbID) { - mmDeleteKnowledgeBase.t.Errorf("RepositoryIMock.DeleteKnowledgeBase got unexpected parameter kbID, want: %#v, got: %#v%s\n", *mm_want_ptrs.kbID, mm_got.kbID, minimock.Diff(*mm_want_ptrs.kbID, mm_got.kbID)) + if mm_want_ptrs.sourceUID != nil && !minimock.Equal(*mm_want_ptrs.sourceUID, mm_got.sourceUID) { + mmDeleteEmbeddingsBySource.t.Errorf("RepositoryIMock.DeleteEmbeddingsBySource got unexpected parameter sourceUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.sourceUID, mm_got.sourceUID, minimock.Diff(*mm_want_ptrs.sourceUID, mm_got.sourceUID)) } } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { - mmDeleteKnowledgeBase.t.Errorf("RepositoryIMock.DeleteKnowledgeBase got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + mmDeleteEmbeddingsBySource.t.Errorf("RepositoryIMock.DeleteEmbeddingsBySource got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) } - mm_results := mmDeleteKnowledgeBase.DeleteKnowledgeBaseMock.defaultExpectation.results + mm_results := mmDeleteEmbeddingsBySource.DeleteEmbeddingsBySourceMock.defaultExpectation.results if mm_results == nil { - mmDeleteKnowledgeBase.t.Fatal("No results are set for the RepositoryIMock.DeleteKnowledgeBase") + mmDeleteEmbeddingsBySource.t.Fatal("No results are set for the RepositoryIMock.DeleteEmbeddingsBySource") } - return (*mm_results).kp1, (*mm_results).err + return (*mm_results).err } - if mmDeleteKnowledgeBase.funcDeleteKnowledgeBase != nil { - return mmDeleteKnowledgeBase.funcDeleteKnowledgeBase(ctx, ownerUID, kbID) + if mmDeleteEmbeddingsBySource.funcDeleteEmbeddingsBySource != nil { + return mmDeleteEmbeddingsBySource.funcDeleteEmbeddingsBySource(ctx, sourceTable, sourceUID) } - mmDeleteKnowledgeBase.t.Fatalf("Unexpected call to RepositoryIMock.DeleteKnowledgeBase. %v %v %v", ctx, ownerUID, kbID) + mmDeleteEmbeddingsBySource.t.Fatalf("Unexpected call to RepositoryIMock.DeleteEmbeddingsBySource. %v %v %v", ctx, sourceTable, sourceUID) return } -// DeleteKnowledgeBaseAfterCounter returns a count of finished RepositoryIMock.DeleteKnowledgeBase invocations -func (mmDeleteKnowledgeBase *RepositoryIMock) DeleteKnowledgeBaseAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmDeleteKnowledgeBase.afterDeleteKnowledgeBaseCounter) +// DeleteEmbeddingsBySourceAfterCounter returns a count of finished RepositoryIMock.DeleteEmbeddingsBySource invocations +func (mmDeleteEmbeddingsBySource *RepositoryIMock) DeleteEmbeddingsBySourceAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmDeleteEmbeddingsBySource.afterDeleteEmbeddingsBySourceCounter) } -// DeleteKnowledgeBaseBeforeCounter returns a count of RepositoryIMock.DeleteKnowledgeBase invocations -func (mmDeleteKnowledgeBase *RepositoryIMock) DeleteKnowledgeBaseBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmDeleteKnowledgeBase.beforeDeleteKnowledgeBaseCounter) +// DeleteEmbeddingsBySourceBeforeCounter returns a count of RepositoryIMock.DeleteEmbeddingsBySource invocations +func (mmDeleteEmbeddingsBySource *RepositoryIMock) DeleteEmbeddingsBySourceBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmDeleteEmbeddingsBySource.beforeDeleteEmbeddingsBySourceCounter) } -// Calls returns a list of arguments used in each call to RepositoryIMock.DeleteKnowledgeBase. +// Calls returns a list of arguments used in each call to RepositoryIMock.DeleteEmbeddingsBySource. // The list is in the same order as the calls were made (i.e. recent calls have a higher index) -func (mmDeleteKnowledgeBase *mRepositoryIMockDeleteKnowledgeBase) Calls() []*RepositoryIMockDeleteKnowledgeBaseParams { - mmDeleteKnowledgeBase.mutex.RLock() +func (mmDeleteEmbeddingsBySource *mRepositoryIMockDeleteEmbeddingsBySource) Calls() []*RepositoryIMockDeleteEmbeddingsBySourceParams { + mmDeleteEmbeddingsBySource.mutex.RLock() - argCopy := make([]*RepositoryIMockDeleteKnowledgeBaseParams, len(mmDeleteKnowledgeBase.callArgs)) - copy(argCopy, mmDeleteKnowledgeBase.callArgs) + argCopy := make([]*RepositoryIMockDeleteEmbeddingsBySourceParams, len(mmDeleteEmbeddingsBySource.callArgs)) + copy(argCopy, mmDeleteEmbeddingsBySource.callArgs) - mmDeleteKnowledgeBase.mutex.RUnlock() + mmDeleteEmbeddingsBySource.mutex.RUnlock() return argCopy } -// MinimockDeleteKnowledgeBaseDone returns true if the count of the DeleteKnowledgeBase invocations corresponds +// MinimockDeleteEmbeddingsBySourceDone returns true if the count of the DeleteEmbeddingsBySource invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockDeleteKnowledgeBaseDone() bool { - for _, e := range m.DeleteKnowledgeBaseMock.expectations { +func (m *RepositoryIMock) MinimockDeleteEmbeddingsBySourceDone() bool { + for _, e := range m.DeleteEmbeddingsBySourceMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.DeleteKnowledgeBaseMock.invocationsDone() + return m.DeleteEmbeddingsBySourceMock.invocationsDone() } -// MinimockDeleteKnowledgeBaseInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockDeleteKnowledgeBaseInspect() { - for _, e := range m.DeleteKnowledgeBaseMock.expectations { +// MinimockDeleteEmbeddingsBySourceInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockDeleteEmbeddingsBySourceInspect() { + for _, e := range m.DeleteEmbeddingsBySourceMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { - m.t.Errorf("Expected call to RepositoryIMock.DeleteKnowledgeBase with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.DeleteEmbeddingsBySource with params: %#v", *e.params) } } - afterDeleteKnowledgeBaseCounter := mm_atomic.LoadUint64(&m.afterDeleteKnowledgeBaseCounter) + afterDeleteEmbeddingsBySourceCounter := mm_atomic.LoadUint64(&m.afterDeleteEmbeddingsBySourceCounter) // if default expectation was set then invocations count should be greater than zero - if m.DeleteKnowledgeBaseMock.defaultExpectation != nil && afterDeleteKnowledgeBaseCounter < 1 { - if m.DeleteKnowledgeBaseMock.defaultExpectation.params == nil { - m.t.Error("Expected call to RepositoryIMock.DeleteKnowledgeBase") + if m.DeleteEmbeddingsBySourceMock.defaultExpectation != nil && afterDeleteEmbeddingsBySourceCounter < 1 { + if m.DeleteEmbeddingsBySourceMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.DeleteEmbeddingsBySource") } else { - m.t.Errorf("Expected call to RepositoryIMock.DeleteKnowledgeBase with params: %#v", *m.DeleteKnowledgeBaseMock.defaultExpectation.params) + m.t.Errorf("Expected call to RepositoryIMock.DeleteEmbeddingsBySource with params: %#v", *m.DeleteEmbeddingsBySourceMock.defaultExpectation.params) } } // if func was set then invocations count should be greater than zero - if m.funcDeleteKnowledgeBase != nil && afterDeleteKnowledgeBaseCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.DeleteKnowledgeBase") + if m.funcDeleteEmbeddingsBySource != nil && afterDeleteEmbeddingsBySourceCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.DeleteEmbeddingsBySource") } - if !m.DeleteKnowledgeBaseMock.invocationsDone() && afterDeleteKnowledgeBaseCounter > 0 { - m.t.Errorf("Expected %d calls to RepositoryIMock.DeleteKnowledgeBase but found %d calls", - mm_atomic.LoadUint64(&m.DeleteKnowledgeBaseMock.expectedInvocations), afterDeleteKnowledgeBaseCounter) + if !m.DeleteEmbeddingsBySourceMock.invocationsDone() && afterDeleteEmbeddingsBySourceCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.DeleteEmbeddingsBySource but found %d calls", + mm_atomic.LoadUint64(&m.DeleteEmbeddingsBySourceMock.expectedInvocations), afterDeleteEmbeddingsBySourceCounter) } } -type mRepositoryIMockDeleteKnowledgeBaseFile struct { +type mRepositoryIMockDeleteEmbeddingsByUIDs struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockDeleteKnowledgeBaseFileExpectation - expectations []*RepositoryIMockDeleteKnowledgeBaseFileExpectation + defaultExpectation *RepositoryIMockDeleteEmbeddingsByUIDsExpectation + expectations []*RepositoryIMockDeleteEmbeddingsByUIDsExpectation - callArgs []*RepositoryIMockDeleteKnowledgeBaseFileParams + callArgs []*RepositoryIMockDeleteEmbeddingsByUIDsParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockDeleteKnowledgeBaseFileExpectation specifies expectation struct of the RepositoryI.DeleteKnowledgeBaseFile -type RepositoryIMockDeleteKnowledgeBaseFileExpectation struct { +// RepositoryIMockDeleteEmbeddingsByUIDsExpectation specifies expectation struct of the RepositoryI.DeleteEmbeddingsByUIDs +type RepositoryIMockDeleteEmbeddingsByUIDsExpectation struct { mock *RepositoryIMock - params *RepositoryIMockDeleteKnowledgeBaseFileParams - paramPtrs *RepositoryIMockDeleteKnowledgeBaseFileParamPtrs - results *RepositoryIMockDeleteKnowledgeBaseFileResults + params *RepositoryIMockDeleteEmbeddingsByUIDsParams + paramPtrs *RepositoryIMockDeleteEmbeddingsByUIDsParamPtrs + results *RepositoryIMockDeleteEmbeddingsByUIDsResults Counter uint64 } -// RepositoryIMockDeleteKnowledgeBaseFileParams contains parameters of the RepositoryI.DeleteKnowledgeBaseFile -type RepositoryIMockDeleteKnowledgeBaseFileParams struct { +// RepositoryIMockDeleteEmbeddingsByUIDsParams contains parameters of the RepositoryI.DeleteEmbeddingsByUIDs +type RepositoryIMockDeleteEmbeddingsByUIDsParams struct { ctx context.Context - fileUID string + embUIDs []uuid.UUID } -// RepositoryIMockDeleteKnowledgeBaseFileParamPtrs contains pointers to parameters of the RepositoryI.DeleteKnowledgeBaseFile -type RepositoryIMockDeleteKnowledgeBaseFileParamPtrs struct { +// RepositoryIMockDeleteEmbeddingsByUIDsParamPtrs contains pointers to parameters of the RepositoryI.DeleteEmbeddingsByUIDs +type RepositoryIMockDeleteEmbeddingsByUIDsParamPtrs struct { ctx *context.Context - fileUID *string + embUIDs *[]uuid.UUID } -// RepositoryIMockDeleteKnowledgeBaseFileResults contains results of the RepositoryI.DeleteKnowledgeBaseFile -type RepositoryIMockDeleteKnowledgeBaseFileResults struct { +// RepositoryIMockDeleteEmbeddingsByUIDsResults contains results of the RepositoryI.DeleteEmbeddingsByUIDs +type RepositoryIMockDeleteEmbeddingsByUIDsResults struct { err error } -// Expect sets up expected params for RepositoryI.DeleteKnowledgeBaseFile -func (mmDeleteKnowledgeBaseFile *mRepositoryIMockDeleteKnowledgeBaseFile) Expect(ctx context.Context, fileUID string) *mRepositoryIMockDeleteKnowledgeBaseFile { - if mmDeleteKnowledgeBaseFile.mock.funcDeleteKnowledgeBaseFile != nil { - mmDeleteKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.DeleteKnowledgeBaseFile mock is already set by Set") +// Expect sets up expected params for RepositoryI.DeleteEmbeddingsByUIDs +func (mmDeleteEmbeddingsByUIDs *mRepositoryIMockDeleteEmbeddingsByUIDs) Expect(ctx context.Context, embUIDs []uuid.UUID) *mRepositoryIMockDeleteEmbeddingsByUIDs { + if mmDeleteEmbeddingsByUIDs.mock.funcDeleteEmbeddingsByUIDs != nil { + mmDeleteEmbeddingsByUIDs.mock.t.Fatalf("RepositoryIMock.DeleteEmbeddingsByUIDs mock is already set by Set") } - if mmDeleteKnowledgeBaseFile.defaultExpectation == nil { - mmDeleteKnowledgeBaseFile.defaultExpectation = &RepositoryIMockDeleteKnowledgeBaseFileExpectation{} + if mmDeleteEmbeddingsByUIDs.defaultExpectation == nil { + mmDeleteEmbeddingsByUIDs.defaultExpectation = &RepositoryIMockDeleteEmbeddingsByUIDsExpectation{} } - if mmDeleteKnowledgeBaseFile.defaultExpectation.paramPtrs != nil { - mmDeleteKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.DeleteKnowledgeBaseFile mock is already set by ExpectParams functions") + if mmDeleteEmbeddingsByUIDs.defaultExpectation.paramPtrs != nil { + mmDeleteEmbeddingsByUIDs.mock.t.Fatalf("RepositoryIMock.DeleteEmbeddingsByUIDs mock is already set by ExpectParams functions") } - mmDeleteKnowledgeBaseFile.defaultExpectation.params = &RepositoryIMockDeleteKnowledgeBaseFileParams{ctx, fileUID} - for _, e := range mmDeleteKnowledgeBaseFile.expectations { - if minimock.Equal(e.params, mmDeleteKnowledgeBaseFile.defaultExpectation.params) { - mmDeleteKnowledgeBaseFile.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmDeleteKnowledgeBaseFile.defaultExpectation.params) + mmDeleteEmbeddingsByUIDs.defaultExpectation.params = &RepositoryIMockDeleteEmbeddingsByUIDsParams{ctx, embUIDs} + for _, e := range mmDeleteEmbeddingsByUIDs.expectations { + if minimock.Equal(e.params, mmDeleteEmbeddingsByUIDs.defaultExpectation.params) { + mmDeleteEmbeddingsByUIDs.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmDeleteEmbeddingsByUIDs.defaultExpectation.params) } } - return mmDeleteKnowledgeBaseFile + return mmDeleteEmbeddingsByUIDs } -// ExpectCtxParam1 sets up expected param ctx for RepositoryI.DeleteKnowledgeBaseFile -func (mmDeleteKnowledgeBaseFile *mRepositoryIMockDeleteKnowledgeBaseFile) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockDeleteKnowledgeBaseFile { - if mmDeleteKnowledgeBaseFile.mock.funcDeleteKnowledgeBaseFile != nil { - mmDeleteKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.DeleteKnowledgeBaseFile mock is already set by Set") +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.DeleteEmbeddingsByUIDs +func (mmDeleteEmbeddingsByUIDs *mRepositoryIMockDeleteEmbeddingsByUIDs) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockDeleteEmbeddingsByUIDs { + if mmDeleteEmbeddingsByUIDs.mock.funcDeleteEmbeddingsByUIDs != nil { + mmDeleteEmbeddingsByUIDs.mock.t.Fatalf("RepositoryIMock.DeleteEmbeddingsByUIDs mock is already set by Set") } - if mmDeleteKnowledgeBaseFile.defaultExpectation == nil { - mmDeleteKnowledgeBaseFile.defaultExpectation = &RepositoryIMockDeleteKnowledgeBaseFileExpectation{} + if mmDeleteEmbeddingsByUIDs.defaultExpectation == nil { + mmDeleteEmbeddingsByUIDs.defaultExpectation = &RepositoryIMockDeleteEmbeddingsByUIDsExpectation{} } - if mmDeleteKnowledgeBaseFile.defaultExpectation.params != nil { - mmDeleteKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.DeleteKnowledgeBaseFile mock is already set by Expect") + if mmDeleteEmbeddingsByUIDs.defaultExpectation.params != nil { + mmDeleteEmbeddingsByUIDs.mock.t.Fatalf("RepositoryIMock.DeleteEmbeddingsByUIDs mock is already set by Expect") } - if mmDeleteKnowledgeBaseFile.defaultExpectation.paramPtrs == nil { - mmDeleteKnowledgeBaseFile.defaultExpectation.paramPtrs = &RepositoryIMockDeleteKnowledgeBaseFileParamPtrs{} + if mmDeleteEmbeddingsByUIDs.defaultExpectation.paramPtrs == nil { + mmDeleteEmbeddingsByUIDs.defaultExpectation.paramPtrs = &RepositoryIMockDeleteEmbeddingsByUIDsParamPtrs{} } - mmDeleteKnowledgeBaseFile.defaultExpectation.paramPtrs.ctx = &ctx + mmDeleteEmbeddingsByUIDs.defaultExpectation.paramPtrs.ctx = &ctx - return mmDeleteKnowledgeBaseFile + return mmDeleteEmbeddingsByUIDs } -// ExpectFileUIDParam2 sets up expected param fileUID for RepositoryI.DeleteKnowledgeBaseFile -func (mmDeleteKnowledgeBaseFile *mRepositoryIMockDeleteKnowledgeBaseFile) ExpectFileUIDParam2(fileUID string) *mRepositoryIMockDeleteKnowledgeBaseFile { - if mmDeleteKnowledgeBaseFile.mock.funcDeleteKnowledgeBaseFile != nil { - mmDeleteKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.DeleteKnowledgeBaseFile mock is already set by Set") +// ExpectEmbUIDsParam2 sets up expected param embUIDs for RepositoryI.DeleteEmbeddingsByUIDs +func (mmDeleteEmbeddingsByUIDs *mRepositoryIMockDeleteEmbeddingsByUIDs) ExpectEmbUIDsParam2(embUIDs []uuid.UUID) *mRepositoryIMockDeleteEmbeddingsByUIDs { + if mmDeleteEmbeddingsByUIDs.mock.funcDeleteEmbeddingsByUIDs != nil { + mmDeleteEmbeddingsByUIDs.mock.t.Fatalf("RepositoryIMock.DeleteEmbeddingsByUIDs mock is already set by Set") } - if mmDeleteKnowledgeBaseFile.defaultExpectation == nil { - mmDeleteKnowledgeBaseFile.defaultExpectation = &RepositoryIMockDeleteKnowledgeBaseFileExpectation{} + if mmDeleteEmbeddingsByUIDs.defaultExpectation == nil { + mmDeleteEmbeddingsByUIDs.defaultExpectation = &RepositoryIMockDeleteEmbeddingsByUIDsExpectation{} } - if mmDeleteKnowledgeBaseFile.defaultExpectation.params != nil { - mmDeleteKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.DeleteKnowledgeBaseFile mock is already set by Expect") + if mmDeleteEmbeddingsByUIDs.defaultExpectation.params != nil { + mmDeleteEmbeddingsByUIDs.mock.t.Fatalf("RepositoryIMock.DeleteEmbeddingsByUIDs mock is already set by Expect") } - if mmDeleteKnowledgeBaseFile.defaultExpectation.paramPtrs == nil { - mmDeleteKnowledgeBaseFile.defaultExpectation.paramPtrs = &RepositoryIMockDeleteKnowledgeBaseFileParamPtrs{} + if mmDeleteEmbeddingsByUIDs.defaultExpectation.paramPtrs == nil { + mmDeleteEmbeddingsByUIDs.defaultExpectation.paramPtrs = &RepositoryIMockDeleteEmbeddingsByUIDsParamPtrs{} } - mmDeleteKnowledgeBaseFile.defaultExpectation.paramPtrs.fileUID = &fileUID + mmDeleteEmbeddingsByUIDs.defaultExpectation.paramPtrs.embUIDs = &embUIDs - return mmDeleteKnowledgeBaseFile + return mmDeleteEmbeddingsByUIDs } -// Inspect accepts an inspector function that has same arguments as the RepositoryI.DeleteKnowledgeBaseFile -func (mmDeleteKnowledgeBaseFile *mRepositoryIMockDeleteKnowledgeBaseFile) Inspect(f func(ctx context.Context, fileUID string)) *mRepositoryIMockDeleteKnowledgeBaseFile { - if mmDeleteKnowledgeBaseFile.mock.inspectFuncDeleteKnowledgeBaseFile != nil { - mmDeleteKnowledgeBaseFile.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.DeleteKnowledgeBaseFile") +// Inspect accepts an inspector function that has same arguments as the RepositoryI.DeleteEmbeddingsByUIDs +func (mmDeleteEmbeddingsByUIDs *mRepositoryIMockDeleteEmbeddingsByUIDs) Inspect(f func(ctx context.Context, embUIDs []uuid.UUID)) *mRepositoryIMockDeleteEmbeddingsByUIDs { + if mmDeleteEmbeddingsByUIDs.mock.inspectFuncDeleteEmbeddingsByUIDs != nil { + mmDeleteEmbeddingsByUIDs.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.DeleteEmbeddingsByUIDs") } - mmDeleteKnowledgeBaseFile.mock.inspectFuncDeleteKnowledgeBaseFile = f + mmDeleteEmbeddingsByUIDs.mock.inspectFuncDeleteEmbeddingsByUIDs = f - return mmDeleteKnowledgeBaseFile + return mmDeleteEmbeddingsByUIDs } -// Return sets up results that will be returned by RepositoryI.DeleteKnowledgeBaseFile -func (mmDeleteKnowledgeBaseFile *mRepositoryIMockDeleteKnowledgeBaseFile) Return(err error) *RepositoryIMock { - if mmDeleteKnowledgeBaseFile.mock.funcDeleteKnowledgeBaseFile != nil { - mmDeleteKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.DeleteKnowledgeBaseFile mock is already set by Set") +// Return sets up results that will be returned by RepositoryI.DeleteEmbeddingsByUIDs +func (mmDeleteEmbeddingsByUIDs *mRepositoryIMockDeleteEmbeddingsByUIDs) Return(err error) *RepositoryIMock { + if mmDeleteEmbeddingsByUIDs.mock.funcDeleteEmbeddingsByUIDs != nil { + mmDeleteEmbeddingsByUIDs.mock.t.Fatalf("RepositoryIMock.DeleteEmbeddingsByUIDs mock is already set by Set") } - if mmDeleteKnowledgeBaseFile.defaultExpectation == nil { - mmDeleteKnowledgeBaseFile.defaultExpectation = &RepositoryIMockDeleteKnowledgeBaseFileExpectation{mock: mmDeleteKnowledgeBaseFile.mock} + if mmDeleteEmbeddingsByUIDs.defaultExpectation == nil { + mmDeleteEmbeddingsByUIDs.defaultExpectation = &RepositoryIMockDeleteEmbeddingsByUIDsExpectation{mock: mmDeleteEmbeddingsByUIDs.mock} } - mmDeleteKnowledgeBaseFile.defaultExpectation.results = &RepositoryIMockDeleteKnowledgeBaseFileResults{err} - return mmDeleteKnowledgeBaseFile.mock + mmDeleteEmbeddingsByUIDs.defaultExpectation.results = &RepositoryIMockDeleteEmbeddingsByUIDsResults{err} + return mmDeleteEmbeddingsByUIDs.mock } -// Set uses given function f to mock the RepositoryI.DeleteKnowledgeBaseFile method -func (mmDeleteKnowledgeBaseFile *mRepositoryIMockDeleteKnowledgeBaseFile) Set(f func(ctx context.Context, fileUID string) (err error)) *RepositoryIMock { - if mmDeleteKnowledgeBaseFile.defaultExpectation != nil { - mmDeleteKnowledgeBaseFile.mock.t.Fatalf("Default expectation is already set for the RepositoryI.DeleteKnowledgeBaseFile method") +// Set uses given function f to mock the RepositoryI.DeleteEmbeddingsByUIDs method +func (mmDeleteEmbeddingsByUIDs *mRepositoryIMockDeleteEmbeddingsByUIDs) Set(f func(ctx context.Context, embUIDs []uuid.UUID) (err error)) *RepositoryIMock { + if mmDeleteEmbeddingsByUIDs.defaultExpectation != nil { + mmDeleteEmbeddingsByUIDs.mock.t.Fatalf("Default expectation is already set for the RepositoryI.DeleteEmbeddingsByUIDs method") } - if len(mmDeleteKnowledgeBaseFile.expectations) > 0 { - mmDeleteKnowledgeBaseFile.mock.t.Fatalf("Some expectations are already set for the RepositoryI.DeleteKnowledgeBaseFile method") + if len(mmDeleteEmbeddingsByUIDs.expectations) > 0 { + mmDeleteEmbeddingsByUIDs.mock.t.Fatalf("Some expectations are already set for the RepositoryI.DeleteEmbeddingsByUIDs method") } - mmDeleteKnowledgeBaseFile.mock.funcDeleteKnowledgeBaseFile = f - return mmDeleteKnowledgeBaseFile.mock + mmDeleteEmbeddingsByUIDs.mock.funcDeleteEmbeddingsByUIDs = f + return mmDeleteEmbeddingsByUIDs.mock } -// When sets expectation for the RepositoryI.DeleteKnowledgeBaseFile which will trigger the result defined by the following +// When sets expectation for the RepositoryI.DeleteEmbeddingsByUIDs which will trigger the result defined by the following // Then helper -func (mmDeleteKnowledgeBaseFile *mRepositoryIMockDeleteKnowledgeBaseFile) When(ctx context.Context, fileUID string) *RepositoryIMockDeleteKnowledgeBaseFileExpectation { - if mmDeleteKnowledgeBaseFile.mock.funcDeleteKnowledgeBaseFile != nil { - mmDeleteKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.DeleteKnowledgeBaseFile mock is already set by Set") +func (mmDeleteEmbeddingsByUIDs *mRepositoryIMockDeleteEmbeddingsByUIDs) When(ctx context.Context, embUIDs []uuid.UUID) *RepositoryIMockDeleteEmbeddingsByUIDsExpectation { + if mmDeleteEmbeddingsByUIDs.mock.funcDeleteEmbeddingsByUIDs != nil { + mmDeleteEmbeddingsByUIDs.mock.t.Fatalf("RepositoryIMock.DeleteEmbeddingsByUIDs mock is already set by Set") } - expectation := &RepositoryIMockDeleteKnowledgeBaseFileExpectation{ - mock: mmDeleteKnowledgeBaseFile.mock, - params: &RepositoryIMockDeleteKnowledgeBaseFileParams{ctx, fileUID}, + expectation := &RepositoryIMockDeleteEmbeddingsByUIDsExpectation{ + mock: mmDeleteEmbeddingsByUIDs.mock, + params: &RepositoryIMockDeleteEmbeddingsByUIDsParams{ctx, embUIDs}, } - mmDeleteKnowledgeBaseFile.expectations = append(mmDeleteKnowledgeBaseFile.expectations, expectation) + mmDeleteEmbeddingsByUIDs.expectations = append(mmDeleteEmbeddingsByUIDs.expectations, expectation) return expectation } -// Then sets up RepositoryI.DeleteKnowledgeBaseFile return parameters for the expectation previously defined by the When method -func (e *RepositoryIMockDeleteKnowledgeBaseFileExpectation) Then(err error) *RepositoryIMock { - e.results = &RepositoryIMockDeleteKnowledgeBaseFileResults{err} +// Then sets up RepositoryI.DeleteEmbeddingsByUIDs return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockDeleteEmbeddingsByUIDsExpectation) Then(err error) *RepositoryIMock { + e.results = &RepositoryIMockDeleteEmbeddingsByUIDsResults{err} return e.mock } -// Times sets number of times RepositoryI.DeleteKnowledgeBaseFile should be invoked -func (mmDeleteKnowledgeBaseFile *mRepositoryIMockDeleteKnowledgeBaseFile) Times(n uint64) *mRepositoryIMockDeleteKnowledgeBaseFile { +// Times sets number of times RepositoryI.DeleteEmbeddingsByUIDs should be invoked +func (mmDeleteEmbeddingsByUIDs *mRepositoryIMockDeleteEmbeddingsByUIDs) Times(n uint64) *mRepositoryIMockDeleteEmbeddingsByUIDs { if n == 0 { - mmDeleteKnowledgeBaseFile.mock.t.Fatalf("Times of RepositoryIMock.DeleteKnowledgeBaseFile mock can not be zero") + mmDeleteEmbeddingsByUIDs.mock.t.Fatalf("Times of RepositoryIMock.DeleteEmbeddingsByUIDs mock can not be zero") } - mm_atomic.StoreUint64(&mmDeleteKnowledgeBaseFile.expectedInvocations, n) - return mmDeleteKnowledgeBaseFile + mm_atomic.StoreUint64(&mmDeleteEmbeddingsByUIDs.expectedInvocations, n) + return mmDeleteEmbeddingsByUIDs } -func (mmDeleteKnowledgeBaseFile *mRepositoryIMockDeleteKnowledgeBaseFile) invocationsDone() bool { - if len(mmDeleteKnowledgeBaseFile.expectations) == 0 && mmDeleteKnowledgeBaseFile.defaultExpectation == nil && mmDeleteKnowledgeBaseFile.mock.funcDeleteKnowledgeBaseFile == nil { +func (mmDeleteEmbeddingsByUIDs *mRepositoryIMockDeleteEmbeddingsByUIDs) invocationsDone() bool { + if len(mmDeleteEmbeddingsByUIDs.expectations) == 0 && mmDeleteEmbeddingsByUIDs.defaultExpectation == nil && mmDeleteEmbeddingsByUIDs.mock.funcDeleteEmbeddingsByUIDs == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmDeleteKnowledgeBaseFile.mock.afterDeleteKnowledgeBaseFileCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmDeleteKnowledgeBaseFile.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmDeleteEmbeddingsByUIDs.mock.afterDeleteEmbeddingsByUIDsCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmDeleteEmbeddingsByUIDs.expectedInvocations) return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) } -// DeleteKnowledgeBaseFile implements repository.RepositoryI -func (mmDeleteKnowledgeBaseFile *RepositoryIMock) DeleteKnowledgeBaseFile(ctx context.Context, fileUID string) (err error) { - mm_atomic.AddUint64(&mmDeleteKnowledgeBaseFile.beforeDeleteKnowledgeBaseFileCounter, 1) - defer mm_atomic.AddUint64(&mmDeleteKnowledgeBaseFile.afterDeleteKnowledgeBaseFileCounter, 1) +// DeleteEmbeddingsByUIDs implements repository.RepositoryI +func (mmDeleteEmbeddingsByUIDs *RepositoryIMock) DeleteEmbeddingsByUIDs(ctx context.Context, embUIDs []uuid.UUID) (err error) { + mm_atomic.AddUint64(&mmDeleteEmbeddingsByUIDs.beforeDeleteEmbeddingsByUIDsCounter, 1) + defer mm_atomic.AddUint64(&mmDeleteEmbeddingsByUIDs.afterDeleteEmbeddingsByUIDsCounter, 1) - if mmDeleteKnowledgeBaseFile.inspectFuncDeleteKnowledgeBaseFile != nil { - mmDeleteKnowledgeBaseFile.inspectFuncDeleteKnowledgeBaseFile(ctx, fileUID) + if mmDeleteEmbeddingsByUIDs.inspectFuncDeleteEmbeddingsByUIDs != nil { + mmDeleteEmbeddingsByUIDs.inspectFuncDeleteEmbeddingsByUIDs(ctx, embUIDs) } - mm_params := RepositoryIMockDeleteKnowledgeBaseFileParams{ctx, fileUID} + mm_params := RepositoryIMockDeleteEmbeddingsByUIDsParams{ctx, embUIDs} // Record call args - mmDeleteKnowledgeBaseFile.DeleteKnowledgeBaseFileMock.mutex.Lock() - mmDeleteKnowledgeBaseFile.DeleteKnowledgeBaseFileMock.callArgs = append(mmDeleteKnowledgeBaseFile.DeleteKnowledgeBaseFileMock.callArgs, &mm_params) - mmDeleteKnowledgeBaseFile.DeleteKnowledgeBaseFileMock.mutex.Unlock() + mmDeleteEmbeddingsByUIDs.DeleteEmbeddingsByUIDsMock.mutex.Lock() + mmDeleteEmbeddingsByUIDs.DeleteEmbeddingsByUIDsMock.callArgs = append(mmDeleteEmbeddingsByUIDs.DeleteEmbeddingsByUIDsMock.callArgs, &mm_params) + mmDeleteEmbeddingsByUIDs.DeleteEmbeddingsByUIDsMock.mutex.Unlock() - for _, e := range mmDeleteKnowledgeBaseFile.DeleteKnowledgeBaseFileMock.expectations { + for _, e := range mmDeleteEmbeddingsByUIDs.DeleteEmbeddingsByUIDsMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) return e.results.err } } - if mmDeleteKnowledgeBaseFile.DeleteKnowledgeBaseFileMock.defaultExpectation != nil { - mm_atomic.AddUint64(&mmDeleteKnowledgeBaseFile.DeleteKnowledgeBaseFileMock.defaultExpectation.Counter, 1) - mm_want := mmDeleteKnowledgeBaseFile.DeleteKnowledgeBaseFileMock.defaultExpectation.params - mm_want_ptrs := mmDeleteKnowledgeBaseFile.DeleteKnowledgeBaseFileMock.defaultExpectation.paramPtrs + if mmDeleteEmbeddingsByUIDs.DeleteEmbeddingsByUIDsMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmDeleteEmbeddingsByUIDs.DeleteEmbeddingsByUIDsMock.defaultExpectation.Counter, 1) + mm_want := mmDeleteEmbeddingsByUIDs.DeleteEmbeddingsByUIDsMock.defaultExpectation.params + mm_want_ptrs := mmDeleteEmbeddingsByUIDs.DeleteEmbeddingsByUIDsMock.defaultExpectation.paramPtrs - mm_got := RepositoryIMockDeleteKnowledgeBaseFileParams{ctx, fileUID} + mm_got := RepositoryIMockDeleteEmbeddingsByUIDsParams{ctx, embUIDs} if mm_want_ptrs != nil { if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { - mmDeleteKnowledgeBaseFile.t.Errorf("RepositoryIMock.DeleteKnowledgeBaseFile got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) + mmDeleteEmbeddingsByUIDs.t.Errorf("RepositoryIMock.DeleteEmbeddingsByUIDs got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) } - if mm_want_ptrs.fileUID != nil && !minimock.Equal(*mm_want_ptrs.fileUID, mm_got.fileUID) { - mmDeleteKnowledgeBaseFile.t.Errorf("RepositoryIMock.DeleteKnowledgeBaseFile got unexpected parameter fileUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.fileUID, mm_got.fileUID, minimock.Diff(*mm_want_ptrs.fileUID, mm_got.fileUID)) + if mm_want_ptrs.embUIDs != nil && !minimock.Equal(*mm_want_ptrs.embUIDs, mm_got.embUIDs) { + mmDeleteEmbeddingsByUIDs.t.Errorf("RepositoryIMock.DeleteEmbeddingsByUIDs got unexpected parameter embUIDs, want: %#v, got: %#v%s\n", *mm_want_ptrs.embUIDs, mm_got.embUIDs, minimock.Diff(*mm_want_ptrs.embUIDs, mm_got.embUIDs)) } } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { - mmDeleteKnowledgeBaseFile.t.Errorf("RepositoryIMock.DeleteKnowledgeBaseFile got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + mmDeleteEmbeddingsByUIDs.t.Errorf("RepositoryIMock.DeleteEmbeddingsByUIDs got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) } - mm_results := mmDeleteKnowledgeBaseFile.DeleteKnowledgeBaseFileMock.defaultExpectation.results + mm_results := mmDeleteEmbeddingsByUIDs.DeleteEmbeddingsByUIDsMock.defaultExpectation.results if mm_results == nil { - mmDeleteKnowledgeBaseFile.t.Fatal("No results are set for the RepositoryIMock.DeleteKnowledgeBaseFile") + mmDeleteEmbeddingsByUIDs.t.Fatal("No results are set for the RepositoryIMock.DeleteEmbeddingsByUIDs") } return (*mm_results).err } - if mmDeleteKnowledgeBaseFile.funcDeleteKnowledgeBaseFile != nil { - return mmDeleteKnowledgeBaseFile.funcDeleteKnowledgeBaseFile(ctx, fileUID) + if mmDeleteEmbeddingsByUIDs.funcDeleteEmbeddingsByUIDs != nil { + return mmDeleteEmbeddingsByUIDs.funcDeleteEmbeddingsByUIDs(ctx, embUIDs) } - mmDeleteKnowledgeBaseFile.t.Fatalf("Unexpected call to RepositoryIMock.DeleteKnowledgeBaseFile. %v %v", ctx, fileUID) + mmDeleteEmbeddingsByUIDs.t.Fatalf("Unexpected call to RepositoryIMock.DeleteEmbeddingsByUIDs. %v %v", ctx, embUIDs) return } -// DeleteKnowledgeBaseFileAfterCounter returns a count of finished RepositoryIMock.DeleteKnowledgeBaseFile invocations -func (mmDeleteKnowledgeBaseFile *RepositoryIMock) DeleteKnowledgeBaseFileAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmDeleteKnowledgeBaseFile.afterDeleteKnowledgeBaseFileCounter) +// DeleteEmbeddingsByUIDsAfterCounter returns a count of finished RepositoryIMock.DeleteEmbeddingsByUIDs invocations +func (mmDeleteEmbeddingsByUIDs *RepositoryIMock) DeleteEmbeddingsByUIDsAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmDeleteEmbeddingsByUIDs.afterDeleteEmbeddingsByUIDsCounter) } -// DeleteKnowledgeBaseFileBeforeCounter returns a count of RepositoryIMock.DeleteKnowledgeBaseFile invocations -func (mmDeleteKnowledgeBaseFile *RepositoryIMock) DeleteKnowledgeBaseFileBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmDeleteKnowledgeBaseFile.beforeDeleteKnowledgeBaseFileCounter) +// DeleteEmbeddingsByUIDsBeforeCounter returns a count of RepositoryIMock.DeleteEmbeddingsByUIDs invocations +func (mmDeleteEmbeddingsByUIDs *RepositoryIMock) DeleteEmbeddingsByUIDsBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmDeleteEmbeddingsByUIDs.beforeDeleteEmbeddingsByUIDsCounter) } -// Calls returns a list of arguments used in each call to RepositoryIMock.DeleteKnowledgeBaseFile. +// Calls returns a list of arguments used in each call to RepositoryIMock.DeleteEmbeddingsByUIDs. // The list is in the same order as the calls were made (i.e. recent calls have a higher index) -func (mmDeleteKnowledgeBaseFile *mRepositoryIMockDeleteKnowledgeBaseFile) Calls() []*RepositoryIMockDeleteKnowledgeBaseFileParams { - mmDeleteKnowledgeBaseFile.mutex.RLock() +func (mmDeleteEmbeddingsByUIDs *mRepositoryIMockDeleteEmbeddingsByUIDs) Calls() []*RepositoryIMockDeleteEmbeddingsByUIDsParams { + mmDeleteEmbeddingsByUIDs.mutex.RLock() - argCopy := make([]*RepositoryIMockDeleteKnowledgeBaseFileParams, len(mmDeleteKnowledgeBaseFile.callArgs)) - copy(argCopy, mmDeleteKnowledgeBaseFile.callArgs) + argCopy := make([]*RepositoryIMockDeleteEmbeddingsByUIDsParams, len(mmDeleteEmbeddingsByUIDs.callArgs)) + copy(argCopy, mmDeleteEmbeddingsByUIDs.callArgs) - mmDeleteKnowledgeBaseFile.mutex.RUnlock() + mmDeleteEmbeddingsByUIDs.mutex.RUnlock() return argCopy } -// MinimockDeleteKnowledgeBaseFileDone returns true if the count of the DeleteKnowledgeBaseFile invocations corresponds +// MinimockDeleteEmbeddingsByUIDsDone returns true if the count of the DeleteEmbeddingsByUIDs invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockDeleteKnowledgeBaseFileDone() bool { - for _, e := range m.DeleteKnowledgeBaseFileMock.expectations { +func (m *RepositoryIMock) MinimockDeleteEmbeddingsByUIDsDone() bool { + for _, e := range m.DeleteEmbeddingsByUIDsMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.DeleteKnowledgeBaseFileMock.invocationsDone() + return m.DeleteEmbeddingsByUIDsMock.invocationsDone() } -// MinimockDeleteKnowledgeBaseFileInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockDeleteKnowledgeBaseFileInspect() { - for _, e := range m.DeleteKnowledgeBaseFileMock.expectations { +// MinimockDeleteEmbeddingsByUIDsInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockDeleteEmbeddingsByUIDsInspect() { + for _, e := range m.DeleteEmbeddingsByUIDsMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { - m.t.Errorf("Expected call to RepositoryIMock.DeleteKnowledgeBaseFile with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.DeleteEmbeddingsByUIDs with params: %#v", *e.params) } } - afterDeleteKnowledgeBaseFileCounter := mm_atomic.LoadUint64(&m.afterDeleteKnowledgeBaseFileCounter) + afterDeleteEmbeddingsByUIDsCounter := mm_atomic.LoadUint64(&m.afterDeleteEmbeddingsByUIDsCounter) // if default expectation was set then invocations count should be greater than zero - if m.DeleteKnowledgeBaseFileMock.defaultExpectation != nil && afterDeleteKnowledgeBaseFileCounter < 1 { - if m.DeleteKnowledgeBaseFileMock.defaultExpectation.params == nil { - m.t.Error("Expected call to RepositoryIMock.DeleteKnowledgeBaseFile") + if m.DeleteEmbeddingsByUIDsMock.defaultExpectation != nil && afterDeleteEmbeddingsByUIDsCounter < 1 { + if m.DeleteEmbeddingsByUIDsMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.DeleteEmbeddingsByUIDs") } else { - m.t.Errorf("Expected call to RepositoryIMock.DeleteKnowledgeBaseFile with params: %#v", *m.DeleteKnowledgeBaseFileMock.defaultExpectation.params) + m.t.Errorf("Expected call to RepositoryIMock.DeleteEmbeddingsByUIDs with params: %#v", *m.DeleteEmbeddingsByUIDsMock.defaultExpectation.params) } } // if func was set then invocations count should be greater than zero - if m.funcDeleteKnowledgeBaseFile != nil && afterDeleteKnowledgeBaseFileCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.DeleteKnowledgeBaseFile") + if m.funcDeleteEmbeddingsByUIDs != nil && afterDeleteEmbeddingsByUIDsCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.DeleteEmbeddingsByUIDs") } - if !m.DeleteKnowledgeBaseFileMock.invocationsDone() && afterDeleteKnowledgeBaseFileCounter > 0 { - m.t.Errorf("Expected %d calls to RepositoryIMock.DeleteKnowledgeBaseFile but found %d calls", - mm_atomic.LoadUint64(&m.DeleteKnowledgeBaseFileMock.expectedInvocations), afterDeleteKnowledgeBaseFileCounter) + if !m.DeleteEmbeddingsByUIDsMock.invocationsDone() && afterDeleteEmbeddingsByUIDsCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.DeleteEmbeddingsByUIDs but found %d calls", + mm_atomic.LoadUint64(&m.DeleteEmbeddingsByUIDsMock.expectedInvocations), afterDeleteEmbeddingsByUIDsCounter) } } -type mRepositoryIMockDeleteRepositoryTag struct { +type mRepositoryIMockDeleteKnowledgeBase struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockDeleteRepositoryTagExpectation - expectations []*RepositoryIMockDeleteRepositoryTagExpectation + defaultExpectation *RepositoryIMockDeleteKnowledgeBaseExpectation + expectations []*RepositoryIMockDeleteKnowledgeBaseExpectation - callArgs []*RepositoryIMockDeleteRepositoryTagParams + callArgs []*RepositoryIMockDeleteKnowledgeBaseParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockDeleteRepositoryTagExpectation specifies expectation struct of the RepositoryI.DeleteRepositoryTag -type RepositoryIMockDeleteRepositoryTagExpectation struct { +// RepositoryIMockDeleteKnowledgeBaseExpectation specifies expectation struct of the RepositoryI.DeleteKnowledgeBase +type RepositoryIMockDeleteKnowledgeBaseExpectation struct { mock *RepositoryIMock - params *RepositoryIMockDeleteRepositoryTagParams - paramPtrs *RepositoryIMockDeleteRepositoryTagParamPtrs - results *RepositoryIMockDeleteRepositoryTagResults + params *RepositoryIMockDeleteKnowledgeBaseParams + paramPtrs *RepositoryIMockDeleteKnowledgeBaseParamPtrs + results *RepositoryIMockDeleteKnowledgeBaseResults Counter uint64 } -// RepositoryIMockDeleteRepositoryTagParams contains parameters of the RepositoryI.DeleteRepositoryTag -type RepositoryIMockDeleteRepositoryTagParams struct { - ctx context.Context - s1 string +// RepositoryIMockDeleteKnowledgeBaseParams contains parameters of the RepositoryI.DeleteKnowledgeBase +type RepositoryIMockDeleteKnowledgeBaseParams struct { + ctx context.Context + ownerUID string + kbID string } -// RepositoryIMockDeleteRepositoryTagParamPtrs contains pointers to parameters of the RepositoryI.DeleteRepositoryTag -type RepositoryIMockDeleteRepositoryTagParamPtrs struct { - ctx *context.Context - s1 *string +// RepositoryIMockDeleteKnowledgeBaseParamPtrs contains pointers to parameters of the RepositoryI.DeleteKnowledgeBase +type RepositoryIMockDeleteKnowledgeBaseParamPtrs struct { + ctx *context.Context + ownerUID *string + kbID *string } -// RepositoryIMockDeleteRepositoryTagResults contains results of the RepositoryI.DeleteRepositoryTag -type RepositoryIMockDeleteRepositoryTagResults struct { +// RepositoryIMockDeleteKnowledgeBaseResults contains results of the RepositoryI.DeleteKnowledgeBase +type RepositoryIMockDeleteKnowledgeBaseResults struct { + kp1 *mm_repository.KnowledgeBase err error } -// Expect sets up expected params for RepositoryI.DeleteRepositoryTag -func (mmDeleteRepositoryTag *mRepositoryIMockDeleteRepositoryTag) Expect(ctx context.Context, s1 string) *mRepositoryIMockDeleteRepositoryTag { - if mmDeleteRepositoryTag.mock.funcDeleteRepositoryTag != nil { - mmDeleteRepositoryTag.mock.t.Fatalf("RepositoryIMock.DeleteRepositoryTag mock is already set by Set") +// Expect sets up expected params for RepositoryI.DeleteKnowledgeBase +func (mmDeleteKnowledgeBase *mRepositoryIMockDeleteKnowledgeBase) Expect(ctx context.Context, ownerUID string, kbID string) *mRepositoryIMockDeleteKnowledgeBase { + if mmDeleteKnowledgeBase.mock.funcDeleteKnowledgeBase != nil { + mmDeleteKnowledgeBase.mock.t.Fatalf("RepositoryIMock.DeleteKnowledgeBase mock is already set by Set") } - if mmDeleteRepositoryTag.defaultExpectation == nil { - mmDeleteRepositoryTag.defaultExpectation = &RepositoryIMockDeleteRepositoryTagExpectation{} + if mmDeleteKnowledgeBase.defaultExpectation == nil { + mmDeleteKnowledgeBase.defaultExpectation = &RepositoryIMockDeleteKnowledgeBaseExpectation{} } - if mmDeleteRepositoryTag.defaultExpectation.paramPtrs != nil { - mmDeleteRepositoryTag.mock.t.Fatalf("RepositoryIMock.DeleteRepositoryTag mock is already set by ExpectParams functions") + if mmDeleteKnowledgeBase.defaultExpectation.paramPtrs != nil { + mmDeleteKnowledgeBase.mock.t.Fatalf("RepositoryIMock.DeleteKnowledgeBase mock is already set by ExpectParams functions") } - mmDeleteRepositoryTag.defaultExpectation.params = &RepositoryIMockDeleteRepositoryTagParams{ctx, s1} - for _, e := range mmDeleteRepositoryTag.expectations { - if minimock.Equal(e.params, mmDeleteRepositoryTag.defaultExpectation.params) { - mmDeleteRepositoryTag.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmDeleteRepositoryTag.defaultExpectation.params) + mmDeleteKnowledgeBase.defaultExpectation.params = &RepositoryIMockDeleteKnowledgeBaseParams{ctx, ownerUID, kbID} + for _, e := range mmDeleteKnowledgeBase.expectations { + if minimock.Equal(e.params, mmDeleteKnowledgeBase.defaultExpectation.params) { + mmDeleteKnowledgeBase.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmDeleteKnowledgeBase.defaultExpectation.params) } } - return mmDeleteRepositoryTag + return mmDeleteKnowledgeBase } -// ExpectCtxParam1 sets up expected param ctx for RepositoryI.DeleteRepositoryTag -func (mmDeleteRepositoryTag *mRepositoryIMockDeleteRepositoryTag) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockDeleteRepositoryTag { - if mmDeleteRepositoryTag.mock.funcDeleteRepositoryTag != nil { - mmDeleteRepositoryTag.mock.t.Fatalf("RepositoryIMock.DeleteRepositoryTag mock is already set by Set") +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.DeleteKnowledgeBase +func (mmDeleteKnowledgeBase *mRepositoryIMockDeleteKnowledgeBase) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockDeleteKnowledgeBase { + if mmDeleteKnowledgeBase.mock.funcDeleteKnowledgeBase != nil { + mmDeleteKnowledgeBase.mock.t.Fatalf("RepositoryIMock.DeleteKnowledgeBase mock is already set by Set") } - if mmDeleteRepositoryTag.defaultExpectation == nil { - mmDeleteRepositoryTag.defaultExpectation = &RepositoryIMockDeleteRepositoryTagExpectation{} + if mmDeleteKnowledgeBase.defaultExpectation == nil { + mmDeleteKnowledgeBase.defaultExpectation = &RepositoryIMockDeleteKnowledgeBaseExpectation{} } - if mmDeleteRepositoryTag.defaultExpectation.params != nil { - mmDeleteRepositoryTag.mock.t.Fatalf("RepositoryIMock.DeleteRepositoryTag mock is already set by Expect") - } + if mmDeleteKnowledgeBase.defaultExpectation.params != nil { + mmDeleteKnowledgeBase.mock.t.Fatalf("RepositoryIMock.DeleteKnowledgeBase mock is already set by Expect") + } - if mmDeleteRepositoryTag.defaultExpectation.paramPtrs == nil { - mmDeleteRepositoryTag.defaultExpectation.paramPtrs = &RepositoryIMockDeleteRepositoryTagParamPtrs{} + if mmDeleteKnowledgeBase.defaultExpectation.paramPtrs == nil { + mmDeleteKnowledgeBase.defaultExpectation.paramPtrs = &RepositoryIMockDeleteKnowledgeBaseParamPtrs{} } - mmDeleteRepositoryTag.defaultExpectation.paramPtrs.ctx = &ctx + mmDeleteKnowledgeBase.defaultExpectation.paramPtrs.ctx = &ctx - return mmDeleteRepositoryTag + return mmDeleteKnowledgeBase } -// ExpectS1Param2 sets up expected param s1 for RepositoryI.DeleteRepositoryTag -func (mmDeleteRepositoryTag *mRepositoryIMockDeleteRepositoryTag) ExpectS1Param2(s1 string) *mRepositoryIMockDeleteRepositoryTag { - if mmDeleteRepositoryTag.mock.funcDeleteRepositoryTag != nil { - mmDeleteRepositoryTag.mock.t.Fatalf("RepositoryIMock.DeleteRepositoryTag mock is already set by Set") +// ExpectOwnerUIDParam2 sets up expected param ownerUID for RepositoryI.DeleteKnowledgeBase +func (mmDeleteKnowledgeBase *mRepositoryIMockDeleteKnowledgeBase) ExpectOwnerUIDParam2(ownerUID string) *mRepositoryIMockDeleteKnowledgeBase { + if mmDeleteKnowledgeBase.mock.funcDeleteKnowledgeBase != nil { + mmDeleteKnowledgeBase.mock.t.Fatalf("RepositoryIMock.DeleteKnowledgeBase mock is already set by Set") } - if mmDeleteRepositoryTag.defaultExpectation == nil { - mmDeleteRepositoryTag.defaultExpectation = &RepositoryIMockDeleteRepositoryTagExpectation{} + if mmDeleteKnowledgeBase.defaultExpectation == nil { + mmDeleteKnowledgeBase.defaultExpectation = &RepositoryIMockDeleteKnowledgeBaseExpectation{} } - if mmDeleteRepositoryTag.defaultExpectation.params != nil { - mmDeleteRepositoryTag.mock.t.Fatalf("RepositoryIMock.DeleteRepositoryTag mock is already set by Expect") + if mmDeleteKnowledgeBase.defaultExpectation.params != nil { + mmDeleteKnowledgeBase.mock.t.Fatalf("RepositoryIMock.DeleteKnowledgeBase mock is already set by Expect") } - if mmDeleteRepositoryTag.defaultExpectation.paramPtrs == nil { - mmDeleteRepositoryTag.defaultExpectation.paramPtrs = &RepositoryIMockDeleteRepositoryTagParamPtrs{} + if mmDeleteKnowledgeBase.defaultExpectation.paramPtrs == nil { + mmDeleteKnowledgeBase.defaultExpectation.paramPtrs = &RepositoryIMockDeleteKnowledgeBaseParamPtrs{} } - mmDeleteRepositoryTag.defaultExpectation.paramPtrs.s1 = &s1 + mmDeleteKnowledgeBase.defaultExpectation.paramPtrs.ownerUID = &ownerUID - return mmDeleteRepositoryTag + return mmDeleteKnowledgeBase } -// Inspect accepts an inspector function that has same arguments as the RepositoryI.DeleteRepositoryTag -func (mmDeleteRepositoryTag *mRepositoryIMockDeleteRepositoryTag) Inspect(f func(ctx context.Context, s1 string)) *mRepositoryIMockDeleteRepositoryTag { - if mmDeleteRepositoryTag.mock.inspectFuncDeleteRepositoryTag != nil { - mmDeleteRepositoryTag.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.DeleteRepositoryTag") +// ExpectKbIDParam3 sets up expected param kbID for RepositoryI.DeleteKnowledgeBase +func (mmDeleteKnowledgeBase *mRepositoryIMockDeleteKnowledgeBase) ExpectKbIDParam3(kbID string) *mRepositoryIMockDeleteKnowledgeBase { + if mmDeleteKnowledgeBase.mock.funcDeleteKnowledgeBase != nil { + mmDeleteKnowledgeBase.mock.t.Fatalf("RepositoryIMock.DeleteKnowledgeBase mock is already set by Set") } - mmDeleteRepositoryTag.mock.inspectFuncDeleteRepositoryTag = f + if mmDeleteKnowledgeBase.defaultExpectation == nil { + mmDeleteKnowledgeBase.defaultExpectation = &RepositoryIMockDeleteKnowledgeBaseExpectation{} + } - return mmDeleteRepositoryTag + if mmDeleteKnowledgeBase.defaultExpectation.params != nil { + mmDeleteKnowledgeBase.mock.t.Fatalf("RepositoryIMock.DeleteKnowledgeBase mock is already set by Expect") + } + + if mmDeleteKnowledgeBase.defaultExpectation.paramPtrs == nil { + mmDeleteKnowledgeBase.defaultExpectation.paramPtrs = &RepositoryIMockDeleteKnowledgeBaseParamPtrs{} + } + mmDeleteKnowledgeBase.defaultExpectation.paramPtrs.kbID = &kbID + + return mmDeleteKnowledgeBase } -// Return sets up results that will be returned by RepositoryI.DeleteRepositoryTag -func (mmDeleteRepositoryTag *mRepositoryIMockDeleteRepositoryTag) Return(err error) *RepositoryIMock { - if mmDeleteRepositoryTag.mock.funcDeleteRepositoryTag != nil { - mmDeleteRepositoryTag.mock.t.Fatalf("RepositoryIMock.DeleteRepositoryTag mock is already set by Set") +// Inspect accepts an inspector function that has same arguments as the RepositoryI.DeleteKnowledgeBase +func (mmDeleteKnowledgeBase *mRepositoryIMockDeleteKnowledgeBase) Inspect(f func(ctx context.Context, ownerUID string, kbID string)) *mRepositoryIMockDeleteKnowledgeBase { + if mmDeleteKnowledgeBase.mock.inspectFuncDeleteKnowledgeBase != nil { + mmDeleteKnowledgeBase.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.DeleteKnowledgeBase") } - if mmDeleteRepositoryTag.defaultExpectation == nil { - mmDeleteRepositoryTag.defaultExpectation = &RepositoryIMockDeleteRepositoryTagExpectation{mock: mmDeleteRepositoryTag.mock} + mmDeleteKnowledgeBase.mock.inspectFuncDeleteKnowledgeBase = f + + return mmDeleteKnowledgeBase +} + +// Return sets up results that will be returned by RepositoryI.DeleteKnowledgeBase +func (mmDeleteKnowledgeBase *mRepositoryIMockDeleteKnowledgeBase) Return(kp1 *mm_repository.KnowledgeBase, err error) *RepositoryIMock { + if mmDeleteKnowledgeBase.mock.funcDeleteKnowledgeBase != nil { + mmDeleteKnowledgeBase.mock.t.Fatalf("RepositoryIMock.DeleteKnowledgeBase mock is already set by Set") } - mmDeleteRepositoryTag.defaultExpectation.results = &RepositoryIMockDeleteRepositoryTagResults{err} - return mmDeleteRepositoryTag.mock + + if mmDeleteKnowledgeBase.defaultExpectation == nil { + mmDeleteKnowledgeBase.defaultExpectation = &RepositoryIMockDeleteKnowledgeBaseExpectation{mock: mmDeleteKnowledgeBase.mock} + } + mmDeleteKnowledgeBase.defaultExpectation.results = &RepositoryIMockDeleteKnowledgeBaseResults{kp1, err} + return mmDeleteKnowledgeBase.mock } -// Set uses given function f to mock the RepositoryI.DeleteRepositoryTag method -func (mmDeleteRepositoryTag *mRepositoryIMockDeleteRepositoryTag) Set(f func(ctx context.Context, s1 string) (err error)) *RepositoryIMock { - if mmDeleteRepositoryTag.defaultExpectation != nil { - mmDeleteRepositoryTag.mock.t.Fatalf("Default expectation is already set for the RepositoryI.DeleteRepositoryTag method") +// Set uses given function f to mock the RepositoryI.DeleteKnowledgeBase method +func (mmDeleteKnowledgeBase *mRepositoryIMockDeleteKnowledgeBase) Set(f func(ctx context.Context, ownerUID string, kbID string) (kp1 *mm_repository.KnowledgeBase, err error)) *RepositoryIMock { + if mmDeleteKnowledgeBase.defaultExpectation != nil { + mmDeleteKnowledgeBase.mock.t.Fatalf("Default expectation is already set for the RepositoryI.DeleteKnowledgeBase method") } - if len(mmDeleteRepositoryTag.expectations) > 0 { - mmDeleteRepositoryTag.mock.t.Fatalf("Some expectations are already set for the RepositoryI.DeleteRepositoryTag method") + if len(mmDeleteKnowledgeBase.expectations) > 0 { + mmDeleteKnowledgeBase.mock.t.Fatalf("Some expectations are already set for the RepositoryI.DeleteKnowledgeBase method") } - mmDeleteRepositoryTag.mock.funcDeleteRepositoryTag = f - return mmDeleteRepositoryTag.mock + mmDeleteKnowledgeBase.mock.funcDeleteKnowledgeBase = f + return mmDeleteKnowledgeBase.mock } -// When sets expectation for the RepositoryI.DeleteRepositoryTag which will trigger the result defined by the following +// When sets expectation for the RepositoryI.DeleteKnowledgeBase which will trigger the result defined by the following // Then helper -func (mmDeleteRepositoryTag *mRepositoryIMockDeleteRepositoryTag) When(ctx context.Context, s1 string) *RepositoryIMockDeleteRepositoryTagExpectation { - if mmDeleteRepositoryTag.mock.funcDeleteRepositoryTag != nil { - mmDeleteRepositoryTag.mock.t.Fatalf("RepositoryIMock.DeleteRepositoryTag mock is already set by Set") +func (mmDeleteKnowledgeBase *mRepositoryIMockDeleteKnowledgeBase) When(ctx context.Context, ownerUID string, kbID string) *RepositoryIMockDeleteKnowledgeBaseExpectation { + if mmDeleteKnowledgeBase.mock.funcDeleteKnowledgeBase != nil { + mmDeleteKnowledgeBase.mock.t.Fatalf("RepositoryIMock.DeleteKnowledgeBase mock is already set by Set") } - expectation := &RepositoryIMockDeleteRepositoryTagExpectation{ - mock: mmDeleteRepositoryTag.mock, - params: &RepositoryIMockDeleteRepositoryTagParams{ctx, s1}, + expectation := &RepositoryIMockDeleteKnowledgeBaseExpectation{ + mock: mmDeleteKnowledgeBase.mock, + params: &RepositoryIMockDeleteKnowledgeBaseParams{ctx, ownerUID, kbID}, } - mmDeleteRepositoryTag.expectations = append(mmDeleteRepositoryTag.expectations, expectation) + mmDeleteKnowledgeBase.expectations = append(mmDeleteKnowledgeBase.expectations, expectation) return expectation } -// Then sets up RepositoryI.DeleteRepositoryTag return parameters for the expectation previously defined by the When method -func (e *RepositoryIMockDeleteRepositoryTagExpectation) Then(err error) *RepositoryIMock { - e.results = &RepositoryIMockDeleteRepositoryTagResults{err} +// Then sets up RepositoryI.DeleteKnowledgeBase return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockDeleteKnowledgeBaseExpectation) Then(kp1 *mm_repository.KnowledgeBase, err error) *RepositoryIMock { + e.results = &RepositoryIMockDeleteKnowledgeBaseResults{kp1, err} return e.mock } -// Times sets number of times RepositoryI.DeleteRepositoryTag should be invoked -func (mmDeleteRepositoryTag *mRepositoryIMockDeleteRepositoryTag) Times(n uint64) *mRepositoryIMockDeleteRepositoryTag { +// Times sets number of times RepositoryI.DeleteKnowledgeBase should be invoked +func (mmDeleteKnowledgeBase *mRepositoryIMockDeleteKnowledgeBase) Times(n uint64) *mRepositoryIMockDeleteKnowledgeBase { if n == 0 { - mmDeleteRepositoryTag.mock.t.Fatalf("Times of RepositoryIMock.DeleteRepositoryTag mock can not be zero") + mmDeleteKnowledgeBase.mock.t.Fatalf("Times of RepositoryIMock.DeleteKnowledgeBase mock can not be zero") } - mm_atomic.StoreUint64(&mmDeleteRepositoryTag.expectedInvocations, n) - return mmDeleteRepositoryTag + mm_atomic.StoreUint64(&mmDeleteKnowledgeBase.expectedInvocations, n) + return mmDeleteKnowledgeBase } -func (mmDeleteRepositoryTag *mRepositoryIMockDeleteRepositoryTag) invocationsDone() bool { - if len(mmDeleteRepositoryTag.expectations) == 0 && mmDeleteRepositoryTag.defaultExpectation == nil && mmDeleteRepositoryTag.mock.funcDeleteRepositoryTag == nil { +func (mmDeleteKnowledgeBase *mRepositoryIMockDeleteKnowledgeBase) invocationsDone() bool { + if len(mmDeleteKnowledgeBase.expectations) == 0 && mmDeleteKnowledgeBase.defaultExpectation == nil && mmDeleteKnowledgeBase.mock.funcDeleteKnowledgeBase == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmDeleteRepositoryTag.mock.afterDeleteRepositoryTagCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmDeleteRepositoryTag.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmDeleteKnowledgeBase.mock.afterDeleteKnowledgeBaseCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmDeleteKnowledgeBase.expectedInvocations) return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) } -// DeleteRepositoryTag implements repository.RepositoryI -func (mmDeleteRepositoryTag *RepositoryIMock) DeleteRepositoryTag(ctx context.Context, s1 string) (err error) { - mm_atomic.AddUint64(&mmDeleteRepositoryTag.beforeDeleteRepositoryTagCounter, 1) - defer mm_atomic.AddUint64(&mmDeleteRepositoryTag.afterDeleteRepositoryTagCounter, 1) +// DeleteKnowledgeBase implements repository.RepositoryI +func (mmDeleteKnowledgeBase *RepositoryIMock) DeleteKnowledgeBase(ctx context.Context, ownerUID string, kbID string) (kp1 *mm_repository.KnowledgeBase, err error) { + mm_atomic.AddUint64(&mmDeleteKnowledgeBase.beforeDeleteKnowledgeBaseCounter, 1) + defer mm_atomic.AddUint64(&mmDeleteKnowledgeBase.afterDeleteKnowledgeBaseCounter, 1) - if mmDeleteRepositoryTag.inspectFuncDeleteRepositoryTag != nil { - mmDeleteRepositoryTag.inspectFuncDeleteRepositoryTag(ctx, s1) + if mmDeleteKnowledgeBase.inspectFuncDeleteKnowledgeBase != nil { + mmDeleteKnowledgeBase.inspectFuncDeleteKnowledgeBase(ctx, ownerUID, kbID) } - mm_params := RepositoryIMockDeleteRepositoryTagParams{ctx, s1} + mm_params := RepositoryIMockDeleteKnowledgeBaseParams{ctx, ownerUID, kbID} // Record call args - mmDeleteRepositoryTag.DeleteRepositoryTagMock.mutex.Lock() - mmDeleteRepositoryTag.DeleteRepositoryTagMock.callArgs = append(mmDeleteRepositoryTag.DeleteRepositoryTagMock.callArgs, &mm_params) - mmDeleteRepositoryTag.DeleteRepositoryTagMock.mutex.Unlock() + mmDeleteKnowledgeBase.DeleteKnowledgeBaseMock.mutex.Lock() + mmDeleteKnowledgeBase.DeleteKnowledgeBaseMock.callArgs = append(mmDeleteKnowledgeBase.DeleteKnowledgeBaseMock.callArgs, &mm_params) + mmDeleteKnowledgeBase.DeleteKnowledgeBaseMock.mutex.Unlock() - for _, e := range mmDeleteRepositoryTag.DeleteRepositoryTagMock.expectations { + for _, e := range mmDeleteKnowledgeBase.DeleteKnowledgeBaseMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.err + return e.results.kp1, e.results.err } } - if mmDeleteRepositoryTag.DeleteRepositoryTagMock.defaultExpectation != nil { - mm_atomic.AddUint64(&mmDeleteRepositoryTag.DeleteRepositoryTagMock.defaultExpectation.Counter, 1) - mm_want := mmDeleteRepositoryTag.DeleteRepositoryTagMock.defaultExpectation.params - mm_want_ptrs := mmDeleteRepositoryTag.DeleteRepositoryTagMock.defaultExpectation.paramPtrs + if mmDeleteKnowledgeBase.DeleteKnowledgeBaseMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmDeleteKnowledgeBase.DeleteKnowledgeBaseMock.defaultExpectation.Counter, 1) + mm_want := mmDeleteKnowledgeBase.DeleteKnowledgeBaseMock.defaultExpectation.params + mm_want_ptrs := mmDeleteKnowledgeBase.DeleteKnowledgeBaseMock.defaultExpectation.paramPtrs - mm_got := RepositoryIMockDeleteRepositoryTagParams{ctx, s1} + mm_got := RepositoryIMockDeleteKnowledgeBaseParams{ctx, ownerUID, kbID} if mm_want_ptrs != nil { if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { - mmDeleteRepositoryTag.t.Errorf("RepositoryIMock.DeleteRepositoryTag got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) + mmDeleteKnowledgeBase.t.Errorf("RepositoryIMock.DeleteKnowledgeBase got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) } - if mm_want_ptrs.s1 != nil && !minimock.Equal(*mm_want_ptrs.s1, mm_got.s1) { - mmDeleteRepositoryTag.t.Errorf("RepositoryIMock.DeleteRepositoryTag got unexpected parameter s1, want: %#v, got: %#v%s\n", *mm_want_ptrs.s1, mm_got.s1, minimock.Diff(*mm_want_ptrs.s1, mm_got.s1)) + if mm_want_ptrs.ownerUID != nil && !minimock.Equal(*mm_want_ptrs.ownerUID, mm_got.ownerUID) { + mmDeleteKnowledgeBase.t.Errorf("RepositoryIMock.DeleteKnowledgeBase got unexpected parameter ownerUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.ownerUID, mm_got.ownerUID, minimock.Diff(*mm_want_ptrs.ownerUID, mm_got.ownerUID)) + } + + if mm_want_ptrs.kbID != nil && !minimock.Equal(*mm_want_ptrs.kbID, mm_got.kbID) { + mmDeleteKnowledgeBase.t.Errorf("RepositoryIMock.DeleteKnowledgeBase got unexpected parameter kbID, want: %#v, got: %#v%s\n", *mm_want_ptrs.kbID, mm_got.kbID, minimock.Diff(*mm_want_ptrs.kbID, mm_got.kbID)) } } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { - mmDeleteRepositoryTag.t.Errorf("RepositoryIMock.DeleteRepositoryTag got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + mmDeleteKnowledgeBase.t.Errorf("RepositoryIMock.DeleteKnowledgeBase got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) } - mm_results := mmDeleteRepositoryTag.DeleteRepositoryTagMock.defaultExpectation.results + mm_results := mmDeleteKnowledgeBase.DeleteKnowledgeBaseMock.defaultExpectation.results if mm_results == nil { - mmDeleteRepositoryTag.t.Fatal("No results are set for the RepositoryIMock.DeleteRepositoryTag") + mmDeleteKnowledgeBase.t.Fatal("No results are set for the RepositoryIMock.DeleteKnowledgeBase") } - return (*mm_results).err + return (*mm_results).kp1, (*mm_results).err } - if mmDeleteRepositoryTag.funcDeleteRepositoryTag != nil { - return mmDeleteRepositoryTag.funcDeleteRepositoryTag(ctx, s1) + if mmDeleteKnowledgeBase.funcDeleteKnowledgeBase != nil { + return mmDeleteKnowledgeBase.funcDeleteKnowledgeBase(ctx, ownerUID, kbID) } - mmDeleteRepositoryTag.t.Fatalf("Unexpected call to RepositoryIMock.DeleteRepositoryTag. %v %v", ctx, s1) + mmDeleteKnowledgeBase.t.Fatalf("Unexpected call to RepositoryIMock.DeleteKnowledgeBase. %v %v %v", ctx, ownerUID, kbID) return } -// DeleteRepositoryTagAfterCounter returns a count of finished RepositoryIMock.DeleteRepositoryTag invocations -func (mmDeleteRepositoryTag *RepositoryIMock) DeleteRepositoryTagAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmDeleteRepositoryTag.afterDeleteRepositoryTagCounter) +// DeleteKnowledgeBaseAfterCounter returns a count of finished RepositoryIMock.DeleteKnowledgeBase invocations +func (mmDeleteKnowledgeBase *RepositoryIMock) DeleteKnowledgeBaseAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmDeleteKnowledgeBase.afterDeleteKnowledgeBaseCounter) } -// DeleteRepositoryTagBeforeCounter returns a count of RepositoryIMock.DeleteRepositoryTag invocations -func (mmDeleteRepositoryTag *RepositoryIMock) DeleteRepositoryTagBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmDeleteRepositoryTag.beforeDeleteRepositoryTagCounter) +// DeleteKnowledgeBaseBeforeCounter returns a count of RepositoryIMock.DeleteKnowledgeBase invocations +func (mmDeleteKnowledgeBase *RepositoryIMock) DeleteKnowledgeBaseBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmDeleteKnowledgeBase.beforeDeleteKnowledgeBaseCounter) } -// Calls returns a list of arguments used in each call to RepositoryIMock.DeleteRepositoryTag. +// Calls returns a list of arguments used in each call to RepositoryIMock.DeleteKnowledgeBase. // The list is in the same order as the calls were made (i.e. recent calls have a higher index) -func (mmDeleteRepositoryTag *mRepositoryIMockDeleteRepositoryTag) Calls() []*RepositoryIMockDeleteRepositoryTagParams { - mmDeleteRepositoryTag.mutex.RLock() +func (mmDeleteKnowledgeBase *mRepositoryIMockDeleteKnowledgeBase) Calls() []*RepositoryIMockDeleteKnowledgeBaseParams { + mmDeleteKnowledgeBase.mutex.RLock() - argCopy := make([]*RepositoryIMockDeleteRepositoryTagParams, len(mmDeleteRepositoryTag.callArgs)) - copy(argCopy, mmDeleteRepositoryTag.callArgs) + argCopy := make([]*RepositoryIMockDeleteKnowledgeBaseParams, len(mmDeleteKnowledgeBase.callArgs)) + copy(argCopy, mmDeleteKnowledgeBase.callArgs) - mmDeleteRepositoryTag.mutex.RUnlock() + mmDeleteKnowledgeBase.mutex.RUnlock() return argCopy } -// MinimockDeleteRepositoryTagDone returns true if the count of the DeleteRepositoryTag invocations corresponds +// MinimockDeleteKnowledgeBaseDone returns true if the count of the DeleteKnowledgeBase invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockDeleteRepositoryTagDone() bool { - for _, e := range m.DeleteRepositoryTagMock.expectations { +func (m *RepositoryIMock) MinimockDeleteKnowledgeBaseDone() bool { + for _, e := range m.DeleteKnowledgeBaseMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.DeleteRepositoryTagMock.invocationsDone() + return m.DeleteKnowledgeBaseMock.invocationsDone() } -// MinimockDeleteRepositoryTagInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockDeleteRepositoryTagInspect() { - for _, e := range m.DeleteRepositoryTagMock.expectations { +// MinimockDeleteKnowledgeBaseInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockDeleteKnowledgeBaseInspect() { + for _, e := range m.DeleteKnowledgeBaseMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { - m.t.Errorf("Expected call to RepositoryIMock.DeleteRepositoryTag with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.DeleteKnowledgeBase with params: %#v", *e.params) } } - afterDeleteRepositoryTagCounter := mm_atomic.LoadUint64(&m.afterDeleteRepositoryTagCounter) + afterDeleteKnowledgeBaseCounter := mm_atomic.LoadUint64(&m.afterDeleteKnowledgeBaseCounter) // if default expectation was set then invocations count should be greater than zero - if m.DeleteRepositoryTagMock.defaultExpectation != nil && afterDeleteRepositoryTagCounter < 1 { - if m.DeleteRepositoryTagMock.defaultExpectation.params == nil { - m.t.Error("Expected call to RepositoryIMock.DeleteRepositoryTag") + if m.DeleteKnowledgeBaseMock.defaultExpectation != nil && afterDeleteKnowledgeBaseCounter < 1 { + if m.DeleteKnowledgeBaseMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.DeleteKnowledgeBase") } else { - m.t.Errorf("Expected call to RepositoryIMock.DeleteRepositoryTag with params: %#v", *m.DeleteRepositoryTagMock.defaultExpectation.params) + m.t.Errorf("Expected call to RepositoryIMock.DeleteKnowledgeBase with params: %#v", *m.DeleteKnowledgeBaseMock.defaultExpectation.params) } } // if func was set then invocations count should be greater than zero - if m.funcDeleteRepositoryTag != nil && afterDeleteRepositoryTagCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.DeleteRepositoryTag") + if m.funcDeleteKnowledgeBase != nil && afterDeleteKnowledgeBaseCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.DeleteKnowledgeBase") } - if !m.DeleteRepositoryTagMock.invocationsDone() && afterDeleteRepositoryTagCounter > 0 { - m.t.Errorf("Expected %d calls to RepositoryIMock.DeleteRepositoryTag but found %d calls", - mm_atomic.LoadUint64(&m.DeleteRepositoryTagMock.expectedInvocations), afterDeleteRepositoryTagCounter) + if !m.DeleteKnowledgeBaseMock.invocationsDone() && afterDeleteKnowledgeBaseCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.DeleteKnowledgeBase but found %d calls", + mm_atomic.LoadUint64(&m.DeleteKnowledgeBaseMock.expectedInvocations), afterDeleteKnowledgeBaseCounter) } } -type mRepositoryIMockGetChunksByUIDs struct { +type mRepositoryIMockDeleteKnowledgeBaseFile struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockGetChunksByUIDsExpectation - expectations []*RepositoryIMockGetChunksByUIDsExpectation + defaultExpectation *RepositoryIMockDeleteKnowledgeBaseFileExpectation + expectations []*RepositoryIMockDeleteKnowledgeBaseFileExpectation - callArgs []*RepositoryIMockGetChunksByUIDsParams + callArgs []*RepositoryIMockDeleteKnowledgeBaseFileParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockGetChunksByUIDsExpectation specifies expectation struct of the RepositoryI.GetChunksByUIDs -type RepositoryIMockGetChunksByUIDsExpectation struct { +// RepositoryIMockDeleteKnowledgeBaseFileExpectation specifies expectation struct of the RepositoryI.DeleteKnowledgeBaseFile +type RepositoryIMockDeleteKnowledgeBaseFileExpectation struct { mock *RepositoryIMock - params *RepositoryIMockGetChunksByUIDsParams - paramPtrs *RepositoryIMockGetChunksByUIDsParamPtrs - results *RepositoryIMockGetChunksByUIDsResults + params *RepositoryIMockDeleteKnowledgeBaseFileParams + paramPtrs *RepositoryIMockDeleteKnowledgeBaseFileParamPtrs + results *RepositoryIMockDeleteKnowledgeBaseFileResults Counter uint64 } -// RepositoryIMockGetChunksByUIDsParams contains parameters of the RepositoryI.GetChunksByUIDs -type RepositoryIMockGetChunksByUIDsParams struct { - ctx context.Context - chunkUIDs []uuid.UUID +// RepositoryIMockDeleteKnowledgeBaseFileParams contains parameters of the RepositoryI.DeleteKnowledgeBaseFile +type RepositoryIMockDeleteKnowledgeBaseFileParams struct { + ctx context.Context + fileUID string } -// RepositoryIMockGetChunksByUIDsParamPtrs contains pointers to parameters of the RepositoryI.GetChunksByUIDs -type RepositoryIMockGetChunksByUIDsParamPtrs struct { - ctx *context.Context - chunkUIDs *[]uuid.UUID +// RepositoryIMockDeleteKnowledgeBaseFileParamPtrs contains pointers to parameters of the RepositoryI.DeleteKnowledgeBaseFile +type RepositoryIMockDeleteKnowledgeBaseFileParamPtrs struct { + ctx *context.Context + fileUID *string } -// RepositoryIMockGetChunksByUIDsResults contains results of the RepositoryI.GetChunksByUIDs -type RepositoryIMockGetChunksByUIDsResults struct { - ta1 []mm_repository.TextChunk +// RepositoryIMockDeleteKnowledgeBaseFileResults contains results of the RepositoryI.DeleteKnowledgeBaseFile +type RepositoryIMockDeleteKnowledgeBaseFileResults struct { err error } -// Expect sets up expected params for RepositoryI.GetChunksByUIDs -func (mmGetChunksByUIDs *mRepositoryIMockGetChunksByUIDs) Expect(ctx context.Context, chunkUIDs []uuid.UUID) *mRepositoryIMockGetChunksByUIDs { - if mmGetChunksByUIDs.mock.funcGetChunksByUIDs != nil { - mmGetChunksByUIDs.mock.t.Fatalf("RepositoryIMock.GetChunksByUIDs mock is already set by Set") +// Expect sets up expected params for RepositoryI.DeleteKnowledgeBaseFile +func (mmDeleteKnowledgeBaseFile *mRepositoryIMockDeleteKnowledgeBaseFile) Expect(ctx context.Context, fileUID string) *mRepositoryIMockDeleteKnowledgeBaseFile { + if mmDeleteKnowledgeBaseFile.mock.funcDeleteKnowledgeBaseFile != nil { + mmDeleteKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.DeleteKnowledgeBaseFile mock is already set by Set") } - if mmGetChunksByUIDs.defaultExpectation == nil { - mmGetChunksByUIDs.defaultExpectation = &RepositoryIMockGetChunksByUIDsExpectation{} + if mmDeleteKnowledgeBaseFile.defaultExpectation == nil { + mmDeleteKnowledgeBaseFile.defaultExpectation = &RepositoryIMockDeleteKnowledgeBaseFileExpectation{} } - if mmGetChunksByUIDs.defaultExpectation.paramPtrs != nil { - mmGetChunksByUIDs.mock.t.Fatalf("RepositoryIMock.GetChunksByUIDs mock is already set by ExpectParams functions") + if mmDeleteKnowledgeBaseFile.defaultExpectation.paramPtrs != nil { + mmDeleteKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.DeleteKnowledgeBaseFile mock is already set by ExpectParams functions") } - mmGetChunksByUIDs.defaultExpectation.params = &RepositoryIMockGetChunksByUIDsParams{ctx, chunkUIDs} - for _, e := range mmGetChunksByUIDs.expectations { - if minimock.Equal(e.params, mmGetChunksByUIDs.defaultExpectation.params) { - mmGetChunksByUIDs.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetChunksByUIDs.defaultExpectation.params) + mmDeleteKnowledgeBaseFile.defaultExpectation.params = &RepositoryIMockDeleteKnowledgeBaseFileParams{ctx, fileUID} + for _, e := range mmDeleteKnowledgeBaseFile.expectations { + if minimock.Equal(e.params, mmDeleteKnowledgeBaseFile.defaultExpectation.params) { + mmDeleteKnowledgeBaseFile.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmDeleteKnowledgeBaseFile.defaultExpectation.params) } } - return mmGetChunksByUIDs + return mmDeleteKnowledgeBaseFile } -// ExpectCtxParam1 sets up expected param ctx for RepositoryI.GetChunksByUIDs -func (mmGetChunksByUIDs *mRepositoryIMockGetChunksByUIDs) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockGetChunksByUIDs { - if mmGetChunksByUIDs.mock.funcGetChunksByUIDs != nil { - mmGetChunksByUIDs.mock.t.Fatalf("RepositoryIMock.GetChunksByUIDs mock is already set by Set") +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.DeleteKnowledgeBaseFile +func (mmDeleteKnowledgeBaseFile *mRepositoryIMockDeleteKnowledgeBaseFile) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockDeleteKnowledgeBaseFile { + if mmDeleteKnowledgeBaseFile.mock.funcDeleteKnowledgeBaseFile != nil { + mmDeleteKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.DeleteKnowledgeBaseFile mock is already set by Set") } - if mmGetChunksByUIDs.defaultExpectation == nil { - mmGetChunksByUIDs.defaultExpectation = &RepositoryIMockGetChunksByUIDsExpectation{} + if mmDeleteKnowledgeBaseFile.defaultExpectation == nil { + mmDeleteKnowledgeBaseFile.defaultExpectation = &RepositoryIMockDeleteKnowledgeBaseFileExpectation{} } - if mmGetChunksByUIDs.defaultExpectation.params != nil { - mmGetChunksByUIDs.mock.t.Fatalf("RepositoryIMock.GetChunksByUIDs mock is already set by Expect") + if mmDeleteKnowledgeBaseFile.defaultExpectation.params != nil { + mmDeleteKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.DeleteKnowledgeBaseFile mock is already set by Expect") } - if mmGetChunksByUIDs.defaultExpectation.paramPtrs == nil { - mmGetChunksByUIDs.defaultExpectation.paramPtrs = &RepositoryIMockGetChunksByUIDsParamPtrs{} + if mmDeleteKnowledgeBaseFile.defaultExpectation.paramPtrs == nil { + mmDeleteKnowledgeBaseFile.defaultExpectation.paramPtrs = &RepositoryIMockDeleteKnowledgeBaseFileParamPtrs{} } - mmGetChunksByUIDs.defaultExpectation.paramPtrs.ctx = &ctx + mmDeleteKnowledgeBaseFile.defaultExpectation.paramPtrs.ctx = &ctx - return mmGetChunksByUIDs + return mmDeleteKnowledgeBaseFile } -// ExpectChunkUIDsParam2 sets up expected param chunkUIDs for RepositoryI.GetChunksByUIDs -func (mmGetChunksByUIDs *mRepositoryIMockGetChunksByUIDs) ExpectChunkUIDsParam2(chunkUIDs []uuid.UUID) *mRepositoryIMockGetChunksByUIDs { - if mmGetChunksByUIDs.mock.funcGetChunksByUIDs != nil { - mmGetChunksByUIDs.mock.t.Fatalf("RepositoryIMock.GetChunksByUIDs mock is already set by Set") +// ExpectFileUIDParam2 sets up expected param fileUID for RepositoryI.DeleteKnowledgeBaseFile +func (mmDeleteKnowledgeBaseFile *mRepositoryIMockDeleteKnowledgeBaseFile) ExpectFileUIDParam2(fileUID string) *mRepositoryIMockDeleteKnowledgeBaseFile { + if mmDeleteKnowledgeBaseFile.mock.funcDeleteKnowledgeBaseFile != nil { + mmDeleteKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.DeleteKnowledgeBaseFile mock is already set by Set") } - if mmGetChunksByUIDs.defaultExpectation == nil { - mmGetChunksByUIDs.defaultExpectation = &RepositoryIMockGetChunksByUIDsExpectation{} + if mmDeleteKnowledgeBaseFile.defaultExpectation == nil { + mmDeleteKnowledgeBaseFile.defaultExpectation = &RepositoryIMockDeleteKnowledgeBaseFileExpectation{} } - if mmGetChunksByUIDs.defaultExpectation.params != nil { - mmGetChunksByUIDs.mock.t.Fatalf("RepositoryIMock.GetChunksByUIDs mock is already set by Expect") + if mmDeleteKnowledgeBaseFile.defaultExpectation.params != nil { + mmDeleteKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.DeleteKnowledgeBaseFile mock is already set by Expect") } - if mmGetChunksByUIDs.defaultExpectation.paramPtrs == nil { - mmGetChunksByUIDs.defaultExpectation.paramPtrs = &RepositoryIMockGetChunksByUIDsParamPtrs{} + if mmDeleteKnowledgeBaseFile.defaultExpectation.paramPtrs == nil { + mmDeleteKnowledgeBaseFile.defaultExpectation.paramPtrs = &RepositoryIMockDeleteKnowledgeBaseFileParamPtrs{} } - mmGetChunksByUIDs.defaultExpectation.paramPtrs.chunkUIDs = &chunkUIDs + mmDeleteKnowledgeBaseFile.defaultExpectation.paramPtrs.fileUID = &fileUID - return mmGetChunksByUIDs + return mmDeleteKnowledgeBaseFile } -// Inspect accepts an inspector function that has same arguments as the RepositoryI.GetChunksByUIDs -func (mmGetChunksByUIDs *mRepositoryIMockGetChunksByUIDs) Inspect(f func(ctx context.Context, chunkUIDs []uuid.UUID)) *mRepositoryIMockGetChunksByUIDs { - if mmGetChunksByUIDs.mock.inspectFuncGetChunksByUIDs != nil { - mmGetChunksByUIDs.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.GetChunksByUIDs") +// Inspect accepts an inspector function that has same arguments as the RepositoryI.DeleteKnowledgeBaseFile +func (mmDeleteKnowledgeBaseFile *mRepositoryIMockDeleteKnowledgeBaseFile) Inspect(f func(ctx context.Context, fileUID string)) *mRepositoryIMockDeleteKnowledgeBaseFile { + if mmDeleteKnowledgeBaseFile.mock.inspectFuncDeleteKnowledgeBaseFile != nil { + mmDeleteKnowledgeBaseFile.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.DeleteKnowledgeBaseFile") } - mmGetChunksByUIDs.mock.inspectFuncGetChunksByUIDs = f + mmDeleteKnowledgeBaseFile.mock.inspectFuncDeleteKnowledgeBaseFile = f - return mmGetChunksByUIDs + return mmDeleteKnowledgeBaseFile } -// Return sets up results that will be returned by RepositoryI.GetChunksByUIDs -func (mmGetChunksByUIDs *mRepositoryIMockGetChunksByUIDs) Return(ta1 []mm_repository.TextChunk, err error) *RepositoryIMock { - if mmGetChunksByUIDs.mock.funcGetChunksByUIDs != nil { - mmGetChunksByUIDs.mock.t.Fatalf("RepositoryIMock.GetChunksByUIDs mock is already set by Set") +// Return sets up results that will be returned by RepositoryI.DeleteKnowledgeBaseFile +func (mmDeleteKnowledgeBaseFile *mRepositoryIMockDeleteKnowledgeBaseFile) Return(err error) *RepositoryIMock { + if mmDeleteKnowledgeBaseFile.mock.funcDeleteKnowledgeBaseFile != nil { + mmDeleteKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.DeleteKnowledgeBaseFile mock is already set by Set") } - if mmGetChunksByUIDs.defaultExpectation == nil { - mmGetChunksByUIDs.defaultExpectation = &RepositoryIMockGetChunksByUIDsExpectation{mock: mmGetChunksByUIDs.mock} + if mmDeleteKnowledgeBaseFile.defaultExpectation == nil { + mmDeleteKnowledgeBaseFile.defaultExpectation = &RepositoryIMockDeleteKnowledgeBaseFileExpectation{mock: mmDeleteKnowledgeBaseFile.mock} } - mmGetChunksByUIDs.defaultExpectation.results = &RepositoryIMockGetChunksByUIDsResults{ta1, err} - return mmGetChunksByUIDs.mock + mmDeleteKnowledgeBaseFile.defaultExpectation.results = &RepositoryIMockDeleteKnowledgeBaseFileResults{err} + return mmDeleteKnowledgeBaseFile.mock } -// Set uses given function f to mock the RepositoryI.GetChunksByUIDs method -func (mmGetChunksByUIDs *mRepositoryIMockGetChunksByUIDs) Set(f func(ctx context.Context, chunkUIDs []uuid.UUID) (ta1 []mm_repository.TextChunk, err error)) *RepositoryIMock { - if mmGetChunksByUIDs.defaultExpectation != nil { - mmGetChunksByUIDs.mock.t.Fatalf("Default expectation is already set for the RepositoryI.GetChunksByUIDs method") +// Set uses given function f to mock the RepositoryI.DeleteKnowledgeBaseFile method +func (mmDeleteKnowledgeBaseFile *mRepositoryIMockDeleteKnowledgeBaseFile) Set(f func(ctx context.Context, fileUID string) (err error)) *RepositoryIMock { + if mmDeleteKnowledgeBaseFile.defaultExpectation != nil { + mmDeleteKnowledgeBaseFile.mock.t.Fatalf("Default expectation is already set for the RepositoryI.DeleteKnowledgeBaseFile method") } - if len(mmGetChunksByUIDs.expectations) > 0 { - mmGetChunksByUIDs.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetChunksByUIDs method") + if len(mmDeleteKnowledgeBaseFile.expectations) > 0 { + mmDeleteKnowledgeBaseFile.mock.t.Fatalf("Some expectations are already set for the RepositoryI.DeleteKnowledgeBaseFile method") } - mmGetChunksByUIDs.mock.funcGetChunksByUIDs = f - return mmGetChunksByUIDs.mock + mmDeleteKnowledgeBaseFile.mock.funcDeleteKnowledgeBaseFile = f + return mmDeleteKnowledgeBaseFile.mock } -// When sets expectation for the RepositoryI.GetChunksByUIDs which will trigger the result defined by the following +// When sets expectation for the RepositoryI.DeleteKnowledgeBaseFile which will trigger the result defined by the following // Then helper -func (mmGetChunksByUIDs *mRepositoryIMockGetChunksByUIDs) When(ctx context.Context, chunkUIDs []uuid.UUID) *RepositoryIMockGetChunksByUIDsExpectation { - if mmGetChunksByUIDs.mock.funcGetChunksByUIDs != nil { - mmGetChunksByUIDs.mock.t.Fatalf("RepositoryIMock.GetChunksByUIDs mock is already set by Set") +func (mmDeleteKnowledgeBaseFile *mRepositoryIMockDeleteKnowledgeBaseFile) When(ctx context.Context, fileUID string) *RepositoryIMockDeleteKnowledgeBaseFileExpectation { + if mmDeleteKnowledgeBaseFile.mock.funcDeleteKnowledgeBaseFile != nil { + mmDeleteKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.DeleteKnowledgeBaseFile mock is already set by Set") } - expectation := &RepositoryIMockGetChunksByUIDsExpectation{ - mock: mmGetChunksByUIDs.mock, - params: &RepositoryIMockGetChunksByUIDsParams{ctx, chunkUIDs}, + expectation := &RepositoryIMockDeleteKnowledgeBaseFileExpectation{ + mock: mmDeleteKnowledgeBaseFile.mock, + params: &RepositoryIMockDeleteKnowledgeBaseFileParams{ctx, fileUID}, } - mmGetChunksByUIDs.expectations = append(mmGetChunksByUIDs.expectations, expectation) + mmDeleteKnowledgeBaseFile.expectations = append(mmDeleteKnowledgeBaseFile.expectations, expectation) return expectation } -// Then sets up RepositoryI.GetChunksByUIDs return parameters for the expectation previously defined by the When method -func (e *RepositoryIMockGetChunksByUIDsExpectation) Then(ta1 []mm_repository.TextChunk, err error) *RepositoryIMock { - e.results = &RepositoryIMockGetChunksByUIDsResults{ta1, err} +// Then sets up RepositoryI.DeleteKnowledgeBaseFile return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockDeleteKnowledgeBaseFileExpectation) Then(err error) *RepositoryIMock { + e.results = &RepositoryIMockDeleteKnowledgeBaseFileResults{err} return e.mock } -// Times sets number of times RepositoryI.GetChunksByUIDs should be invoked -func (mmGetChunksByUIDs *mRepositoryIMockGetChunksByUIDs) Times(n uint64) *mRepositoryIMockGetChunksByUIDs { +// Times sets number of times RepositoryI.DeleteKnowledgeBaseFile should be invoked +func (mmDeleteKnowledgeBaseFile *mRepositoryIMockDeleteKnowledgeBaseFile) Times(n uint64) *mRepositoryIMockDeleteKnowledgeBaseFile { if n == 0 { - mmGetChunksByUIDs.mock.t.Fatalf("Times of RepositoryIMock.GetChunksByUIDs mock can not be zero") + mmDeleteKnowledgeBaseFile.mock.t.Fatalf("Times of RepositoryIMock.DeleteKnowledgeBaseFile mock can not be zero") } - mm_atomic.StoreUint64(&mmGetChunksByUIDs.expectedInvocations, n) - return mmGetChunksByUIDs + mm_atomic.StoreUint64(&mmDeleteKnowledgeBaseFile.expectedInvocations, n) + return mmDeleteKnowledgeBaseFile } -func (mmGetChunksByUIDs *mRepositoryIMockGetChunksByUIDs) invocationsDone() bool { - if len(mmGetChunksByUIDs.expectations) == 0 && mmGetChunksByUIDs.defaultExpectation == nil && mmGetChunksByUIDs.mock.funcGetChunksByUIDs == nil { +func (mmDeleteKnowledgeBaseFile *mRepositoryIMockDeleteKnowledgeBaseFile) invocationsDone() bool { + if len(mmDeleteKnowledgeBaseFile.expectations) == 0 && mmDeleteKnowledgeBaseFile.defaultExpectation == nil && mmDeleteKnowledgeBaseFile.mock.funcDeleteKnowledgeBaseFile == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmGetChunksByUIDs.mock.afterGetChunksByUIDsCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmGetChunksByUIDs.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmDeleteKnowledgeBaseFile.mock.afterDeleteKnowledgeBaseFileCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmDeleteKnowledgeBaseFile.expectedInvocations) return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) } -// GetChunksByUIDs implements repository.RepositoryI -func (mmGetChunksByUIDs *RepositoryIMock) GetChunksByUIDs(ctx context.Context, chunkUIDs []uuid.UUID) (ta1 []mm_repository.TextChunk, err error) { - mm_atomic.AddUint64(&mmGetChunksByUIDs.beforeGetChunksByUIDsCounter, 1) - defer mm_atomic.AddUint64(&mmGetChunksByUIDs.afterGetChunksByUIDsCounter, 1) +// DeleteKnowledgeBaseFile implements repository.RepositoryI +func (mmDeleteKnowledgeBaseFile *RepositoryIMock) DeleteKnowledgeBaseFile(ctx context.Context, fileUID string) (err error) { + mm_atomic.AddUint64(&mmDeleteKnowledgeBaseFile.beforeDeleteKnowledgeBaseFileCounter, 1) + defer mm_atomic.AddUint64(&mmDeleteKnowledgeBaseFile.afterDeleteKnowledgeBaseFileCounter, 1) - if mmGetChunksByUIDs.inspectFuncGetChunksByUIDs != nil { - mmGetChunksByUIDs.inspectFuncGetChunksByUIDs(ctx, chunkUIDs) + if mmDeleteKnowledgeBaseFile.inspectFuncDeleteKnowledgeBaseFile != nil { + mmDeleteKnowledgeBaseFile.inspectFuncDeleteKnowledgeBaseFile(ctx, fileUID) } - mm_params := RepositoryIMockGetChunksByUIDsParams{ctx, chunkUIDs} + mm_params := RepositoryIMockDeleteKnowledgeBaseFileParams{ctx, fileUID} // Record call args - mmGetChunksByUIDs.GetChunksByUIDsMock.mutex.Lock() - mmGetChunksByUIDs.GetChunksByUIDsMock.callArgs = append(mmGetChunksByUIDs.GetChunksByUIDsMock.callArgs, &mm_params) - mmGetChunksByUIDs.GetChunksByUIDsMock.mutex.Unlock() + mmDeleteKnowledgeBaseFile.DeleteKnowledgeBaseFileMock.mutex.Lock() + mmDeleteKnowledgeBaseFile.DeleteKnowledgeBaseFileMock.callArgs = append(mmDeleteKnowledgeBaseFile.DeleteKnowledgeBaseFileMock.callArgs, &mm_params) + mmDeleteKnowledgeBaseFile.DeleteKnowledgeBaseFileMock.mutex.Unlock() - for _, e := range mmGetChunksByUIDs.GetChunksByUIDsMock.expectations { + for _, e := range mmDeleteKnowledgeBaseFile.DeleteKnowledgeBaseFileMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.ta1, e.results.err + return e.results.err } } - if mmGetChunksByUIDs.GetChunksByUIDsMock.defaultExpectation != nil { - mm_atomic.AddUint64(&mmGetChunksByUIDs.GetChunksByUIDsMock.defaultExpectation.Counter, 1) - mm_want := mmGetChunksByUIDs.GetChunksByUIDsMock.defaultExpectation.params - mm_want_ptrs := mmGetChunksByUIDs.GetChunksByUIDsMock.defaultExpectation.paramPtrs + if mmDeleteKnowledgeBaseFile.DeleteKnowledgeBaseFileMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmDeleteKnowledgeBaseFile.DeleteKnowledgeBaseFileMock.defaultExpectation.Counter, 1) + mm_want := mmDeleteKnowledgeBaseFile.DeleteKnowledgeBaseFileMock.defaultExpectation.params + mm_want_ptrs := mmDeleteKnowledgeBaseFile.DeleteKnowledgeBaseFileMock.defaultExpectation.paramPtrs - mm_got := RepositoryIMockGetChunksByUIDsParams{ctx, chunkUIDs} + mm_got := RepositoryIMockDeleteKnowledgeBaseFileParams{ctx, fileUID} if mm_want_ptrs != nil { if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { - mmGetChunksByUIDs.t.Errorf("RepositoryIMock.GetChunksByUIDs got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) + mmDeleteKnowledgeBaseFile.t.Errorf("RepositoryIMock.DeleteKnowledgeBaseFile got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) } - if mm_want_ptrs.chunkUIDs != nil && !minimock.Equal(*mm_want_ptrs.chunkUIDs, mm_got.chunkUIDs) { - mmGetChunksByUIDs.t.Errorf("RepositoryIMock.GetChunksByUIDs got unexpected parameter chunkUIDs, want: %#v, got: %#v%s\n", *mm_want_ptrs.chunkUIDs, mm_got.chunkUIDs, minimock.Diff(*mm_want_ptrs.chunkUIDs, mm_got.chunkUIDs)) + if mm_want_ptrs.fileUID != nil && !minimock.Equal(*mm_want_ptrs.fileUID, mm_got.fileUID) { + mmDeleteKnowledgeBaseFile.t.Errorf("RepositoryIMock.DeleteKnowledgeBaseFile got unexpected parameter fileUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.fileUID, mm_got.fileUID, minimock.Diff(*mm_want_ptrs.fileUID, mm_got.fileUID)) } } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { - mmGetChunksByUIDs.t.Errorf("RepositoryIMock.GetChunksByUIDs got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + mmDeleteKnowledgeBaseFile.t.Errorf("RepositoryIMock.DeleteKnowledgeBaseFile got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) } - mm_results := mmGetChunksByUIDs.GetChunksByUIDsMock.defaultExpectation.results + mm_results := mmDeleteKnowledgeBaseFile.DeleteKnowledgeBaseFileMock.defaultExpectation.results if mm_results == nil { - mmGetChunksByUIDs.t.Fatal("No results are set for the RepositoryIMock.GetChunksByUIDs") + mmDeleteKnowledgeBaseFile.t.Fatal("No results are set for the RepositoryIMock.DeleteKnowledgeBaseFile") } - return (*mm_results).ta1, (*mm_results).err + return (*mm_results).err } - if mmGetChunksByUIDs.funcGetChunksByUIDs != nil { - return mmGetChunksByUIDs.funcGetChunksByUIDs(ctx, chunkUIDs) + if mmDeleteKnowledgeBaseFile.funcDeleteKnowledgeBaseFile != nil { + return mmDeleteKnowledgeBaseFile.funcDeleteKnowledgeBaseFile(ctx, fileUID) } - mmGetChunksByUIDs.t.Fatalf("Unexpected call to RepositoryIMock.GetChunksByUIDs. %v %v", ctx, chunkUIDs) + mmDeleteKnowledgeBaseFile.t.Fatalf("Unexpected call to RepositoryIMock.DeleteKnowledgeBaseFile. %v %v", ctx, fileUID) return } -// GetChunksByUIDsAfterCounter returns a count of finished RepositoryIMock.GetChunksByUIDs invocations -func (mmGetChunksByUIDs *RepositoryIMock) GetChunksByUIDsAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetChunksByUIDs.afterGetChunksByUIDsCounter) +// DeleteKnowledgeBaseFileAfterCounter returns a count of finished RepositoryIMock.DeleteKnowledgeBaseFile invocations +func (mmDeleteKnowledgeBaseFile *RepositoryIMock) DeleteKnowledgeBaseFileAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmDeleteKnowledgeBaseFile.afterDeleteKnowledgeBaseFileCounter) } -// GetChunksByUIDsBeforeCounter returns a count of RepositoryIMock.GetChunksByUIDs invocations -func (mmGetChunksByUIDs *RepositoryIMock) GetChunksByUIDsBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetChunksByUIDs.beforeGetChunksByUIDsCounter) +// DeleteKnowledgeBaseFileBeforeCounter returns a count of RepositoryIMock.DeleteKnowledgeBaseFile invocations +func (mmDeleteKnowledgeBaseFile *RepositoryIMock) DeleteKnowledgeBaseFileBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmDeleteKnowledgeBaseFile.beforeDeleteKnowledgeBaseFileCounter) } -// Calls returns a list of arguments used in each call to RepositoryIMock.GetChunksByUIDs. +// Calls returns a list of arguments used in each call to RepositoryIMock.DeleteKnowledgeBaseFile. // The list is in the same order as the calls were made (i.e. recent calls have a higher index) -func (mmGetChunksByUIDs *mRepositoryIMockGetChunksByUIDs) Calls() []*RepositoryIMockGetChunksByUIDsParams { - mmGetChunksByUIDs.mutex.RLock() +func (mmDeleteKnowledgeBaseFile *mRepositoryIMockDeleteKnowledgeBaseFile) Calls() []*RepositoryIMockDeleteKnowledgeBaseFileParams { + mmDeleteKnowledgeBaseFile.mutex.RLock() - argCopy := make([]*RepositoryIMockGetChunksByUIDsParams, len(mmGetChunksByUIDs.callArgs)) - copy(argCopy, mmGetChunksByUIDs.callArgs) + argCopy := make([]*RepositoryIMockDeleteKnowledgeBaseFileParams, len(mmDeleteKnowledgeBaseFile.callArgs)) + copy(argCopy, mmDeleteKnowledgeBaseFile.callArgs) - mmGetChunksByUIDs.mutex.RUnlock() + mmDeleteKnowledgeBaseFile.mutex.RUnlock() return argCopy } -// MinimockGetChunksByUIDsDone returns true if the count of the GetChunksByUIDs invocations corresponds +// MinimockDeleteKnowledgeBaseFileDone returns true if the count of the DeleteKnowledgeBaseFile invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockGetChunksByUIDsDone() bool { - for _, e := range m.GetChunksByUIDsMock.expectations { +func (m *RepositoryIMock) MinimockDeleteKnowledgeBaseFileDone() bool { + for _, e := range m.DeleteKnowledgeBaseFileMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.GetChunksByUIDsMock.invocationsDone() + return m.DeleteKnowledgeBaseFileMock.invocationsDone() } -// MinimockGetChunksByUIDsInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockGetChunksByUIDsInspect() { - for _, e := range m.GetChunksByUIDsMock.expectations { +// MinimockDeleteKnowledgeBaseFileInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockDeleteKnowledgeBaseFileInspect() { + for _, e := range m.DeleteKnowledgeBaseFileMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { - m.t.Errorf("Expected call to RepositoryIMock.GetChunksByUIDs with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.DeleteKnowledgeBaseFile with params: %#v", *e.params) } } - afterGetChunksByUIDsCounter := mm_atomic.LoadUint64(&m.afterGetChunksByUIDsCounter) + afterDeleteKnowledgeBaseFileCounter := mm_atomic.LoadUint64(&m.afterDeleteKnowledgeBaseFileCounter) // if default expectation was set then invocations count should be greater than zero - if m.GetChunksByUIDsMock.defaultExpectation != nil && afterGetChunksByUIDsCounter < 1 { - if m.GetChunksByUIDsMock.defaultExpectation.params == nil { - m.t.Error("Expected call to RepositoryIMock.GetChunksByUIDs") + if m.DeleteKnowledgeBaseFileMock.defaultExpectation != nil && afterDeleteKnowledgeBaseFileCounter < 1 { + if m.DeleteKnowledgeBaseFileMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.DeleteKnowledgeBaseFile") } else { - m.t.Errorf("Expected call to RepositoryIMock.GetChunksByUIDs with params: %#v", *m.GetChunksByUIDsMock.defaultExpectation.params) + m.t.Errorf("Expected call to RepositoryIMock.DeleteKnowledgeBaseFile with params: %#v", *m.DeleteKnowledgeBaseFileMock.defaultExpectation.params) } } // if func was set then invocations count should be greater than zero - if m.funcGetChunksByUIDs != nil && afterGetChunksByUIDsCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.GetChunksByUIDs") + if m.funcDeleteKnowledgeBaseFile != nil && afterDeleteKnowledgeBaseFileCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.DeleteKnowledgeBaseFile") } - if !m.GetChunksByUIDsMock.invocationsDone() && afterGetChunksByUIDsCounter > 0 { - m.t.Errorf("Expected %d calls to RepositoryIMock.GetChunksByUIDs but found %d calls", - mm_atomic.LoadUint64(&m.GetChunksByUIDsMock.expectedInvocations), afterGetChunksByUIDsCounter) + if !m.DeleteKnowledgeBaseFileMock.invocationsDone() && afterDeleteKnowledgeBaseFileCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.DeleteKnowledgeBaseFile but found %d calls", + mm_atomic.LoadUint64(&m.DeleteKnowledgeBaseFileMock.expectedInvocations), afterDeleteKnowledgeBaseFileCounter) } } -type mRepositoryIMockGetConvertedFileByFileUID struct { +type mRepositoryIMockDeleteRepositoryTag struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockGetConvertedFileByFileUIDExpectation - expectations []*RepositoryIMockGetConvertedFileByFileUIDExpectation + defaultExpectation *RepositoryIMockDeleteRepositoryTagExpectation + expectations []*RepositoryIMockDeleteRepositoryTagExpectation - callArgs []*RepositoryIMockGetConvertedFileByFileUIDParams + callArgs []*RepositoryIMockDeleteRepositoryTagParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockGetConvertedFileByFileUIDExpectation specifies expectation struct of the RepositoryI.GetConvertedFileByFileUID -type RepositoryIMockGetConvertedFileByFileUIDExpectation struct { +// RepositoryIMockDeleteRepositoryTagExpectation specifies expectation struct of the RepositoryI.DeleteRepositoryTag +type RepositoryIMockDeleteRepositoryTagExpectation struct { mock *RepositoryIMock - params *RepositoryIMockGetConvertedFileByFileUIDParams - paramPtrs *RepositoryIMockGetConvertedFileByFileUIDParamPtrs - results *RepositoryIMockGetConvertedFileByFileUIDResults + params *RepositoryIMockDeleteRepositoryTagParams + paramPtrs *RepositoryIMockDeleteRepositoryTagParamPtrs + results *RepositoryIMockDeleteRepositoryTagResults Counter uint64 } -// RepositoryIMockGetConvertedFileByFileUIDParams contains parameters of the RepositoryI.GetConvertedFileByFileUID -type RepositoryIMockGetConvertedFileByFileUIDParams struct { - ctx context.Context - fileUID uuid.UUID +// RepositoryIMockDeleteRepositoryTagParams contains parameters of the RepositoryI.DeleteRepositoryTag +type RepositoryIMockDeleteRepositoryTagParams struct { + ctx context.Context + s1 string } -// RepositoryIMockGetConvertedFileByFileUIDParamPtrs contains pointers to parameters of the RepositoryI.GetConvertedFileByFileUID -type RepositoryIMockGetConvertedFileByFileUIDParamPtrs struct { - ctx *context.Context - fileUID *uuid.UUID +// RepositoryIMockDeleteRepositoryTagParamPtrs contains pointers to parameters of the RepositoryI.DeleteRepositoryTag +type RepositoryIMockDeleteRepositoryTagParamPtrs struct { + ctx *context.Context + s1 *string } -// RepositoryIMockGetConvertedFileByFileUIDResults contains results of the RepositoryI.GetConvertedFileByFileUID -type RepositoryIMockGetConvertedFileByFileUIDResults struct { - cp1 *mm_repository.ConvertedFile +// RepositoryIMockDeleteRepositoryTagResults contains results of the RepositoryI.DeleteRepositoryTag +type RepositoryIMockDeleteRepositoryTagResults struct { err error } -// Expect sets up expected params for RepositoryI.GetConvertedFileByFileUID -func (mmGetConvertedFileByFileUID *mRepositoryIMockGetConvertedFileByFileUID) Expect(ctx context.Context, fileUID uuid.UUID) *mRepositoryIMockGetConvertedFileByFileUID { - if mmGetConvertedFileByFileUID.mock.funcGetConvertedFileByFileUID != nil { - mmGetConvertedFileByFileUID.mock.t.Fatalf("RepositoryIMock.GetConvertedFileByFileUID mock is already set by Set") +// Expect sets up expected params for RepositoryI.DeleteRepositoryTag +func (mmDeleteRepositoryTag *mRepositoryIMockDeleteRepositoryTag) Expect(ctx context.Context, s1 string) *mRepositoryIMockDeleteRepositoryTag { + if mmDeleteRepositoryTag.mock.funcDeleteRepositoryTag != nil { + mmDeleteRepositoryTag.mock.t.Fatalf("RepositoryIMock.DeleteRepositoryTag mock is already set by Set") } - if mmGetConvertedFileByFileUID.defaultExpectation == nil { - mmGetConvertedFileByFileUID.defaultExpectation = &RepositoryIMockGetConvertedFileByFileUIDExpectation{} + if mmDeleteRepositoryTag.defaultExpectation == nil { + mmDeleteRepositoryTag.defaultExpectation = &RepositoryIMockDeleteRepositoryTagExpectation{} } - if mmGetConvertedFileByFileUID.defaultExpectation.paramPtrs != nil { - mmGetConvertedFileByFileUID.mock.t.Fatalf("RepositoryIMock.GetConvertedFileByFileUID mock is already set by ExpectParams functions") + if mmDeleteRepositoryTag.defaultExpectation.paramPtrs != nil { + mmDeleteRepositoryTag.mock.t.Fatalf("RepositoryIMock.DeleteRepositoryTag mock is already set by ExpectParams functions") } - mmGetConvertedFileByFileUID.defaultExpectation.params = &RepositoryIMockGetConvertedFileByFileUIDParams{ctx, fileUID} - for _, e := range mmGetConvertedFileByFileUID.expectations { - if minimock.Equal(e.params, mmGetConvertedFileByFileUID.defaultExpectation.params) { - mmGetConvertedFileByFileUID.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetConvertedFileByFileUID.defaultExpectation.params) + mmDeleteRepositoryTag.defaultExpectation.params = &RepositoryIMockDeleteRepositoryTagParams{ctx, s1} + for _, e := range mmDeleteRepositoryTag.expectations { + if minimock.Equal(e.params, mmDeleteRepositoryTag.defaultExpectation.params) { + mmDeleteRepositoryTag.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmDeleteRepositoryTag.defaultExpectation.params) } } - return mmGetConvertedFileByFileUID + return mmDeleteRepositoryTag } -// ExpectCtxParam1 sets up expected param ctx for RepositoryI.GetConvertedFileByFileUID -func (mmGetConvertedFileByFileUID *mRepositoryIMockGetConvertedFileByFileUID) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockGetConvertedFileByFileUID { - if mmGetConvertedFileByFileUID.mock.funcGetConvertedFileByFileUID != nil { - mmGetConvertedFileByFileUID.mock.t.Fatalf("RepositoryIMock.GetConvertedFileByFileUID mock is already set by Set") +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.DeleteRepositoryTag +func (mmDeleteRepositoryTag *mRepositoryIMockDeleteRepositoryTag) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockDeleteRepositoryTag { + if mmDeleteRepositoryTag.mock.funcDeleteRepositoryTag != nil { + mmDeleteRepositoryTag.mock.t.Fatalf("RepositoryIMock.DeleteRepositoryTag mock is already set by Set") } - if mmGetConvertedFileByFileUID.defaultExpectation == nil { - mmGetConvertedFileByFileUID.defaultExpectation = &RepositoryIMockGetConvertedFileByFileUIDExpectation{} + if mmDeleteRepositoryTag.defaultExpectation == nil { + mmDeleteRepositoryTag.defaultExpectation = &RepositoryIMockDeleteRepositoryTagExpectation{} } - if mmGetConvertedFileByFileUID.defaultExpectation.params != nil { - mmGetConvertedFileByFileUID.mock.t.Fatalf("RepositoryIMock.GetConvertedFileByFileUID mock is already set by Expect") + if mmDeleteRepositoryTag.defaultExpectation.params != nil { + mmDeleteRepositoryTag.mock.t.Fatalf("RepositoryIMock.DeleteRepositoryTag mock is already set by Expect") } - if mmGetConvertedFileByFileUID.defaultExpectation.paramPtrs == nil { - mmGetConvertedFileByFileUID.defaultExpectation.paramPtrs = &RepositoryIMockGetConvertedFileByFileUIDParamPtrs{} + if mmDeleteRepositoryTag.defaultExpectation.paramPtrs == nil { + mmDeleteRepositoryTag.defaultExpectation.paramPtrs = &RepositoryIMockDeleteRepositoryTagParamPtrs{} } - mmGetConvertedFileByFileUID.defaultExpectation.paramPtrs.ctx = &ctx + mmDeleteRepositoryTag.defaultExpectation.paramPtrs.ctx = &ctx - return mmGetConvertedFileByFileUID + return mmDeleteRepositoryTag } -// ExpectFileUIDParam2 sets up expected param fileUID for RepositoryI.GetConvertedFileByFileUID -func (mmGetConvertedFileByFileUID *mRepositoryIMockGetConvertedFileByFileUID) ExpectFileUIDParam2(fileUID uuid.UUID) *mRepositoryIMockGetConvertedFileByFileUID { - if mmGetConvertedFileByFileUID.mock.funcGetConvertedFileByFileUID != nil { - mmGetConvertedFileByFileUID.mock.t.Fatalf("RepositoryIMock.GetConvertedFileByFileUID mock is already set by Set") +// ExpectS1Param2 sets up expected param s1 for RepositoryI.DeleteRepositoryTag +func (mmDeleteRepositoryTag *mRepositoryIMockDeleteRepositoryTag) ExpectS1Param2(s1 string) *mRepositoryIMockDeleteRepositoryTag { + if mmDeleteRepositoryTag.mock.funcDeleteRepositoryTag != nil { + mmDeleteRepositoryTag.mock.t.Fatalf("RepositoryIMock.DeleteRepositoryTag mock is already set by Set") } - if mmGetConvertedFileByFileUID.defaultExpectation == nil { - mmGetConvertedFileByFileUID.defaultExpectation = &RepositoryIMockGetConvertedFileByFileUIDExpectation{} + if mmDeleteRepositoryTag.defaultExpectation == nil { + mmDeleteRepositoryTag.defaultExpectation = &RepositoryIMockDeleteRepositoryTagExpectation{} } - if mmGetConvertedFileByFileUID.defaultExpectation.params != nil { - mmGetConvertedFileByFileUID.mock.t.Fatalf("RepositoryIMock.GetConvertedFileByFileUID mock is already set by Expect") + if mmDeleteRepositoryTag.defaultExpectation.params != nil { + mmDeleteRepositoryTag.mock.t.Fatalf("RepositoryIMock.DeleteRepositoryTag mock is already set by Expect") } - if mmGetConvertedFileByFileUID.defaultExpectation.paramPtrs == nil { - mmGetConvertedFileByFileUID.defaultExpectation.paramPtrs = &RepositoryIMockGetConvertedFileByFileUIDParamPtrs{} + if mmDeleteRepositoryTag.defaultExpectation.paramPtrs == nil { + mmDeleteRepositoryTag.defaultExpectation.paramPtrs = &RepositoryIMockDeleteRepositoryTagParamPtrs{} } - mmGetConvertedFileByFileUID.defaultExpectation.paramPtrs.fileUID = &fileUID + mmDeleteRepositoryTag.defaultExpectation.paramPtrs.s1 = &s1 - return mmGetConvertedFileByFileUID + return mmDeleteRepositoryTag } -// Inspect accepts an inspector function that has same arguments as the RepositoryI.GetConvertedFileByFileUID -func (mmGetConvertedFileByFileUID *mRepositoryIMockGetConvertedFileByFileUID) Inspect(f func(ctx context.Context, fileUID uuid.UUID)) *mRepositoryIMockGetConvertedFileByFileUID { - if mmGetConvertedFileByFileUID.mock.inspectFuncGetConvertedFileByFileUID != nil { - mmGetConvertedFileByFileUID.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.GetConvertedFileByFileUID") +// Inspect accepts an inspector function that has same arguments as the RepositoryI.DeleteRepositoryTag +func (mmDeleteRepositoryTag *mRepositoryIMockDeleteRepositoryTag) Inspect(f func(ctx context.Context, s1 string)) *mRepositoryIMockDeleteRepositoryTag { + if mmDeleteRepositoryTag.mock.inspectFuncDeleteRepositoryTag != nil { + mmDeleteRepositoryTag.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.DeleteRepositoryTag") } - mmGetConvertedFileByFileUID.mock.inspectFuncGetConvertedFileByFileUID = f + mmDeleteRepositoryTag.mock.inspectFuncDeleteRepositoryTag = f - return mmGetConvertedFileByFileUID + return mmDeleteRepositoryTag } -// Return sets up results that will be returned by RepositoryI.GetConvertedFileByFileUID -func (mmGetConvertedFileByFileUID *mRepositoryIMockGetConvertedFileByFileUID) Return(cp1 *mm_repository.ConvertedFile, err error) *RepositoryIMock { - if mmGetConvertedFileByFileUID.mock.funcGetConvertedFileByFileUID != nil { - mmGetConvertedFileByFileUID.mock.t.Fatalf("RepositoryIMock.GetConvertedFileByFileUID mock is already set by Set") +// Return sets up results that will be returned by RepositoryI.DeleteRepositoryTag +func (mmDeleteRepositoryTag *mRepositoryIMockDeleteRepositoryTag) Return(err error) *RepositoryIMock { + if mmDeleteRepositoryTag.mock.funcDeleteRepositoryTag != nil { + mmDeleteRepositoryTag.mock.t.Fatalf("RepositoryIMock.DeleteRepositoryTag mock is already set by Set") } - if mmGetConvertedFileByFileUID.defaultExpectation == nil { - mmGetConvertedFileByFileUID.defaultExpectation = &RepositoryIMockGetConvertedFileByFileUIDExpectation{mock: mmGetConvertedFileByFileUID.mock} + if mmDeleteRepositoryTag.defaultExpectation == nil { + mmDeleteRepositoryTag.defaultExpectation = &RepositoryIMockDeleteRepositoryTagExpectation{mock: mmDeleteRepositoryTag.mock} } - mmGetConvertedFileByFileUID.defaultExpectation.results = &RepositoryIMockGetConvertedFileByFileUIDResults{cp1, err} - return mmGetConvertedFileByFileUID.mock + mmDeleteRepositoryTag.defaultExpectation.results = &RepositoryIMockDeleteRepositoryTagResults{err} + return mmDeleteRepositoryTag.mock } -// Set uses given function f to mock the RepositoryI.GetConvertedFileByFileUID method -func (mmGetConvertedFileByFileUID *mRepositoryIMockGetConvertedFileByFileUID) Set(f func(ctx context.Context, fileUID uuid.UUID) (cp1 *mm_repository.ConvertedFile, err error)) *RepositoryIMock { - if mmGetConvertedFileByFileUID.defaultExpectation != nil { - mmGetConvertedFileByFileUID.mock.t.Fatalf("Default expectation is already set for the RepositoryI.GetConvertedFileByFileUID method") +// Set uses given function f to mock the RepositoryI.DeleteRepositoryTag method +func (mmDeleteRepositoryTag *mRepositoryIMockDeleteRepositoryTag) Set(f func(ctx context.Context, s1 string) (err error)) *RepositoryIMock { + if mmDeleteRepositoryTag.defaultExpectation != nil { + mmDeleteRepositoryTag.mock.t.Fatalf("Default expectation is already set for the RepositoryI.DeleteRepositoryTag method") } - if len(mmGetConvertedFileByFileUID.expectations) > 0 { - mmGetConvertedFileByFileUID.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetConvertedFileByFileUID method") + if len(mmDeleteRepositoryTag.expectations) > 0 { + mmDeleteRepositoryTag.mock.t.Fatalf("Some expectations are already set for the RepositoryI.DeleteRepositoryTag method") } - mmGetConvertedFileByFileUID.mock.funcGetConvertedFileByFileUID = f - return mmGetConvertedFileByFileUID.mock + mmDeleteRepositoryTag.mock.funcDeleteRepositoryTag = f + return mmDeleteRepositoryTag.mock } -// When sets expectation for the RepositoryI.GetConvertedFileByFileUID which will trigger the result defined by the following +// When sets expectation for the RepositoryI.DeleteRepositoryTag which will trigger the result defined by the following // Then helper -func (mmGetConvertedFileByFileUID *mRepositoryIMockGetConvertedFileByFileUID) When(ctx context.Context, fileUID uuid.UUID) *RepositoryIMockGetConvertedFileByFileUIDExpectation { - if mmGetConvertedFileByFileUID.mock.funcGetConvertedFileByFileUID != nil { - mmGetConvertedFileByFileUID.mock.t.Fatalf("RepositoryIMock.GetConvertedFileByFileUID mock is already set by Set") +func (mmDeleteRepositoryTag *mRepositoryIMockDeleteRepositoryTag) When(ctx context.Context, s1 string) *RepositoryIMockDeleteRepositoryTagExpectation { + if mmDeleteRepositoryTag.mock.funcDeleteRepositoryTag != nil { + mmDeleteRepositoryTag.mock.t.Fatalf("RepositoryIMock.DeleteRepositoryTag mock is already set by Set") } - expectation := &RepositoryIMockGetConvertedFileByFileUIDExpectation{ - mock: mmGetConvertedFileByFileUID.mock, - params: &RepositoryIMockGetConvertedFileByFileUIDParams{ctx, fileUID}, + expectation := &RepositoryIMockDeleteRepositoryTagExpectation{ + mock: mmDeleteRepositoryTag.mock, + params: &RepositoryIMockDeleteRepositoryTagParams{ctx, s1}, } - mmGetConvertedFileByFileUID.expectations = append(mmGetConvertedFileByFileUID.expectations, expectation) + mmDeleteRepositoryTag.expectations = append(mmDeleteRepositoryTag.expectations, expectation) return expectation } -// Then sets up RepositoryI.GetConvertedFileByFileUID return parameters for the expectation previously defined by the When method -func (e *RepositoryIMockGetConvertedFileByFileUIDExpectation) Then(cp1 *mm_repository.ConvertedFile, err error) *RepositoryIMock { - e.results = &RepositoryIMockGetConvertedFileByFileUIDResults{cp1, err} +// Then sets up RepositoryI.DeleteRepositoryTag return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockDeleteRepositoryTagExpectation) Then(err error) *RepositoryIMock { + e.results = &RepositoryIMockDeleteRepositoryTagResults{err} return e.mock } -// Times sets number of times RepositoryI.GetConvertedFileByFileUID should be invoked -func (mmGetConvertedFileByFileUID *mRepositoryIMockGetConvertedFileByFileUID) Times(n uint64) *mRepositoryIMockGetConvertedFileByFileUID { +// Times sets number of times RepositoryI.DeleteRepositoryTag should be invoked +func (mmDeleteRepositoryTag *mRepositoryIMockDeleteRepositoryTag) Times(n uint64) *mRepositoryIMockDeleteRepositoryTag { if n == 0 { - mmGetConvertedFileByFileUID.mock.t.Fatalf("Times of RepositoryIMock.GetConvertedFileByFileUID mock can not be zero") + mmDeleteRepositoryTag.mock.t.Fatalf("Times of RepositoryIMock.DeleteRepositoryTag mock can not be zero") } - mm_atomic.StoreUint64(&mmGetConvertedFileByFileUID.expectedInvocations, n) - return mmGetConvertedFileByFileUID + mm_atomic.StoreUint64(&mmDeleteRepositoryTag.expectedInvocations, n) + return mmDeleteRepositoryTag } -func (mmGetConvertedFileByFileUID *mRepositoryIMockGetConvertedFileByFileUID) invocationsDone() bool { - if len(mmGetConvertedFileByFileUID.expectations) == 0 && mmGetConvertedFileByFileUID.defaultExpectation == nil && mmGetConvertedFileByFileUID.mock.funcGetConvertedFileByFileUID == nil { +func (mmDeleteRepositoryTag *mRepositoryIMockDeleteRepositoryTag) invocationsDone() bool { + if len(mmDeleteRepositoryTag.expectations) == 0 && mmDeleteRepositoryTag.defaultExpectation == nil && mmDeleteRepositoryTag.mock.funcDeleteRepositoryTag == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmGetConvertedFileByFileUID.mock.afterGetConvertedFileByFileUIDCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmGetConvertedFileByFileUID.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmDeleteRepositoryTag.mock.afterDeleteRepositoryTagCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmDeleteRepositoryTag.expectedInvocations) return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) } -// GetConvertedFileByFileUID implements repository.RepositoryI -func (mmGetConvertedFileByFileUID *RepositoryIMock) GetConvertedFileByFileUID(ctx context.Context, fileUID uuid.UUID) (cp1 *mm_repository.ConvertedFile, err error) { - mm_atomic.AddUint64(&mmGetConvertedFileByFileUID.beforeGetConvertedFileByFileUIDCounter, 1) - defer mm_atomic.AddUint64(&mmGetConvertedFileByFileUID.afterGetConvertedFileByFileUIDCounter, 1) +// DeleteRepositoryTag implements repository.RepositoryI +func (mmDeleteRepositoryTag *RepositoryIMock) DeleteRepositoryTag(ctx context.Context, s1 string) (err error) { + mm_atomic.AddUint64(&mmDeleteRepositoryTag.beforeDeleteRepositoryTagCounter, 1) + defer mm_atomic.AddUint64(&mmDeleteRepositoryTag.afterDeleteRepositoryTagCounter, 1) - if mmGetConvertedFileByFileUID.inspectFuncGetConvertedFileByFileUID != nil { - mmGetConvertedFileByFileUID.inspectFuncGetConvertedFileByFileUID(ctx, fileUID) + if mmDeleteRepositoryTag.inspectFuncDeleteRepositoryTag != nil { + mmDeleteRepositoryTag.inspectFuncDeleteRepositoryTag(ctx, s1) } - mm_params := RepositoryIMockGetConvertedFileByFileUIDParams{ctx, fileUID} + mm_params := RepositoryIMockDeleteRepositoryTagParams{ctx, s1} // Record call args - mmGetConvertedFileByFileUID.GetConvertedFileByFileUIDMock.mutex.Lock() - mmGetConvertedFileByFileUID.GetConvertedFileByFileUIDMock.callArgs = append(mmGetConvertedFileByFileUID.GetConvertedFileByFileUIDMock.callArgs, &mm_params) - mmGetConvertedFileByFileUID.GetConvertedFileByFileUIDMock.mutex.Unlock() + mmDeleteRepositoryTag.DeleteRepositoryTagMock.mutex.Lock() + mmDeleteRepositoryTag.DeleteRepositoryTagMock.callArgs = append(mmDeleteRepositoryTag.DeleteRepositoryTagMock.callArgs, &mm_params) + mmDeleteRepositoryTag.DeleteRepositoryTagMock.mutex.Unlock() - for _, e := range mmGetConvertedFileByFileUID.GetConvertedFileByFileUIDMock.expectations { + for _, e := range mmDeleteRepositoryTag.DeleteRepositoryTagMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.cp1, e.results.err + return e.results.err } } - if mmGetConvertedFileByFileUID.GetConvertedFileByFileUIDMock.defaultExpectation != nil { - mm_atomic.AddUint64(&mmGetConvertedFileByFileUID.GetConvertedFileByFileUIDMock.defaultExpectation.Counter, 1) - mm_want := mmGetConvertedFileByFileUID.GetConvertedFileByFileUIDMock.defaultExpectation.params - mm_want_ptrs := mmGetConvertedFileByFileUID.GetConvertedFileByFileUIDMock.defaultExpectation.paramPtrs + if mmDeleteRepositoryTag.DeleteRepositoryTagMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmDeleteRepositoryTag.DeleteRepositoryTagMock.defaultExpectation.Counter, 1) + mm_want := mmDeleteRepositoryTag.DeleteRepositoryTagMock.defaultExpectation.params + mm_want_ptrs := mmDeleteRepositoryTag.DeleteRepositoryTagMock.defaultExpectation.paramPtrs - mm_got := RepositoryIMockGetConvertedFileByFileUIDParams{ctx, fileUID} + mm_got := RepositoryIMockDeleteRepositoryTagParams{ctx, s1} if mm_want_ptrs != nil { if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { - mmGetConvertedFileByFileUID.t.Errorf("RepositoryIMock.GetConvertedFileByFileUID got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) + mmDeleteRepositoryTag.t.Errorf("RepositoryIMock.DeleteRepositoryTag got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) } - if mm_want_ptrs.fileUID != nil && !minimock.Equal(*mm_want_ptrs.fileUID, mm_got.fileUID) { - mmGetConvertedFileByFileUID.t.Errorf("RepositoryIMock.GetConvertedFileByFileUID got unexpected parameter fileUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.fileUID, mm_got.fileUID, minimock.Diff(*mm_want_ptrs.fileUID, mm_got.fileUID)) + if mm_want_ptrs.s1 != nil && !minimock.Equal(*mm_want_ptrs.s1, mm_got.s1) { + mmDeleteRepositoryTag.t.Errorf("RepositoryIMock.DeleteRepositoryTag got unexpected parameter s1, want: %#v, got: %#v%s\n", *mm_want_ptrs.s1, mm_got.s1, minimock.Diff(*mm_want_ptrs.s1, mm_got.s1)) } } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { - mmGetConvertedFileByFileUID.t.Errorf("RepositoryIMock.GetConvertedFileByFileUID got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + mmDeleteRepositoryTag.t.Errorf("RepositoryIMock.DeleteRepositoryTag got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) } - mm_results := mmGetConvertedFileByFileUID.GetConvertedFileByFileUIDMock.defaultExpectation.results + mm_results := mmDeleteRepositoryTag.DeleteRepositoryTagMock.defaultExpectation.results if mm_results == nil { - mmGetConvertedFileByFileUID.t.Fatal("No results are set for the RepositoryIMock.GetConvertedFileByFileUID") + mmDeleteRepositoryTag.t.Fatal("No results are set for the RepositoryIMock.DeleteRepositoryTag") } - return (*mm_results).cp1, (*mm_results).err + return (*mm_results).err } - if mmGetConvertedFileByFileUID.funcGetConvertedFileByFileUID != nil { - return mmGetConvertedFileByFileUID.funcGetConvertedFileByFileUID(ctx, fileUID) + if mmDeleteRepositoryTag.funcDeleteRepositoryTag != nil { + return mmDeleteRepositoryTag.funcDeleteRepositoryTag(ctx, s1) } - mmGetConvertedFileByFileUID.t.Fatalf("Unexpected call to RepositoryIMock.GetConvertedFileByFileUID. %v %v", ctx, fileUID) + mmDeleteRepositoryTag.t.Fatalf("Unexpected call to RepositoryIMock.DeleteRepositoryTag. %v %v", ctx, s1) return } -// GetConvertedFileByFileUIDAfterCounter returns a count of finished RepositoryIMock.GetConvertedFileByFileUID invocations -func (mmGetConvertedFileByFileUID *RepositoryIMock) GetConvertedFileByFileUIDAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetConvertedFileByFileUID.afterGetConvertedFileByFileUIDCounter) +// DeleteRepositoryTagAfterCounter returns a count of finished RepositoryIMock.DeleteRepositoryTag invocations +func (mmDeleteRepositoryTag *RepositoryIMock) DeleteRepositoryTagAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmDeleteRepositoryTag.afterDeleteRepositoryTagCounter) } -// GetConvertedFileByFileUIDBeforeCounter returns a count of RepositoryIMock.GetConvertedFileByFileUID invocations -func (mmGetConvertedFileByFileUID *RepositoryIMock) GetConvertedFileByFileUIDBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetConvertedFileByFileUID.beforeGetConvertedFileByFileUIDCounter) +// DeleteRepositoryTagBeforeCounter returns a count of RepositoryIMock.DeleteRepositoryTag invocations +func (mmDeleteRepositoryTag *RepositoryIMock) DeleteRepositoryTagBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmDeleteRepositoryTag.beforeDeleteRepositoryTagCounter) } -// Calls returns a list of arguments used in each call to RepositoryIMock.GetConvertedFileByFileUID. +// Calls returns a list of arguments used in each call to RepositoryIMock.DeleteRepositoryTag. // The list is in the same order as the calls were made (i.e. recent calls have a higher index) -func (mmGetConvertedFileByFileUID *mRepositoryIMockGetConvertedFileByFileUID) Calls() []*RepositoryIMockGetConvertedFileByFileUIDParams { - mmGetConvertedFileByFileUID.mutex.RLock() +func (mmDeleteRepositoryTag *mRepositoryIMockDeleteRepositoryTag) Calls() []*RepositoryIMockDeleteRepositoryTagParams { + mmDeleteRepositoryTag.mutex.RLock() - argCopy := make([]*RepositoryIMockGetConvertedFileByFileUIDParams, len(mmGetConvertedFileByFileUID.callArgs)) - copy(argCopy, mmGetConvertedFileByFileUID.callArgs) + argCopy := make([]*RepositoryIMockDeleteRepositoryTagParams, len(mmDeleteRepositoryTag.callArgs)) + copy(argCopy, mmDeleteRepositoryTag.callArgs) - mmGetConvertedFileByFileUID.mutex.RUnlock() + mmDeleteRepositoryTag.mutex.RUnlock() return argCopy } -// MinimockGetConvertedFileByFileUIDDone returns true if the count of the GetConvertedFileByFileUID invocations corresponds +// MinimockDeleteRepositoryTagDone returns true if the count of the DeleteRepositoryTag invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockGetConvertedFileByFileUIDDone() bool { - for _, e := range m.GetConvertedFileByFileUIDMock.expectations { +func (m *RepositoryIMock) MinimockDeleteRepositoryTagDone() bool { + for _, e := range m.DeleteRepositoryTagMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.GetConvertedFileByFileUIDMock.invocationsDone() + return m.DeleteRepositoryTagMock.invocationsDone() } -// MinimockGetConvertedFileByFileUIDInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockGetConvertedFileByFileUIDInspect() { - for _, e := range m.GetConvertedFileByFileUIDMock.expectations { +// MinimockDeleteRepositoryTagInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockDeleteRepositoryTagInspect() { + for _, e := range m.DeleteRepositoryTagMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { - m.t.Errorf("Expected call to RepositoryIMock.GetConvertedFileByFileUID with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.DeleteRepositoryTag with params: %#v", *e.params) } } - afterGetConvertedFileByFileUIDCounter := mm_atomic.LoadUint64(&m.afterGetConvertedFileByFileUIDCounter) + afterDeleteRepositoryTagCounter := mm_atomic.LoadUint64(&m.afterDeleteRepositoryTagCounter) // if default expectation was set then invocations count should be greater than zero - if m.GetConvertedFileByFileUIDMock.defaultExpectation != nil && afterGetConvertedFileByFileUIDCounter < 1 { - if m.GetConvertedFileByFileUIDMock.defaultExpectation.params == nil { - m.t.Error("Expected call to RepositoryIMock.GetConvertedFileByFileUID") + if m.DeleteRepositoryTagMock.defaultExpectation != nil && afterDeleteRepositoryTagCounter < 1 { + if m.DeleteRepositoryTagMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.DeleteRepositoryTag") } else { - m.t.Errorf("Expected call to RepositoryIMock.GetConvertedFileByFileUID with params: %#v", *m.GetConvertedFileByFileUIDMock.defaultExpectation.params) + m.t.Errorf("Expected call to RepositoryIMock.DeleteRepositoryTag with params: %#v", *m.DeleteRepositoryTagMock.defaultExpectation.params) } } // if func was set then invocations count should be greater than zero - if m.funcGetConvertedFileByFileUID != nil && afterGetConvertedFileByFileUIDCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.GetConvertedFileByFileUID") + if m.funcDeleteRepositoryTag != nil && afterDeleteRepositoryTagCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.DeleteRepositoryTag") } - if !m.GetConvertedFileByFileUIDMock.invocationsDone() && afterGetConvertedFileByFileUIDCounter > 0 { - m.t.Errorf("Expected %d calls to RepositoryIMock.GetConvertedFileByFileUID but found %d calls", - mm_atomic.LoadUint64(&m.GetConvertedFileByFileUIDMock.expectedInvocations), afterGetConvertedFileByFileUIDCounter) + if !m.DeleteRepositoryTagMock.invocationsDone() && afterDeleteRepositoryTagCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.DeleteRepositoryTag but found %d calls", + mm_atomic.LoadUint64(&m.DeleteRepositoryTagMock.expectedInvocations), afterDeleteRepositoryTagCounter) } } -type mRepositoryIMockGetCountFilesByListKnowledgeBaseUID struct { +type mRepositoryIMockGetChunksByUIDs struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockGetCountFilesByListKnowledgeBaseUIDExpectation - expectations []*RepositoryIMockGetCountFilesByListKnowledgeBaseUIDExpectation + defaultExpectation *RepositoryIMockGetChunksByUIDsExpectation + expectations []*RepositoryIMockGetChunksByUIDsExpectation - callArgs []*RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParams + callArgs []*RepositoryIMockGetChunksByUIDsParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockGetCountFilesByListKnowledgeBaseUIDExpectation specifies expectation struct of the RepositoryI.GetCountFilesByListKnowledgeBaseUID -type RepositoryIMockGetCountFilesByListKnowledgeBaseUIDExpectation struct { +// RepositoryIMockGetChunksByUIDsExpectation specifies expectation struct of the RepositoryI.GetChunksByUIDs +type RepositoryIMockGetChunksByUIDsExpectation struct { mock *RepositoryIMock - params *RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParams - paramPtrs *RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParamPtrs - results *RepositoryIMockGetCountFilesByListKnowledgeBaseUIDResults + params *RepositoryIMockGetChunksByUIDsParams + paramPtrs *RepositoryIMockGetChunksByUIDsParamPtrs + results *RepositoryIMockGetChunksByUIDsResults Counter uint64 } -// RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParams contains parameters of the RepositoryI.GetCountFilesByListKnowledgeBaseUID -type RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParams struct { - ctx context.Context - kbUIDs []mm_repository.KbUID +// RepositoryIMockGetChunksByUIDsParams contains parameters of the RepositoryI.GetChunksByUIDs +type RepositoryIMockGetChunksByUIDsParams struct { + ctx context.Context + chunkUIDs []uuid.UUID } -// RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParamPtrs contains pointers to parameters of the RepositoryI.GetCountFilesByListKnowledgeBaseUID -type RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParamPtrs struct { - ctx *context.Context - kbUIDs *[]mm_repository.KbUID +// RepositoryIMockGetChunksByUIDsParamPtrs contains pointers to parameters of the RepositoryI.GetChunksByUIDs +type RepositoryIMockGetChunksByUIDsParamPtrs struct { + ctx *context.Context + chunkUIDs *[]uuid.UUID } -// RepositoryIMockGetCountFilesByListKnowledgeBaseUIDResults contains results of the RepositoryI.GetCountFilesByListKnowledgeBaseUID -type RepositoryIMockGetCountFilesByListKnowledgeBaseUIDResults struct { - m1 map[mm_repository.KbUID]int64 +// RepositoryIMockGetChunksByUIDsResults contains results of the RepositoryI.GetChunksByUIDs +type RepositoryIMockGetChunksByUIDsResults struct { + ta1 []mm_repository.TextChunk err error } -// Expect sets up expected params for RepositoryI.GetCountFilesByListKnowledgeBaseUID -func (mmGetCountFilesByListKnowledgeBaseUID *mRepositoryIMockGetCountFilesByListKnowledgeBaseUID) Expect(ctx context.Context, kbUIDs []mm_repository.KbUID) *mRepositoryIMockGetCountFilesByListKnowledgeBaseUID { - if mmGetCountFilesByListKnowledgeBaseUID.mock.funcGetCountFilesByListKnowledgeBaseUID != nil { - mmGetCountFilesByListKnowledgeBaseUID.mock.t.Fatalf("RepositoryIMock.GetCountFilesByListKnowledgeBaseUID mock is already set by Set") +// Expect sets up expected params for RepositoryI.GetChunksByUIDs +func (mmGetChunksByUIDs *mRepositoryIMockGetChunksByUIDs) Expect(ctx context.Context, chunkUIDs []uuid.UUID) *mRepositoryIMockGetChunksByUIDs { + if mmGetChunksByUIDs.mock.funcGetChunksByUIDs != nil { + mmGetChunksByUIDs.mock.t.Fatalf("RepositoryIMock.GetChunksByUIDs mock is already set by Set") } - if mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation == nil { - mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation = &RepositoryIMockGetCountFilesByListKnowledgeBaseUIDExpectation{} + if mmGetChunksByUIDs.defaultExpectation == nil { + mmGetChunksByUIDs.defaultExpectation = &RepositoryIMockGetChunksByUIDsExpectation{} } - if mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.paramPtrs != nil { - mmGetCountFilesByListKnowledgeBaseUID.mock.t.Fatalf("RepositoryIMock.GetCountFilesByListKnowledgeBaseUID mock is already set by ExpectParams functions") + if mmGetChunksByUIDs.defaultExpectation.paramPtrs != nil { + mmGetChunksByUIDs.mock.t.Fatalf("RepositoryIMock.GetChunksByUIDs mock is already set by ExpectParams functions") } - mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.params = &RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParams{ctx, kbUIDs} - for _, e := range mmGetCountFilesByListKnowledgeBaseUID.expectations { - if minimock.Equal(e.params, mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.params) { - mmGetCountFilesByListKnowledgeBaseUID.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.params) + mmGetChunksByUIDs.defaultExpectation.params = &RepositoryIMockGetChunksByUIDsParams{ctx, chunkUIDs} + for _, e := range mmGetChunksByUIDs.expectations { + if minimock.Equal(e.params, mmGetChunksByUIDs.defaultExpectation.params) { + mmGetChunksByUIDs.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetChunksByUIDs.defaultExpectation.params) } } - return mmGetCountFilesByListKnowledgeBaseUID + return mmGetChunksByUIDs } -// ExpectCtxParam1 sets up expected param ctx for RepositoryI.GetCountFilesByListKnowledgeBaseUID -func (mmGetCountFilesByListKnowledgeBaseUID *mRepositoryIMockGetCountFilesByListKnowledgeBaseUID) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockGetCountFilesByListKnowledgeBaseUID { - if mmGetCountFilesByListKnowledgeBaseUID.mock.funcGetCountFilesByListKnowledgeBaseUID != nil { - mmGetCountFilesByListKnowledgeBaseUID.mock.t.Fatalf("RepositoryIMock.GetCountFilesByListKnowledgeBaseUID mock is already set by Set") +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.GetChunksByUIDs +func (mmGetChunksByUIDs *mRepositoryIMockGetChunksByUIDs) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockGetChunksByUIDs { + if mmGetChunksByUIDs.mock.funcGetChunksByUIDs != nil { + mmGetChunksByUIDs.mock.t.Fatalf("RepositoryIMock.GetChunksByUIDs mock is already set by Set") } - if mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation == nil { - mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation = &RepositoryIMockGetCountFilesByListKnowledgeBaseUIDExpectation{} + if mmGetChunksByUIDs.defaultExpectation == nil { + mmGetChunksByUIDs.defaultExpectation = &RepositoryIMockGetChunksByUIDsExpectation{} } - if mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.params != nil { - mmGetCountFilesByListKnowledgeBaseUID.mock.t.Fatalf("RepositoryIMock.GetCountFilesByListKnowledgeBaseUID mock is already set by Expect") + if mmGetChunksByUIDs.defaultExpectation.params != nil { + mmGetChunksByUIDs.mock.t.Fatalf("RepositoryIMock.GetChunksByUIDs mock is already set by Expect") } - if mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.paramPtrs == nil { - mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.paramPtrs = &RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParamPtrs{} + if mmGetChunksByUIDs.defaultExpectation.paramPtrs == nil { + mmGetChunksByUIDs.defaultExpectation.paramPtrs = &RepositoryIMockGetChunksByUIDsParamPtrs{} } - mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.paramPtrs.ctx = &ctx + mmGetChunksByUIDs.defaultExpectation.paramPtrs.ctx = &ctx - return mmGetCountFilesByListKnowledgeBaseUID + return mmGetChunksByUIDs } -// ExpectKbUIDsParam2 sets up expected param kbUIDs for RepositoryI.GetCountFilesByListKnowledgeBaseUID -func (mmGetCountFilesByListKnowledgeBaseUID *mRepositoryIMockGetCountFilesByListKnowledgeBaseUID) ExpectKbUIDsParam2(kbUIDs []mm_repository.KbUID) *mRepositoryIMockGetCountFilesByListKnowledgeBaseUID { - if mmGetCountFilesByListKnowledgeBaseUID.mock.funcGetCountFilesByListKnowledgeBaseUID != nil { - mmGetCountFilesByListKnowledgeBaseUID.mock.t.Fatalf("RepositoryIMock.GetCountFilesByListKnowledgeBaseUID mock is already set by Set") +// ExpectChunkUIDsParam2 sets up expected param chunkUIDs for RepositoryI.GetChunksByUIDs +func (mmGetChunksByUIDs *mRepositoryIMockGetChunksByUIDs) ExpectChunkUIDsParam2(chunkUIDs []uuid.UUID) *mRepositoryIMockGetChunksByUIDs { + if mmGetChunksByUIDs.mock.funcGetChunksByUIDs != nil { + mmGetChunksByUIDs.mock.t.Fatalf("RepositoryIMock.GetChunksByUIDs mock is already set by Set") } - if mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation == nil { - mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation = &RepositoryIMockGetCountFilesByListKnowledgeBaseUIDExpectation{} + if mmGetChunksByUIDs.defaultExpectation == nil { + mmGetChunksByUIDs.defaultExpectation = &RepositoryIMockGetChunksByUIDsExpectation{} } - if mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.params != nil { - mmGetCountFilesByListKnowledgeBaseUID.mock.t.Fatalf("RepositoryIMock.GetCountFilesByListKnowledgeBaseUID mock is already set by Expect") + if mmGetChunksByUIDs.defaultExpectation.params != nil { + mmGetChunksByUIDs.mock.t.Fatalf("RepositoryIMock.GetChunksByUIDs mock is already set by Expect") } - if mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.paramPtrs == nil { - mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.paramPtrs = &RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParamPtrs{} + if mmGetChunksByUIDs.defaultExpectation.paramPtrs == nil { + mmGetChunksByUIDs.defaultExpectation.paramPtrs = &RepositoryIMockGetChunksByUIDsParamPtrs{} } - mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.paramPtrs.kbUIDs = &kbUIDs + mmGetChunksByUIDs.defaultExpectation.paramPtrs.chunkUIDs = &chunkUIDs - return mmGetCountFilesByListKnowledgeBaseUID + return mmGetChunksByUIDs } -// Inspect accepts an inspector function that has same arguments as the RepositoryI.GetCountFilesByListKnowledgeBaseUID -func (mmGetCountFilesByListKnowledgeBaseUID *mRepositoryIMockGetCountFilesByListKnowledgeBaseUID) Inspect(f func(ctx context.Context, kbUIDs []mm_repository.KbUID)) *mRepositoryIMockGetCountFilesByListKnowledgeBaseUID { - if mmGetCountFilesByListKnowledgeBaseUID.mock.inspectFuncGetCountFilesByListKnowledgeBaseUID != nil { - mmGetCountFilesByListKnowledgeBaseUID.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.GetCountFilesByListKnowledgeBaseUID") +// Inspect accepts an inspector function that has same arguments as the RepositoryI.GetChunksByUIDs +func (mmGetChunksByUIDs *mRepositoryIMockGetChunksByUIDs) Inspect(f func(ctx context.Context, chunkUIDs []uuid.UUID)) *mRepositoryIMockGetChunksByUIDs { + if mmGetChunksByUIDs.mock.inspectFuncGetChunksByUIDs != nil { + mmGetChunksByUIDs.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.GetChunksByUIDs") } - mmGetCountFilesByListKnowledgeBaseUID.mock.inspectFuncGetCountFilesByListKnowledgeBaseUID = f + mmGetChunksByUIDs.mock.inspectFuncGetChunksByUIDs = f - return mmGetCountFilesByListKnowledgeBaseUID + return mmGetChunksByUIDs } -// Return sets up results that will be returned by RepositoryI.GetCountFilesByListKnowledgeBaseUID -func (mmGetCountFilesByListKnowledgeBaseUID *mRepositoryIMockGetCountFilesByListKnowledgeBaseUID) Return(m1 map[mm_repository.KbUID]int64, err error) *RepositoryIMock { - if mmGetCountFilesByListKnowledgeBaseUID.mock.funcGetCountFilesByListKnowledgeBaseUID != nil { - mmGetCountFilesByListKnowledgeBaseUID.mock.t.Fatalf("RepositoryIMock.GetCountFilesByListKnowledgeBaseUID mock is already set by Set") +// Return sets up results that will be returned by RepositoryI.GetChunksByUIDs +func (mmGetChunksByUIDs *mRepositoryIMockGetChunksByUIDs) Return(ta1 []mm_repository.TextChunk, err error) *RepositoryIMock { + if mmGetChunksByUIDs.mock.funcGetChunksByUIDs != nil { + mmGetChunksByUIDs.mock.t.Fatalf("RepositoryIMock.GetChunksByUIDs mock is already set by Set") } - if mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation == nil { - mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation = &RepositoryIMockGetCountFilesByListKnowledgeBaseUIDExpectation{mock: mmGetCountFilesByListKnowledgeBaseUID.mock} + if mmGetChunksByUIDs.defaultExpectation == nil { + mmGetChunksByUIDs.defaultExpectation = &RepositoryIMockGetChunksByUIDsExpectation{mock: mmGetChunksByUIDs.mock} } - mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.results = &RepositoryIMockGetCountFilesByListKnowledgeBaseUIDResults{m1, err} - return mmGetCountFilesByListKnowledgeBaseUID.mock + mmGetChunksByUIDs.defaultExpectation.results = &RepositoryIMockGetChunksByUIDsResults{ta1, err} + return mmGetChunksByUIDs.mock } -// Set uses given function f to mock the RepositoryI.GetCountFilesByListKnowledgeBaseUID method -func (mmGetCountFilesByListKnowledgeBaseUID *mRepositoryIMockGetCountFilesByListKnowledgeBaseUID) Set(f func(ctx context.Context, kbUIDs []mm_repository.KbUID) (m1 map[mm_repository.KbUID]int64, err error)) *RepositoryIMock { - if mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation != nil { - mmGetCountFilesByListKnowledgeBaseUID.mock.t.Fatalf("Default expectation is already set for the RepositoryI.GetCountFilesByListKnowledgeBaseUID method") +// Set uses given function f to mock the RepositoryI.GetChunksByUIDs method +func (mmGetChunksByUIDs *mRepositoryIMockGetChunksByUIDs) Set(f func(ctx context.Context, chunkUIDs []uuid.UUID) (ta1 []mm_repository.TextChunk, err error)) *RepositoryIMock { + if mmGetChunksByUIDs.defaultExpectation != nil { + mmGetChunksByUIDs.mock.t.Fatalf("Default expectation is already set for the RepositoryI.GetChunksByUIDs method") } - if len(mmGetCountFilesByListKnowledgeBaseUID.expectations) > 0 { - mmGetCountFilesByListKnowledgeBaseUID.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetCountFilesByListKnowledgeBaseUID method") + if len(mmGetChunksByUIDs.expectations) > 0 { + mmGetChunksByUIDs.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetChunksByUIDs method") } - mmGetCountFilesByListKnowledgeBaseUID.mock.funcGetCountFilesByListKnowledgeBaseUID = f - return mmGetCountFilesByListKnowledgeBaseUID.mock + mmGetChunksByUIDs.mock.funcGetChunksByUIDs = f + return mmGetChunksByUIDs.mock } -// When sets expectation for the RepositoryI.GetCountFilesByListKnowledgeBaseUID which will trigger the result defined by the following +// When sets expectation for the RepositoryI.GetChunksByUIDs which will trigger the result defined by the following // Then helper -func (mmGetCountFilesByListKnowledgeBaseUID *mRepositoryIMockGetCountFilesByListKnowledgeBaseUID) When(ctx context.Context, kbUIDs []mm_repository.KbUID) *RepositoryIMockGetCountFilesByListKnowledgeBaseUIDExpectation { - if mmGetCountFilesByListKnowledgeBaseUID.mock.funcGetCountFilesByListKnowledgeBaseUID != nil { - mmGetCountFilesByListKnowledgeBaseUID.mock.t.Fatalf("RepositoryIMock.GetCountFilesByListKnowledgeBaseUID mock is already set by Set") +func (mmGetChunksByUIDs *mRepositoryIMockGetChunksByUIDs) When(ctx context.Context, chunkUIDs []uuid.UUID) *RepositoryIMockGetChunksByUIDsExpectation { + if mmGetChunksByUIDs.mock.funcGetChunksByUIDs != nil { + mmGetChunksByUIDs.mock.t.Fatalf("RepositoryIMock.GetChunksByUIDs mock is already set by Set") } - expectation := &RepositoryIMockGetCountFilesByListKnowledgeBaseUIDExpectation{ - mock: mmGetCountFilesByListKnowledgeBaseUID.mock, - params: &RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParams{ctx, kbUIDs}, + expectation := &RepositoryIMockGetChunksByUIDsExpectation{ + mock: mmGetChunksByUIDs.mock, + params: &RepositoryIMockGetChunksByUIDsParams{ctx, chunkUIDs}, } - mmGetCountFilesByListKnowledgeBaseUID.expectations = append(mmGetCountFilesByListKnowledgeBaseUID.expectations, expectation) + mmGetChunksByUIDs.expectations = append(mmGetChunksByUIDs.expectations, expectation) return expectation } -// Then sets up RepositoryI.GetCountFilesByListKnowledgeBaseUID return parameters for the expectation previously defined by the When method -func (e *RepositoryIMockGetCountFilesByListKnowledgeBaseUIDExpectation) Then(m1 map[mm_repository.KbUID]int64, err error) *RepositoryIMock { - e.results = &RepositoryIMockGetCountFilesByListKnowledgeBaseUIDResults{m1, err} +// Then sets up RepositoryI.GetChunksByUIDs return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockGetChunksByUIDsExpectation) Then(ta1 []mm_repository.TextChunk, err error) *RepositoryIMock { + e.results = &RepositoryIMockGetChunksByUIDsResults{ta1, err} return e.mock } -// Times sets number of times RepositoryI.GetCountFilesByListKnowledgeBaseUID should be invoked -func (mmGetCountFilesByListKnowledgeBaseUID *mRepositoryIMockGetCountFilesByListKnowledgeBaseUID) Times(n uint64) *mRepositoryIMockGetCountFilesByListKnowledgeBaseUID { +// Times sets number of times RepositoryI.GetChunksByUIDs should be invoked +func (mmGetChunksByUIDs *mRepositoryIMockGetChunksByUIDs) Times(n uint64) *mRepositoryIMockGetChunksByUIDs { if n == 0 { - mmGetCountFilesByListKnowledgeBaseUID.mock.t.Fatalf("Times of RepositoryIMock.GetCountFilesByListKnowledgeBaseUID mock can not be zero") + mmGetChunksByUIDs.mock.t.Fatalf("Times of RepositoryIMock.GetChunksByUIDs mock can not be zero") } - mm_atomic.StoreUint64(&mmGetCountFilesByListKnowledgeBaseUID.expectedInvocations, n) - return mmGetCountFilesByListKnowledgeBaseUID + mm_atomic.StoreUint64(&mmGetChunksByUIDs.expectedInvocations, n) + return mmGetChunksByUIDs } -func (mmGetCountFilesByListKnowledgeBaseUID *mRepositoryIMockGetCountFilesByListKnowledgeBaseUID) invocationsDone() bool { - if len(mmGetCountFilesByListKnowledgeBaseUID.expectations) == 0 && mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation == nil && mmGetCountFilesByListKnowledgeBaseUID.mock.funcGetCountFilesByListKnowledgeBaseUID == nil { +func (mmGetChunksByUIDs *mRepositoryIMockGetChunksByUIDs) invocationsDone() bool { + if len(mmGetChunksByUIDs.expectations) == 0 && mmGetChunksByUIDs.defaultExpectation == nil && mmGetChunksByUIDs.mock.funcGetChunksByUIDs == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmGetCountFilesByListKnowledgeBaseUID.mock.afterGetCountFilesByListKnowledgeBaseUIDCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmGetCountFilesByListKnowledgeBaseUID.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmGetChunksByUIDs.mock.afterGetChunksByUIDsCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmGetChunksByUIDs.expectedInvocations) return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) } -// GetCountFilesByListKnowledgeBaseUID implements repository.RepositoryI -func (mmGetCountFilesByListKnowledgeBaseUID *RepositoryIMock) GetCountFilesByListKnowledgeBaseUID(ctx context.Context, kbUIDs []mm_repository.KbUID) (m1 map[mm_repository.KbUID]int64, err error) { - mm_atomic.AddUint64(&mmGetCountFilesByListKnowledgeBaseUID.beforeGetCountFilesByListKnowledgeBaseUIDCounter, 1) - defer mm_atomic.AddUint64(&mmGetCountFilesByListKnowledgeBaseUID.afterGetCountFilesByListKnowledgeBaseUIDCounter, 1) +// GetChunksByUIDs implements repository.RepositoryI +func (mmGetChunksByUIDs *RepositoryIMock) GetChunksByUIDs(ctx context.Context, chunkUIDs []uuid.UUID) (ta1 []mm_repository.TextChunk, err error) { + mm_atomic.AddUint64(&mmGetChunksByUIDs.beforeGetChunksByUIDsCounter, 1) + defer mm_atomic.AddUint64(&mmGetChunksByUIDs.afterGetChunksByUIDsCounter, 1) - if mmGetCountFilesByListKnowledgeBaseUID.inspectFuncGetCountFilesByListKnowledgeBaseUID != nil { - mmGetCountFilesByListKnowledgeBaseUID.inspectFuncGetCountFilesByListKnowledgeBaseUID(ctx, kbUIDs) + if mmGetChunksByUIDs.inspectFuncGetChunksByUIDs != nil { + mmGetChunksByUIDs.inspectFuncGetChunksByUIDs(ctx, chunkUIDs) } - mm_params := RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParams{ctx, kbUIDs} + mm_params := RepositoryIMockGetChunksByUIDsParams{ctx, chunkUIDs} // Record call args - mmGetCountFilesByListKnowledgeBaseUID.GetCountFilesByListKnowledgeBaseUIDMock.mutex.Lock() - mmGetCountFilesByListKnowledgeBaseUID.GetCountFilesByListKnowledgeBaseUIDMock.callArgs = append(mmGetCountFilesByListKnowledgeBaseUID.GetCountFilesByListKnowledgeBaseUIDMock.callArgs, &mm_params) - mmGetCountFilesByListKnowledgeBaseUID.GetCountFilesByListKnowledgeBaseUIDMock.mutex.Unlock() + mmGetChunksByUIDs.GetChunksByUIDsMock.mutex.Lock() + mmGetChunksByUIDs.GetChunksByUIDsMock.callArgs = append(mmGetChunksByUIDs.GetChunksByUIDsMock.callArgs, &mm_params) + mmGetChunksByUIDs.GetChunksByUIDsMock.mutex.Unlock() - for _, e := range mmGetCountFilesByListKnowledgeBaseUID.GetCountFilesByListKnowledgeBaseUIDMock.expectations { + for _, e := range mmGetChunksByUIDs.GetChunksByUIDsMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.m1, e.results.err + return e.results.ta1, e.results.err } } - if mmGetCountFilesByListKnowledgeBaseUID.GetCountFilesByListKnowledgeBaseUIDMock.defaultExpectation != nil { - mm_atomic.AddUint64(&mmGetCountFilesByListKnowledgeBaseUID.GetCountFilesByListKnowledgeBaseUIDMock.defaultExpectation.Counter, 1) - mm_want := mmGetCountFilesByListKnowledgeBaseUID.GetCountFilesByListKnowledgeBaseUIDMock.defaultExpectation.params - mm_want_ptrs := mmGetCountFilesByListKnowledgeBaseUID.GetCountFilesByListKnowledgeBaseUIDMock.defaultExpectation.paramPtrs + if mmGetChunksByUIDs.GetChunksByUIDsMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmGetChunksByUIDs.GetChunksByUIDsMock.defaultExpectation.Counter, 1) + mm_want := mmGetChunksByUIDs.GetChunksByUIDsMock.defaultExpectation.params + mm_want_ptrs := mmGetChunksByUIDs.GetChunksByUIDsMock.defaultExpectation.paramPtrs - mm_got := RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParams{ctx, kbUIDs} + mm_got := RepositoryIMockGetChunksByUIDsParams{ctx, chunkUIDs} if mm_want_ptrs != nil { if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { - mmGetCountFilesByListKnowledgeBaseUID.t.Errorf("RepositoryIMock.GetCountFilesByListKnowledgeBaseUID got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) + mmGetChunksByUIDs.t.Errorf("RepositoryIMock.GetChunksByUIDs got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) } - if mm_want_ptrs.kbUIDs != nil && !minimock.Equal(*mm_want_ptrs.kbUIDs, mm_got.kbUIDs) { - mmGetCountFilesByListKnowledgeBaseUID.t.Errorf("RepositoryIMock.GetCountFilesByListKnowledgeBaseUID got unexpected parameter kbUIDs, want: %#v, got: %#v%s\n", *mm_want_ptrs.kbUIDs, mm_got.kbUIDs, minimock.Diff(*mm_want_ptrs.kbUIDs, mm_got.kbUIDs)) + if mm_want_ptrs.chunkUIDs != nil && !minimock.Equal(*mm_want_ptrs.chunkUIDs, mm_got.chunkUIDs) { + mmGetChunksByUIDs.t.Errorf("RepositoryIMock.GetChunksByUIDs got unexpected parameter chunkUIDs, want: %#v, got: %#v%s\n", *mm_want_ptrs.chunkUIDs, mm_got.chunkUIDs, minimock.Diff(*mm_want_ptrs.chunkUIDs, mm_got.chunkUIDs)) } } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { - mmGetCountFilesByListKnowledgeBaseUID.t.Errorf("RepositoryIMock.GetCountFilesByListKnowledgeBaseUID got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + mmGetChunksByUIDs.t.Errorf("RepositoryIMock.GetChunksByUIDs got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) } - mm_results := mmGetCountFilesByListKnowledgeBaseUID.GetCountFilesByListKnowledgeBaseUIDMock.defaultExpectation.results + mm_results := mmGetChunksByUIDs.GetChunksByUIDsMock.defaultExpectation.results if mm_results == nil { - mmGetCountFilesByListKnowledgeBaseUID.t.Fatal("No results are set for the RepositoryIMock.GetCountFilesByListKnowledgeBaseUID") + mmGetChunksByUIDs.t.Fatal("No results are set for the RepositoryIMock.GetChunksByUIDs") } - return (*mm_results).m1, (*mm_results).err + return (*mm_results).ta1, (*mm_results).err } - if mmGetCountFilesByListKnowledgeBaseUID.funcGetCountFilesByListKnowledgeBaseUID != nil { - return mmGetCountFilesByListKnowledgeBaseUID.funcGetCountFilesByListKnowledgeBaseUID(ctx, kbUIDs) + if mmGetChunksByUIDs.funcGetChunksByUIDs != nil { + return mmGetChunksByUIDs.funcGetChunksByUIDs(ctx, chunkUIDs) } - mmGetCountFilesByListKnowledgeBaseUID.t.Fatalf("Unexpected call to RepositoryIMock.GetCountFilesByListKnowledgeBaseUID. %v %v", ctx, kbUIDs) + mmGetChunksByUIDs.t.Fatalf("Unexpected call to RepositoryIMock.GetChunksByUIDs. %v %v", ctx, chunkUIDs) return } -// GetCountFilesByListKnowledgeBaseUIDAfterCounter returns a count of finished RepositoryIMock.GetCountFilesByListKnowledgeBaseUID invocations -func (mmGetCountFilesByListKnowledgeBaseUID *RepositoryIMock) GetCountFilesByListKnowledgeBaseUIDAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetCountFilesByListKnowledgeBaseUID.afterGetCountFilesByListKnowledgeBaseUIDCounter) +// GetChunksByUIDsAfterCounter returns a count of finished RepositoryIMock.GetChunksByUIDs invocations +func (mmGetChunksByUIDs *RepositoryIMock) GetChunksByUIDsAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetChunksByUIDs.afterGetChunksByUIDsCounter) } -// GetCountFilesByListKnowledgeBaseUIDBeforeCounter returns a count of RepositoryIMock.GetCountFilesByListKnowledgeBaseUID invocations -func (mmGetCountFilesByListKnowledgeBaseUID *RepositoryIMock) GetCountFilesByListKnowledgeBaseUIDBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetCountFilesByListKnowledgeBaseUID.beforeGetCountFilesByListKnowledgeBaseUIDCounter) +// GetChunksByUIDsBeforeCounter returns a count of RepositoryIMock.GetChunksByUIDs invocations +func (mmGetChunksByUIDs *RepositoryIMock) GetChunksByUIDsBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetChunksByUIDs.beforeGetChunksByUIDsCounter) } -// Calls returns a list of arguments used in each call to RepositoryIMock.GetCountFilesByListKnowledgeBaseUID. +// Calls returns a list of arguments used in each call to RepositoryIMock.GetChunksByUIDs. // The list is in the same order as the calls were made (i.e. recent calls have a higher index) -func (mmGetCountFilesByListKnowledgeBaseUID *mRepositoryIMockGetCountFilesByListKnowledgeBaseUID) Calls() []*RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParams { - mmGetCountFilesByListKnowledgeBaseUID.mutex.RLock() +func (mmGetChunksByUIDs *mRepositoryIMockGetChunksByUIDs) Calls() []*RepositoryIMockGetChunksByUIDsParams { + mmGetChunksByUIDs.mutex.RLock() - argCopy := make([]*RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParams, len(mmGetCountFilesByListKnowledgeBaseUID.callArgs)) - copy(argCopy, mmGetCountFilesByListKnowledgeBaseUID.callArgs) + argCopy := make([]*RepositoryIMockGetChunksByUIDsParams, len(mmGetChunksByUIDs.callArgs)) + copy(argCopy, mmGetChunksByUIDs.callArgs) - mmGetCountFilesByListKnowledgeBaseUID.mutex.RUnlock() + mmGetChunksByUIDs.mutex.RUnlock() return argCopy } -// MinimockGetCountFilesByListKnowledgeBaseUIDDone returns true if the count of the GetCountFilesByListKnowledgeBaseUID invocations corresponds +// MinimockGetChunksByUIDsDone returns true if the count of the GetChunksByUIDs invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockGetCountFilesByListKnowledgeBaseUIDDone() bool { - for _, e := range m.GetCountFilesByListKnowledgeBaseUIDMock.expectations { +func (m *RepositoryIMock) MinimockGetChunksByUIDsDone() bool { + for _, e := range m.GetChunksByUIDsMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.GetCountFilesByListKnowledgeBaseUIDMock.invocationsDone() + return m.GetChunksByUIDsMock.invocationsDone() } -// MinimockGetCountFilesByListKnowledgeBaseUIDInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockGetCountFilesByListKnowledgeBaseUIDInspect() { - for _, e := range m.GetCountFilesByListKnowledgeBaseUIDMock.expectations { +// MinimockGetChunksByUIDsInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockGetChunksByUIDsInspect() { + for _, e := range m.GetChunksByUIDsMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { - m.t.Errorf("Expected call to RepositoryIMock.GetCountFilesByListKnowledgeBaseUID with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.GetChunksByUIDs with params: %#v", *e.params) } } - afterGetCountFilesByListKnowledgeBaseUIDCounter := mm_atomic.LoadUint64(&m.afterGetCountFilesByListKnowledgeBaseUIDCounter) + afterGetChunksByUIDsCounter := mm_atomic.LoadUint64(&m.afterGetChunksByUIDsCounter) // if default expectation was set then invocations count should be greater than zero - if m.GetCountFilesByListKnowledgeBaseUIDMock.defaultExpectation != nil && afterGetCountFilesByListKnowledgeBaseUIDCounter < 1 { - if m.GetCountFilesByListKnowledgeBaseUIDMock.defaultExpectation.params == nil { - m.t.Error("Expected call to RepositoryIMock.GetCountFilesByListKnowledgeBaseUID") + if m.GetChunksByUIDsMock.defaultExpectation != nil && afterGetChunksByUIDsCounter < 1 { + if m.GetChunksByUIDsMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.GetChunksByUIDs") } else { - m.t.Errorf("Expected call to RepositoryIMock.GetCountFilesByListKnowledgeBaseUID with params: %#v", *m.GetCountFilesByListKnowledgeBaseUIDMock.defaultExpectation.params) + m.t.Errorf("Expected call to RepositoryIMock.GetChunksByUIDs with params: %#v", *m.GetChunksByUIDsMock.defaultExpectation.params) } } // if func was set then invocations count should be greater than zero - if m.funcGetCountFilesByListKnowledgeBaseUID != nil && afterGetCountFilesByListKnowledgeBaseUIDCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.GetCountFilesByListKnowledgeBaseUID") + if m.funcGetChunksByUIDs != nil && afterGetChunksByUIDsCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.GetChunksByUIDs") } - if !m.GetCountFilesByListKnowledgeBaseUIDMock.invocationsDone() && afterGetCountFilesByListKnowledgeBaseUIDCounter > 0 { - m.t.Errorf("Expected %d calls to RepositoryIMock.GetCountFilesByListKnowledgeBaseUID but found %d calls", - mm_atomic.LoadUint64(&m.GetCountFilesByListKnowledgeBaseUIDMock.expectedInvocations), afterGetCountFilesByListKnowledgeBaseUIDCounter) + if !m.GetChunksByUIDsMock.invocationsDone() && afterGetChunksByUIDsCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.GetChunksByUIDs but found %d calls", + mm_atomic.LoadUint64(&m.GetChunksByUIDsMock.expectedInvocations), afterGetChunksByUIDsCounter) } } -type mRepositoryIMockGetEmbeddingByUIDs struct { +type mRepositoryIMockGetConvertedFileByFileUID struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockGetEmbeddingByUIDsExpectation - expectations []*RepositoryIMockGetEmbeddingByUIDsExpectation + defaultExpectation *RepositoryIMockGetConvertedFileByFileUIDExpectation + expectations []*RepositoryIMockGetConvertedFileByFileUIDExpectation - callArgs []*RepositoryIMockGetEmbeddingByUIDsParams + callArgs []*RepositoryIMockGetConvertedFileByFileUIDParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockGetEmbeddingByUIDsExpectation specifies expectation struct of the RepositoryI.GetEmbeddingByUIDs -type RepositoryIMockGetEmbeddingByUIDsExpectation struct { +// RepositoryIMockGetConvertedFileByFileUIDExpectation specifies expectation struct of the RepositoryI.GetConvertedFileByFileUID +type RepositoryIMockGetConvertedFileByFileUIDExpectation struct { mock *RepositoryIMock - params *RepositoryIMockGetEmbeddingByUIDsParams - paramPtrs *RepositoryIMockGetEmbeddingByUIDsParamPtrs - results *RepositoryIMockGetEmbeddingByUIDsResults + params *RepositoryIMockGetConvertedFileByFileUIDParams + paramPtrs *RepositoryIMockGetConvertedFileByFileUIDParamPtrs + results *RepositoryIMockGetConvertedFileByFileUIDResults Counter uint64 } -// RepositoryIMockGetEmbeddingByUIDsParams contains parameters of the RepositoryI.GetEmbeddingByUIDs -type RepositoryIMockGetEmbeddingByUIDsParams struct { +// RepositoryIMockGetConvertedFileByFileUIDParams contains parameters of the RepositoryI.GetConvertedFileByFileUID +type RepositoryIMockGetConvertedFileByFileUIDParams struct { ctx context.Context - embUIDs []uuid.UUID + fileUID uuid.UUID } -// RepositoryIMockGetEmbeddingByUIDsParamPtrs contains pointers to parameters of the RepositoryI.GetEmbeddingByUIDs -type RepositoryIMockGetEmbeddingByUIDsParamPtrs struct { +// RepositoryIMockGetConvertedFileByFileUIDParamPtrs contains pointers to parameters of the RepositoryI.GetConvertedFileByFileUID +type RepositoryIMockGetConvertedFileByFileUIDParamPtrs struct { ctx *context.Context - embUIDs *[]uuid.UUID + fileUID *uuid.UUID } -// RepositoryIMockGetEmbeddingByUIDsResults contains results of the RepositoryI.GetEmbeddingByUIDs -type RepositoryIMockGetEmbeddingByUIDsResults struct { - ea1 []mm_repository.Embedding +// RepositoryIMockGetConvertedFileByFileUIDResults contains results of the RepositoryI.GetConvertedFileByFileUID +type RepositoryIMockGetConvertedFileByFileUIDResults struct { + cp1 *mm_repository.ConvertedFile err error } -// Expect sets up expected params for RepositoryI.GetEmbeddingByUIDs -func (mmGetEmbeddingByUIDs *mRepositoryIMockGetEmbeddingByUIDs) Expect(ctx context.Context, embUIDs []uuid.UUID) *mRepositoryIMockGetEmbeddingByUIDs { - if mmGetEmbeddingByUIDs.mock.funcGetEmbeddingByUIDs != nil { - mmGetEmbeddingByUIDs.mock.t.Fatalf("RepositoryIMock.GetEmbeddingByUIDs mock is already set by Set") +// Expect sets up expected params for RepositoryI.GetConvertedFileByFileUID +func (mmGetConvertedFileByFileUID *mRepositoryIMockGetConvertedFileByFileUID) Expect(ctx context.Context, fileUID uuid.UUID) *mRepositoryIMockGetConvertedFileByFileUID { + if mmGetConvertedFileByFileUID.mock.funcGetConvertedFileByFileUID != nil { + mmGetConvertedFileByFileUID.mock.t.Fatalf("RepositoryIMock.GetConvertedFileByFileUID mock is already set by Set") } - if mmGetEmbeddingByUIDs.defaultExpectation == nil { - mmGetEmbeddingByUIDs.defaultExpectation = &RepositoryIMockGetEmbeddingByUIDsExpectation{} + if mmGetConvertedFileByFileUID.defaultExpectation == nil { + mmGetConvertedFileByFileUID.defaultExpectation = &RepositoryIMockGetConvertedFileByFileUIDExpectation{} } - if mmGetEmbeddingByUIDs.defaultExpectation.paramPtrs != nil { - mmGetEmbeddingByUIDs.mock.t.Fatalf("RepositoryIMock.GetEmbeddingByUIDs mock is already set by ExpectParams functions") + if mmGetConvertedFileByFileUID.defaultExpectation.paramPtrs != nil { + mmGetConvertedFileByFileUID.mock.t.Fatalf("RepositoryIMock.GetConvertedFileByFileUID mock is already set by ExpectParams functions") } - mmGetEmbeddingByUIDs.defaultExpectation.params = &RepositoryIMockGetEmbeddingByUIDsParams{ctx, embUIDs} - for _, e := range mmGetEmbeddingByUIDs.expectations { - if minimock.Equal(e.params, mmGetEmbeddingByUIDs.defaultExpectation.params) { - mmGetEmbeddingByUIDs.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetEmbeddingByUIDs.defaultExpectation.params) + mmGetConvertedFileByFileUID.defaultExpectation.params = &RepositoryIMockGetConvertedFileByFileUIDParams{ctx, fileUID} + for _, e := range mmGetConvertedFileByFileUID.expectations { + if minimock.Equal(e.params, mmGetConvertedFileByFileUID.defaultExpectation.params) { + mmGetConvertedFileByFileUID.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetConvertedFileByFileUID.defaultExpectation.params) } } - return mmGetEmbeddingByUIDs + return mmGetConvertedFileByFileUID } -// ExpectCtxParam1 sets up expected param ctx for RepositoryI.GetEmbeddingByUIDs -func (mmGetEmbeddingByUIDs *mRepositoryIMockGetEmbeddingByUIDs) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockGetEmbeddingByUIDs { - if mmGetEmbeddingByUIDs.mock.funcGetEmbeddingByUIDs != nil { - mmGetEmbeddingByUIDs.mock.t.Fatalf("RepositoryIMock.GetEmbeddingByUIDs mock is already set by Set") +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.GetConvertedFileByFileUID +func (mmGetConvertedFileByFileUID *mRepositoryIMockGetConvertedFileByFileUID) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockGetConvertedFileByFileUID { + if mmGetConvertedFileByFileUID.mock.funcGetConvertedFileByFileUID != nil { + mmGetConvertedFileByFileUID.mock.t.Fatalf("RepositoryIMock.GetConvertedFileByFileUID mock is already set by Set") } - if mmGetEmbeddingByUIDs.defaultExpectation == nil { - mmGetEmbeddingByUIDs.defaultExpectation = &RepositoryIMockGetEmbeddingByUIDsExpectation{} + if mmGetConvertedFileByFileUID.defaultExpectation == nil { + mmGetConvertedFileByFileUID.defaultExpectation = &RepositoryIMockGetConvertedFileByFileUIDExpectation{} } - if mmGetEmbeddingByUIDs.defaultExpectation.params != nil { - mmGetEmbeddingByUIDs.mock.t.Fatalf("RepositoryIMock.GetEmbeddingByUIDs mock is already set by Expect") + if mmGetConvertedFileByFileUID.defaultExpectation.params != nil { + mmGetConvertedFileByFileUID.mock.t.Fatalf("RepositoryIMock.GetConvertedFileByFileUID mock is already set by Expect") } - if mmGetEmbeddingByUIDs.defaultExpectation.paramPtrs == nil { - mmGetEmbeddingByUIDs.defaultExpectation.paramPtrs = &RepositoryIMockGetEmbeddingByUIDsParamPtrs{} + if mmGetConvertedFileByFileUID.defaultExpectation.paramPtrs == nil { + mmGetConvertedFileByFileUID.defaultExpectation.paramPtrs = &RepositoryIMockGetConvertedFileByFileUIDParamPtrs{} } - mmGetEmbeddingByUIDs.defaultExpectation.paramPtrs.ctx = &ctx + mmGetConvertedFileByFileUID.defaultExpectation.paramPtrs.ctx = &ctx - return mmGetEmbeddingByUIDs + return mmGetConvertedFileByFileUID } -// ExpectEmbUIDsParam2 sets up expected param embUIDs for RepositoryI.GetEmbeddingByUIDs -func (mmGetEmbeddingByUIDs *mRepositoryIMockGetEmbeddingByUIDs) ExpectEmbUIDsParam2(embUIDs []uuid.UUID) *mRepositoryIMockGetEmbeddingByUIDs { - if mmGetEmbeddingByUIDs.mock.funcGetEmbeddingByUIDs != nil { - mmGetEmbeddingByUIDs.mock.t.Fatalf("RepositoryIMock.GetEmbeddingByUIDs mock is already set by Set") +// ExpectFileUIDParam2 sets up expected param fileUID for RepositoryI.GetConvertedFileByFileUID +func (mmGetConvertedFileByFileUID *mRepositoryIMockGetConvertedFileByFileUID) ExpectFileUIDParam2(fileUID uuid.UUID) *mRepositoryIMockGetConvertedFileByFileUID { + if mmGetConvertedFileByFileUID.mock.funcGetConvertedFileByFileUID != nil { + mmGetConvertedFileByFileUID.mock.t.Fatalf("RepositoryIMock.GetConvertedFileByFileUID mock is already set by Set") } - if mmGetEmbeddingByUIDs.defaultExpectation == nil { - mmGetEmbeddingByUIDs.defaultExpectation = &RepositoryIMockGetEmbeddingByUIDsExpectation{} + if mmGetConvertedFileByFileUID.defaultExpectation == nil { + mmGetConvertedFileByFileUID.defaultExpectation = &RepositoryIMockGetConvertedFileByFileUIDExpectation{} } - if mmGetEmbeddingByUIDs.defaultExpectation.params != nil { - mmGetEmbeddingByUIDs.mock.t.Fatalf("RepositoryIMock.GetEmbeddingByUIDs mock is already set by Expect") + if mmGetConvertedFileByFileUID.defaultExpectation.params != nil { + mmGetConvertedFileByFileUID.mock.t.Fatalf("RepositoryIMock.GetConvertedFileByFileUID mock is already set by Expect") } - if mmGetEmbeddingByUIDs.defaultExpectation.paramPtrs == nil { - mmGetEmbeddingByUIDs.defaultExpectation.paramPtrs = &RepositoryIMockGetEmbeddingByUIDsParamPtrs{} + if mmGetConvertedFileByFileUID.defaultExpectation.paramPtrs == nil { + mmGetConvertedFileByFileUID.defaultExpectation.paramPtrs = &RepositoryIMockGetConvertedFileByFileUIDParamPtrs{} } - mmGetEmbeddingByUIDs.defaultExpectation.paramPtrs.embUIDs = &embUIDs + mmGetConvertedFileByFileUID.defaultExpectation.paramPtrs.fileUID = &fileUID - return mmGetEmbeddingByUIDs + return mmGetConvertedFileByFileUID } -// Inspect accepts an inspector function that has same arguments as the RepositoryI.GetEmbeddingByUIDs -func (mmGetEmbeddingByUIDs *mRepositoryIMockGetEmbeddingByUIDs) Inspect(f func(ctx context.Context, embUIDs []uuid.UUID)) *mRepositoryIMockGetEmbeddingByUIDs { - if mmGetEmbeddingByUIDs.mock.inspectFuncGetEmbeddingByUIDs != nil { - mmGetEmbeddingByUIDs.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.GetEmbeddingByUIDs") +// Inspect accepts an inspector function that has same arguments as the RepositoryI.GetConvertedFileByFileUID +func (mmGetConvertedFileByFileUID *mRepositoryIMockGetConvertedFileByFileUID) Inspect(f func(ctx context.Context, fileUID uuid.UUID)) *mRepositoryIMockGetConvertedFileByFileUID { + if mmGetConvertedFileByFileUID.mock.inspectFuncGetConvertedFileByFileUID != nil { + mmGetConvertedFileByFileUID.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.GetConvertedFileByFileUID") } - mmGetEmbeddingByUIDs.mock.inspectFuncGetEmbeddingByUIDs = f + mmGetConvertedFileByFileUID.mock.inspectFuncGetConvertedFileByFileUID = f - return mmGetEmbeddingByUIDs + return mmGetConvertedFileByFileUID } -// Return sets up results that will be returned by RepositoryI.GetEmbeddingByUIDs -func (mmGetEmbeddingByUIDs *mRepositoryIMockGetEmbeddingByUIDs) Return(ea1 []mm_repository.Embedding, err error) *RepositoryIMock { - if mmGetEmbeddingByUIDs.mock.funcGetEmbeddingByUIDs != nil { - mmGetEmbeddingByUIDs.mock.t.Fatalf("RepositoryIMock.GetEmbeddingByUIDs mock is already set by Set") +// Return sets up results that will be returned by RepositoryI.GetConvertedFileByFileUID +func (mmGetConvertedFileByFileUID *mRepositoryIMockGetConvertedFileByFileUID) Return(cp1 *mm_repository.ConvertedFile, err error) *RepositoryIMock { + if mmGetConvertedFileByFileUID.mock.funcGetConvertedFileByFileUID != nil { + mmGetConvertedFileByFileUID.mock.t.Fatalf("RepositoryIMock.GetConvertedFileByFileUID mock is already set by Set") } - if mmGetEmbeddingByUIDs.defaultExpectation == nil { - mmGetEmbeddingByUIDs.defaultExpectation = &RepositoryIMockGetEmbeddingByUIDsExpectation{mock: mmGetEmbeddingByUIDs.mock} + if mmGetConvertedFileByFileUID.defaultExpectation == nil { + mmGetConvertedFileByFileUID.defaultExpectation = &RepositoryIMockGetConvertedFileByFileUIDExpectation{mock: mmGetConvertedFileByFileUID.mock} } - mmGetEmbeddingByUIDs.defaultExpectation.results = &RepositoryIMockGetEmbeddingByUIDsResults{ea1, err} - return mmGetEmbeddingByUIDs.mock + mmGetConvertedFileByFileUID.defaultExpectation.results = &RepositoryIMockGetConvertedFileByFileUIDResults{cp1, err} + return mmGetConvertedFileByFileUID.mock } -// Set uses given function f to mock the RepositoryI.GetEmbeddingByUIDs method -func (mmGetEmbeddingByUIDs *mRepositoryIMockGetEmbeddingByUIDs) Set(f func(ctx context.Context, embUIDs []uuid.UUID) (ea1 []mm_repository.Embedding, err error)) *RepositoryIMock { - if mmGetEmbeddingByUIDs.defaultExpectation != nil { - mmGetEmbeddingByUIDs.mock.t.Fatalf("Default expectation is already set for the RepositoryI.GetEmbeddingByUIDs method") +// Set uses given function f to mock the RepositoryI.GetConvertedFileByFileUID method +func (mmGetConvertedFileByFileUID *mRepositoryIMockGetConvertedFileByFileUID) Set(f func(ctx context.Context, fileUID uuid.UUID) (cp1 *mm_repository.ConvertedFile, err error)) *RepositoryIMock { + if mmGetConvertedFileByFileUID.defaultExpectation != nil { + mmGetConvertedFileByFileUID.mock.t.Fatalf("Default expectation is already set for the RepositoryI.GetConvertedFileByFileUID method") } - if len(mmGetEmbeddingByUIDs.expectations) > 0 { - mmGetEmbeddingByUIDs.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetEmbeddingByUIDs method") + if len(mmGetConvertedFileByFileUID.expectations) > 0 { + mmGetConvertedFileByFileUID.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetConvertedFileByFileUID method") } - mmGetEmbeddingByUIDs.mock.funcGetEmbeddingByUIDs = f - return mmGetEmbeddingByUIDs.mock + mmGetConvertedFileByFileUID.mock.funcGetConvertedFileByFileUID = f + return mmGetConvertedFileByFileUID.mock } -// When sets expectation for the RepositoryI.GetEmbeddingByUIDs which will trigger the result defined by the following +// When sets expectation for the RepositoryI.GetConvertedFileByFileUID which will trigger the result defined by the following // Then helper -func (mmGetEmbeddingByUIDs *mRepositoryIMockGetEmbeddingByUIDs) When(ctx context.Context, embUIDs []uuid.UUID) *RepositoryIMockGetEmbeddingByUIDsExpectation { - if mmGetEmbeddingByUIDs.mock.funcGetEmbeddingByUIDs != nil { - mmGetEmbeddingByUIDs.mock.t.Fatalf("RepositoryIMock.GetEmbeddingByUIDs mock is already set by Set") +func (mmGetConvertedFileByFileUID *mRepositoryIMockGetConvertedFileByFileUID) When(ctx context.Context, fileUID uuid.UUID) *RepositoryIMockGetConvertedFileByFileUIDExpectation { + if mmGetConvertedFileByFileUID.mock.funcGetConvertedFileByFileUID != nil { + mmGetConvertedFileByFileUID.mock.t.Fatalf("RepositoryIMock.GetConvertedFileByFileUID mock is already set by Set") } - expectation := &RepositoryIMockGetEmbeddingByUIDsExpectation{ - mock: mmGetEmbeddingByUIDs.mock, - params: &RepositoryIMockGetEmbeddingByUIDsParams{ctx, embUIDs}, + expectation := &RepositoryIMockGetConvertedFileByFileUIDExpectation{ + mock: mmGetConvertedFileByFileUID.mock, + params: &RepositoryIMockGetConvertedFileByFileUIDParams{ctx, fileUID}, } - mmGetEmbeddingByUIDs.expectations = append(mmGetEmbeddingByUIDs.expectations, expectation) + mmGetConvertedFileByFileUID.expectations = append(mmGetConvertedFileByFileUID.expectations, expectation) return expectation } -// Then sets up RepositoryI.GetEmbeddingByUIDs return parameters for the expectation previously defined by the When method -func (e *RepositoryIMockGetEmbeddingByUIDsExpectation) Then(ea1 []mm_repository.Embedding, err error) *RepositoryIMock { - e.results = &RepositoryIMockGetEmbeddingByUIDsResults{ea1, err} +// Then sets up RepositoryI.GetConvertedFileByFileUID return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockGetConvertedFileByFileUIDExpectation) Then(cp1 *mm_repository.ConvertedFile, err error) *RepositoryIMock { + e.results = &RepositoryIMockGetConvertedFileByFileUIDResults{cp1, err} return e.mock } -// Times sets number of times RepositoryI.GetEmbeddingByUIDs should be invoked -func (mmGetEmbeddingByUIDs *mRepositoryIMockGetEmbeddingByUIDs) Times(n uint64) *mRepositoryIMockGetEmbeddingByUIDs { +// Times sets number of times RepositoryI.GetConvertedFileByFileUID should be invoked +func (mmGetConvertedFileByFileUID *mRepositoryIMockGetConvertedFileByFileUID) Times(n uint64) *mRepositoryIMockGetConvertedFileByFileUID { if n == 0 { - mmGetEmbeddingByUIDs.mock.t.Fatalf("Times of RepositoryIMock.GetEmbeddingByUIDs mock can not be zero") + mmGetConvertedFileByFileUID.mock.t.Fatalf("Times of RepositoryIMock.GetConvertedFileByFileUID mock can not be zero") } - mm_atomic.StoreUint64(&mmGetEmbeddingByUIDs.expectedInvocations, n) - return mmGetEmbeddingByUIDs + mm_atomic.StoreUint64(&mmGetConvertedFileByFileUID.expectedInvocations, n) + return mmGetConvertedFileByFileUID } -func (mmGetEmbeddingByUIDs *mRepositoryIMockGetEmbeddingByUIDs) invocationsDone() bool { - if len(mmGetEmbeddingByUIDs.expectations) == 0 && mmGetEmbeddingByUIDs.defaultExpectation == nil && mmGetEmbeddingByUIDs.mock.funcGetEmbeddingByUIDs == nil { +func (mmGetConvertedFileByFileUID *mRepositoryIMockGetConvertedFileByFileUID) invocationsDone() bool { + if len(mmGetConvertedFileByFileUID.expectations) == 0 && mmGetConvertedFileByFileUID.defaultExpectation == nil && mmGetConvertedFileByFileUID.mock.funcGetConvertedFileByFileUID == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmGetEmbeddingByUIDs.mock.afterGetEmbeddingByUIDsCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmGetEmbeddingByUIDs.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmGetConvertedFileByFileUID.mock.afterGetConvertedFileByFileUIDCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmGetConvertedFileByFileUID.expectedInvocations) return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) } -// GetEmbeddingByUIDs implements repository.RepositoryI -func (mmGetEmbeddingByUIDs *RepositoryIMock) GetEmbeddingByUIDs(ctx context.Context, embUIDs []uuid.UUID) (ea1 []mm_repository.Embedding, err error) { - mm_atomic.AddUint64(&mmGetEmbeddingByUIDs.beforeGetEmbeddingByUIDsCounter, 1) - defer mm_atomic.AddUint64(&mmGetEmbeddingByUIDs.afterGetEmbeddingByUIDsCounter, 1) +// GetConvertedFileByFileUID implements repository.RepositoryI +func (mmGetConvertedFileByFileUID *RepositoryIMock) GetConvertedFileByFileUID(ctx context.Context, fileUID uuid.UUID) (cp1 *mm_repository.ConvertedFile, err error) { + mm_atomic.AddUint64(&mmGetConvertedFileByFileUID.beforeGetConvertedFileByFileUIDCounter, 1) + defer mm_atomic.AddUint64(&mmGetConvertedFileByFileUID.afterGetConvertedFileByFileUIDCounter, 1) - if mmGetEmbeddingByUIDs.inspectFuncGetEmbeddingByUIDs != nil { - mmGetEmbeddingByUIDs.inspectFuncGetEmbeddingByUIDs(ctx, embUIDs) + if mmGetConvertedFileByFileUID.inspectFuncGetConvertedFileByFileUID != nil { + mmGetConvertedFileByFileUID.inspectFuncGetConvertedFileByFileUID(ctx, fileUID) } - mm_params := RepositoryIMockGetEmbeddingByUIDsParams{ctx, embUIDs} + mm_params := RepositoryIMockGetConvertedFileByFileUIDParams{ctx, fileUID} // Record call args - mmGetEmbeddingByUIDs.GetEmbeddingByUIDsMock.mutex.Lock() - mmGetEmbeddingByUIDs.GetEmbeddingByUIDsMock.callArgs = append(mmGetEmbeddingByUIDs.GetEmbeddingByUIDsMock.callArgs, &mm_params) - mmGetEmbeddingByUIDs.GetEmbeddingByUIDsMock.mutex.Unlock() + mmGetConvertedFileByFileUID.GetConvertedFileByFileUIDMock.mutex.Lock() + mmGetConvertedFileByFileUID.GetConvertedFileByFileUIDMock.callArgs = append(mmGetConvertedFileByFileUID.GetConvertedFileByFileUIDMock.callArgs, &mm_params) + mmGetConvertedFileByFileUID.GetConvertedFileByFileUIDMock.mutex.Unlock() - for _, e := range mmGetEmbeddingByUIDs.GetEmbeddingByUIDsMock.expectations { + for _, e := range mmGetConvertedFileByFileUID.GetConvertedFileByFileUIDMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.ea1, e.results.err + return e.results.cp1, e.results.err } } - if mmGetEmbeddingByUIDs.GetEmbeddingByUIDsMock.defaultExpectation != nil { - mm_atomic.AddUint64(&mmGetEmbeddingByUIDs.GetEmbeddingByUIDsMock.defaultExpectation.Counter, 1) - mm_want := mmGetEmbeddingByUIDs.GetEmbeddingByUIDsMock.defaultExpectation.params - mm_want_ptrs := mmGetEmbeddingByUIDs.GetEmbeddingByUIDsMock.defaultExpectation.paramPtrs + if mmGetConvertedFileByFileUID.GetConvertedFileByFileUIDMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmGetConvertedFileByFileUID.GetConvertedFileByFileUIDMock.defaultExpectation.Counter, 1) + mm_want := mmGetConvertedFileByFileUID.GetConvertedFileByFileUIDMock.defaultExpectation.params + mm_want_ptrs := mmGetConvertedFileByFileUID.GetConvertedFileByFileUIDMock.defaultExpectation.paramPtrs - mm_got := RepositoryIMockGetEmbeddingByUIDsParams{ctx, embUIDs} + mm_got := RepositoryIMockGetConvertedFileByFileUIDParams{ctx, fileUID} if mm_want_ptrs != nil { if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { - mmGetEmbeddingByUIDs.t.Errorf("RepositoryIMock.GetEmbeddingByUIDs got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) + mmGetConvertedFileByFileUID.t.Errorf("RepositoryIMock.GetConvertedFileByFileUID got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) } - if mm_want_ptrs.embUIDs != nil && !minimock.Equal(*mm_want_ptrs.embUIDs, mm_got.embUIDs) { - mmGetEmbeddingByUIDs.t.Errorf("RepositoryIMock.GetEmbeddingByUIDs got unexpected parameter embUIDs, want: %#v, got: %#v%s\n", *mm_want_ptrs.embUIDs, mm_got.embUIDs, minimock.Diff(*mm_want_ptrs.embUIDs, mm_got.embUIDs)) + if mm_want_ptrs.fileUID != nil && !minimock.Equal(*mm_want_ptrs.fileUID, mm_got.fileUID) { + mmGetConvertedFileByFileUID.t.Errorf("RepositoryIMock.GetConvertedFileByFileUID got unexpected parameter fileUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.fileUID, mm_got.fileUID, minimock.Diff(*mm_want_ptrs.fileUID, mm_got.fileUID)) } } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { - mmGetEmbeddingByUIDs.t.Errorf("RepositoryIMock.GetEmbeddingByUIDs got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + mmGetConvertedFileByFileUID.t.Errorf("RepositoryIMock.GetConvertedFileByFileUID got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) } - mm_results := mmGetEmbeddingByUIDs.GetEmbeddingByUIDsMock.defaultExpectation.results + mm_results := mmGetConvertedFileByFileUID.GetConvertedFileByFileUIDMock.defaultExpectation.results if mm_results == nil { - mmGetEmbeddingByUIDs.t.Fatal("No results are set for the RepositoryIMock.GetEmbeddingByUIDs") + mmGetConvertedFileByFileUID.t.Fatal("No results are set for the RepositoryIMock.GetConvertedFileByFileUID") } - return (*mm_results).ea1, (*mm_results).err + return (*mm_results).cp1, (*mm_results).err } - if mmGetEmbeddingByUIDs.funcGetEmbeddingByUIDs != nil { - return mmGetEmbeddingByUIDs.funcGetEmbeddingByUIDs(ctx, embUIDs) + if mmGetConvertedFileByFileUID.funcGetConvertedFileByFileUID != nil { + return mmGetConvertedFileByFileUID.funcGetConvertedFileByFileUID(ctx, fileUID) } - mmGetEmbeddingByUIDs.t.Fatalf("Unexpected call to RepositoryIMock.GetEmbeddingByUIDs. %v %v", ctx, embUIDs) + mmGetConvertedFileByFileUID.t.Fatalf("Unexpected call to RepositoryIMock.GetConvertedFileByFileUID. %v %v", ctx, fileUID) return } -// GetEmbeddingByUIDsAfterCounter returns a count of finished RepositoryIMock.GetEmbeddingByUIDs invocations -func (mmGetEmbeddingByUIDs *RepositoryIMock) GetEmbeddingByUIDsAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetEmbeddingByUIDs.afterGetEmbeddingByUIDsCounter) +// GetConvertedFileByFileUIDAfterCounter returns a count of finished RepositoryIMock.GetConvertedFileByFileUID invocations +func (mmGetConvertedFileByFileUID *RepositoryIMock) GetConvertedFileByFileUIDAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetConvertedFileByFileUID.afterGetConvertedFileByFileUIDCounter) } -// GetEmbeddingByUIDsBeforeCounter returns a count of RepositoryIMock.GetEmbeddingByUIDs invocations -func (mmGetEmbeddingByUIDs *RepositoryIMock) GetEmbeddingByUIDsBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetEmbeddingByUIDs.beforeGetEmbeddingByUIDsCounter) +// GetConvertedFileByFileUIDBeforeCounter returns a count of RepositoryIMock.GetConvertedFileByFileUID invocations +func (mmGetConvertedFileByFileUID *RepositoryIMock) GetConvertedFileByFileUIDBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetConvertedFileByFileUID.beforeGetConvertedFileByFileUIDCounter) } -// Calls returns a list of arguments used in each call to RepositoryIMock.GetEmbeddingByUIDs. +// Calls returns a list of arguments used in each call to RepositoryIMock.GetConvertedFileByFileUID. // The list is in the same order as the calls were made (i.e. recent calls have a higher index) -func (mmGetEmbeddingByUIDs *mRepositoryIMockGetEmbeddingByUIDs) Calls() []*RepositoryIMockGetEmbeddingByUIDsParams { - mmGetEmbeddingByUIDs.mutex.RLock() +func (mmGetConvertedFileByFileUID *mRepositoryIMockGetConvertedFileByFileUID) Calls() []*RepositoryIMockGetConvertedFileByFileUIDParams { + mmGetConvertedFileByFileUID.mutex.RLock() - argCopy := make([]*RepositoryIMockGetEmbeddingByUIDsParams, len(mmGetEmbeddingByUIDs.callArgs)) - copy(argCopy, mmGetEmbeddingByUIDs.callArgs) + argCopy := make([]*RepositoryIMockGetConvertedFileByFileUIDParams, len(mmGetConvertedFileByFileUID.callArgs)) + copy(argCopy, mmGetConvertedFileByFileUID.callArgs) - mmGetEmbeddingByUIDs.mutex.RUnlock() + mmGetConvertedFileByFileUID.mutex.RUnlock() return argCopy } -// MinimockGetEmbeddingByUIDsDone returns true if the count of the GetEmbeddingByUIDs invocations corresponds +// MinimockGetConvertedFileByFileUIDDone returns true if the count of the GetConvertedFileByFileUID invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockGetEmbeddingByUIDsDone() bool { - for _, e := range m.GetEmbeddingByUIDsMock.expectations { +func (m *RepositoryIMock) MinimockGetConvertedFileByFileUIDDone() bool { + for _, e := range m.GetConvertedFileByFileUIDMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.GetEmbeddingByUIDsMock.invocationsDone() + return m.GetConvertedFileByFileUIDMock.invocationsDone() } -// MinimockGetEmbeddingByUIDsInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockGetEmbeddingByUIDsInspect() { - for _, e := range m.GetEmbeddingByUIDsMock.expectations { +// MinimockGetConvertedFileByFileUIDInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockGetConvertedFileByFileUIDInspect() { + for _, e := range m.GetConvertedFileByFileUIDMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { - m.t.Errorf("Expected call to RepositoryIMock.GetEmbeddingByUIDs with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.GetConvertedFileByFileUID with params: %#v", *e.params) } } - afterGetEmbeddingByUIDsCounter := mm_atomic.LoadUint64(&m.afterGetEmbeddingByUIDsCounter) + afterGetConvertedFileByFileUIDCounter := mm_atomic.LoadUint64(&m.afterGetConvertedFileByFileUIDCounter) // if default expectation was set then invocations count should be greater than zero - if m.GetEmbeddingByUIDsMock.defaultExpectation != nil && afterGetEmbeddingByUIDsCounter < 1 { - if m.GetEmbeddingByUIDsMock.defaultExpectation.params == nil { - m.t.Error("Expected call to RepositoryIMock.GetEmbeddingByUIDs") + if m.GetConvertedFileByFileUIDMock.defaultExpectation != nil && afterGetConvertedFileByFileUIDCounter < 1 { + if m.GetConvertedFileByFileUIDMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.GetConvertedFileByFileUID") } else { - m.t.Errorf("Expected call to RepositoryIMock.GetEmbeddingByUIDs with params: %#v", *m.GetEmbeddingByUIDsMock.defaultExpectation.params) + m.t.Errorf("Expected call to RepositoryIMock.GetConvertedFileByFileUID with params: %#v", *m.GetConvertedFileByFileUIDMock.defaultExpectation.params) } } // if func was set then invocations count should be greater than zero - if m.funcGetEmbeddingByUIDs != nil && afterGetEmbeddingByUIDsCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.GetEmbeddingByUIDs") + if m.funcGetConvertedFileByFileUID != nil && afterGetConvertedFileByFileUIDCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.GetConvertedFileByFileUID") } - if !m.GetEmbeddingByUIDsMock.invocationsDone() && afterGetEmbeddingByUIDsCounter > 0 { - m.t.Errorf("Expected %d calls to RepositoryIMock.GetEmbeddingByUIDs but found %d calls", - mm_atomic.LoadUint64(&m.GetEmbeddingByUIDsMock.expectedInvocations), afterGetEmbeddingByUIDsCounter) + if !m.GetConvertedFileByFileUIDMock.invocationsDone() && afterGetConvertedFileByFileUIDCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.GetConvertedFileByFileUID but found %d calls", + mm_atomic.LoadUint64(&m.GetConvertedFileByFileUIDMock.expectedInvocations), afterGetConvertedFileByFileUIDCounter) } } -type mRepositoryIMockGetFilesTotalTokens struct { +type mRepositoryIMockGetCountFilesByListKnowledgeBaseUID struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockGetFilesTotalTokensExpectation - expectations []*RepositoryIMockGetFilesTotalTokensExpectation + defaultExpectation *RepositoryIMockGetCountFilesByListKnowledgeBaseUIDExpectation + expectations []*RepositoryIMockGetCountFilesByListKnowledgeBaseUIDExpectation - callArgs []*RepositoryIMockGetFilesTotalTokensParams + callArgs []*RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockGetFilesTotalTokensExpectation specifies expectation struct of the RepositoryI.GetFilesTotalTokens -type RepositoryIMockGetFilesTotalTokensExpectation struct { +// RepositoryIMockGetCountFilesByListKnowledgeBaseUIDExpectation specifies expectation struct of the RepositoryI.GetCountFilesByListKnowledgeBaseUID +type RepositoryIMockGetCountFilesByListKnowledgeBaseUIDExpectation struct { mock *RepositoryIMock - params *RepositoryIMockGetFilesTotalTokensParams - paramPtrs *RepositoryIMockGetFilesTotalTokensParamPtrs - results *RepositoryIMockGetFilesTotalTokensResults + params *RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParams + paramPtrs *RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParamPtrs + results *RepositoryIMockGetCountFilesByListKnowledgeBaseUIDResults Counter uint64 } -// RepositoryIMockGetFilesTotalTokensParams contains parameters of the RepositoryI.GetFilesTotalTokens -type RepositoryIMockGetFilesTotalTokensParams struct { - ctx context.Context - sources map[mm_repository.FileUID]struct { - SourceTable mm_repository.SourceTable - SourceUID mm_repository.SourceUID - } +// RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParams contains parameters of the RepositoryI.GetCountFilesByListKnowledgeBaseUID +type RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParams struct { + ctx context.Context + kbUIDs []mm_repository.KbUID } -// RepositoryIMockGetFilesTotalTokensParamPtrs contains pointers to parameters of the RepositoryI.GetFilesTotalTokens -type RepositoryIMockGetFilesTotalTokensParamPtrs struct { - ctx *context.Context - sources *map[mm_repository.FileUID]struct { - SourceTable mm_repository.SourceTable - SourceUID mm_repository.SourceUID - } +// RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParamPtrs contains pointers to parameters of the RepositoryI.GetCountFilesByListKnowledgeBaseUID +type RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParamPtrs struct { + ctx *context.Context + kbUIDs *[]mm_repository.KbUID } -// RepositoryIMockGetFilesTotalTokensResults contains results of the RepositoryI.GetFilesTotalTokens -type RepositoryIMockGetFilesTotalTokensResults struct { - m1 map[mm_repository.FileUID]int +// RepositoryIMockGetCountFilesByListKnowledgeBaseUIDResults contains results of the RepositoryI.GetCountFilesByListKnowledgeBaseUID +type RepositoryIMockGetCountFilesByListKnowledgeBaseUIDResults struct { + m1 map[mm_repository.KbUID]int64 err error } -// Expect sets up expected params for RepositoryI.GetFilesTotalTokens -func (mmGetFilesTotalTokens *mRepositoryIMockGetFilesTotalTokens) Expect(ctx context.Context, sources map[mm_repository.FileUID]struct { - SourceTable mm_repository.SourceTable - SourceUID mm_repository.SourceUID -}) *mRepositoryIMockGetFilesTotalTokens { - if mmGetFilesTotalTokens.mock.funcGetFilesTotalTokens != nil { - mmGetFilesTotalTokens.mock.t.Fatalf("RepositoryIMock.GetFilesTotalTokens mock is already set by Set") +// Expect sets up expected params for RepositoryI.GetCountFilesByListKnowledgeBaseUID +func (mmGetCountFilesByListKnowledgeBaseUID *mRepositoryIMockGetCountFilesByListKnowledgeBaseUID) Expect(ctx context.Context, kbUIDs []mm_repository.KbUID) *mRepositoryIMockGetCountFilesByListKnowledgeBaseUID { + if mmGetCountFilesByListKnowledgeBaseUID.mock.funcGetCountFilesByListKnowledgeBaseUID != nil { + mmGetCountFilesByListKnowledgeBaseUID.mock.t.Fatalf("RepositoryIMock.GetCountFilesByListKnowledgeBaseUID mock is already set by Set") } - if mmGetFilesTotalTokens.defaultExpectation == nil { - mmGetFilesTotalTokens.defaultExpectation = &RepositoryIMockGetFilesTotalTokensExpectation{} + if mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation == nil { + mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation = &RepositoryIMockGetCountFilesByListKnowledgeBaseUIDExpectation{} } - if mmGetFilesTotalTokens.defaultExpectation.paramPtrs != nil { - mmGetFilesTotalTokens.mock.t.Fatalf("RepositoryIMock.GetFilesTotalTokens mock is already set by ExpectParams functions") + if mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.paramPtrs != nil { + mmGetCountFilesByListKnowledgeBaseUID.mock.t.Fatalf("RepositoryIMock.GetCountFilesByListKnowledgeBaseUID mock is already set by ExpectParams functions") } - mmGetFilesTotalTokens.defaultExpectation.params = &RepositoryIMockGetFilesTotalTokensParams{ctx, sources} - for _, e := range mmGetFilesTotalTokens.expectations { - if minimock.Equal(e.params, mmGetFilesTotalTokens.defaultExpectation.params) { - mmGetFilesTotalTokens.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetFilesTotalTokens.defaultExpectation.params) + mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.params = &RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParams{ctx, kbUIDs} + for _, e := range mmGetCountFilesByListKnowledgeBaseUID.expectations { + if minimock.Equal(e.params, mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.params) { + mmGetCountFilesByListKnowledgeBaseUID.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.params) } } - return mmGetFilesTotalTokens + return mmGetCountFilesByListKnowledgeBaseUID } -// ExpectCtxParam1 sets up expected param ctx for RepositoryI.GetFilesTotalTokens -func (mmGetFilesTotalTokens *mRepositoryIMockGetFilesTotalTokens) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockGetFilesTotalTokens { - if mmGetFilesTotalTokens.mock.funcGetFilesTotalTokens != nil { - mmGetFilesTotalTokens.mock.t.Fatalf("RepositoryIMock.GetFilesTotalTokens mock is already set by Set") +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.GetCountFilesByListKnowledgeBaseUID +func (mmGetCountFilesByListKnowledgeBaseUID *mRepositoryIMockGetCountFilesByListKnowledgeBaseUID) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockGetCountFilesByListKnowledgeBaseUID { + if mmGetCountFilesByListKnowledgeBaseUID.mock.funcGetCountFilesByListKnowledgeBaseUID != nil { + mmGetCountFilesByListKnowledgeBaseUID.mock.t.Fatalf("RepositoryIMock.GetCountFilesByListKnowledgeBaseUID mock is already set by Set") } - if mmGetFilesTotalTokens.defaultExpectation == nil { - mmGetFilesTotalTokens.defaultExpectation = &RepositoryIMockGetFilesTotalTokensExpectation{} + if mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation == nil { + mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation = &RepositoryIMockGetCountFilesByListKnowledgeBaseUIDExpectation{} } - if mmGetFilesTotalTokens.defaultExpectation.params != nil { - mmGetFilesTotalTokens.mock.t.Fatalf("RepositoryIMock.GetFilesTotalTokens mock is already set by Expect") + if mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.params != nil { + mmGetCountFilesByListKnowledgeBaseUID.mock.t.Fatalf("RepositoryIMock.GetCountFilesByListKnowledgeBaseUID mock is already set by Expect") } - if mmGetFilesTotalTokens.defaultExpectation.paramPtrs == nil { - mmGetFilesTotalTokens.defaultExpectation.paramPtrs = &RepositoryIMockGetFilesTotalTokensParamPtrs{} + if mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.paramPtrs == nil { + mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.paramPtrs = &RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParamPtrs{} } - mmGetFilesTotalTokens.defaultExpectation.paramPtrs.ctx = &ctx + mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.paramPtrs.ctx = &ctx - return mmGetFilesTotalTokens + return mmGetCountFilesByListKnowledgeBaseUID } -// ExpectSourcesParam2 sets up expected param sources for RepositoryI.GetFilesTotalTokens -func (mmGetFilesTotalTokens *mRepositoryIMockGetFilesTotalTokens) ExpectSourcesParam2(sources map[mm_repository.FileUID]struct { - SourceTable mm_repository.SourceTable - SourceUID mm_repository.SourceUID -}) *mRepositoryIMockGetFilesTotalTokens { - if mmGetFilesTotalTokens.mock.funcGetFilesTotalTokens != nil { - mmGetFilesTotalTokens.mock.t.Fatalf("RepositoryIMock.GetFilesTotalTokens mock is already set by Set") +// ExpectKbUIDsParam2 sets up expected param kbUIDs for RepositoryI.GetCountFilesByListKnowledgeBaseUID +func (mmGetCountFilesByListKnowledgeBaseUID *mRepositoryIMockGetCountFilesByListKnowledgeBaseUID) ExpectKbUIDsParam2(kbUIDs []mm_repository.KbUID) *mRepositoryIMockGetCountFilesByListKnowledgeBaseUID { + if mmGetCountFilesByListKnowledgeBaseUID.mock.funcGetCountFilesByListKnowledgeBaseUID != nil { + mmGetCountFilesByListKnowledgeBaseUID.mock.t.Fatalf("RepositoryIMock.GetCountFilesByListKnowledgeBaseUID mock is already set by Set") } - if mmGetFilesTotalTokens.defaultExpectation == nil { - mmGetFilesTotalTokens.defaultExpectation = &RepositoryIMockGetFilesTotalTokensExpectation{} + if mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation == nil { + mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation = &RepositoryIMockGetCountFilesByListKnowledgeBaseUIDExpectation{} } - if mmGetFilesTotalTokens.defaultExpectation.params != nil { - mmGetFilesTotalTokens.mock.t.Fatalf("RepositoryIMock.GetFilesTotalTokens mock is already set by Expect") + if mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.params != nil { + mmGetCountFilesByListKnowledgeBaseUID.mock.t.Fatalf("RepositoryIMock.GetCountFilesByListKnowledgeBaseUID mock is already set by Expect") } - if mmGetFilesTotalTokens.defaultExpectation.paramPtrs == nil { - mmGetFilesTotalTokens.defaultExpectation.paramPtrs = &RepositoryIMockGetFilesTotalTokensParamPtrs{} + if mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.paramPtrs == nil { + mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.paramPtrs = &RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParamPtrs{} } - mmGetFilesTotalTokens.defaultExpectation.paramPtrs.sources = &sources + mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.paramPtrs.kbUIDs = &kbUIDs - return mmGetFilesTotalTokens + return mmGetCountFilesByListKnowledgeBaseUID } -// Inspect accepts an inspector function that has same arguments as the RepositoryI.GetFilesTotalTokens -func (mmGetFilesTotalTokens *mRepositoryIMockGetFilesTotalTokens) Inspect(f func(ctx context.Context, sources map[mm_repository.FileUID]struct { - SourceTable mm_repository.SourceTable - SourceUID mm_repository.SourceUID -})) *mRepositoryIMockGetFilesTotalTokens { - if mmGetFilesTotalTokens.mock.inspectFuncGetFilesTotalTokens != nil { - mmGetFilesTotalTokens.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.GetFilesTotalTokens") +// Inspect accepts an inspector function that has same arguments as the RepositoryI.GetCountFilesByListKnowledgeBaseUID +func (mmGetCountFilesByListKnowledgeBaseUID *mRepositoryIMockGetCountFilesByListKnowledgeBaseUID) Inspect(f func(ctx context.Context, kbUIDs []mm_repository.KbUID)) *mRepositoryIMockGetCountFilesByListKnowledgeBaseUID { + if mmGetCountFilesByListKnowledgeBaseUID.mock.inspectFuncGetCountFilesByListKnowledgeBaseUID != nil { + mmGetCountFilesByListKnowledgeBaseUID.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.GetCountFilesByListKnowledgeBaseUID") } - mmGetFilesTotalTokens.mock.inspectFuncGetFilesTotalTokens = f + mmGetCountFilesByListKnowledgeBaseUID.mock.inspectFuncGetCountFilesByListKnowledgeBaseUID = f - return mmGetFilesTotalTokens + return mmGetCountFilesByListKnowledgeBaseUID } -// Return sets up results that will be returned by RepositoryI.GetFilesTotalTokens -func (mmGetFilesTotalTokens *mRepositoryIMockGetFilesTotalTokens) Return(m1 map[mm_repository.FileUID]int, err error) *RepositoryIMock { - if mmGetFilesTotalTokens.mock.funcGetFilesTotalTokens != nil { - mmGetFilesTotalTokens.mock.t.Fatalf("RepositoryIMock.GetFilesTotalTokens mock is already set by Set") +// Return sets up results that will be returned by RepositoryI.GetCountFilesByListKnowledgeBaseUID +func (mmGetCountFilesByListKnowledgeBaseUID *mRepositoryIMockGetCountFilesByListKnowledgeBaseUID) Return(m1 map[mm_repository.KbUID]int64, err error) *RepositoryIMock { + if mmGetCountFilesByListKnowledgeBaseUID.mock.funcGetCountFilesByListKnowledgeBaseUID != nil { + mmGetCountFilesByListKnowledgeBaseUID.mock.t.Fatalf("RepositoryIMock.GetCountFilesByListKnowledgeBaseUID mock is already set by Set") } - if mmGetFilesTotalTokens.defaultExpectation == nil { - mmGetFilesTotalTokens.defaultExpectation = &RepositoryIMockGetFilesTotalTokensExpectation{mock: mmGetFilesTotalTokens.mock} + if mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation == nil { + mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation = &RepositoryIMockGetCountFilesByListKnowledgeBaseUIDExpectation{mock: mmGetCountFilesByListKnowledgeBaseUID.mock} } - mmGetFilesTotalTokens.defaultExpectation.results = &RepositoryIMockGetFilesTotalTokensResults{m1, err} - return mmGetFilesTotalTokens.mock + mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.results = &RepositoryIMockGetCountFilesByListKnowledgeBaseUIDResults{m1, err} + return mmGetCountFilesByListKnowledgeBaseUID.mock } -// Set uses given function f to mock the RepositoryI.GetFilesTotalTokens method -func (mmGetFilesTotalTokens *mRepositoryIMockGetFilesTotalTokens) Set(f func(ctx context.Context, sources map[mm_repository.FileUID]struct { - SourceTable mm_repository.SourceTable - SourceUID mm_repository.SourceUID -}) (m1 map[mm_repository.FileUID]int, err error)) *RepositoryIMock { - if mmGetFilesTotalTokens.defaultExpectation != nil { - mmGetFilesTotalTokens.mock.t.Fatalf("Default expectation is already set for the RepositoryI.GetFilesTotalTokens method") +// Set uses given function f to mock the RepositoryI.GetCountFilesByListKnowledgeBaseUID method +func (mmGetCountFilesByListKnowledgeBaseUID *mRepositoryIMockGetCountFilesByListKnowledgeBaseUID) Set(f func(ctx context.Context, kbUIDs []mm_repository.KbUID) (m1 map[mm_repository.KbUID]int64, err error)) *RepositoryIMock { + if mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation != nil { + mmGetCountFilesByListKnowledgeBaseUID.mock.t.Fatalf("Default expectation is already set for the RepositoryI.GetCountFilesByListKnowledgeBaseUID method") } - if len(mmGetFilesTotalTokens.expectations) > 0 { - mmGetFilesTotalTokens.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetFilesTotalTokens method") + if len(mmGetCountFilesByListKnowledgeBaseUID.expectations) > 0 { + mmGetCountFilesByListKnowledgeBaseUID.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetCountFilesByListKnowledgeBaseUID method") } - mmGetFilesTotalTokens.mock.funcGetFilesTotalTokens = f - return mmGetFilesTotalTokens.mock + mmGetCountFilesByListKnowledgeBaseUID.mock.funcGetCountFilesByListKnowledgeBaseUID = f + return mmGetCountFilesByListKnowledgeBaseUID.mock } -// When sets expectation for the RepositoryI.GetFilesTotalTokens which will trigger the result defined by the following +// When sets expectation for the RepositoryI.GetCountFilesByListKnowledgeBaseUID which will trigger the result defined by the following // Then helper -func (mmGetFilesTotalTokens *mRepositoryIMockGetFilesTotalTokens) When(ctx context.Context, sources map[mm_repository.FileUID]struct { - SourceTable mm_repository.SourceTable - SourceUID mm_repository.SourceUID -}) *RepositoryIMockGetFilesTotalTokensExpectation { - if mmGetFilesTotalTokens.mock.funcGetFilesTotalTokens != nil { - mmGetFilesTotalTokens.mock.t.Fatalf("RepositoryIMock.GetFilesTotalTokens mock is already set by Set") +func (mmGetCountFilesByListKnowledgeBaseUID *mRepositoryIMockGetCountFilesByListKnowledgeBaseUID) When(ctx context.Context, kbUIDs []mm_repository.KbUID) *RepositoryIMockGetCountFilesByListKnowledgeBaseUIDExpectation { + if mmGetCountFilesByListKnowledgeBaseUID.mock.funcGetCountFilesByListKnowledgeBaseUID != nil { + mmGetCountFilesByListKnowledgeBaseUID.mock.t.Fatalf("RepositoryIMock.GetCountFilesByListKnowledgeBaseUID mock is already set by Set") } - expectation := &RepositoryIMockGetFilesTotalTokensExpectation{ - mock: mmGetFilesTotalTokens.mock, - params: &RepositoryIMockGetFilesTotalTokensParams{ctx, sources}, + expectation := &RepositoryIMockGetCountFilesByListKnowledgeBaseUIDExpectation{ + mock: mmGetCountFilesByListKnowledgeBaseUID.mock, + params: &RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParams{ctx, kbUIDs}, } - mmGetFilesTotalTokens.expectations = append(mmGetFilesTotalTokens.expectations, expectation) + mmGetCountFilesByListKnowledgeBaseUID.expectations = append(mmGetCountFilesByListKnowledgeBaseUID.expectations, expectation) return expectation } -// Then sets up RepositoryI.GetFilesTotalTokens return parameters for the expectation previously defined by the When method -func (e *RepositoryIMockGetFilesTotalTokensExpectation) Then(m1 map[mm_repository.FileUID]int, err error) *RepositoryIMock { - e.results = &RepositoryIMockGetFilesTotalTokensResults{m1, err} +// Then sets up RepositoryI.GetCountFilesByListKnowledgeBaseUID return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockGetCountFilesByListKnowledgeBaseUIDExpectation) Then(m1 map[mm_repository.KbUID]int64, err error) *RepositoryIMock { + e.results = &RepositoryIMockGetCountFilesByListKnowledgeBaseUIDResults{m1, err} return e.mock } -// Times sets number of times RepositoryI.GetFilesTotalTokens should be invoked -func (mmGetFilesTotalTokens *mRepositoryIMockGetFilesTotalTokens) Times(n uint64) *mRepositoryIMockGetFilesTotalTokens { +// Times sets number of times RepositoryI.GetCountFilesByListKnowledgeBaseUID should be invoked +func (mmGetCountFilesByListKnowledgeBaseUID *mRepositoryIMockGetCountFilesByListKnowledgeBaseUID) Times(n uint64) *mRepositoryIMockGetCountFilesByListKnowledgeBaseUID { if n == 0 { - mmGetFilesTotalTokens.mock.t.Fatalf("Times of RepositoryIMock.GetFilesTotalTokens mock can not be zero") + mmGetCountFilesByListKnowledgeBaseUID.mock.t.Fatalf("Times of RepositoryIMock.GetCountFilesByListKnowledgeBaseUID mock can not be zero") } - mm_atomic.StoreUint64(&mmGetFilesTotalTokens.expectedInvocations, n) - return mmGetFilesTotalTokens + mm_atomic.StoreUint64(&mmGetCountFilesByListKnowledgeBaseUID.expectedInvocations, n) + return mmGetCountFilesByListKnowledgeBaseUID } -func (mmGetFilesTotalTokens *mRepositoryIMockGetFilesTotalTokens) invocationsDone() bool { - if len(mmGetFilesTotalTokens.expectations) == 0 && mmGetFilesTotalTokens.defaultExpectation == nil && mmGetFilesTotalTokens.mock.funcGetFilesTotalTokens == nil { +func (mmGetCountFilesByListKnowledgeBaseUID *mRepositoryIMockGetCountFilesByListKnowledgeBaseUID) invocationsDone() bool { + if len(mmGetCountFilesByListKnowledgeBaseUID.expectations) == 0 && mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation == nil && mmGetCountFilesByListKnowledgeBaseUID.mock.funcGetCountFilesByListKnowledgeBaseUID == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmGetFilesTotalTokens.mock.afterGetFilesTotalTokensCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmGetFilesTotalTokens.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmGetCountFilesByListKnowledgeBaseUID.mock.afterGetCountFilesByListKnowledgeBaseUIDCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmGetCountFilesByListKnowledgeBaseUID.expectedInvocations) return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) } -// GetFilesTotalTokens implements repository.RepositoryI -func (mmGetFilesTotalTokens *RepositoryIMock) GetFilesTotalTokens(ctx context.Context, sources map[mm_repository.FileUID]struct { - SourceTable mm_repository.SourceTable - SourceUID mm_repository.SourceUID -}) (m1 map[mm_repository.FileUID]int, err error) { - mm_atomic.AddUint64(&mmGetFilesTotalTokens.beforeGetFilesTotalTokensCounter, 1) - defer mm_atomic.AddUint64(&mmGetFilesTotalTokens.afterGetFilesTotalTokensCounter, 1) +// GetCountFilesByListKnowledgeBaseUID implements repository.RepositoryI +func (mmGetCountFilesByListKnowledgeBaseUID *RepositoryIMock) GetCountFilesByListKnowledgeBaseUID(ctx context.Context, kbUIDs []mm_repository.KbUID) (m1 map[mm_repository.KbUID]int64, err error) { + mm_atomic.AddUint64(&mmGetCountFilesByListKnowledgeBaseUID.beforeGetCountFilesByListKnowledgeBaseUIDCounter, 1) + defer mm_atomic.AddUint64(&mmGetCountFilesByListKnowledgeBaseUID.afterGetCountFilesByListKnowledgeBaseUIDCounter, 1) - if mmGetFilesTotalTokens.inspectFuncGetFilesTotalTokens != nil { - mmGetFilesTotalTokens.inspectFuncGetFilesTotalTokens(ctx, sources) + if mmGetCountFilesByListKnowledgeBaseUID.inspectFuncGetCountFilesByListKnowledgeBaseUID != nil { + mmGetCountFilesByListKnowledgeBaseUID.inspectFuncGetCountFilesByListKnowledgeBaseUID(ctx, kbUIDs) } - mm_params := RepositoryIMockGetFilesTotalTokensParams{ctx, sources} + mm_params := RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParams{ctx, kbUIDs} // Record call args - mmGetFilesTotalTokens.GetFilesTotalTokensMock.mutex.Lock() - mmGetFilesTotalTokens.GetFilesTotalTokensMock.callArgs = append(mmGetFilesTotalTokens.GetFilesTotalTokensMock.callArgs, &mm_params) - mmGetFilesTotalTokens.GetFilesTotalTokensMock.mutex.Unlock() + mmGetCountFilesByListKnowledgeBaseUID.GetCountFilesByListKnowledgeBaseUIDMock.mutex.Lock() + mmGetCountFilesByListKnowledgeBaseUID.GetCountFilesByListKnowledgeBaseUIDMock.callArgs = append(mmGetCountFilesByListKnowledgeBaseUID.GetCountFilesByListKnowledgeBaseUIDMock.callArgs, &mm_params) + mmGetCountFilesByListKnowledgeBaseUID.GetCountFilesByListKnowledgeBaseUIDMock.mutex.Unlock() - for _, e := range mmGetFilesTotalTokens.GetFilesTotalTokensMock.expectations { + for _, e := range mmGetCountFilesByListKnowledgeBaseUID.GetCountFilesByListKnowledgeBaseUIDMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) return e.results.m1, e.results.err } } - if mmGetFilesTotalTokens.GetFilesTotalTokensMock.defaultExpectation != nil { - mm_atomic.AddUint64(&mmGetFilesTotalTokens.GetFilesTotalTokensMock.defaultExpectation.Counter, 1) - mm_want := mmGetFilesTotalTokens.GetFilesTotalTokensMock.defaultExpectation.params - mm_want_ptrs := mmGetFilesTotalTokens.GetFilesTotalTokensMock.defaultExpectation.paramPtrs + if mmGetCountFilesByListKnowledgeBaseUID.GetCountFilesByListKnowledgeBaseUIDMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmGetCountFilesByListKnowledgeBaseUID.GetCountFilesByListKnowledgeBaseUIDMock.defaultExpectation.Counter, 1) + mm_want := mmGetCountFilesByListKnowledgeBaseUID.GetCountFilesByListKnowledgeBaseUIDMock.defaultExpectation.params + mm_want_ptrs := mmGetCountFilesByListKnowledgeBaseUID.GetCountFilesByListKnowledgeBaseUIDMock.defaultExpectation.paramPtrs - mm_got := RepositoryIMockGetFilesTotalTokensParams{ctx, sources} + mm_got := RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParams{ctx, kbUIDs} if mm_want_ptrs != nil { if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { - mmGetFilesTotalTokens.t.Errorf("RepositoryIMock.GetFilesTotalTokens got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) + mmGetCountFilesByListKnowledgeBaseUID.t.Errorf("RepositoryIMock.GetCountFilesByListKnowledgeBaseUID got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) } - if mm_want_ptrs.sources != nil && !minimock.Equal(*mm_want_ptrs.sources, mm_got.sources) { - mmGetFilesTotalTokens.t.Errorf("RepositoryIMock.GetFilesTotalTokens got unexpected parameter sources, want: %#v, got: %#v%s\n", *mm_want_ptrs.sources, mm_got.sources, minimock.Diff(*mm_want_ptrs.sources, mm_got.sources)) + if mm_want_ptrs.kbUIDs != nil && !minimock.Equal(*mm_want_ptrs.kbUIDs, mm_got.kbUIDs) { + mmGetCountFilesByListKnowledgeBaseUID.t.Errorf("RepositoryIMock.GetCountFilesByListKnowledgeBaseUID got unexpected parameter kbUIDs, want: %#v, got: %#v%s\n", *mm_want_ptrs.kbUIDs, mm_got.kbUIDs, minimock.Diff(*mm_want_ptrs.kbUIDs, mm_got.kbUIDs)) } } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { - mmGetFilesTotalTokens.t.Errorf("RepositoryIMock.GetFilesTotalTokens got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + mmGetCountFilesByListKnowledgeBaseUID.t.Errorf("RepositoryIMock.GetCountFilesByListKnowledgeBaseUID got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) } - mm_results := mmGetFilesTotalTokens.GetFilesTotalTokensMock.defaultExpectation.results + mm_results := mmGetCountFilesByListKnowledgeBaseUID.GetCountFilesByListKnowledgeBaseUIDMock.defaultExpectation.results if mm_results == nil { - mmGetFilesTotalTokens.t.Fatal("No results are set for the RepositoryIMock.GetFilesTotalTokens") + mmGetCountFilesByListKnowledgeBaseUID.t.Fatal("No results are set for the RepositoryIMock.GetCountFilesByListKnowledgeBaseUID") } return (*mm_results).m1, (*mm_results).err } - if mmGetFilesTotalTokens.funcGetFilesTotalTokens != nil { - return mmGetFilesTotalTokens.funcGetFilesTotalTokens(ctx, sources) + if mmGetCountFilesByListKnowledgeBaseUID.funcGetCountFilesByListKnowledgeBaseUID != nil { + return mmGetCountFilesByListKnowledgeBaseUID.funcGetCountFilesByListKnowledgeBaseUID(ctx, kbUIDs) } - mmGetFilesTotalTokens.t.Fatalf("Unexpected call to RepositoryIMock.GetFilesTotalTokens. %v %v", ctx, sources) + mmGetCountFilesByListKnowledgeBaseUID.t.Fatalf("Unexpected call to RepositoryIMock.GetCountFilesByListKnowledgeBaseUID. %v %v", ctx, kbUIDs) return } -// GetFilesTotalTokensAfterCounter returns a count of finished RepositoryIMock.GetFilesTotalTokens invocations -func (mmGetFilesTotalTokens *RepositoryIMock) GetFilesTotalTokensAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetFilesTotalTokens.afterGetFilesTotalTokensCounter) +// GetCountFilesByListKnowledgeBaseUIDAfterCounter returns a count of finished RepositoryIMock.GetCountFilesByListKnowledgeBaseUID invocations +func (mmGetCountFilesByListKnowledgeBaseUID *RepositoryIMock) GetCountFilesByListKnowledgeBaseUIDAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetCountFilesByListKnowledgeBaseUID.afterGetCountFilesByListKnowledgeBaseUIDCounter) } -// GetFilesTotalTokensBeforeCounter returns a count of RepositoryIMock.GetFilesTotalTokens invocations -func (mmGetFilesTotalTokens *RepositoryIMock) GetFilesTotalTokensBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetFilesTotalTokens.beforeGetFilesTotalTokensCounter) +// GetCountFilesByListKnowledgeBaseUIDBeforeCounter returns a count of RepositoryIMock.GetCountFilesByListKnowledgeBaseUID invocations +func (mmGetCountFilesByListKnowledgeBaseUID *RepositoryIMock) GetCountFilesByListKnowledgeBaseUIDBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetCountFilesByListKnowledgeBaseUID.beforeGetCountFilesByListKnowledgeBaseUIDCounter) } -// Calls returns a list of arguments used in each call to RepositoryIMock.GetFilesTotalTokens. +// Calls returns a list of arguments used in each call to RepositoryIMock.GetCountFilesByListKnowledgeBaseUID. // The list is in the same order as the calls were made (i.e. recent calls have a higher index) -func (mmGetFilesTotalTokens *mRepositoryIMockGetFilesTotalTokens) Calls() []*RepositoryIMockGetFilesTotalTokensParams { - mmGetFilesTotalTokens.mutex.RLock() +func (mmGetCountFilesByListKnowledgeBaseUID *mRepositoryIMockGetCountFilesByListKnowledgeBaseUID) Calls() []*RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParams { + mmGetCountFilesByListKnowledgeBaseUID.mutex.RLock() - argCopy := make([]*RepositoryIMockGetFilesTotalTokensParams, len(mmGetFilesTotalTokens.callArgs)) - copy(argCopy, mmGetFilesTotalTokens.callArgs) + argCopy := make([]*RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParams, len(mmGetCountFilesByListKnowledgeBaseUID.callArgs)) + copy(argCopy, mmGetCountFilesByListKnowledgeBaseUID.callArgs) - mmGetFilesTotalTokens.mutex.RUnlock() + mmGetCountFilesByListKnowledgeBaseUID.mutex.RUnlock() return argCopy } -// MinimockGetFilesTotalTokensDone returns true if the count of the GetFilesTotalTokens invocations corresponds +// MinimockGetCountFilesByListKnowledgeBaseUIDDone returns true if the count of the GetCountFilesByListKnowledgeBaseUID invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockGetFilesTotalTokensDone() bool { - for _, e := range m.GetFilesTotalTokensMock.expectations { +func (m *RepositoryIMock) MinimockGetCountFilesByListKnowledgeBaseUIDDone() bool { + for _, e := range m.GetCountFilesByListKnowledgeBaseUIDMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.GetFilesTotalTokensMock.invocationsDone() + return m.GetCountFilesByListKnowledgeBaseUIDMock.invocationsDone() } -// MinimockGetFilesTotalTokensInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockGetFilesTotalTokensInspect() { - for _, e := range m.GetFilesTotalTokensMock.expectations { +// MinimockGetCountFilesByListKnowledgeBaseUIDInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockGetCountFilesByListKnowledgeBaseUIDInspect() { + for _, e := range m.GetCountFilesByListKnowledgeBaseUIDMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { - m.t.Errorf("Expected call to RepositoryIMock.GetFilesTotalTokens with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.GetCountFilesByListKnowledgeBaseUID with params: %#v", *e.params) } } - afterGetFilesTotalTokensCounter := mm_atomic.LoadUint64(&m.afterGetFilesTotalTokensCounter) + afterGetCountFilesByListKnowledgeBaseUIDCounter := mm_atomic.LoadUint64(&m.afterGetCountFilesByListKnowledgeBaseUIDCounter) // if default expectation was set then invocations count should be greater than zero - if m.GetFilesTotalTokensMock.defaultExpectation != nil && afterGetFilesTotalTokensCounter < 1 { - if m.GetFilesTotalTokensMock.defaultExpectation.params == nil { - m.t.Error("Expected call to RepositoryIMock.GetFilesTotalTokens") + if m.GetCountFilesByListKnowledgeBaseUIDMock.defaultExpectation != nil && afterGetCountFilesByListKnowledgeBaseUIDCounter < 1 { + if m.GetCountFilesByListKnowledgeBaseUIDMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.GetCountFilesByListKnowledgeBaseUID") } else { - m.t.Errorf("Expected call to RepositoryIMock.GetFilesTotalTokens with params: %#v", *m.GetFilesTotalTokensMock.defaultExpectation.params) + m.t.Errorf("Expected call to RepositoryIMock.GetCountFilesByListKnowledgeBaseUID with params: %#v", *m.GetCountFilesByListKnowledgeBaseUIDMock.defaultExpectation.params) } } // if func was set then invocations count should be greater than zero - if m.funcGetFilesTotalTokens != nil && afterGetFilesTotalTokensCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.GetFilesTotalTokens") + if m.funcGetCountFilesByListKnowledgeBaseUID != nil && afterGetCountFilesByListKnowledgeBaseUIDCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.GetCountFilesByListKnowledgeBaseUID") } - if !m.GetFilesTotalTokensMock.invocationsDone() && afterGetFilesTotalTokensCounter > 0 { - m.t.Errorf("Expected %d calls to RepositoryIMock.GetFilesTotalTokens but found %d calls", - mm_atomic.LoadUint64(&m.GetFilesTotalTokensMock.expectedInvocations), afterGetFilesTotalTokensCounter) + if !m.GetCountFilesByListKnowledgeBaseUIDMock.invocationsDone() && afterGetCountFilesByListKnowledgeBaseUIDCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.GetCountFilesByListKnowledgeBaseUID but found %d calls", + mm_atomic.LoadUint64(&m.GetCountFilesByListKnowledgeBaseUIDMock.expectedInvocations), afterGetCountFilesByListKnowledgeBaseUIDCounter) } } -type mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID struct { +type mRepositoryIMockGetEmbeddingByUIDs struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation - expectations []*RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation + defaultExpectation *RepositoryIMockGetEmbeddingByUIDsExpectation + expectations []*RepositoryIMockGetEmbeddingByUIDsExpectation - callArgs []*RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParams + callArgs []*RepositoryIMockGetEmbeddingByUIDsParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation specifies expectation struct of the RepositoryI.GetKnowledgeBaseByOwnerAndKbID -type RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation struct { +// RepositoryIMockGetEmbeddingByUIDsExpectation specifies expectation struct of the RepositoryI.GetEmbeddingByUIDs +type RepositoryIMockGetEmbeddingByUIDsExpectation struct { mock *RepositoryIMock - params *RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParams - paramPtrs *RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParamPtrs - results *RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDResults + params *RepositoryIMockGetEmbeddingByUIDsParams + paramPtrs *RepositoryIMockGetEmbeddingByUIDsParamPtrs + results *RepositoryIMockGetEmbeddingByUIDsResults Counter uint64 } -// RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParams contains parameters of the RepositoryI.GetKnowledgeBaseByOwnerAndKbID -type RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParams struct { - ctx context.Context - ownerUID string - kbID string +// RepositoryIMockGetEmbeddingByUIDsParams contains parameters of the RepositoryI.GetEmbeddingByUIDs +type RepositoryIMockGetEmbeddingByUIDsParams struct { + ctx context.Context + embUIDs []uuid.UUID } -// RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParamPtrs contains pointers to parameters of the RepositoryI.GetKnowledgeBaseByOwnerAndKbID -type RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParamPtrs struct { - ctx *context.Context - ownerUID *string - kbID *string +// RepositoryIMockGetEmbeddingByUIDsParamPtrs contains pointers to parameters of the RepositoryI.GetEmbeddingByUIDs +type RepositoryIMockGetEmbeddingByUIDsParamPtrs struct { + ctx *context.Context + embUIDs *[]uuid.UUID } -// RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDResults contains results of the RepositoryI.GetKnowledgeBaseByOwnerAndKbID -type RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDResults struct { - kp1 *mm_repository.KnowledgeBase +// RepositoryIMockGetEmbeddingByUIDsResults contains results of the RepositoryI.GetEmbeddingByUIDs +type RepositoryIMockGetEmbeddingByUIDsResults struct { + ea1 []mm_repository.Embedding err error } -// Expect sets up expected params for RepositoryI.GetKnowledgeBaseByOwnerAndKbID -func (mmGetKnowledgeBaseByOwnerAndKbID *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID) Expect(ctx context.Context, ownerUID string, kbID string) *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID { - if mmGetKnowledgeBaseByOwnerAndKbID.mock.funcGetKnowledgeBaseByOwnerAndKbID != nil { - mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID mock is already set by Set") +// Expect sets up expected params for RepositoryI.GetEmbeddingByUIDs +func (mmGetEmbeddingByUIDs *mRepositoryIMockGetEmbeddingByUIDs) Expect(ctx context.Context, embUIDs []uuid.UUID) *mRepositoryIMockGetEmbeddingByUIDs { + if mmGetEmbeddingByUIDs.mock.funcGetEmbeddingByUIDs != nil { + mmGetEmbeddingByUIDs.mock.t.Fatalf("RepositoryIMock.GetEmbeddingByUIDs mock is already set by Set") } - if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation == nil { - mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation = &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation{} + if mmGetEmbeddingByUIDs.defaultExpectation == nil { + mmGetEmbeddingByUIDs.defaultExpectation = &RepositoryIMockGetEmbeddingByUIDsExpectation{} } - if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.paramPtrs != nil { - mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID mock is already set by ExpectParams functions") + if mmGetEmbeddingByUIDs.defaultExpectation.paramPtrs != nil { + mmGetEmbeddingByUIDs.mock.t.Fatalf("RepositoryIMock.GetEmbeddingByUIDs mock is already set by ExpectParams functions") } - mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.params = &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParams{ctx, ownerUID, kbID} - for _, e := range mmGetKnowledgeBaseByOwnerAndKbID.expectations { - if minimock.Equal(e.params, mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.params) { - mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.params) + mmGetEmbeddingByUIDs.defaultExpectation.params = &RepositoryIMockGetEmbeddingByUIDsParams{ctx, embUIDs} + for _, e := range mmGetEmbeddingByUIDs.expectations { + if minimock.Equal(e.params, mmGetEmbeddingByUIDs.defaultExpectation.params) { + mmGetEmbeddingByUIDs.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetEmbeddingByUIDs.defaultExpectation.params) } } - return mmGetKnowledgeBaseByOwnerAndKbID -} - -// ExpectCtxParam1 sets up expected param ctx for RepositoryI.GetKnowledgeBaseByOwnerAndKbID -func (mmGetKnowledgeBaseByOwnerAndKbID *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID { - if mmGetKnowledgeBaseByOwnerAndKbID.mock.funcGetKnowledgeBaseByOwnerAndKbID != nil { - mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID mock is already set by Set") - } - - if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation == nil { - mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation = &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation{} - } - - if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.params != nil { - mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID mock is already set by Expect") - } - - if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.paramPtrs == nil { - mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.paramPtrs = &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParamPtrs{} - } - mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.paramPtrs.ctx = &ctx - - return mmGetKnowledgeBaseByOwnerAndKbID + return mmGetEmbeddingByUIDs } -// ExpectOwnerUIDParam2 sets up expected param ownerUID for RepositoryI.GetKnowledgeBaseByOwnerAndKbID -func (mmGetKnowledgeBaseByOwnerAndKbID *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID) ExpectOwnerUIDParam2(ownerUID string) *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID { - if mmGetKnowledgeBaseByOwnerAndKbID.mock.funcGetKnowledgeBaseByOwnerAndKbID != nil { - mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID mock is already set by Set") +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.GetEmbeddingByUIDs +func (mmGetEmbeddingByUIDs *mRepositoryIMockGetEmbeddingByUIDs) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockGetEmbeddingByUIDs { + if mmGetEmbeddingByUIDs.mock.funcGetEmbeddingByUIDs != nil { + mmGetEmbeddingByUIDs.mock.t.Fatalf("RepositoryIMock.GetEmbeddingByUIDs mock is already set by Set") } - if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation == nil { - mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation = &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation{} + if mmGetEmbeddingByUIDs.defaultExpectation == nil { + mmGetEmbeddingByUIDs.defaultExpectation = &RepositoryIMockGetEmbeddingByUIDsExpectation{} } - if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.params != nil { - mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID mock is already set by Expect") + if mmGetEmbeddingByUIDs.defaultExpectation.params != nil { + mmGetEmbeddingByUIDs.mock.t.Fatalf("RepositoryIMock.GetEmbeddingByUIDs mock is already set by Expect") } - if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.paramPtrs == nil { - mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.paramPtrs = &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParamPtrs{} + if mmGetEmbeddingByUIDs.defaultExpectation.paramPtrs == nil { + mmGetEmbeddingByUIDs.defaultExpectation.paramPtrs = &RepositoryIMockGetEmbeddingByUIDsParamPtrs{} } - mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.paramPtrs.ownerUID = &ownerUID + mmGetEmbeddingByUIDs.defaultExpectation.paramPtrs.ctx = &ctx - return mmGetKnowledgeBaseByOwnerAndKbID + return mmGetEmbeddingByUIDs } -// ExpectKbIDParam3 sets up expected param kbID for RepositoryI.GetKnowledgeBaseByOwnerAndKbID -func (mmGetKnowledgeBaseByOwnerAndKbID *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID) ExpectKbIDParam3(kbID string) *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID { - if mmGetKnowledgeBaseByOwnerAndKbID.mock.funcGetKnowledgeBaseByOwnerAndKbID != nil { - mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID mock is already set by Set") +// ExpectEmbUIDsParam2 sets up expected param embUIDs for RepositoryI.GetEmbeddingByUIDs +func (mmGetEmbeddingByUIDs *mRepositoryIMockGetEmbeddingByUIDs) ExpectEmbUIDsParam2(embUIDs []uuid.UUID) *mRepositoryIMockGetEmbeddingByUIDs { + if mmGetEmbeddingByUIDs.mock.funcGetEmbeddingByUIDs != nil { + mmGetEmbeddingByUIDs.mock.t.Fatalf("RepositoryIMock.GetEmbeddingByUIDs mock is already set by Set") } - if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation == nil { - mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation = &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation{} + if mmGetEmbeddingByUIDs.defaultExpectation == nil { + mmGetEmbeddingByUIDs.defaultExpectation = &RepositoryIMockGetEmbeddingByUIDsExpectation{} } - if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.params != nil { - mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID mock is already set by Expect") + if mmGetEmbeddingByUIDs.defaultExpectation.params != nil { + mmGetEmbeddingByUIDs.mock.t.Fatalf("RepositoryIMock.GetEmbeddingByUIDs mock is already set by Expect") } - if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.paramPtrs == nil { - mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.paramPtrs = &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParamPtrs{} + if mmGetEmbeddingByUIDs.defaultExpectation.paramPtrs == nil { + mmGetEmbeddingByUIDs.defaultExpectation.paramPtrs = &RepositoryIMockGetEmbeddingByUIDsParamPtrs{} } - mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.paramPtrs.kbID = &kbID + mmGetEmbeddingByUIDs.defaultExpectation.paramPtrs.embUIDs = &embUIDs - return mmGetKnowledgeBaseByOwnerAndKbID + return mmGetEmbeddingByUIDs } -// Inspect accepts an inspector function that has same arguments as the RepositoryI.GetKnowledgeBaseByOwnerAndKbID -func (mmGetKnowledgeBaseByOwnerAndKbID *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID) Inspect(f func(ctx context.Context, ownerUID string, kbID string)) *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID { - if mmGetKnowledgeBaseByOwnerAndKbID.mock.inspectFuncGetKnowledgeBaseByOwnerAndKbID != nil { - mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID") +// Inspect accepts an inspector function that has same arguments as the RepositoryI.GetEmbeddingByUIDs +func (mmGetEmbeddingByUIDs *mRepositoryIMockGetEmbeddingByUIDs) Inspect(f func(ctx context.Context, embUIDs []uuid.UUID)) *mRepositoryIMockGetEmbeddingByUIDs { + if mmGetEmbeddingByUIDs.mock.inspectFuncGetEmbeddingByUIDs != nil { + mmGetEmbeddingByUIDs.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.GetEmbeddingByUIDs") } - mmGetKnowledgeBaseByOwnerAndKbID.mock.inspectFuncGetKnowledgeBaseByOwnerAndKbID = f + mmGetEmbeddingByUIDs.mock.inspectFuncGetEmbeddingByUIDs = f - return mmGetKnowledgeBaseByOwnerAndKbID + return mmGetEmbeddingByUIDs } -// Return sets up results that will be returned by RepositoryI.GetKnowledgeBaseByOwnerAndKbID -func (mmGetKnowledgeBaseByOwnerAndKbID *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID) Return(kp1 *mm_repository.KnowledgeBase, err error) *RepositoryIMock { - if mmGetKnowledgeBaseByOwnerAndKbID.mock.funcGetKnowledgeBaseByOwnerAndKbID != nil { - mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID mock is already set by Set") +// Return sets up results that will be returned by RepositoryI.GetEmbeddingByUIDs +func (mmGetEmbeddingByUIDs *mRepositoryIMockGetEmbeddingByUIDs) Return(ea1 []mm_repository.Embedding, err error) *RepositoryIMock { + if mmGetEmbeddingByUIDs.mock.funcGetEmbeddingByUIDs != nil { + mmGetEmbeddingByUIDs.mock.t.Fatalf("RepositoryIMock.GetEmbeddingByUIDs mock is already set by Set") } - if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation == nil { - mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation = &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation{mock: mmGetKnowledgeBaseByOwnerAndKbID.mock} + if mmGetEmbeddingByUIDs.defaultExpectation == nil { + mmGetEmbeddingByUIDs.defaultExpectation = &RepositoryIMockGetEmbeddingByUIDsExpectation{mock: mmGetEmbeddingByUIDs.mock} } - mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.results = &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDResults{kp1, err} - return mmGetKnowledgeBaseByOwnerAndKbID.mock + mmGetEmbeddingByUIDs.defaultExpectation.results = &RepositoryIMockGetEmbeddingByUIDsResults{ea1, err} + return mmGetEmbeddingByUIDs.mock } -// Set uses given function f to mock the RepositoryI.GetKnowledgeBaseByOwnerAndKbID method -func (mmGetKnowledgeBaseByOwnerAndKbID *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID) Set(f func(ctx context.Context, ownerUID string, kbID string) (kp1 *mm_repository.KnowledgeBase, err error)) *RepositoryIMock { - if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation != nil { - mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("Default expectation is already set for the RepositoryI.GetKnowledgeBaseByOwnerAndKbID method") +// Set uses given function f to mock the RepositoryI.GetEmbeddingByUIDs method +func (mmGetEmbeddingByUIDs *mRepositoryIMockGetEmbeddingByUIDs) Set(f func(ctx context.Context, embUIDs []uuid.UUID) (ea1 []mm_repository.Embedding, err error)) *RepositoryIMock { + if mmGetEmbeddingByUIDs.defaultExpectation != nil { + mmGetEmbeddingByUIDs.mock.t.Fatalf("Default expectation is already set for the RepositoryI.GetEmbeddingByUIDs method") } - if len(mmGetKnowledgeBaseByOwnerAndKbID.expectations) > 0 { - mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetKnowledgeBaseByOwnerAndKbID method") + if len(mmGetEmbeddingByUIDs.expectations) > 0 { + mmGetEmbeddingByUIDs.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetEmbeddingByUIDs method") } - mmGetKnowledgeBaseByOwnerAndKbID.mock.funcGetKnowledgeBaseByOwnerAndKbID = f - return mmGetKnowledgeBaseByOwnerAndKbID.mock + mmGetEmbeddingByUIDs.mock.funcGetEmbeddingByUIDs = f + return mmGetEmbeddingByUIDs.mock } -// When sets expectation for the RepositoryI.GetKnowledgeBaseByOwnerAndKbID which will trigger the result defined by the following +// When sets expectation for the RepositoryI.GetEmbeddingByUIDs which will trigger the result defined by the following // Then helper -func (mmGetKnowledgeBaseByOwnerAndKbID *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID) When(ctx context.Context, ownerUID string, kbID string) *RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation { - if mmGetKnowledgeBaseByOwnerAndKbID.mock.funcGetKnowledgeBaseByOwnerAndKbID != nil { - mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID mock is already set by Set") +func (mmGetEmbeddingByUIDs *mRepositoryIMockGetEmbeddingByUIDs) When(ctx context.Context, embUIDs []uuid.UUID) *RepositoryIMockGetEmbeddingByUIDsExpectation { + if mmGetEmbeddingByUIDs.mock.funcGetEmbeddingByUIDs != nil { + mmGetEmbeddingByUIDs.mock.t.Fatalf("RepositoryIMock.GetEmbeddingByUIDs mock is already set by Set") } - expectation := &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation{ - mock: mmGetKnowledgeBaseByOwnerAndKbID.mock, - params: &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParams{ctx, ownerUID, kbID}, + expectation := &RepositoryIMockGetEmbeddingByUIDsExpectation{ + mock: mmGetEmbeddingByUIDs.mock, + params: &RepositoryIMockGetEmbeddingByUIDsParams{ctx, embUIDs}, } - mmGetKnowledgeBaseByOwnerAndKbID.expectations = append(mmGetKnowledgeBaseByOwnerAndKbID.expectations, expectation) + mmGetEmbeddingByUIDs.expectations = append(mmGetEmbeddingByUIDs.expectations, expectation) return expectation } -// Then sets up RepositoryI.GetKnowledgeBaseByOwnerAndKbID return parameters for the expectation previously defined by the When method -func (e *RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation) Then(kp1 *mm_repository.KnowledgeBase, err error) *RepositoryIMock { - e.results = &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDResults{kp1, err} +// Then sets up RepositoryI.GetEmbeddingByUIDs return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockGetEmbeddingByUIDsExpectation) Then(ea1 []mm_repository.Embedding, err error) *RepositoryIMock { + e.results = &RepositoryIMockGetEmbeddingByUIDsResults{ea1, err} return e.mock } -// Times sets number of times RepositoryI.GetKnowledgeBaseByOwnerAndKbID should be invoked -func (mmGetKnowledgeBaseByOwnerAndKbID *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID) Times(n uint64) *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID { +// Times sets number of times RepositoryI.GetEmbeddingByUIDs should be invoked +func (mmGetEmbeddingByUIDs *mRepositoryIMockGetEmbeddingByUIDs) Times(n uint64) *mRepositoryIMockGetEmbeddingByUIDs { if n == 0 { - mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("Times of RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID mock can not be zero") + mmGetEmbeddingByUIDs.mock.t.Fatalf("Times of RepositoryIMock.GetEmbeddingByUIDs mock can not be zero") } - mm_atomic.StoreUint64(&mmGetKnowledgeBaseByOwnerAndKbID.expectedInvocations, n) - return mmGetKnowledgeBaseByOwnerAndKbID + mm_atomic.StoreUint64(&mmGetEmbeddingByUIDs.expectedInvocations, n) + return mmGetEmbeddingByUIDs } -func (mmGetKnowledgeBaseByOwnerAndKbID *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID) invocationsDone() bool { - if len(mmGetKnowledgeBaseByOwnerAndKbID.expectations) == 0 && mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation == nil && mmGetKnowledgeBaseByOwnerAndKbID.mock.funcGetKnowledgeBaseByOwnerAndKbID == nil { +func (mmGetEmbeddingByUIDs *mRepositoryIMockGetEmbeddingByUIDs) invocationsDone() bool { + if len(mmGetEmbeddingByUIDs.expectations) == 0 && mmGetEmbeddingByUIDs.defaultExpectation == nil && mmGetEmbeddingByUIDs.mock.funcGetEmbeddingByUIDs == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmGetKnowledgeBaseByOwnerAndKbID.mock.afterGetKnowledgeBaseByOwnerAndKbIDCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmGetKnowledgeBaseByOwnerAndKbID.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmGetEmbeddingByUIDs.mock.afterGetEmbeddingByUIDsCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmGetEmbeddingByUIDs.expectedInvocations) return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) } -// GetKnowledgeBaseByOwnerAndKbID implements repository.RepositoryI -func (mmGetKnowledgeBaseByOwnerAndKbID *RepositoryIMock) GetKnowledgeBaseByOwnerAndKbID(ctx context.Context, ownerUID string, kbID string) (kp1 *mm_repository.KnowledgeBase, err error) { - mm_atomic.AddUint64(&mmGetKnowledgeBaseByOwnerAndKbID.beforeGetKnowledgeBaseByOwnerAndKbIDCounter, 1) - defer mm_atomic.AddUint64(&mmGetKnowledgeBaseByOwnerAndKbID.afterGetKnowledgeBaseByOwnerAndKbIDCounter, 1) +// GetEmbeddingByUIDs implements repository.RepositoryI +func (mmGetEmbeddingByUIDs *RepositoryIMock) GetEmbeddingByUIDs(ctx context.Context, embUIDs []uuid.UUID) (ea1 []mm_repository.Embedding, err error) { + mm_atomic.AddUint64(&mmGetEmbeddingByUIDs.beforeGetEmbeddingByUIDsCounter, 1) + defer mm_atomic.AddUint64(&mmGetEmbeddingByUIDs.afterGetEmbeddingByUIDsCounter, 1) - if mmGetKnowledgeBaseByOwnerAndKbID.inspectFuncGetKnowledgeBaseByOwnerAndKbID != nil { - mmGetKnowledgeBaseByOwnerAndKbID.inspectFuncGetKnowledgeBaseByOwnerAndKbID(ctx, ownerUID, kbID) + if mmGetEmbeddingByUIDs.inspectFuncGetEmbeddingByUIDs != nil { + mmGetEmbeddingByUIDs.inspectFuncGetEmbeddingByUIDs(ctx, embUIDs) } - mm_params := RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParams{ctx, ownerUID, kbID} + mm_params := RepositoryIMockGetEmbeddingByUIDsParams{ctx, embUIDs} // Record call args - mmGetKnowledgeBaseByOwnerAndKbID.GetKnowledgeBaseByOwnerAndKbIDMock.mutex.Lock() - mmGetKnowledgeBaseByOwnerAndKbID.GetKnowledgeBaseByOwnerAndKbIDMock.callArgs = append(mmGetKnowledgeBaseByOwnerAndKbID.GetKnowledgeBaseByOwnerAndKbIDMock.callArgs, &mm_params) - mmGetKnowledgeBaseByOwnerAndKbID.GetKnowledgeBaseByOwnerAndKbIDMock.mutex.Unlock() + mmGetEmbeddingByUIDs.GetEmbeddingByUIDsMock.mutex.Lock() + mmGetEmbeddingByUIDs.GetEmbeddingByUIDsMock.callArgs = append(mmGetEmbeddingByUIDs.GetEmbeddingByUIDsMock.callArgs, &mm_params) + mmGetEmbeddingByUIDs.GetEmbeddingByUIDsMock.mutex.Unlock() - for _, e := range mmGetKnowledgeBaseByOwnerAndKbID.GetKnowledgeBaseByOwnerAndKbIDMock.expectations { + for _, e := range mmGetEmbeddingByUIDs.GetEmbeddingByUIDsMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.kp1, e.results.err + return e.results.ea1, e.results.err } } - if mmGetKnowledgeBaseByOwnerAndKbID.GetKnowledgeBaseByOwnerAndKbIDMock.defaultExpectation != nil { - mm_atomic.AddUint64(&mmGetKnowledgeBaseByOwnerAndKbID.GetKnowledgeBaseByOwnerAndKbIDMock.defaultExpectation.Counter, 1) - mm_want := mmGetKnowledgeBaseByOwnerAndKbID.GetKnowledgeBaseByOwnerAndKbIDMock.defaultExpectation.params - mm_want_ptrs := mmGetKnowledgeBaseByOwnerAndKbID.GetKnowledgeBaseByOwnerAndKbIDMock.defaultExpectation.paramPtrs + if mmGetEmbeddingByUIDs.GetEmbeddingByUIDsMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmGetEmbeddingByUIDs.GetEmbeddingByUIDsMock.defaultExpectation.Counter, 1) + mm_want := mmGetEmbeddingByUIDs.GetEmbeddingByUIDsMock.defaultExpectation.params + mm_want_ptrs := mmGetEmbeddingByUIDs.GetEmbeddingByUIDsMock.defaultExpectation.paramPtrs - mm_got := RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParams{ctx, ownerUID, kbID} + mm_got := RepositoryIMockGetEmbeddingByUIDsParams{ctx, embUIDs} if mm_want_ptrs != nil { if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { - mmGetKnowledgeBaseByOwnerAndKbID.t.Errorf("RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) - } - - if mm_want_ptrs.ownerUID != nil && !minimock.Equal(*mm_want_ptrs.ownerUID, mm_got.ownerUID) { - mmGetKnowledgeBaseByOwnerAndKbID.t.Errorf("RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID got unexpected parameter ownerUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.ownerUID, mm_got.ownerUID, minimock.Diff(*mm_want_ptrs.ownerUID, mm_got.ownerUID)) + mmGetEmbeddingByUIDs.t.Errorf("RepositoryIMock.GetEmbeddingByUIDs got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) } - if mm_want_ptrs.kbID != nil && !minimock.Equal(*mm_want_ptrs.kbID, mm_got.kbID) { - mmGetKnowledgeBaseByOwnerAndKbID.t.Errorf("RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID got unexpected parameter kbID, want: %#v, got: %#v%s\n", *mm_want_ptrs.kbID, mm_got.kbID, minimock.Diff(*mm_want_ptrs.kbID, mm_got.kbID)) + if mm_want_ptrs.embUIDs != nil && !minimock.Equal(*mm_want_ptrs.embUIDs, mm_got.embUIDs) { + mmGetEmbeddingByUIDs.t.Errorf("RepositoryIMock.GetEmbeddingByUIDs got unexpected parameter embUIDs, want: %#v, got: %#v%s\n", *mm_want_ptrs.embUIDs, mm_got.embUIDs, minimock.Diff(*mm_want_ptrs.embUIDs, mm_got.embUIDs)) } } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { - mmGetKnowledgeBaseByOwnerAndKbID.t.Errorf("RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + mmGetEmbeddingByUIDs.t.Errorf("RepositoryIMock.GetEmbeddingByUIDs got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) } - mm_results := mmGetKnowledgeBaseByOwnerAndKbID.GetKnowledgeBaseByOwnerAndKbIDMock.defaultExpectation.results + mm_results := mmGetEmbeddingByUIDs.GetEmbeddingByUIDsMock.defaultExpectation.results if mm_results == nil { - mmGetKnowledgeBaseByOwnerAndKbID.t.Fatal("No results are set for the RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID") + mmGetEmbeddingByUIDs.t.Fatal("No results are set for the RepositoryIMock.GetEmbeddingByUIDs") } - return (*mm_results).kp1, (*mm_results).err + return (*mm_results).ea1, (*mm_results).err } - if mmGetKnowledgeBaseByOwnerAndKbID.funcGetKnowledgeBaseByOwnerAndKbID != nil { - return mmGetKnowledgeBaseByOwnerAndKbID.funcGetKnowledgeBaseByOwnerAndKbID(ctx, ownerUID, kbID) + if mmGetEmbeddingByUIDs.funcGetEmbeddingByUIDs != nil { + return mmGetEmbeddingByUIDs.funcGetEmbeddingByUIDs(ctx, embUIDs) } - mmGetKnowledgeBaseByOwnerAndKbID.t.Fatalf("Unexpected call to RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID. %v %v %v", ctx, ownerUID, kbID) + mmGetEmbeddingByUIDs.t.Fatalf("Unexpected call to RepositoryIMock.GetEmbeddingByUIDs. %v %v", ctx, embUIDs) return } -// GetKnowledgeBaseByOwnerAndKbIDAfterCounter returns a count of finished RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID invocations -func (mmGetKnowledgeBaseByOwnerAndKbID *RepositoryIMock) GetKnowledgeBaseByOwnerAndKbIDAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetKnowledgeBaseByOwnerAndKbID.afterGetKnowledgeBaseByOwnerAndKbIDCounter) +// GetEmbeddingByUIDsAfterCounter returns a count of finished RepositoryIMock.GetEmbeddingByUIDs invocations +func (mmGetEmbeddingByUIDs *RepositoryIMock) GetEmbeddingByUIDsAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetEmbeddingByUIDs.afterGetEmbeddingByUIDsCounter) } -// GetKnowledgeBaseByOwnerAndKbIDBeforeCounter returns a count of RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID invocations -func (mmGetKnowledgeBaseByOwnerAndKbID *RepositoryIMock) GetKnowledgeBaseByOwnerAndKbIDBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetKnowledgeBaseByOwnerAndKbID.beforeGetKnowledgeBaseByOwnerAndKbIDCounter) +// GetEmbeddingByUIDsBeforeCounter returns a count of RepositoryIMock.GetEmbeddingByUIDs invocations +func (mmGetEmbeddingByUIDs *RepositoryIMock) GetEmbeddingByUIDsBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetEmbeddingByUIDs.beforeGetEmbeddingByUIDsCounter) } -// Calls returns a list of arguments used in each call to RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID. +// Calls returns a list of arguments used in each call to RepositoryIMock.GetEmbeddingByUIDs. // The list is in the same order as the calls were made (i.e. recent calls have a higher index) -func (mmGetKnowledgeBaseByOwnerAndKbID *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID) Calls() []*RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParams { - mmGetKnowledgeBaseByOwnerAndKbID.mutex.RLock() +func (mmGetEmbeddingByUIDs *mRepositoryIMockGetEmbeddingByUIDs) Calls() []*RepositoryIMockGetEmbeddingByUIDsParams { + mmGetEmbeddingByUIDs.mutex.RLock() - argCopy := make([]*RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParams, len(mmGetKnowledgeBaseByOwnerAndKbID.callArgs)) - copy(argCopy, mmGetKnowledgeBaseByOwnerAndKbID.callArgs) + argCopy := make([]*RepositoryIMockGetEmbeddingByUIDsParams, len(mmGetEmbeddingByUIDs.callArgs)) + copy(argCopy, mmGetEmbeddingByUIDs.callArgs) - mmGetKnowledgeBaseByOwnerAndKbID.mutex.RUnlock() + mmGetEmbeddingByUIDs.mutex.RUnlock() return argCopy } -// MinimockGetKnowledgeBaseByOwnerAndKbIDDone returns true if the count of the GetKnowledgeBaseByOwnerAndKbID invocations corresponds +// MinimockGetEmbeddingByUIDsDone returns true if the count of the GetEmbeddingByUIDs invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockGetKnowledgeBaseByOwnerAndKbIDDone() bool { - for _, e := range m.GetKnowledgeBaseByOwnerAndKbIDMock.expectations { +func (m *RepositoryIMock) MinimockGetEmbeddingByUIDsDone() bool { + for _, e := range m.GetEmbeddingByUIDsMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.GetKnowledgeBaseByOwnerAndKbIDMock.invocationsDone() + return m.GetEmbeddingByUIDsMock.invocationsDone() } -// MinimockGetKnowledgeBaseByOwnerAndKbIDInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockGetKnowledgeBaseByOwnerAndKbIDInspect() { - for _, e := range m.GetKnowledgeBaseByOwnerAndKbIDMock.expectations { +// MinimockGetEmbeddingByUIDsInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockGetEmbeddingByUIDsInspect() { + for _, e := range m.GetEmbeddingByUIDsMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { - m.t.Errorf("Expected call to RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.GetEmbeddingByUIDs with params: %#v", *e.params) } } - afterGetKnowledgeBaseByOwnerAndKbIDCounter := mm_atomic.LoadUint64(&m.afterGetKnowledgeBaseByOwnerAndKbIDCounter) + afterGetEmbeddingByUIDsCounter := mm_atomic.LoadUint64(&m.afterGetEmbeddingByUIDsCounter) // if default expectation was set then invocations count should be greater than zero - if m.GetKnowledgeBaseByOwnerAndKbIDMock.defaultExpectation != nil && afterGetKnowledgeBaseByOwnerAndKbIDCounter < 1 { - if m.GetKnowledgeBaseByOwnerAndKbIDMock.defaultExpectation.params == nil { - m.t.Error("Expected call to RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID") + if m.GetEmbeddingByUIDsMock.defaultExpectation != nil && afterGetEmbeddingByUIDsCounter < 1 { + if m.GetEmbeddingByUIDsMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.GetEmbeddingByUIDs") } else { - m.t.Errorf("Expected call to RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID with params: %#v", *m.GetKnowledgeBaseByOwnerAndKbIDMock.defaultExpectation.params) + m.t.Errorf("Expected call to RepositoryIMock.GetEmbeddingByUIDs with params: %#v", *m.GetEmbeddingByUIDsMock.defaultExpectation.params) } } // if func was set then invocations count should be greater than zero - if m.funcGetKnowledgeBaseByOwnerAndKbID != nil && afterGetKnowledgeBaseByOwnerAndKbIDCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID") + if m.funcGetEmbeddingByUIDs != nil && afterGetEmbeddingByUIDsCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.GetEmbeddingByUIDs") } - if !m.GetKnowledgeBaseByOwnerAndKbIDMock.invocationsDone() && afterGetKnowledgeBaseByOwnerAndKbIDCounter > 0 { - m.t.Errorf("Expected %d calls to RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID but found %d calls", - mm_atomic.LoadUint64(&m.GetKnowledgeBaseByOwnerAndKbIDMock.expectedInvocations), afterGetKnowledgeBaseByOwnerAndKbIDCounter) + if !m.GetEmbeddingByUIDsMock.invocationsDone() && afterGetEmbeddingByUIDsCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.GetEmbeddingByUIDs but found %d calls", + mm_atomic.LoadUint64(&m.GetEmbeddingByUIDsMock.expectedInvocations), afterGetEmbeddingByUIDsCounter) } } -type mRepositoryIMockGetKnowledgeBaseCountByOwner struct { +type mRepositoryIMockGetFilesTotalTokens struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockGetKnowledgeBaseCountByOwnerExpectation - expectations []*RepositoryIMockGetKnowledgeBaseCountByOwnerExpectation + defaultExpectation *RepositoryIMockGetFilesTotalTokensExpectation + expectations []*RepositoryIMockGetFilesTotalTokensExpectation - callArgs []*RepositoryIMockGetKnowledgeBaseCountByOwnerParams + callArgs []*RepositoryIMockGetFilesTotalTokensParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockGetKnowledgeBaseCountByOwnerExpectation specifies expectation struct of the RepositoryI.GetKnowledgeBaseCountByOwner -type RepositoryIMockGetKnowledgeBaseCountByOwnerExpectation struct { +// RepositoryIMockGetFilesTotalTokensExpectation specifies expectation struct of the RepositoryI.GetFilesTotalTokens +type RepositoryIMockGetFilesTotalTokensExpectation struct { mock *RepositoryIMock - params *RepositoryIMockGetKnowledgeBaseCountByOwnerParams - paramPtrs *RepositoryIMockGetKnowledgeBaseCountByOwnerParamPtrs - results *RepositoryIMockGetKnowledgeBaseCountByOwnerResults + params *RepositoryIMockGetFilesTotalTokensParams + paramPtrs *RepositoryIMockGetFilesTotalTokensParamPtrs + results *RepositoryIMockGetFilesTotalTokensResults Counter uint64 } -// RepositoryIMockGetKnowledgeBaseCountByOwnerParams contains parameters of the RepositoryI.GetKnowledgeBaseCountByOwner -type RepositoryIMockGetKnowledgeBaseCountByOwnerParams struct { - ctx context.Context - ownerUID string +// RepositoryIMockGetFilesTotalTokensParams contains parameters of the RepositoryI.GetFilesTotalTokens +type RepositoryIMockGetFilesTotalTokensParams struct { + ctx context.Context + sources map[mm_repository.FileUID]struct { + SourceTable mm_repository.SourceTable + SourceUID mm_repository.SourceUID + } } -// RepositoryIMockGetKnowledgeBaseCountByOwnerParamPtrs contains pointers to parameters of the RepositoryI.GetKnowledgeBaseCountByOwner -type RepositoryIMockGetKnowledgeBaseCountByOwnerParamPtrs struct { - ctx *context.Context - ownerUID *string +// RepositoryIMockGetFilesTotalTokensParamPtrs contains pointers to parameters of the RepositoryI.GetFilesTotalTokens +type RepositoryIMockGetFilesTotalTokensParamPtrs struct { + ctx *context.Context + sources *map[mm_repository.FileUID]struct { + SourceTable mm_repository.SourceTable + SourceUID mm_repository.SourceUID + } } -// RepositoryIMockGetKnowledgeBaseCountByOwnerResults contains results of the RepositoryI.GetKnowledgeBaseCountByOwner -type RepositoryIMockGetKnowledgeBaseCountByOwnerResults struct { - i1 int64 +// RepositoryIMockGetFilesTotalTokensResults contains results of the RepositoryI.GetFilesTotalTokens +type RepositoryIMockGetFilesTotalTokensResults struct { + m1 map[mm_repository.FileUID]int err error } -// Expect sets up expected params for RepositoryI.GetKnowledgeBaseCountByOwner -func (mmGetKnowledgeBaseCountByOwner *mRepositoryIMockGetKnowledgeBaseCountByOwner) Expect(ctx context.Context, ownerUID string) *mRepositoryIMockGetKnowledgeBaseCountByOwner { - if mmGetKnowledgeBaseCountByOwner.mock.funcGetKnowledgeBaseCountByOwner != nil { - mmGetKnowledgeBaseCountByOwner.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseCountByOwner mock is already set by Set") +// Expect sets up expected params for RepositoryI.GetFilesTotalTokens +func (mmGetFilesTotalTokens *mRepositoryIMockGetFilesTotalTokens) Expect(ctx context.Context, sources map[mm_repository.FileUID]struct { + SourceTable mm_repository.SourceTable + SourceUID mm_repository.SourceUID +}) *mRepositoryIMockGetFilesTotalTokens { + if mmGetFilesTotalTokens.mock.funcGetFilesTotalTokens != nil { + mmGetFilesTotalTokens.mock.t.Fatalf("RepositoryIMock.GetFilesTotalTokens mock is already set by Set") } - if mmGetKnowledgeBaseCountByOwner.defaultExpectation == nil { - mmGetKnowledgeBaseCountByOwner.defaultExpectation = &RepositoryIMockGetKnowledgeBaseCountByOwnerExpectation{} + if mmGetFilesTotalTokens.defaultExpectation == nil { + mmGetFilesTotalTokens.defaultExpectation = &RepositoryIMockGetFilesTotalTokensExpectation{} } - if mmGetKnowledgeBaseCountByOwner.defaultExpectation.paramPtrs != nil { - mmGetKnowledgeBaseCountByOwner.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseCountByOwner mock is already set by ExpectParams functions") + if mmGetFilesTotalTokens.defaultExpectation.paramPtrs != nil { + mmGetFilesTotalTokens.mock.t.Fatalf("RepositoryIMock.GetFilesTotalTokens mock is already set by ExpectParams functions") } - mmGetKnowledgeBaseCountByOwner.defaultExpectation.params = &RepositoryIMockGetKnowledgeBaseCountByOwnerParams{ctx, ownerUID} - for _, e := range mmGetKnowledgeBaseCountByOwner.expectations { - if minimock.Equal(e.params, mmGetKnowledgeBaseCountByOwner.defaultExpectation.params) { - mmGetKnowledgeBaseCountByOwner.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetKnowledgeBaseCountByOwner.defaultExpectation.params) + mmGetFilesTotalTokens.defaultExpectation.params = &RepositoryIMockGetFilesTotalTokensParams{ctx, sources} + for _, e := range mmGetFilesTotalTokens.expectations { + if minimock.Equal(e.params, mmGetFilesTotalTokens.defaultExpectation.params) { + mmGetFilesTotalTokens.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetFilesTotalTokens.defaultExpectation.params) } } - return mmGetKnowledgeBaseCountByOwner + return mmGetFilesTotalTokens } -// ExpectCtxParam1 sets up expected param ctx for RepositoryI.GetKnowledgeBaseCountByOwner -func (mmGetKnowledgeBaseCountByOwner *mRepositoryIMockGetKnowledgeBaseCountByOwner) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockGetKnowledgeBaseCountByOwner { - if mmGetKnowledgeBaseCountByOwner.mock.funcGetKnowledgeBaseCountByOwner != nil { - mmGetKnowledgeBaseCountByOwner.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseCountByOwner mock is already set by Set") +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.GetFilesTotalTokens +func (mmGetFilesTotalTokens *mRepositoryIMockGetFilesTotalTokens) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockGetFilesTotalTokens { + if mmGetFilesTotalTokens.mock.funcGetFilesTotalTokens != nil { + mmGetFilesTotalTokens.mock.t.Fatalf("RepositoryIMock.GetFilesTotalTokens mock is already set by Set") } - if mmGetKnowledgeBaseCountByOwner.defaultExpectation == nil { - mmGetKnowledgeBaseCountByOwner.defaultExpectation = &RepositoryIMockGetKnowledgeBaseCountByOwnerExpectation{} + if mmGetFilesTotalTokens.defaultExpectation == nil { + mmGetFilesTotalTokens.defaultExpectation = &RepositoryIMockGetFilesTotalTokensExpectation{} } - if mmGetKnowledgeBaseCountByOwner.defaultExpectation.params != nil { - mmGetKnowledgeBaseCountByOwner.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseCountByOwner mock is already set by Expect") + if mmGetFilesTotalTokens.defaultExpectation.params != nil { + mmGetFilesTotalTokens.mock.t.Fatalf("RepositoryIMock.GetFilesTotalTokens mock is already set by Expect") } - if mmGetKnowledgeBaseCountByOwner.defaultExpectation.paramPtrs == nil { - mmGetKnowledgeBaseCountByOwner.defaultExpectation.paramPtrs = &RepositoryIMockGetKnowledgeBaseCountByOwnerParamPtrs{} + if mmGetFilesTotalTokens.defaultExpectation.paramPtrs == nil { + mmGetFilesTotalTokens.defaultExpectation.paramPtrs = &RepositoryIMockGetFilesTotalTokensParamPtrs{} } - mmGetKnowledgeBaseCountByOwner.defaultExpectation.paramPtrs.ctx = &ctx + mmGetFilesTotalTokens.defaultExpectation.paramPtrs.ctx = &ctx - return mmGetKnowledgeBaseCountByOwner + return mmGetFilesTotalTokens } -// ExpectOwnerUIDParam2 sets up expected param ownerUID for RepositoryI.GetKnowledgeBaseCountByOwner -func (mmGetKnowledgeBaseCountByOwner *mRepositoryIMockGetKnowledgeBaseCountByOwner) ExpectOwnerUIDParam2(ownerUID string) *mRepositoryIMockGetKnowledgeBaseCountByOwner { - if mmGetKnowledgeBaseCountByOwner.mock.funcGetKnowledgeBaseCountByOwner != nil { - mmGetKnowledgeBaseCountByOwner.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseCountByOwner mock is already set by Set") +// ExpectSourcesParam2 sets up expected param sources for RepositoryI.GetFilesTotalTokens +func (mmGetFilesTotalTokens *mRepositoryIMockGetFilesTotalTokens) ExpectSourcesParam2(sources map[mm_repository.FileUID]struct { + SourceTable mm_repository.SourceTable + SourceUID mm_repository.SourceUID +}) *mRepositoryIMockGetFilesTotalTokens { + if mmGetFilesTotalTokens.mock.funcGetFilesTotalTokens != nil { + mmGetFilesTotalTokens.mock.t.Fatalf("RepositoryIMock.GetFilesTotalTokens mock is already set by Set") } - if mmGetKnowledgeBaseCountByOwner.defaultExpectation == nil { - mmGetKnowledgeBaseCountByOwner.defaultExpectation = &RepositoryIMockGetKnowledgeBaseCountByOwnerExpectation{} + if mmGetFilesTotalTokens.defaultExpectation == nil { + mmGetFilesTotalTokens.defaultExpectation = &RepositoryIMockGetFilesTotalTokensExpectation{} } - if mmGetKnowledgeBaseCountByOwner.defaultExpectation.params != nil { - mmGetKnowledgeBaseCountByOwner.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseCountByOwner mock is already set by Expect") + if mmGetFilesTotalTokens.defaultExpectation.params != nil { + mmGetFilesTotalTokens.mock.t.Fatalf("RepositoryIMock.GetFilesTotalTokens mock is already set by Expect") } - if mmGetKnowledgeBaseCountByOwner.defaultExpectation.paramPtrs == nil { - mmGetKnowledgeBaseCountByOwner.defaultExpectation.paramPtrs = &RepositoryIMockGetKnowledgeBaseCountByOwnerParamPtrs{} + if mmGetFilesTotalTokens.defaultExpectation.paramPtrs == nil { + mmGetFilesTotalTokens.defaultExpectation.paramPtrs = &RepositoryIMockGetFilesTotalTokensParamPtrs{} } - mmGetKnowledgeBaseCountByOwner.defaultExpectation.paramPtrs.ownerUID = &ownerUID + mmGetFilesTotalTokens.defaultExpectation.paramPtrs.sources = &sources - return mmGetKnowledgeBaseCountByOwner + return mmGetFilesTotalTokens } -// Inspect accepts an inspector function that has same arguments as the RepositoryI.GetKnowledgeBaseCountByOwner -func (mmGetKnowledgeBaseCountByOwner *mRepositoryIMockGetKnowledgeBaseCountByOwner) Inspect(f func(ctx context.Context, ownerUID string)) *mRepositoryIMockGetKnowledgeBaseCountByOwner { - if mmGetKnowledgeBaseCountByOwner.mock.inspectFuncGetKnowledgeBaseCountByOwner != nil { - mmGetKnowledgeBaseCountByOwner.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.GetKnowledgeBaseCountByOwner") - } +// Inspect accepts an inspector function that has same arguments as the RepositoryI.GetFilesTotalTokens +func (mmGetFilesTotalTokens *mRepositoryIMockGetFilesTotalTokens) Inspect(f func(ctx context.Context, sources map[mm_repository.FileUID]struct { + SourceTable mm_repository.SourceTable + SourceUID mm_repository.SourceUID +})) *mRepositoryIMockGetFilesTotalTokens { + if mmGetFilesTotalTokens.mock.inspectFuncGetFilesTotalTokens != nil { + mmGetFilesTotalTokens.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.GetFilesTotalTokens") + } - mmGetKnowledgeBaseCountByOwner.mock.inspectFuncGetKnowledgeBaseCountByOwner = f + mmGetFilesTotalTokens.mock.inspectFuncGetFilesTotalTokens = f - return mmGetKnowledgeBaseCountByOwner + return mmGetFilesTotalTokens } -// Return sets up results that will be returned by RepositoryI.GetKnowledgeBaseCountByOwner -func (mmGetKnowledgeBaseCountByOwner *mRepositoryIMockGetKnowledgeBaseCountByOwner) Return(i1 int64, err error) *RepositoryIMock { - if mmGetKnowledgeBaseCountByOwner.mock.funcGetKnowledgeBaseCountByOwner != nil { - mmGetKnowledgeBaseCountByOwner.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseCountByOwner mock is already set by Set") +// Return sets up results that will be returned by RepositoryI.GetFilesTotalTokens +func (mmGetFilesTotalTokens *mRepositoryIMockGetFilesTotalTokens) Return(m1 map[mm_repository.FileUID]int, err error) *RepositoryIMock { + if mmGetFilesTotalTokens.mock.funcGetFilesTotalTokens != nil { + mmGetFilesTotalTokens.mock.t.Fatalf("RepositoryIMock.GetFilesTotalTokens mock is already set by Set") } - if mmGetKnowledgeBaseCountByOwner.defaultExpectation == nil { - mmGetKnowledgeBaseCountByOwner.defaultExpectation = &RepositoryIMockGetKnowledgeBaseCountByOwnerExpectation{mock: mmGetKnowledgeBaseCountByOwner.mock} + if mmGetFilesTotalTokens.defaultExpectation == nil { + mmGetFilesTotalTokens.defaultExpectation = &RepositoryIMockGetFilesTotalTokensExpectation{mock: mmGetFilesTotalTokens.mock} } - mmGetKnowledgeBaseCountByOwner.defaultExpectation.results = &RepositoryIMockGetKnowledgeBaseCountByOwnerResults{i1, err} - return mmGetKnowledgeBaseCountByOwner.mock + mmGetFilesTotalTokens.defaultExpectation.results = &RepositoryIMockGetFilesTotalTokensResults{m1, err} + return mmGetFilesTotalTokens.mock } -// Set uses given function f to mock the RepositoryI.GetKnowledgeBaseCountByOwner method -func (mmGetKnowledgeBaseCountByOwner *mRepositoryIMockGetKnowledgeBaseCountByOwner) Set(f func(ctx context.Context, ownerUID string) (i1 int64, err error)) *RepositoryIMock { - if mmGetKnowledgeBaseCountByOwner.defaultExpectation != nil { - mmGetKnowledgeBaseCountByOwner.mock.t.Fatalf("Default expectation is already set for the RepositoryI.GetKnowledgeBaseCountByOwner method") +// Set uses given function f to mock the RepositoryI.GetFilesTotalTokens method +func (mmGetFilesTotalTokens *mRepositoryIMockGetFilesTotalTokens) Set(f func(ctx context.Context, sources map[mm_repository.FileUID]struct { + SourceTable mm_repository.SourceTable + SourceUID mm_repository.SourceUID +}) (m1 map[mm_repository.FileUID]int, err error)) *RepositoryIMock { + if mmGetFilesTotalTokens.defaultExpectation != nil { + mmGetFilesTotalTokens.mock.t.Fatalf("Default expectation is already set for the RepositoryI.GetFilesTotalTokens method") } - if len(mmGetKnowledgeBaseCountByOwner.expectations) > 0 { - mmGetKnowledgeBaseCountByOwner.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetKnowledgeBaseCountByOwner method") + if len(mmGetFilesTotalTokens.expectations) > 0 { + mmGetFilesTotalTokens.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetFilesTotalTokens method") } - mmGetKnowledgeBaseCountByOwner.mock.funcGetKnowledgeBaseCountByOwner = f - return mmGetKnowledgeBaseCountByOwner.mock + mmGetFilesTotalTokens.mock.funcGetFilesTotalTokens = f + return mmGetFilesTotalTokens.mock } -// When sets expectation for the RepositoryI.GetKnowledgeBaseCountByOwner which will trigger the result defined by the following +// When sets expectation for the RepositoryI.GetFilesTotalTokens which will trigger the result defined by the following // Then helper -func (mmGetKnowledgeBaseCountByOwner *mRepositoryIMockGetKnowledgeBaseCountByOwner) When(ctx context.Context, ownerUID string) *RepositoryIMockGetKnowledgeBaseCountByOwnerExpectation { - if mmGetKnowledgeBaseCountByOwner.mock.funcGetKnowledgeBaseCountByOwner != nil { - mmGetKnowledgeBaseCountByOwner.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseCountByOwner mock is already set by Set") +func (mmGetFilesTotalTokens *mRepositoryIMockGetFilesTotalTokens) When(ctx context.Context, sources map[mm_repository.FileUID]struct { + SourceTable mm_repository.SourceTable + SourceUID mm_repository.SourceUID +}) *RepositoryIMockGetFilesTotalTokensExpectation { + if mmGetFilesTotalTokens.mock.funcGetFilesTotalTokens != nil { + mmGetFilesTotalTokens.mock.t.Fatalf("RepositoryIMock.GetFilesTotalTokens mock is already set by Set") } - expectation := &RepositoryIMockGetKnowledgeBaseCountByOwnerExpectation{ - mock: mmGetKnowledgeBaseCountByOwner.mock, - params: &RepositoryIMockGetKnowledgeBaseCountByOwnerParams{ctx, ownerUID}, + expectation := &RepositoryIMockGetFilesTotalTokensExpectation{ + mock: mmGetFilesTotalTokens.mock, + params: &RepositoryIMockGetFilesTotalTokensParams{ctx, sources}, } - mmGetKnowledgeBaseCountByOwner.expectations = append(mmGetKnowledgeBaseCountByOwner.expectations, expectation) + mmGetFilesTotalTokens.expectations = append(mmGetFilesTotalTokens.expectations, expectation) return expectation } -// Then sets up RepositoryI.GetKnowledgeBaseCountByOwner return parameters for the expectation previously defined by the When method -func (e *RepositoryIMockGetKnowledgeBaseCountByOwnerExpectation) Then(i1 int64, err error) *RepositoryIMock { - e.results = &RepositoryIMockGetKnowledgeBaseCountByOwnerResults{i1, err} +// Then sets up RepositoryI.GetFilesTotalTokens return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockGetFilesTotalTokensExpectation) Then(m1 map[mm_repository.FileUID]int, err error) *RepositoryIMock { + e.results = &RepositoryIMockGetFilesTotalTokensResults{m1, err} return e.mock } -// Times sets number of times RepositoryI.GetKnowledgeBaseCountByOwner should be invoked -func (mmGetKnowledgeBaseCountByOwner *mRepositoryIMockGetKnowledgeBaseCountByOwner) Times(n uint64) *mRepositoryIMockGetKnowledgeBaseCountByOwner { +// Times sets number of times RepositoryI.GetFilesTotalTokens should be invoked +func (mmGetFilesTotalTokens *mRepositoryIMockGetFilesTotalTokens) Times(n uint64) *mRepositoryIMockGetFilesTotalTokens { if n == 0 { - mmGetKnowledgeBaseCountByOwner.mock.t.Fatalf("Times of RepositoryIMock.GetKnowledgeBaseCountByOwner mock can not be zero") + mmGetFilesTotalTokens.mock.t.Fatalf("Times of RepositoryIMock.GetFilesTotalTokens mock can not be zero") } - mm_atomic.StoreUint64(&mmGetKnowledgeBaseCountByOwner.expectedInvocations, n) - return mmGetKnowledgeBaseCountByOwner + mm_atomic.StoreUint64(&mmGetFilesTotalTokens.expectedInvocations, n) + return mmGetFilesTotalTokens } -func (mmGetKnowledgeBaseCountByOwner *mRepositoryIMockGetKnowledgeBaseCountByOwner) invocationsDone() bool { - if len(mmGetKnowledgeBaseCountByOwner.expectations) == 0 && mmGetKnowledgeBaseCountByOwner.defaultExpectation == nil && mmGetKnowledgeBaseCountByOwner.mock.funcGetKnowledgeBaseCountByOwner == nil { +func (mmGetFilesTotalTokens *mRepositoryIMockGetFilesTotalTokens) invocationsDone() bool { + if len(mmGetFilesTotalTokens.expectations) == 0 && mmGetFilesTotalTokens.defaultExpectation == nil && mmGetFilesTotalTokens.mock.funcGetFilesTotalTokens == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmGetKnowledgeBaseCountByOwner.mock.afterGetKnowledgeBaseCountByOwnerCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmGetKnowledgeBaseCountByOwner.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmGetFilesTotalTokens.mock.afterGetFilesTotalTokensCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmGetFilesTotalTokens.expectedInvocations) return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) } -// GetKnowledgeBaseCountByOwner implements repository.RepositoryI -func (mmGetKnowledgeBaseCountByOwner *RepositoryIMock) GetKnowledgeBaseCountByOwner(ctx context.Context, ownerUID string) (i1 int64, err error) { - mm_atomic.AddUint64(&mmGetKnowledgeBaseCountByOwner.beforeGetKnowledgeBaseCountByOwnerCounter, 1) - defer mm_atomic.AddUint64(&mmGetKnowledgeBaseCountByOwner.afterGetKnowledgeBaseCountByOwnerCounter, 1) +// GetFilesTotalTokens implements repository.RepositoryI +func (mmGetFilesTotalTokens *RepositoryIMock) GetFilesTotalTokens(ctx context.Context, sources map[mm_repository.FileUID]struct { + SourceTable mm_repository.SourceTable + SourceUID mm_repository.SourceUID +}) (m1 map[mm_repository.FileUID]int, err error) { + mm_atomic.AddUint64(&mmGetFilesTotalTokens.beforeGetFilesTotalTokensCounter, 1) + defer mm_atomic.AddUint64(&mmGetFilesTotalTokens.afterGetFilesTotalTokensCounter, 1) - if mmGetKnowledgeBaseCountByOwner.inspectFuncGetKnowledgeBaseCountByOwner != nil { - mmGetKnowledgeBaseCountByOwner.inspectFuncGetKnowledgeBaseCountByOwner(ctx, ownerUID) + if mmGetFilesTotalTokens.inspectFuncGetFilesTotalTokens != nil { + mmGetFilesTotalTokens.inspectFuncGetFilesTotalTokens(ctx, sources) } - mm_params := RepositoryIMockGetKnowledgeBaseCountByOwnerParams{ctx, ownerUID} + mm_params := RepositoryIMockGetFilesTotalTokensParams{ctx, sources} // Record call args - mmGetKnowledgeBaseCountByOwner.GetKnowledgeBaseCountByOwnerMock.mutex.Lock() - mmGetKnowledgeBaseCountByOwner.GetKnowledgeBaseCountByOwnerMock.callArgs = append(mmGetKnowledgeBaseCountByOwner.GetKnowledgeBaseCountByOwnerMock.callArgs, &mm_params) - mmGetKnowledgeBaseCountByOwner.GetKnowledgeBaseCountByOwnerMock.mutex.Unlock() + mmGetFilesTotalTokens.GetFilesTotalTokensMock.mutex.Lock() + mmGetFilesTotalTokens.GetFilesTotalTokensMock.callArgs = append(mmGetFilesTotalTokens.GetFilesTotalTokensMock.callArgs, &mm_params) + mmGetFilesTotalTokens.GetFilesTotalTokensMock.mutex.Unlock() - for _, e := range mmGetKnowledgeBaseCountByOwner.GetKnowledgeBaseCountByOwnerMock.expectations { + for _, e := range mmGetFilesTotalTokens.GetFilesTotalTokensMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.i1, e.results.err + return e.results.m1, e.results.err } } - if mmGetKnowledgeBaseCountByOwner.GetKnowledgeBaseCountByOwnerMock.defaultExpectation != nil { - mm_atomic.AddUint64(&mmGetKnowledgeBaseCountByOwner.GetKnowledgeBaseCountByOwnerMock.defaultExpectation.Counter, 1) - mm_want := mmGetKnowledgeBaseCountByOwner.GetKnowledgeBaseCountByOwnerMock.defaultExpectation.params - mm_want_ptrs := mmGetKnowledgeBaseCountByOwner.GetKnowledgeBaseCountByOwnerMock.defaultExpectation.paramPtrs + if mmGetFilesTotalTokens.GetFilesTotalTokensMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmGetFilesTotalTokens.GetFilesTotalTokensMock.defaultExpectation.Counter, 1) + mm_want := mmGetFilesTotalTokens.GetFilesTotalTokensMock.defaultExpectation.params + mm_want_ptrs := mmGetFilesTotalTokens.GetFilesTotalTokensMock.defaultExpectation.paramPtrs - mm_got := RepositoryIMockGetKnowledgeBaseCountByOwnerParams{ctx, ownerUID} + mm_got := RepositoryIMockGetFilesTotalTokensParams{ctx, sources} if mm_want_ptrs != nil { if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { - mmGetKnowledgeBaseCountByOwner.t.Errorf("RepositoryIMock.GetKnowledgeBaseCountByOwner got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) + mmGetFilesTotalTokens.t.Errorf("RepositoryIMock.GetFilesTotalTokens got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) } - if mm_want_ptrs.ownerUID != nil && !minimock.Equal(*mm_want_ptrs.ownerUID, mm_got.ownerUID) { - mmGetKnowledgeBaseCountByOwner.t.Errorf("RepositoryIMock.GetKnowledgeBaseCountByOwner got unexpected parameter ownerUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.ownerUID, mm_got.ownerUID, minimock.Diff(*mm_want_ptrs.ownerUID, mm_got.ownerUID)) + if mm_want_ptrs.sources != nil && !minimock.Equal(*mm_want_ptrs.sources, mm_got.sources) { + mmGetFilesTotalTokens.t.Errorf("RepositoryIMock.GetFilesTotalTokens got unexpected parameter sources, want: %#v, got: %#v%s\n", *mm_want_ptrs.sources, mm_got.sources, minimock.Diff(*mm_want_ptrs.sources, mm_got.sources)) } } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { - mmGetKnowledgeBaseCountByOwner.t.Errorf("RepositoryIMock.GetKnowledgeBaseCountByOwner got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + mmGetFilesTotalTokens.t.Errorf("RepositoryIMock.GetFilesTotalTokens got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) } - mm_results := mmGetKnowledgeBaseCountByOwner.GetKnowledgeBaseCountByOwnerMock.defaultExpectation.results + mm_results := mmGetFilesTotalTokens.GetFilesTotalTokensMock.defaultExpectation.results if mm_results == nil { - mmGetKnowledgeBaseCountByOwner.t.Fatal("No results are set for the RepositoryIMock.GetKnowledgeBaseCountByOwner") + mmGetFilesTotalTokens.t.Fatal("No results are set for the RepositoryIMock.GetFilesTotalTokens") } - return (*mm_results).i1, (*mm_results).err + return (*mm_results).m1, (*mm_results).err } - if mmGetKnowledgeBaseCountByOwner.funcGetKnowledgeBaseCountByOwner != nil { - return mmGetKnowledgeBaseCountByOwner.funcGetKnowledgeBaseCountByOwner(ctx, ownerUID) + if mmGetFilesTotalTokens.funcGetFilesTotalTokens != nil { + return mmGetFilesTotalTokens.funcGetFilesTotalTokens(ctx, sources) } - mmGetKnowledgeBaseCountByOwner.t.Fatalf("Unexpected call to RepositoryIMock.GetKnowledgeBaseCountByOwner. %v %v", ctx, ownerUID) + mmGetFilesTotalTokens.t.Fatalf("Unexpected call to RepositoryIMock.GetFilesTotalTokens. %v %v", ctx, sources) return } -// GetKnowledgeBaseCountByOwnerAfterCounter returns a count of finished RepositoryIMock.GetKnowledgeBaseCountByOwner invocations -func (mmGetKnowledgeBaseCountByOwner *RepositoryIMock) GetKnowledgeBaseCountByOwnerAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetKnowledgeBaseCountByOwner.afterGetKnowledgeBaseCountByOwnerCounter) +// GetFilesTotalTokensAfterCounter returns a count of finished RepositoryIMock.GetFilesTotalTokens invocations +func (mmGetFilesTotalTokens *RepositoryIMock) GetFilesTotalTokensAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetFilesTotalTokens.afterGetFilesTotalTokensCounter) } -// GetKnowledgeBaseCountByOwnerBeforeCounter returns a count of RepositoryIMock.GetKnowledgeBaseCountByOwner invocations -func (mmGetKnowledgeBaseCountByOwner *RepositoryIMock) GetKnowledgeBaseCountByOwnerBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetKnowledgeBaseCountByOwner.beforeGetKnowledgeBaseCountByOwnerCounter) +// GetFilesTotalTokensBeforeCounter returns a count of RepositoryIMock.GetFilesTotalTokens invocations +func (mmGetFilesTotalTokens *RepositoryIMock) GetFilesTotalTokensBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetFilesTotalTokens.beforeGetFilesTotalTokensCounter) } -// Calls returns a list of arguments used in each call to RepositoryIMock.GetKnowledgeBaseCountByOwner. +// Calls returns a list of arguments used in each call to RepositoryIMock.GetFilesTotalTokens. // The list is in the same order as the calls were made (i.e. recent calls have a higher index) -func (mmGetKnowledgeBaseCountByOwner *mRepositoryIMockGetKnowledgeBaseCountByOwner) Calls() []*RepositoryIMockGetKnowledgeBaseCountByOwnerParams { - mmGetKnowledgeBaseCountByOwner.mutex.RLock() +func (mmGetFilesTotalTokens *mRepositoryIMockGetFilesTotalTokens) Calls() []*RepositoryIMockGetFilesTotalTokensParams { + mmGetFilesTotalTokens.mutex.RLock() - argCopy := make([]*RepositoryIMockGetKnowledgeBaseCountByOwnerParams, len(mmGetKnowledgeBaseCountByOwner.callArgs)) - copy(argCopy, mmGetKnowledgeBaseCountByOwner.callArgs) + argCopy := make([]*RepositoryIMockGetFilesTotalTokensParams, len(mmGetFilesTotalTokens.callArgs)) + copy(argCopy, mmGetFilesTotalTokens.callArgs) - mmGetKnowledgeBaseCountByOwner.mutex.RUnlock() + mmGetFilesTotalTokens.mutex.RUnlock() return argCopy } -// MinimockGetKnowledgeBaseCountByOwnerDone returns true if the count of the GetKnowledgeBaseCountByOwner invocations corresponds +// MinimockGetFilesTotalTokensDone returns true if the count of the GetFilesTotalTokens invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockGetKnowledgeBaseCountByOwnerDone() bool { - for _, e := range m.GetKnowledgeBaseCountByOwnerMock.expectations { +func (m *RepositoryIMock) MinimockGetFilesTotalTokensDone() bool { + for _, e := range m.GetFilesTotalTokensMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.GetKnowledgeBaseCountByOwnerMock.invocationsDone() + return m.GetFilesTotalTokensMock.invocationsDone() } -// MinimockGetKnowledgeBaseCountByOwnerInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockGetKnowledgeBaseCountByOwnerInspect() { - for _, e := range m.GetKnowledgeBaseCountByOwnerMock.expectations { +// MinimockGetFilesTotalTokensInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockGetFilesTotalTokensInspect() { + for _, e := range m.GetFilesTotalTokensMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { - m.t.Errorf("Expected call to RepositoryIMock.GetKnowledgeBaseCountByOwner with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.GetFilesTotalTokens with params: %#v", *e.params) } } - afterGetKnowledgeBaseCountByOwnerCounter := mm_atomic.LoadUint64(&m.afterGetKnowledgeBaseCountByOwnerCounter) + afterGetFilesTotalTokensCounter := mm_atomic.LoadUint64(&m.afterGetFilesTotalTokensCounter) // if default expectation was set then invocations count should be greater than zero - if m.GetKnowledgeBaseCountByOwnerMock.defaultExpectation != nil && afterGetKnowledgeBaseCountByOwnerCounter < 1 { - if m.GetKnowledgeBaseCountByOwnerMock.defaultExpectation.params == nil { - m.t.Error("Expected call to RepositoryIMock.GetKnowledgeBaseCountByOwner") + if m.GetFilesTotalTokensMock.defaultExpectation != nil && afterGetFilesTotalTokensCounter < 1 { + if m.GetFilesTotalTokensMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.GetFilesTotalTokens") } else { - m.t.Errorf("Expected call to RepositoryIMock.GetKnowledgeBaseCountByOwner with params: %#v", *m.GetKnowledgeBaseCountByOwnerMock.defaultExpectation.params) + m.t.Errorf("Expected call to RepositoryIMock.GetFilesTotalTokens with params: %#v", *m.GetFilesTotalTokensMock.defaultExpectation.params) } } // if func was set then invocations count should be greater than zero - if m.funcGetKnowledgeBaseCountByOwner != nil && afterGetKnowledgeBaseCountByOwnerCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.GetKnowledgeBaseCountByOwner") + if m.funcGetFilesTotalTokens != nil && afterGetFilesTotalTokensCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.GetFilesTotalTokens") } - if !m.GetKnowledgeBaseCountByOwnerMock.invocationsDone() && afterGetKnowledgeBaseCountByOwnerCounter > 0 { - m.t.Errorf("Expected %d calls to RepositoryIMock.GetKnowledgeBaseCountByOwner but found %d calls", - mm_atomic.LoadUint64(&m.GetKnowledgeBaseCountByOwnerMock.expectedInvocations), afterGetKnowledgeBaseCountByOwnerCounter) + if !m.GetFilesTotalTokensMock.invocationsDone() && afterGetFilesTotalTokensCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.GetFilesTotalTokens but found %d calls", + mm_atomic.LoadUint64(&m.GetFilesTotalTokensMock.expectedInvocations), afterGetFilesTotalTokensCounter) } } -type mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs struct { +type mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation - expectations []*RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation + defaultExpectation *RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation + expectations []*RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation - callArgs []*RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParams + callArgs []*RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation specifies expectation struct of the RepositoryI.GetKnowledgeBaseFilesByFileUIDs -type RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation struct { +// RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation specifies expectation struct of the RepositoryI.GetKnowledgeBaseByOwnerAndKbID +type RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation struct { mock *RepositoryIMock - params *RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParams - paramPtrs *RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParamPtrs - results *RepositoryIMockGetKnowledgeBaseFilesByFileUIDsResults + params *RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParams + paramPtrs *RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParamPtrs + results *RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDResults Counter uint64 } -// RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParams contains parameters of the RepositoryI.GetKnowledgeBaseFilesByFileUIDs -type RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParams struct { +// RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParams contains parameters of the RepositoryI.GetKnowledgeBaseByOwnerAndKbID +type RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParams struct { ctx context.Context - fileUIDs []uuid.UUID - columns []string + ownerUID string + kbID string } -// RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParamPtrs contains pointers to parameters of the RepositoryI.GetKnowledgeBaseFilesByFileUIDs -type RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParamPtrs struct { +// RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParamPtrs contains pointers to parameters of the RepositoryI.GetKnowledgeBaseByOwnerAndKbID +type RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParamPtrs struct { ctx *context.Context - fileUIDs *[]uuid.UUID - columns *[]string + ownerUID *string + kbID *string } -// RepositoryIMockGetKnowledgeBaseFilesByFileUIDsResults contains results of the RepositoryI.GetKnowledgeBaseFilesByFileUIDs -type RepositoryIMockGetKnowledgeBaseFilesByFileUIDsResults struct { - ka1 []mm_repository.KnowledgeBaseFile +// RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDResults contains results of the RepositoryI.GetKnowledgeBaseByOwnerAndKbID +type RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDResults struct { + kp1 *mm_repository.KnowledgeBase err error } -// Expect sets up expected params for RepositoryI.GetKnowledgeBaseFilesByFileUIDs -func (mmGetKnowledgeBaseFilesByFileUIDs *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs) Expect(ctx context.Context, fileUIDs []uuid.UUID, columns ...string) *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs { - if mmGetKnowledgeBaseFilesByFileUIDs.mock.funcGetKnowledgeBaseFilesByFileUIDs != nil { - mmGetKnowledgeBaseFilesByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs mock is already set by Set") +// Expect sets up expected params for RepositoryI.GetKnowledgeBaseByOwnerAndKbID +func (mmGetKnowledgeBaseByOwnerAndKbID *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID) Expect(ctx context.Context, ownerUID string, kbID string) *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID { + if mmGetKnowledgeBaseByOwnerAndKbID.mock.funcGetKnowledgeBaseByOwnerAndKbID != nil { + mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID mock is already set by Set") } - if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation == nil { - mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation = &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation{} + if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation == nil { + mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation = &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation{} } - if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.paramPtrs != nil { - mmGetKnowledgeBaseFilesByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs mock is already set by ExpectParams functions") + if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.paramPtrs != nil { + mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID mock is already set by ExpectParams functions") } - mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.params = &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParams{ctx, fileUIDs, columns} - for _, e := range mmGetKnowledgeBaseFilesByFileUIDs.expectations { - if minimock.Equal(e.params, mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.params) { - mmGetKnowledgeBaseFilesByFileUIDs.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.params) + mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.params = &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParams{ctx, ownerUID, kbID} + for _, e := range mmGetKnowledgeBaseByOwnerAndKbID.expectations { + if minimock.Equal(e.params, mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.params) { + mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.params) } } - return mmGetKnowledgeBaseFilesByFileUIDs + return mmGetKnowledgeBaseByOwnerAndKbID } -// ExpectCtxParam1 sets up expected param ctx for RepositoryI.GetKnowledgeBaseFilesByFileUIDs -func (mmGetKnowledgeBaseFilesByFileUIDs *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs { - if mmGetKnowledgeBaseFilesByFileUIDs.mock.funcGetKnowledgeBaseFilesByFileUIDs != nil { - mmGetKnowledgeBaseFilesByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs mock is already set by Set") +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.GetKnowledgeBaseByOwnerAndKbID +func (mmGetKnowledgeBaseByOwnerAndKbID *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID { + if mmGetKnowledgeBaseByOwnerAndKbID.mock.funcGetKnowledgeBaseByOwnerAndKbID != nil { + mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID mock is already set by Set") } - if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation == nil { - mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation = &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation{} + if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation == nil { + mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation = &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation{} } - if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.params != nil { - mmGetKnowledgeBaseFilesByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs mock is already set by Expect") + if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.params != nil { + mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID mock is already set by Expect") } - if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.paramPtrs == nil { - mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.paramPtrs = &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParamPtrs{} + if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.paramPtrs == nil { + mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.paramPtrs = &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParamPtrs{} } - mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.paramPtrs.ctx = &ctx + mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.paramPtrs.ctx = &ctx - return mmGetKnowledgeBaseFilesByFileUIDs + return mmGetKnowledgeBaseByOwnerAndKbID } -// ExpectFileUIDsParam2 sets up expected param fileUIDs for RepositoryI.GetKnowledgeBaseFilesByFileUIDs -func (mmGetKnowledgeBaseFilesByFileUIDs *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs) ExpectFileUIDsParam2(fileUIDs []uuid.UUID) *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs { - if mmGetKnowledgeBaseFilesByFileUIDs.mock.funcGetKnowledgeBaseFilesByFileUIDs != nil { - mmGetKnowledgeBaseFilesByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs mock is already set by Set") +// ExpectOwnerUIDParam2 sets up expected param ownerUID for RepositoryI.GetKnowledgeBaseByOwnerAndKbID +func (mmGetKnowledgeBaseByOwnerAndKbID *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID) ExpectOwnerUIDParam2(ownerUID string) *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID { + if mmGetKnowledgeBaseByOwnerAndKbID.mock.funcGetKnowledgeBaseByOwnerAndKbID != nil { + mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID mock is already set by Set") } - if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation == nil { - mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation = &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation{} + if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation == nil { + mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation = &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation{} } - if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.params != nil { - mmGetKnowledgeBaseFilesByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs mock is already set by Expect") + if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.params != nil { + mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID mock is already set by Expect") } - if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.paramPtrs == nil { - mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.paramPtrs = &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParamPtrs{} + if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.paramPtrs == nil { + mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.paramPtrs = &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParamPtrs{} } - mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.paramPtrs.fileUIDs = &fileUIDs + mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.paramPtrs.ownerUID = &ownerUID - return mmGetKnowledgeBaseFilesByFileUIDs + return mmGetKnowledgeBaseByOwnerAndKbID } -// ExpectColumnsParam3 sets up expected param columns for RepositoryI.GetKnowledgeBaseFilesByFileUIDs -func (mmGetKnowledgeBaseFilesByFileUIDs *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs) ExpectColumnsParam3(columns ...string) *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs { - if mmGetKnowledgeBaseFilesByFileUIDs.mock.funcGetKnowledgeBaseFilesByFileUIDs != nil { - mmGetKnowledgeBaseFilesByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs mock is already set by Set") +// ExpectKbIDParam3 sets up expected param kbID for RepositoryI.GetKnowledgeBaseByOwnerAndKbID +func (mmGetKnowledgeBaseByOwnerAndKbID *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID) ExpectKbIDParam3(kbID string) *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID { + if mmGetKnowledgeBaseByOwnerAndKbID.mock.funcGetKnowledgeBaseByOwnerAndKbID != nil { + mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID mock is already set by Set") } - if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation == nil { - mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation = &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation{} + if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation == nil { + mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation = &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation{} } - if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.params != nil { - mmGetKnowledgeBaseFilesByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs mock is already set by Expect") + if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.params != nil { + mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID mock is already set by Expect") } - if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.paramPtrs == nil { - mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.paramPtrs = &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParamPtrs{} + if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.paramPtrs == nil { + mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.paramPtrs = &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParamPtrs{} } - mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.paramPtrs.columns = &columns + mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.paramPtrs.kbID = &kbID - return mmGetKnowledgeBaseFilesByFileUIDs + return mmGetKnowledgeBaseByOwnerAndKbID } -// Inspect accepts an inspector function that has same arguments as the RepositoryI.GetKnowledgeBaseFilesByFileUIDs -func (mmGetKnowledgeBaseFilesByFileUIDs *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs) Inspect(f func(ctx context.Context, fileUIDs []uuid.UUID, columns ...string)) *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs { - if mmGetKnowledgeBaseFilesByFileUIDs.mock.inspectFuncGetKnowledgeBaseFilesByFileUIDs != nil { - mmGetKnowledgeBaseFilesByFileUIDs.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs") +// Inspect accepts an inspector function that has same arguments as the RepositoryI.GetKnowledgeBaseByOwnerAndKbID +func (mmGetKnowledgeBaseByOwnerAndKbID *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID) Inspect(f func(ctx context.Context, ownerUID string, kbID string)) *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID { + if mmGetKnowledgeBaseByOwnerAndKbID.mock.inspectFuncGetKnowledgeBaseByOwnerAndKbID != nil { + mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID") } - mmGetKnowledgeBaseFilesByFileUIDs.mock.inspectFuncGetKnowledgeBaseFilesByFileUIDs = f + mmGetKnowledgeBaseByOwnerAndKbID.mock.inspectFuncGetKnowledgeBaseByOwnerAndKbID = f - return mmGetKnowledgeBaseFilesByFileUIDs + return mmGetKnowledgeBaseByOwnerAndKbID } -// Return sets up results that will be returned by RepositoryI.GetKnowledgeBaseFilesByFileUIDs -func (mmGetKnowledgeBaseFilesByFileUIDs *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs) Return(ka1 []mm_repository.KnowledgeBaseFile, err error) *RepositoryIMock { - if mmGetKnowledgeBaseFilesByFileUIDs.mock.funcGetKnowledgeBaseFilesByFileUIDs != nil { - mmGetKnowledgeBaseFilesByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs mock is already set by Set") +// Return sets up results that will be returned by RepositoryI.GetKnowledgeBaseByOwnerAndKbID +func (mmGetKnowledgeBaseByOwnerAndKbID *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID) Return(kp1 *mm_repository.KnowledgeBase, err error) *RepositoryIMock { + if mmGetKnowledgeBaseByOwnerAndKbID.mock.funcGetKnowledgeBaseByOwnerAndKbID != nil { + mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID mock is already set by Set") } - if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation == nil { - mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation = &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation{mock: mmGetKnowledgeBaseFilesByFileUIDs.mock} + if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation == nil { + mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation = &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation{mock: mmGetKnowledgeBaseByOwnerAndKbID.mock} } - mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.results = &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsResults{ka1, err} - return mmGetKnowledgeBaseFilesByFileUIDs.mock + mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.results = &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDResults{kp1, err} + return mmGetKnowledgeBaseByOwnerAndKbID.mock } -// Set uses given function f to mock the RepositoryI.GetKnowledgeBaseFilesByFileUIDs method -func (mmGetKnowledgeBaseFilesByFileUIDs *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs) Set(f func(ctx context.Context, fileUIDs []uuid.UUID, columns ...string) (ka1 []mm_repository.KnowledgeBaseFile, err error)) *RepositoryIMock { - if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation != nil { - mmGetKnowledgeBaseFilesByFileUIDs.mock.t.Fatalf("Default expectation is already set for the RepositoryI.GetKnowledgeBaseFilesByFileUIDs method") +// Set uses given function f to mock the RepositoryI.GetKnowledgeBaseByOwnerAndKbID method +func (mmGetKnowledgeBaseByOwnerAndKbID *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID) Set(f func(ctx context.Context, ownerUID string, kbID string) (kp1 *mm_repository.KnowledgeBase, err error)) *RepositoryIMock { + if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation != nil { + mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("Default expectation is already set for the RepositoryI.GetKnowledgeBaseByOwnerAndKbID method") } - if len(mmGetKnowledgeBaseFilesByFileUIDs.expectations) > 0 { - mmGetKnowledgeBaseFilesByFileUIDs.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetKnowledgeBaseFilesByFileUIDs method") + if len(mmGetKnowledgeBaseByOwnerAndKbID.expectations) > 0 { + mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetKnowledgeBaseByOwnerAndKbID method") } - mmGetKnowledgeBaseFilesByFileUIDs.mock.funcGetKnowledgeBaseFilesByFileUIDs = f - return mmGetKnowledgeBaseFilesByFileUIDs.mock + mmGetKnowledgeBaseByOwnerAndKbID.mock.funcGetKnowledgeBaseByOwnerAndKbID = f + return mmGetKnowledgeBaseByOwnerAndKbID.mock } -// When sets expectation for the RepositoryI.GetKnowledgeBaseFilesByFileUIDs which will trigger the result defined by the following +// When sets expectation for the RepositoryI.GetKnowledgeBaseByOwnerAndKbID which will trigger the result defined by the following // Then helper -func (mmGetKnowledgeBaseFilesByFileUIDs *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs) When(ctx context.Context, fileUIDs []uuid.UUID, columns ...string) *RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation { - if mmGetKnowledgeBaseFilesByFileUIDs.mock.funcGetKnowledgeBaseFilesByFileUIDs != nil { - mmGetKnowledgeBaseFilesByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs mock is already set by Set") +func (mmGetKnowledgeBaseByOwnerAndKbID *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID) When(ctx context.Context, ownerUID string, kbID string) *RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation { + if mmGetKnowledgeBaseByOwnerAndKbID.mock.funcGetKnowledgeBaseByOwnerAndKbID != nil { + mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID mock is already set by Set") } - expectation := &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation{ - mock: mmGetKnowledgeBaseFilesByFileUIDs.mock, - params: &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParams{ctx, fileUIDs, columns}, + expectation := &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation{ + mock: mmGetKnowledgeBaseByOwnerAndKbID.mock, + params: &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParams{ctx, ownerUID, kbID}, } - mmGetKnowledgeBaseFilesByFileUIDs.expectations = append(mmGetKnowledgeBaseFilesByFileUIDs.expectations, expectation) + mmGetKnowledgeBaseByOwnerAndKbID.expectations = append(mmGetKnowledgeBaseByOwnerAndKbID.expectations, expectation) return expectation } -// Then sets up RepositoryI.GetKnowledgeBaseFilesByFileUIDs return parameters for the expectation previously defined by the When method -func (e *RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation) Then(ka1 []mm_repository.KnowledgeBaseFile, err error) *RepositoryIMock { - e.results = &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsResults{ka1, err} +// Then sets up RepositoryI.GetKnowledgeBaseByOwnerAndKbID return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation) Then(kp1 *mm_repository.KnowledgeBase, err error) *RepositoryIMock { + e.results = &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDResults{kp1, err} return e.mock } -// Times sets number of times RepositoryI.GetKnowledgeBaseFilesByFileUIDs should be invoked -func (mmGetKnowledgeBaseFilesByFileUIDs *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs) Times(n uint64) *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs { +// Times sets number of times RepositoryI.GetKnowledgeBaseByOwnerAndKbID should be invoked +func (mmGetKnowledgeBaseByOwnerAndKbID *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID) Times(n uint64) *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID { if n == 0 { - mmGetKnowledgeBaseFilesByFileUIDs.mock.t.Fatalf("Times of RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs mock can not be zero") + mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("Times of RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID mock can not be zero") } - mm_atomic.StoreUint64(&mmGetKnowledgeBaseFilesByFileUIDs.expectedInvocations, n) - return mmGetKnowledgeBaseFilesByFileUIDs + mm_atomic.StoreUint64(&mmGetKnowledgeBaseByOwnerAndKbID.expectedInvocations, n) + return mmGetKnowledgeBaseByOwnerAndKbID } -func (mmGetKnowledgeBaseFilesByFileUIDs *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs) invocationsDone() bool { - if len(mmGetKnowledgeBaseFilesByFileUIDs.expectations) == 0 && mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation == nil && mmGetKnowledgeBaseFilesByFileUIDs.mock.funcGetKnowledgeBaseFilesByFileUIDs == nil { +func (mmGetKnowledgeBaseByOwnerAndKbID *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID) invocationsDone() bool { + if len(mmGetKnowledgeBaseByOwnerAndKbID.expectations) == 0 && mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation == nil && mmGetKnowledgeBaseByOwnerAndKbID.mock.funcGetKnowledgeBaseByOwnerAndKbID == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmGetKnowledgeBaseFilesByFileUIDs.mock.afterGetKnowledgeBaseFilesByFileUIDsCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmGetKnowledgeBaseFilesByFileUIDs.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmGetKnowledgeBaseByOwnerAndKbID.mock.afterGetKnowledgeBaseByOwnerAndKbIDCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmGetKnowledgeBaseByOwnerAndKbID.expectedInvocations) return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) } -// GetKnowledgeBaseFilesByFileUIDs implements repository.RepositoryI -func (mmGetKnowledgeBaseFilesByFileUIDs *RepositoryIMock) GetKnowledgeBaseFilesByFileUIDs(ctx context.Context, fileUIDs []uuid.UUID, columns ...string) (ka1 []mm_repository.KnowledgeBaseFile, err error) { - mm_atomic.AddUint64(&mmGetKnowledgeBaseFilesByFileUIDs.beforeGetKnowledgeBaseFilesByFileUIDsCounter, 1) - defer mm_atomic.AddUint64(&mmGetKnowledgeBaseFilesByFileUIDs.afterGetKnowledgeBaseFilesByFileUIDsCounter, 1) +// GetKnowledgeBaseByOwnerAndKbID implements repository.RepositoryI +func (mmGetKnowledgeBaseByOwnerAndKbID *RepositoryIMock) GetKnowledgeBaseByOwnerAndKbID(ctx context.Context, ownerUID string, kbID string) (kp1 *mm_repository.KnowledgeBase, err error) { + mm_atomic.AddUint64(&mmGetKnowledgeBaseByOwnerAndKbID.beforeGetKnowledgeBaseByOwnerAndKbIDCounter, 1) + defer mm_atomic.AddUint64(&mmGetKnowledgeBaseByOwnerAndKbID.afterGetKnowledgeBaseByOwnerAndKbIDCounter, 1) - if mmGetKnowledgeBaseFilesByFileUIDs.inspectFuncGetKnowledgeBaseFilesByFileUIDs != nil { - mmGetKnowledgeBaseFilesByFileUIDs.inspectFuncGetKnowledgeBaseFilesByFileUIDs(ctx, fileUIDs, columns...) + if mmGetKnowledgeBaseByOwnerAndKbID.inspectFuncGetKnowledgeBaseByOwnerAndKbID != nil { + mmGetKnowledgeBaseByOwnerAndKbID.inspectFuncGetKnowledgeBaseByOwnerAndKbID(ctx, ownerUID, kbID) } - mm_params := RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParams{ctx, fileUIDs, columns} + mm_params := RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParams{ctx, ownerUID, kbID} // Record call args - mmGetKnowledgeBaseFilesByFileUIDs.GetKnowledgeBaseFilesByFileUIDsMock.mutex.Lock() - mmGetKnowledgeBaseFilesByFileUIDs.GetKnowledgeBaseFilesByFileUIDsMock.callArgs = append(mmGetKnowledgeBaseFilesByFileUIDs.GetKnowledgeBaseFilesByFileUIDsMock.callArgs, &mm_params) - mmGetKnowledgeBaseFilesByFileUIDs.GetKnowledgeBaseFilesByFileUIDsMock.mutex.Unlock() + mmGetKnowledgeBaseByOwnerAndKbID.GetKnowledgeBaseByOwnerAndKbIDMock.mutex.Lock() + mmGetKnowledgeBaseByOwnerAndKbID.GetKnowledgeBaseByOwnerAndKbIDMock.callArgs = append(mmGetKnowledgeBaseByOwnerAndKbID.GetKnowledgeBaseByOwnerAndKbIDMock.callArgs, &mm_params) + mmGetKnowledgeBaseByOwnerAndKbID.GetKnowledgeBaseByOwnerAndKbIDMock.mutex.Unlock() - for _, e := range mmGetKnowledgeBaseFilesByFileUIDs.GetKnowledgeBaseFilesByFileUIDsMock.expectations { + for _, e := range mmGetKnowledgeBaseByOwnerAndKbID.GetKnowledgeBaseByOwnerAndKbIDMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.ka1, e.results.err + return e.results.kp1, e.results.err } } - if mmGetKnowledgeBaseFilesByFileUIDs.GetKnowledgeBaseFilesByFileUIDsMock.defaultExpectation != nil { - mm_atomic.AddUint64(&mmGetKnowledgeBaseFilesByFileUIDs.GetKnowledgeBaseFilesByFileUIDsMock.defaultExpectation.Counter, 1) - mm_want := mmGetKnowledgeBaseFilesByFileUIDs.GetKnowledgeBaseFilesByFileUIDsMock.defaultExpectation.params - mm_want_ptrs := mmGetKnowledgeBaseFilesByFileUIDs.GetKnowledgeBaseFilesByFileUIDsMock.defaultExpectation.paramPtrs + if mmGetKnowledgeBaseByOwnerAndKbID.GetKnowledgeBaseByOwnerAndKbIDMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmGetKnowledgeBaseByOwnerAndKbID.GetKnowledgeBaseByOwnerAndKbIDMock.defaultExpectation.Counter, 1) + mm_want := mmGetKnowledgeBaseByOwnerAndKbID.GetKnowledgeBaseByOwnerAndKbIDMock.defaultExpectation.params + mm_want_ptrs := mmGetKnowledgeBaseByOwnerAndKbID.GetKnowledgeBaseByOwnerAndKbIDMock.defaultExpectation.paramPtrs - mm_got := RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParams{ctx, fileUIDs, columns} + mm_got := RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParams{ctx, ownerUID, kbID} if mm_want_ptrs != nil { if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { - mmGetKnowledgeBaseFilesByFileUIDs.t.Errorf("RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) + mmGetKnowledgeBaseByOwnerAndKbID.t.Errorf("RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) } - if mm_want_ptrs.fileUIDs != nil && !minimock.Equal(*mm_want_ptrs.fileUIDs, mm_got.fileUIDs) { - mmGetKnowledgeBaseFilesByFileUIDs.t.Errorf("RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs got unexpected parameter fileUIDs, want: %#v, got: %#v%s\n", *mm_want_ptrs.fileUIDs, mm_got.fileUIDs, minimock.Diff(*mm_want_ptrs.fileUIDs, mm_got.fileUIDs)) + if mm_want_ptrs.ownerUID != nil && !minimock.Equal(*mm_want_ptrs.ownerUID, mm_got.ownerUID) { + mmGetKnowledgeBaseByOwnerAndKbID.t.Errorf("RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID got unexpected parameter ownerUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.ownerUID, mm_got.ownerUID, minimock.Diff(*mm_want_ptrs.ownerUID, mm_got.ownerUID)) } - if mm_want_ptrs.columns != nil && !minimock.Equal(*mm_want_ptrs.columns, mm_got.columns) { - mmGetKnowledgeBaseFilesByFileUIDs.t.Errorf("RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs got unexpected parameter columns, want: %#v, got: %#v%s\n", *mm_want_ptrs.columns, mm_got.columns, minimock.Diff(*mm_want_ptrs.columns, mm_got.columns)) + if mm_want_ptrs.kbID != nil && !minimock.Equal(*mm_want_ptrs.kbID, mm_got.kbID) { + mmGetKnowledgeBaseByOwnerAndKbID.t.Errorf("RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID got unexpected parameter kbID, want: %#v, got: %#v%s\n", *mm_want_ptrs.kbID, mm_got.kbID, minimock.Diff(*mm_want_ptrs.kbID, mm_got.kbID)) } } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { - mmGetKnowledgeBaseFilesByFileUIDs.t.Errorf("RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + mmGetKnowledgeBaseByOwnerAndKbID.t.Errorf("RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) } - mm_results := mmGetKnowledgeBaseFilesByFileUIDs.GetKnowledgeBaseFilesByFileUIDsMock.defaultExpectation.results + mm_results := mmGetKnowledgeBaseByOwnerAndKbID.GetKnowledgeBaseByOwnerAndKbIDMock.defaultExpectation.results if mm_results == nil { - mmGetKnowledgeBaseFilesByFileUIDs.t.Fatal("No results are set for the RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs") + mmGetKnowledgeBaseByOwnerAndKbID.t.Fatal("No results are set for the RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID") } - return (*mm_results).ka1, (*mm_results).err + return (*mm_results).kp1, (*mm_results).err } - if mmGetKnowledgeBaseFilesByFileUIDs.funcGetKnowledgeBaseFilesByFileUIDs != nil { - return mmGetKnowledgeBaseFilesByFileUIDs.funcGetKnowledgeBaseFilesByFileUIDs(ctx, fileUIDs, columns...) + if mmGetKnowledgeBaseByOwnerAndKbID.funcGetKnowledgeBaseByOwnerAndKbID != nil { + return mmGetKnowledgeBaseByOwnerAndKbID.funcGetKnowledgeBaseByOwnerAndKbID(ctx, ownerUID, kbID) } - mmGetKnowledgeBaseFilesByFileUIDs.t.Fatalf("Unexpected call to RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs. %v %v %v", ctx, fileUIDs, columns) + mmGetKnowledgeBaseByOwnerAndKbID.t.Fatalf("Unexpected call to RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID. %v %v %v", ctx, ownerUID, kbID) return } -// GetKnowledgeBaseFilesByFileUIDsAfterCounter returns a count of finished RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs invocations -func (mmGetKnowledgeBaseFilesByFileUIDs *RepositoryIMock) GetKnowledgeBaseFilesByFileUIDsAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetKnowledgeBaseFilesByFileUIDs.afterGetKnowledgeBaseFilesByFileUIDsCounter) +// GetKnowledgeBaseByOwnerAndKbIDAfterCounter returns a count of finished RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID invocations +func (mmGetKnowledgeBaseByOwnerAndKbID *RepositoryIMock) GetKnowledgeBaseByOwnerAndKbIDAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetKnowledgeBaseByOwnerAndKbID.afterGetKnowledgeBaseByOwnerAndKbIDCounter) } -// GetKnowledgeBaseFilesByFileUIDsBeforeCounter returns a count of RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs invocations -func (mmGetKnowledgeBaseFilesByFileUIDs *RepositoryIMock) GetKnowledgeBaseFilesByFileUIDsBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetKnowledgeBaseFilesByFileUIDs.beforeGetKnowledgeBaseFilesByFileUIDsCounter) +// GetKnowledgeBaseByOwnerAndKbIDBeforeCounter returns a count of RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID invocations +func (mmGetKnowledgeBaseByOwnerAndKbID *RepositoryIMock) GetKnowledgeBaseByOwnerAndKbIDBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetKnowledgeBaseByOwnerAndKbID.beforeGetKnowledgeBaseByOwnerAndKbIDCounter) } -// Calls returns a list of arguments used in each call to RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs. +// Calls returns a list of arguments used in each call to RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID. // The list is in the same order as the calls were made (i.e. recent calls have a higher index) -func (mmGetKnowledgeBaseFilesByFileUIDs *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs) Calls() []*RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParams { - mmGetKnowledgeBaseFilesByFileUIDs.mutex.RLock() +func (mmGetKnowledgeBaseByOwnerAndKbID *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID) Calls() []*RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParams { + mmGetKnowledgeBaseByOwnerAndKbID.mutex.RLock() - argCopy := make([]*RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParams, len(mmGetKnowledgeBaseFilesByFileUIDs.callArgs)) - copy(argCopy, mmGetKnowledgeBaseFilesByFileUIDs.callArgs) + argCopy := make([]*RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParams, len(mmGetKnowledgeBaseByOwnerAndKbID.callArgs)) + copy(argCopy, mmGetKnowledgeBaseByOwnerAndKbID.callArgs) - mmGetKnowledgeBaseFilesByFileUIDs.mutex.RUnlock() + mmGetKnowledgeBaseByOwnerAndKbID.mutex.RUnlock() return argCopy } -// MinimockGetKnowledgeBaseFilesByFileUIDsDone returns true if the count of the GetKnowledgeBaseFilesByFileUIDs invocations corresponds +// MinimockGetKnowledgeBaseByOwnerAndKbIDDone returns true if the count of the GetKnowledgeBaseByOwnerAndKbID invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockGetKnowledgeBaseFilesByFileUIDsDone() bool { - for _, e := range m.GetKnowledgeBaseFilesByFileUIDsMock.expectations { +func (m *RepositoryIMock) MinimockGetKnowledgeBaseByOwnerAndKbIDDone() bool { + for _, e := range m.GetKnowledgeBaseByOwnerAndKbIDMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.GetKnowledgeBaseFilesByFileUIDsMock.invocationsDone() + return m.GetKnowledgeBaseByOwnerAndKbIDMock.invocationsDone() } -// MinimockGetKnowledgeBaseFilesByFileUIDsInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockGetKnowledgeBaseFilesByFileUIDsInspect() { - for _, e := range m.GetKnowledgeBaseFilesByFileUIDsMock.expectations { +// MinimockGetKnowledgeBaseByOwnerAndKbIDInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockGetKnowledgeBaseByOwnerAndKbIDInspect() { + for _, e := range m.GetKnowledgeBaseByOwnerAndKbIDMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { - m.t.Errorf("Expected call to RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID with params: %#v", *e.params) } } - afterGetKnowledgeBaseFilesByFileUIDsCounter := mm_atomic.LoadUint64(&m.afterGetKnowledgeBaseFilesByFileUIDsCounter) + afterGetKnowledgeBaseByOwnerAndKbIDCounter := mm_atomic.LoadUint64(&m.afterGetKnowledgeBaseByOwnerAndKbIDCounter) // if default expectation was set then invocations count should be greater than zero - if m.GetKnowledgeBaseFilesByFileUIDsMock.defaultExpectation != nil && afterGetKnowledgeBaseFilesByFileUIDsCounter < 1 { - if m.GetKnowledgeBaseFilesByFileUIDsMock.defaultExpectation.params == nil { - m.t.Error("Expected call to RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs") + if m.GetKnowledgeBaseByOwnerAndKbIDMock.defaultExpectation != nil && afterGetKnowledgeBaseByOwnerAndKbIDCounter < 1 { + if m.GetKnowledgeBaseByOwnerAndKbIDMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID") } else { - m.t.Errorf("Expected call to RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs with params: %#v", *m.GetKnowledgeBaseFilesByFileUIDsMock.defaultExpectation.params) + m.t.Errorf("Expected call to RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID with params: %#v", *m.GetKnowledgeBaseByOwnerAndKbIDMock.defaultExpectation.params) } } // if func was set then invocations count should be greater than zero - if m.funcGetKnowledgeBaseFilesByFileUIDs != nil && afterGetKnowledgeBaseFilesByFileUIDsCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs") + if m.funcGetKnowledgeBaseByOwnerAndKbID != nil && afterGetKnowledgeBaseByOwnerAndKbIDCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID") } - if !m.GetKnowledgeBaseFilesByFileUIDsMock.invocationsDone() && afterGetKnowledgeBaseFilesByFileUIDsCounter > 0 { - m.t.Errorf("Expected %d calls to RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs but found %d calls", - mm_atomic.LoadUint64(&m.GetKnowledgeBaseFilesByFileUIDsMock.expectedInvocations), afterGetKnowledgeBaseFilesByFileUIDsCounter) + if !m.GetKnowledgeBaseByOwnerAndKbIDMock.invocationsDone() && afterGetKnowledgeBaseByOwnerAndKbIDCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID but found %d calls", + mm_atomic.LoadUint64(&m.GetKnowledgeBaseByOwnerAndKbIDMock.expectedInvocations), afterGetKnowledgeBaseByOwnerAndKbIDCounter) } } -type mRepositoryIMockGetNeedProcessFiles struct { +type mRepositoryIMockGetKnowledgeBaseCountByOwner struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockGetNeedProcessFilesExpectation - expectations []*RepositoryIMockGetNeedProcessFilesExpectation + defaultExpectation *RepositoryIMockGetKnowledgeBaseCountByOwnerExpectation + expectations []*RepositoryIMockGetKnowledgeBaseCountByOwnerExpectation - callArgs []*RepositoryIMockGetNeedProcessFilesParams + callArgs []*RepositoryIMockGetKnowledgeBaseCountByOwnerParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockGetNeedProcessFilesExpectation specifies expectation struct of the RepositoryI.GetNeedProcessFiles -type RepositoryIMockGetNeedProcessFilesExpectation struct { +// RepositoryIMockGetKnowledgeBaseCountByOwnerExpectation specifies expectation struct of the RepositoryI.GetKnowledgeBaseCountByOwner +type RepositoryIMockGetKnowledgeBaseCountByOwnerExpectation struct { mock *RepositoryIMock - params *RepositoryIMockGetNeedProcessFilesParams - paramPtrs *RepositoryIMockGetNeedProcessFilesParamPtrs - results *RepositoryIMockGetNeedProcessFilesResults + params *RepositoryIMockGetKnowledgeBaseCountByOwnerParams + paramPtrs *RepositoryIMockGetKnowledgeBaseCountByOwnerParamPtrs + results *RepositoryIMockGetKnowledgeBaseCountByOwnerResults Counter uint64 } -// RepositoryIMockGetNeedProcessFilesParams contains parameters of the RepositoryI.GetNeedProcessFiles -type RepositoryIMockGetNeedProcessFilesParams struct { - ctx context.Context +// RepositoryIMockGetKnowledgeBaseCountByOwnerParams contains parameters of the RepositoryI.GetKnowledgeBaseCountByOwner +type RepositoryIMockGetKnowledgeBaseCountByOwnerParams struct { + ctx context.Context + ownerUID string } -// RepositoryIMockGetNeedProcessFilesParamPtrs contains pointers to parameters of the RepositoryI.GetNeedProcessFiles -type RepositoryIMockGetNeedProcessFilesParamPtrs struct { - ctx *context.Context +// RepositoryIMockGetKnowledgeBaseCountByOwnerParamPtrs contains pointers to parameters of the RepositoryI.GetKnowledgeBaseCountByOwner +type RepositoryIMockGetKnowledgeBaseCountByOwnerParamPtrs struct { + ctx *context.Context + ownerUID *string } -// RepositoryIMockGetNeedProcessFilesResults contains results of the RepositoryI.GetNeedProcessFiles -type RepositoryIMockGetNeedProcessFilesResults struct { - ka1 []mm_repository.KnowledgeBaseFile +// RepositoryIMockGetKnowledgeBaseCountByOwnerResults contains results of the RepositoryI.GetKnowledgeBaseCountByOwner +type RepositoryIMockGetKnowledgeBaseCountByOwnerResults struct { + i1 int64 + err error } -// Expect sets up expected params for RepositoryI.GetNeedProcessFiles -func (mmGetNeedProcessFiles *mRepositoryIMockGetNeedProcessFiles) Expect(ctx context.Context) *mRepositoryIMockGetNeedProcessFiles { - if mmGetNeedProcessFiles.mock.funcGetNeedProcessFiles != nil { - mmGetNeedProcessFiles.mock.t.Fatalf("RepositoryIMock.GetNeedProcessFiles mock is already set by Set") +// Expect sets up expected params for RepositoryI.GetKnowledgeBaseCountByOwner +func (mmGetKnowledgeBaseCountByOwner *mRepositoryIMockGetKnowledgeBaseCountByOwner) Expect(ctx context.Context, ownerUID string) *mRepositoryIMockGetKnowledgeBaseCountByOwner { + if mmGetKnowledgeBaseCountByOwner.mock.funcGetKnowledgeBaseCountByOwner != nil { + mmGetKnowledgeBaseCountByOwner.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseCountByOwner mock is already set by Set") } - if mmGetNeedProcessFiles.defaultExpectation == nil { - mmGetNeedProcessFiles.defaultExpectation = &RepositoryIMockGetNeedProcessFilesExpectation{} + if mmGetKnowledgeBaseCountByOwner.defaultExpectation == nil { + mmGetKnowledgeBaseCountByOwner.defaultExpectation = &RepositoryIMockGetKnowledgeBaseCountByOwnerExpectation{} } - if mmGetNeedProcessFiles.defaultExpectation.paramPtrs != nil { - mmGetNeedProcessFiles.mock.t.Fatalf("RepositoryIMock.GetNeedProcessFiles mock is already set by ExpectParams functions") + if mmGetKnowledgeBaseCountByOwner.defaultExpectation.paramPtrs != nil { + mmGetKnowledgeBaseCountByOwner.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseCountByOwner mock is already set by ExpectParams functions") } - mmGetNeedProcessFiles.defaultExpectation.params = &RepositoryIMockGetNeedProcessFilesParams{ctx} - for _, e := range mmGetNeedProcessFiles.expectations { - if minimock.Equal(e.params, mmGetNeedProcessFiles.defaultExpectation.params) { - mmGetNeedProcessFiles.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetNeedProcessFiles.defaultExpectation.params) + mmGetKnowledgeBaseCountByOwner.defaultExpectation.params = &RepositoryIMockGetKnowledgeBaseCountByOwnerParams{ctx, ownerUID} + for _, e := range mmGetKnowledgeBaseCountByOwner.expectations { + if minimock.Equal(e.params, mmGetKnowledgeBaseCountByOwner.defaultExpectation.params) { + mmGetKnowledgeBaseCountByOwner.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetKnowledgeBaseCountByOwner.defaultExpectation.params) } } - return mmGetNeedProcessFiles + return mmGetKnowledgeBaseCountByOwner } -// ExpectCtxParam1 sets up expected param ctx for RepositoryI.GetNeedProcessFiles -func (mmGetNeedProcessFiles *mRepositoryIMockGetNeedProcessFiles) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockGetNeedProcessFiles { - if mmGetNeedProcessFiles.mock.funcGetNeedProcessFiles != nil { - mmGetNeedProcessFiles.mock.t.Fatalf("RepositoryIMock.GetNeedProcessFiles mock is already set by Set") +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.GetKnowledgeBaseCountByOwner +func (mmGetKnowledgeBaseCountByOwner *mRepositoryIMockGetKnowledgeBaseCountByOwner) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockGetKnowledgeBaseCountByOwner { + if mmGetKnowledgeBaseCountByOwner.mock.funcGetKnowledgeBaseCountByOwner != nil { + mmGetKnowledgeBaseCountByOwner.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseCountByOwner mock is already set by Set") } - if mmGetNeedProcessFiles.defaultExpectation == nil { - mmGetNeedProcessFiles.defaultExpectation = &RepositoryIMockGetNeedProcessFilesExpectation{} + if mmGetKnowledgeBaseCountByOwner.defaultExpectation == nil { + mmGetKnowledgeBaseCountByOwner.defaultExpectation = &RepositoryIMockGetKnowledgeBaseCountByOwnerExpectation{} } - if mmGetNeedProcessFiles.defaultExpectation.params != nil { - mmGetNeedProcessFiles.mock.t.Fatalf("RepositoryIMock.GetNeedProcessFiles mock is already set by Expect") + if mmGetKnowledgeBaseCountByOwner.defaultExpectation.params != nil { + mmGetKnowledgeBaseCountByOwner.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseCountByOwner mock is already set by Expect") } - if mmGetNeedProcessFiles.defaultExpectation.paramPtrs == nil { - mmGetNeedProcessFiles.defaultExpectation.paramPtrs = &RepositoryIMockGetNeedProcessFilesParamPtrs{} + if mmGetKnowledgeBaseCountByOwner.defaultExpectation.paramPtrs == nil { + mmGetKnowledgeBaseCountByOwner.defaultExpectation.paramPtrs = &RepositoryIMockGetKnowledgeBaseCountByOwnerParamPtrs{} } - mmGetNeedProcessFiles.defaultExpectation.paramPtrs.ctx = &ctx + mmGetKnowledgeBaseCountByOwner.defaultExpectation.paramPtrs.ctx = &ctx - return mmGetNeedProcessFiles + return mmGetKnowledgeBaseCountByOwner } -// Inspect accepts an inspector function that has same arguments as the RepositoryI.GetNeedProcessFiles -func (mmGetNeedProcessFiles *mRepositoryIMockGetNeedProcessFiles) Inspect(f func(ctx context.Context)) *mRepositoryIMockGetNeedProcessFiles { - if mmGetNeedProcessFiles.mock.inspectFuncGetNeedProcessFiles != nil { - mmGetNeedProcessFiles.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.GetNeedProcessFiles") +// ExpectOwnerUIDParam2 sets up expected param ownerUID for RepositoryI.GetKnowledgeBaseCountByOwner +func (mmGetKnowledgeBaseCountByOwner *mRepositoryIMockGetKnowledgeBaseCountByOwner) ExpectOwnerUIDParam2(ownerUID string) *mRepositoryIMockGetKnowledgeBaseCountByOwner { + if mmGetKnowledgeBaseCountByOwner.mock.funcGetKnowledgeBaseCountByOwner != nil { + mmGetKnowledgeBaseCountByOwner.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseCountByOwner mock is already set by Set") } - mmGetNeedProcessFiles.mock.inspectFuncGetNeedProcessFiles = f + if mmGetKnowledgeBaseCountByOwner.defaultExpectation == nil { + mmGetKnowledgeBaseCountByOwner.defaultExpectation = &RepositoryIMockGetKnowledgeBaseCountByOwnerExpectation{} + } - return mmGetNeedProcessFiles + if mmGetKnowledgeBaseCountByOwner.defaultExpectation.params != nil { + mmGetKnowledgeBaseCountByOwner.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseCountByOwner mock is already set by Expect") + } + + if mmGetKnowledgeBaseCountByOwner.defaultExpectation.paramPtrs == nil { + mmGetKnowledgeBaseCountByOwner.defaultExpectation.paramPtrs = &RepositoryIMockGetKnowledgeBaseCountByOwnerParamPtrs{} + } + mmGetKnowledgeBaseCountByOwner.defaultExpectation.paramPtrs.ownerUID = &ownerUID + + return mmGetKnowledgeBaseCountByOwner } -// Return sets up results that will be returned by RepositoryI.GetNeedProcessFiles -func (mmGetNeedProcessFiles *mRepositoryIMockGetNeedProcessFiles) Return(ka1 []mm_repository.KnowledgeBaseFile) *RepositoryIMock { - if mmGetNeedProcessFiles.mock.funcGetNeedProcessFiles != nil { - mmGetNeedProcessFiles.mock.t.Fatalf("RepositoryIMock.GetNeedProcessFiles mock is already set by Set") +// Inspect accepts an inspector function that has same arguments as the RepositoryI.GetKnowledgeBaseCountByOwner +func (mmGetKnowledgeBaseCountByOwner *mRepositoryIMockGetKnowledgeBaseCountByOwner) Inspect(f func(ctx context.Context, ownerUID string)) *mRepositoryIMockGetKnowledgeBaseCountByOwner { + if mmGetKnowledgeBaseCountByOwner.mock.inspectFuncGetKnowledgeBaseCountByOwner != nil { + mmGetKnowledgeBaseCountByOwner.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.GetKnowledgeBaseCountByOwner") } - if mmGetNeedProcessFiles.defaultExpectation == nil { - mmGetNeedProcessFiles.defaultExpectation = &RepositoryIMockGetNeedProcessFilesExpectation{mock: mmGetNeedProcessFiles.mock} + mmGetKnowledgeBaseCountByOwner.mock.inspectFuncGetKnowledgeBaseCountByOwner = f + + return mmGetKnowledgeBaseCountByOwner +} + +// Return sets up results that will be returned by RepositoryI.GetKnowledgeBaseCountByOwner +func (mmGetKnowledgeBaseCountByOwner *mRepositoryIMockGetKnowledgeBaseCountByOwner) Return(i1 int64, err error) *RepositoryIMock { + if mmGetKnowledgeBaseCountByOwner.mock.funcGetKnowledgeBaseCountByOwner != nil { + mmGetKnowledgeBaseCountByOwner.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseCountByOwner mock is already set by Set") } - mmGetNeedProcessFiles.defaultExpectation.results = &RepositoryIMockGetNeedProcessFilesResults{ka1} - return mmGetNeedProcessFiles.mock + + if mmGetKnowledgeBaseCountByOwner.defaultExpectation == nil { + mmGetKnowledgeBaseCountByOwner.defaultExpectation = &RepositoryIMockGetKnowledgeBaseCountByOwnerExpectation{mock: mmGetKnowledgeBaseCountByOwner.mock} + } + mmGetKnowledgeBaseCountByOwner.defaultExpectation.results = &RepositoryIMockGetKnowledgeBaseCountByOwnerResults{i1, err} + return mmGetKnowledgeBaseCountByOwner.mock } -// Set uses given function f to mock the RepositoryI.GetNeedProcessFiles method -func (mmGetNeedProcessFiles *mRepositoryIMockGetNeedProcessFiles) Set(f func(ctx context.Context) (ka1 []mm_repository.KnowledgeBaseFile)) *RepositoryIMock { - if mmGetNeedProcessFiles.defaultExpectation != nil { - mmGetNeedProcessFiles.mock.t.Fatalf("Default expectation is already set for the RepositoryI.GetNeedProcessFiles method") +// Set uses given function f to mock the RepositoryI.GetKnowledgeBaseCountByOwner method +func (mmGetKnowledgeBaseCountByOwner *mRepositoryIMockGetKnowledgeBaseCountByOwner) Set(f func(ctx context.Context, ownerUID string) (i1 int64, err error)) *RepositoryIMock { + if mmGetKnowledgeBaseCountByOwner.defaultExpectation != nil { + mmGetKnowledgeBaseCountByOwner.mock.t.Fatalf("Default expectation is already set for the RepositoryI.GetKnowledgeBaseCountByOwner method") } - if len(mmGetNeedProcessFiles.expectations) > 0 { - mmGetNeedProcessFiles.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetNeedProcessFiles method") + if len(mmGetKnowledgeBaseCountByOwner.expectations) > 0 { + mmGetKnowledgeBaseCountByOwner.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetKnowledgeBaseCountByOwner method") } - mmGetNeedProcessFiles.mock.funcGetNeedProcessFiles = f - return mmGetNeedProcessFiles.mock + mmGetKnowledgeBaseCountByOwner.mock.funcGetKnowledgeBaseCountByOwner = f + return mmGetKnowledgeBaseCountByOwner.mock } -// When sets expectation for the RepositoryI.GetNeedProcessFiles which will trigger the result defined by the following +// When sets expectation for the RepositoryI.GetKnowledgeBaseCountByOwner which will trigger the result defined by the following // Then helper -func (mmGetNeedProcessFiles *mRepositoryIMockGetNeedProcessFiles) When(ctx context.Context) *RepositoryIMockGetNeedProcessFilesExpectation { - if mmGetNeedProcessFiles.mock.funcGetNeedProcessFiles != nil { - mmGetNeedProcessFiles.mock.t.Fatalf("RepositoryIMock.GetNeedProcessFiles mock is already set by Set") +func (mmGetKnowledgeBaseCountByOwner *mRepositoryIMockGetKnowledgeBaseCountByOwner) When(ctx context.Context, ownerUID string) *RepositoryIMockGetKnowledgeBaseCountByOwnerExpectation { + if mmGetKnowledgeBaseCountByOwner.mock.funcGetKnowledgeBaseCountByOwner != nil { + mmGetKnowledgeBaseCountByOwner.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseCountByOwner mock is already set by Set") } - expectation := &RepositoryIMockGetNeedProcessFilesExpectation{ - mock: mmGetNeedProcessFiles.mock, - params: &RepositoryIMockGetNeedProcessFilesParams{ctx}, + expectation := &RepositoryIMockGetKnowledgeBaseCountByOwnerExpectation{ + mock: mmGetKnowledgeBaseCountByOwner.mock, + params: &RepositoryIMockGetKnowledgeBaseCountByOwnerParams{ctx, ownerUID}, } - mmGetNeedProcessFiles.expectations = append(mmGetNeedProcessFiles.expectations, expectation) + mmGetKnowledgeBaseCountByOwner.expectations = append(mmGetKnowledgeBaseCountByOwner.expectations, expectation) return expectation } -// Then sets up RepositoryI.GetNeedProcessFiles return parameters for the expectation previously defined by the When method -func (e *RepositoryIMockGetNeedProcessFilesExpectation) Then(ka1 []mm_repository.KnowledgeBaseFile) *RepositoryIMock { - e.results = &RepositoryIMockGetNeedProcessFilesResults{ka1} +// Then sets up RepositoryI.GetKnowledgeBaseCountByOwner return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockGetKnowledgeBaseCountByOwnerExpectation) Then(i1 int64, err error) *RepositoryIMock { + e.results = &RepositoryIMockGetKnowledgeBaseCountByOwnerResults{i1, err} return e.mock } -// Times sets number of times RepositoryI.GetNeedProcessFiles should be invoked -func (mmGetNeedProcessFiles *mRepositoryIMockGetNeedProcessFiles) Times(n uint64) *mRepositoryIMockGetNeedProcessFiles { +// Times sets number of times RepositoryI.GetKnowledgeBaseCountByOwner should be invoked +func (mmGetKnowledgeBaseCountByOwner *mRepositoryIMockGetKnowledgeBaseCountByOwner) Times(n uint64) *mRepositoryIMockGetKnowledgeBaseCountByOwner { if n == 0 { - mmGetNeedProcessFiles.mock.t.Fatalf("Times of RepositoryIMock.GetNeedProcessFiles mock can not be zero") + mmGetKnowledgeBaseCountByOwner.mock.t.Fatalf("Times of RepositoryIMock.GetKnowledgeBaseCountByOwner mock can not be zero") } - mm_atomic.StoreUint64(&mmGetNeedProcessFiles.expectedInvocations, n) - return mmGetNeedProcessFiles + mm_atomic.StoreUint64(&mmGetKnowledgeBaseCountByOwner.expectedInvocations, n) + return mmGetKnowledgeBaseCountByOwner } -func (mmGetNeedProcessFiles *mRepositoryIMockGetNeedProcessFiles) invocationsDone() bool { - if len(mmGetNeedProcessFiles.expectations) == 0 && mmGetNeedProcessFiles.defaultExpectation == nil && mmGetNeedProcessFiles.mock.funcGetNeedProcessFiles == nil { +func (mmGetKnowledgeBaseCountByOwner *mRepositoryIMockGetKnowledgeBaseCountByOwner) invocationsDone() bool { + if len(mmGetKnowledgeBaseCountByOwner.expectations) == 0 && mmGetKnowledgeBaseCountByOwner.defaultExpectation == nil && mmGetKnowledgeBaseCountByOwner.mock.funcGetKnowledgeBaseCountByOwner == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmGetNeedProcessFiles.mock.afterGetNeedProcessFilesCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmGetNeedProcessFiles.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmGetKnowledgeBaseCountByOwner.mock.afterGetKnowledgeBaseCountByOwnerCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmGetKnowledgeBaseCountByOwner.expectedInvocations) return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) } -// GetNeedProcessFiles implements repository.RepositoryI -func (mmGetNeedProcessFiles *RepositoryIMock) GetNeedProcessFiles(ctx context.Context) (ka1 []mm_repository.KnowledgeBaseFile) { - mm_atomic.AddUint64(&mmGetNeedProcessFiles.beforeGetNeedProcessFilesCounter, 1) - defer mm_atomic.AddUint64(&mmGetNeedProcessFiles.afterGetNeedProcessFilesCounter, 1) +// GetKnowledgeBaseCountByOwner implements repository.RepositoryI +func (mmGetKnowledgeBaseCountByOwner *RepositoryIMock) GetKnowledgeBaseCountByOwner(ctx context.Context, ownerUID string) (i1 int64, err error) { + mm_atomic.AddUint64(&mmGetKnowledgeBaseCountByOwner.beforeGetKnowledgeBaseCountByOwnerCounter, 1) + defer mm_atomic.AddUint64(&mmGetKnowledgeBaseCountByOwner.afterGetKnowledgeBaseCountByOwnerCounter, 1) - if mmGetNeedProcessFiles.inspectFuncGetNeedProcessFiles != nil { - mmGetNeedProcessFiles.inspectFuncGetNeedProcessFiles(ctx) + if mmGetKnowledgeBaseCountByOwner.inspectFuncGetKnowledgeBaseCountByOwner != nil { + mmGetKnowledgeBaseCountByOwner.inspectFuncGetKnowledgeBaseCountByOwner(ctx, ownerUID) } - mm_params := RepositoryIMockGetNeedProcessFilesParams{ctx} + mm_params := RepositoryIMockGetKnowledgeBaseCountByOwnerParams{ctx, ownerUID} // Record call args - mmGetNeedProcessFiles.GetNeedProcessFilesMock.mutex.Lock() - mmGetNeedProcessFiles.GetNeedProcessFilesMock.callArgs = append(mmGetNeedProcessFiles.GetNeedProcessFilesMock.callArgs, &mm_params) - mmGetNeedProcessFiles.GetNeedProcessFilesMock.mutex.Unlock() + mmGetKnowledgeBaseCountByOwner.GetKnowledgeBaseCountByOwnerMock.mutex.Lock() + mmGetKnowledgeBaseCountByOwner.GetKnowledgeBaseCountByOwnerMock.callArgs = append(mmGetKnowledgeBaseCountByOwner.GetKnowledgeBaseCountByOwnerMock.callArgs, &mm_params) + mmGetKnowledgeBaseCountByOwner.GetKnowledgeBaseCountByOwnerMock.mutex.Unlock() - for _, e := range mmGetNeedProcessFiles.GetNeedProcessFilesMock.expectations { + for _, e := range mmGetKnowledgeBaseCountByOwner.GetKnowledgeBaseCountByOwnerMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.ka1 + return e.results.i1, e.results.err } } - if mmGetNeedProcessFiles.GetNeedProcessFilesMock.defaultExpectation != nil { - mm_atomic.AddUint64(&mmGetNeedProcessFiles.GetNeedProcessFilesMock.defaultExpectation.Counter, 1) - mm_want := mmGetNeedProcessFiles.GetNeedProcessFilesMock.defaultExpectation.params - mm_want_ptrs := mmGetNeedProcessFiles.GetNeedProcessFilesMock.defaultExpectation.paramPtrs + if mmGetKnowledgeBaseCountByOwner.GetKnowledgeBaseCountByOwnerMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmGetKnowledgeBaseCountByOwner.GetKnowledgeBaseCountByOwnerMock.defaultExpectation.Counter, 1) + mm_want := mmGetKnowledgeBaseCountByOwner.GetKnowledgeBaseCountByOwnerMock.defaultExpectation.params + mm_want_ptrs := mmGetKnowledgeBaseCountByOwner.GetKnowledgeBaseCountByOwnerMock.defaultExpectation.paramPtrs - mm_got := RepositoryIMockGetNeedProcessFilesParams{ctx} + mm_got := RepositoryIMockGetKnowledgeBaseCountByOwnerParams{ctx, ownerUID} if mm_want_ptrs != nil { if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { - mmGetNeedProcessFiles.t.Errorf("RepositoryIMock.GetNeedProcessFiles got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) + mmGetKnowledgeBaseCountByOwner.t.Errorf("RepositoryIMock.GetKnowledgeBaseCountByOwner got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) + } + + if mm_want_ptrs.ownerUID != nil && !minimock.Equal(*mm_want_ptrs.ownerUID, mm_got.ownerUID) { + mmGetKnowledgeBaseCountByOwner.t.Errorf("RepositoryIMock.GetKnowledgeBaseCountByOwner got unexpected parameter ownerUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.ownerUID, mm_got.ownerUID, minimock.Diff(*mm_want_ptrs.ownerUID, mm_got.ownerUID)) } } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { - mmGetNeedProcessFiles.t.Errorf("RepositoryIMock.GetNeedProcessFiles got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + mmGetKnowledgeBaseCountByOwner.t.Errorf("RepositoryIMock.GetKnowledgeBaseCountByOwner got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) } - mm_results := mmGetNeedProcessFiles.GetNeedProcessFilesMock.defaultExpectation.results + mm_results := mmGetKnowledgeBaseCountByOwner.GetKnowledgeBaseCountByOwnerMock.defaultExpectation.results if mm_results == nil { - mmGetNeedProcessFiles.t.Fatal("No results are set for the RepositoryIMock.GetNeedProcessFiles") + mmGetKnowledgeBaseCountByOwner.t.Fatal("No results are set for the RepositoryIMock.GetKnowledgeBaseCountByOwner") } - return (*mm_results).ka1 + return (*mm_results).i1, (*mm_results).err } - if mmGetNeedProcessFiles.funcGetNeedProcessFiles != nil { - return mmGetNeedProcessFiles.funcGetNeedProcessFiles(ctx) + if mmGetKnowledgeBaseCountByOwner.funcGetKnowledgeBaseCountByOwner != nil { + return mmGetKnowledgeBaseCountByOwner.funcGetKnowledgeBaseCountByOwner(ctx, ownerUID) } - mmGetNeedProcessFiles.t.Fatalf("Unexpected call to RepositoryIMock.GetNeedProcessFiles. %v", ctx) + mmGetKnowledgeBaseCountByOwner.t.Fatalf("Unexpected call to RepositoryIMock.GetKnowledgeBaseCountByOwner. %v %v", ctx, ownerUID) return } -// GetNeedProcessFilesAfterCounter returns a count of finished RepositoryIMock.GetNeedProcessFiles invocations -func (mmGetNeedProcessFiles *RepositoryIMock) GetNeedProcessFilesAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetNeedProcessFiles.afterGetNeedProcessFilesCounter) +// GetKnowledgeBaseCountByOwnerAfterCounter returns a count of finished RepositoryIMock.GetKnowledgeBaseCountByOwner invocations +func (mmGetKnowledgeBaseCountByOwner *RepositoryIMock) GetKnowledgeBaseCountByOwnerAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetKnowledgeBaseCountByOwner.afterGetKnowledgeBaseCountByOwnerCounter) } -// GetNeedProcessFilesBeforeCounter returns a count of RepositoryIMock.GetNeedProcessFiles invocations -func (mmGetNeedProcessFiles *RepositoryIMock) GetNeedProcessFilesBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetNeedProcessFiles.beforeGetNeedProcessFilesCounter) +// GetKnowledgeBaseCountByOwnerBeforeCounter returns a count of RepositoryIMock.GetKnowledgeBaseCountByOwner invocations +func (mmGetKnowledgeBaseCountByOwner *RepositoryIMock) GetKnowledgeBaseCountByOwnerBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetKnowledgeBaseCountByOwner.beforeGetKnowledgeBaseCountByOwnerCounter) } -// Calls returns a list of arguments used in each call to RepositoryIMock.GetNeedProcessFiles. +// Calls returns a list of arguments used in each call to RepositoryIMock.GetKnowledgeBaseCountByOwner. // The list is in the same order as the calls were made (i.e. recent calls have a higher index) -func (mmGetNeedProcessFiles *mRepositoryIMockGetNeedProcessFiles) Calls() []*RepositoryIMockGetNeedProcessFilesParams { - mmGetNeedProcessFiles.mutex.RLock() +func (mmGetKnowledgeBaseCountByOwner *mRepositoryIMockGetKnowledgeBaseCountByOwner) Calls() []*RepositoryIMockGetKnowledgeBaseCountByOwnerParams { + mmGetKnowledgeBaseCountByOwner.mutex.RLock() - argCopy := make([]*RepositoryIMockGetNeedProcessFilesParams, len(mmGetNeedProcessFiles.callArgs)) - copy(argCopy, mmGetNeedProcessFiles.callArgs) + argCopy := make([]*RepositoryIMockGetKnowledgeBaseCountByOwnerParams, len(mmGetKnowledgeBaseCountByOwner.callArgs)) + copy(argCopy, mmGetKnowledgeBaseCountByOwner.callArgs) - mmGetNeedProcessFiles.mutex.RUnlock() + mmGetKnowledgeBaseCountByOwner.mutex.RUnlock() return argCopy } -// MinimockGetNeedProcessFilesDone returns true if the count of the GetNeedProcessFiles invocations corresponds +// MinimockGetKnowledgeBaseCountByOwnerDone returns true if the count of the GetKnowledgeBaseCountByOwner invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockGetNeedProcessFilesDone() bool { - for _, e := range m.GetNeedProcessFilesMock.expectations { +func (m *RepositoryIMock) MinimockGetKnowledgeBaseCountByOwnerDone() bool { + for _, e := range m.GetKnowledgeBaseCountByOwnerMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.GetNeedProcessFilesMock.invocationsDone() + return m.GetKnowledgeBaseCountByOwnerMock.invocationsDone() } -// MinimockGetNeedProcessFilesInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockGetNeedProcessFilesInspect() { - for _, e := range m.GetNeedProcessFilesMock.expectations { +// MinimockGetKnowledgeBaseCountByOwnerInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockGetKnowledgeBaseCountByOwnerInspect() { + for _, e := range m.GetKnowledgeBaseCountByOwnerMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { - m.t.Errorf("Expected call to RepositoryIMock.GetNeedProcessFiles with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.GetKnowledgeBaseCountByOwner with params: %#v", *e.params) } } - afterGetNeedProcessFilesCounter := mm_atomic.LoadUint64(&m.afterGetNeedProcessFilesCounter) + afterGetKnowledgeBaseCountByOwnerCounter := mm_atomic.LoadUint64(&m.afterGetKnowledgeBaseCountByOwnerCounter) // if default expectation was set then invocations count should be greater than zero - if m.GetNeedProcessFilesMock.defaultExpectation != nil && afterGetNeedProcessFilesCounter < 1 { - if m.GetNeedProcessFilesMock.defaultExpectation.params == nil { - m.t.Error("Expected call to RepositoryIMock.GetNeedProcessFiles") + if m.GetKnowledgeBaseCountByOwnerMock.defaultExpectation != nil && afterGetKnowledgeBaseCountByOwnerCounter < 1 { + if m.GetKnowledgeBaseCountByOwnerMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.GetKnowledgeBaseCountByOwner") } else { - m.t.Errorf("Expected call to RepositoryIMock.GetNeedProcessFiles with params: %#v", *m.GetNeedProcessFilesMock.defaultExpectation.params) + m.t.Errorf("Expected call to RepositoryIMock.GetKnowledgeBaseCountByOwner with params: %#v", *m.GetKnowledgeBaseCountByOwnerMock.defaultExpectation.params) } } // if func was set then invocations count should be greater than zero - if m.funcGetNeedProcessFiles != nil && afterGetNeedProcessFilesCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.GetNeedProcessFiles") + if m.funcGetKnowledgeBaseCountByOwner != nil && afterGetKnowledgeBaseCountByOwnerCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.GetKnowledgeBaseCountByOwner") } - if !m.GetNeedProcessFilesMock.invocationsDone() && afterGetNeedProcessFilesCounter > 0 { - m.t.Errorf("Expected %d calls to RepositoryIMock.GetNeedProcessFiles but found %d calls", - mm_atomic.LoadUint64(&m.GetNeedProcessFilesMock.expectedInvocations), afterGetNeedProcessFilesCounter) + if !m.GetKnowledgeBaseCountByOwnerMock.invocationsDone() && afterGetKnowledgeBaseCountByOwnerCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.GetKnowledgeBaseCountByOwner but found %d calls", + mm_atomic.LoadUint64(&m.GetKnowledgeBaseCountByOwnerMock.expectedInvocations), afterGetKnowledgeBaseCountByOwnerCounter) } } -type mRepositoryIMockGetRepositoryTag struct { +type mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockGetRepositoryTagExpectation - expectations []*RepositoryIMockGetRepositoryTagExpectation + defaultExpectation *RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation + expectations []*RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation - callArgs []*RepositoryIMockGetRepositoryTagParams + callArgs []*RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockGetRepositoryTagExpectation specifies expectation struct of the RepositoryI.GetRepositoryTag -type RepositoryIMockGetRepositoryTagExpectation struct { +// RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation specifies expectation struct of the RepositoryI.GetKnowledgeBaseFilesByFileUIDs +type RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation struct { mock *RepositoryIMock - params *RepositoryIMockGetRepositoryTagParams - paramPtrs *RepositoryIMockGetRepositoryTagParamPtrs - results *RepositoryIMockGetRepositoryTagResults + params *RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParams + paramPtrs *RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParamPtrs + results *RepositoryIMockGetKnowledgeBaseFilesByFileUIDsResults Counter uint64 } -// RepositoryIMockGetRepositoryTagParams contains parameters of the RepositoryI.GetRepositoryTag -type RepositoryIMockGetRepositoryTagParams struct { - ctx context.Context - r1 utils.RepositoryTagName +// RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParams contains parameters of the RepositoryI.GetKnowledgeBaseFilesByFileUIDs +type RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParams struct { + ctx context.Context + fileUIDs []uuid.UUID + columns []string } -// RepositoryIMockGetRepositoryTagParamPtrs contains pointers to parameters of the RepositoryI.GetRepositoryTag -type RepositoryIMockGetRepositoryTagParamPtrs struct { - ctx *context.Context - r1 *utils.RepositoryTagName +// RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParamPtrs contains pointers to parameters of the RepositoryI.GetKnowledgeBaseFilesByFileUIDs +type RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParamPtrs struct { + ctx *context.Context + fileUIDs *[]uuid.UUID + columns *[]string } -// RepositoryIMockGetRepositoryTagResults contains results of the RepositoryI.GetRepositoryTag -type RepositoryIMockGetRepositoryTagResults struct { - rp1 *pb.RepositoryTag +// RepositoryIMockGetKnowledgeBaseFilesByFileUIDsResults contains results of the RepositoryI.GetKnowledgeBaseFilesByFileUIDs +type RepositoryIMockGetKnowledgeBaseFilesByFileUIDsResults struct { + ka1 []mm_repository.KnowledgeBaseFile err error } -// Expect sets up expected params for RepositoryI.GetRepositoryTag -func (mmGetRepositoryTag *mRepositoryIMockGetRepositoryTag) Expect(ctx context.Context, r1 utils.RepositoryTagName) *mRepositoryIMockGetRepositoryTag { - if mmGetRepositoryTag.mock.funcGetRepositoryTag != nil { - mmGetRepositoryTag.mock.t.Fatalf("RepositoryIMock.GetRepositoryTag mock is already set by Set") +// Expect sets up expected params for RepositoryI.GetKnowledgeBaseFilesByFileUIDs +func (mmGetKnowledgeBaseFilesByFileUIDs *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs) Expect(ctx context.Context, fileUIDs []uuid.UUID, columns ...string) *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs { + if mmGetKnowledgeBaseFilesByFileUIDs.mock.funcGetKnowledgeBaseFilesByFileUIDs != nil { + mmGetKnowledgeBaseFilesByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs mock is already set by Set") } - if mmGetRepositoryTag.defaultExpectation == nil { - mmGetRepositoryTag.defaultExpectation = &RepositoryIMockGetRepositoryTagExpectation{} + if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation == nil { + mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation = &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation{} } - if mmGetRepositoryTag.defaultExpectation.paramPtrs != nil { - mmGetRepositoryTag.mock.t.Fatalf("RepositoryIMock.GetRepositoryTag mock is already set by ExpectParams functions") + if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.paramPtrs != nil { + mmGetKnowledgeBaseFilesByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs mock is already set by ExpectParams functions") } - mmGetRepositoryTag.defaultExpectation.params = &RepositoryIMockGetRepositoryTagParams{ctx, r1} - for _, e := range mmGetRepositoryTag.expectations { - if minimock.Equal(e.params, mmGetRepositoryTag.defaultExpectation.params) { - mmGetRepositoryTag.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetRepositoryTag.defaultExpectation.params) + mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.params = &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParams{ctx, fileUIDs, columns} + for _, e := range mmGetKnowledgeBaseFilesByFileUIDs.expectations { + if minimock.Equal(e.params, mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.params) { + mmGetKnowledgeBaseFilesByFileUIDs.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.params) } } - return mmGetRepositoryTag + return mmGetKnowledgeBaseFilesByFileUIDs } -// ExpectCtxParam1 sets up expected param ctx for RepositoryI.GetRepositoryTag -func (mmGetRepositoryTag *mRepositoryIMockGetRepositoryTag) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockGetRepositoryTag { - if mmGetRepositoryTag.mock.funcGetRepositoryTag != nil { - mmGetRepositoryTag.mock.t.Fatalf("RepositoryIMock.GetRepositoryTag mock is already set by Set") +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.GetKnowledgeBaseFilesByFileUIDs +func (mmGetKnowledgeBaseFilesByFileUIDs *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs { + if mmGetKnowledgeBaseFilesByFileUIDs.mock.funcGetKnowledgeBaseFilesByFileUIDs != nil { + mmGetKnowledgeBaseFilesByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs mock is already set by Set") } - if mmGetRepositoryTag.defaultExpectation == nil { - mmGetRepositoryTag.defaultExpectation = &RepositoryIMockGetRepositoryTagExpectation{} + if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation == nil { + mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation = &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation{} } - if mmGetRepositoryTag.defaultExpectation.params != nil { - mmGetRepositoryTag.mock.t.Fatalf("RepositoryIMock.GetRepositoryTag mock is already set by Expect") + if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.params != nil { + mmGetKnowledgeBaseFilesByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs mock is already set by Expect") } - if mmGetRepositoryTag.defaultExpectation.paramPtrs == nil { - mmGetRepositoryTag.defaultExpectation.paramPtrs = &RepositoryIMockGetRepositoryTagParamPtrs{} + if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.paramPtrs == nil { + mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.paramPtrs = &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParamPtrs{} } - mmGetRepositoryTag.defaultExpectation.paramPtrs.ctx = &ctx + mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.paramPtrs.ctx = &ctx - return mmGetRepositoryTag + return mmGetKnowledgeBaseFilesByFileUIDs } -// ExpectR1Param2 sets up expected param r1 for RepositoryI.GetRepositoryTag -func (mmGetRepositoryTag *mRepositoryIMockGetRepositoryTag) ExpectR1Param2(r1 utils.RepositoryTagName) *mRepositoryIMockGetRepositoryTag { - if mmGetRepositoryTag.mock.funcGetRepositoryTag != nil { - mmGetRepositoryTag.mock.t.Fatalf("RepositoryIMock.GetRepositoryTag mock is already set by Set") +// ExpectFileUIDsParam2 sets up expected param fileUIDs for RepositoryI.GetKnowledgeBaseFilesByFileUIDs +func (mmGetKnowledgeBaseFilesByFileUIDs *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs) ExpectFileUIDsParam2(fileUIDs []uuid.UUID) *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs { + if mmGetKnowledgeBaseFilesByFileUIDs.mock.funcGetKnowledgeBaseFilesByFileUIDs != nil { + mmGetKnowledgeBaseFilesByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs mock is already set by Set") } - if mmGetRepositoryTag.defaultExpectation == nil { - mmGetRepositoryTag.defaultExpectation = &RepositoryIMockGetRepositoryTagExpectation{} + if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation == nil { + mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation = &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation{} } - if mmGetRepositoryTag.defaultExpectation.params != nil { - mmGetRepositoryTag.mock.t.Fatalf("RepositoryIMock.GetRepositoryTag mock is already set by Expect") + if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.params != nil { + mmGetKnowledgeBaseFilesByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs mock is already set by Expect") } - if mmGetRepositoryTag.defaultExpectation.paramPtrs == nil { - mmGetRepositoryTag.defaultExpectation.paramPtrs = &RepositoryIMockGetRepositoryTagParamPtrs{} + if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.paramPtrs == nil { + mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.paramPtrs = &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParamPtrs{} } - mmGetRepositoryTag.defaultExpectation.paramPtrs.r1 = &r1 + mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.paramPtrs.fileUIDs = &fileUIDs - return mmGetRepositoryTag + return mmGetKnowledgeBaseFilesByFileUIDs } -// Inspect accepts an inspector function that has same arguments as the RepositoryI.GetRepositoryTag -func (mmGetRepositoryTag *mRepositoryIMockGetRepositoryTag) Inspect(f func(ctx context.Context, r1 utils.RepositoryTagName)) *mRepositoryIMockGetRepositoryTag { - if mmGetRepositoryTag.mock.inspectFuncGetRepositoryTag != nil { - mmGetRepositoryTag.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.GetRepositoryTag") +// ExpectColumnsParam3 sets up expected param columns for RepositoryI.GetKnowledgeBaseFilesByFileUIDs +func (mmGetKnowledgeBaseFilesByFileUIDs *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs) ExpectColumnsParam3(columns ...string) *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs { + if mmGetKnowledgeBaseFilesByFileUIDs.mock.funcGetKnowledgeBaseFilesByFileUIDs != nil { + mmGetKnowledgeBaseFilesByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs mock is already set by Set") } - mmGetRepositoryTag.mock.inspectFuncGetRepositoryTag = f - - return mmGetRepositoryTag -} + if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation == nil { + mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation = &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation{} + } -// Return sets up results that will be returned by RepositoryI.GetRepositoryTag -func (mmGetRepositoryTag *mRepositoryIMockGetRepositoryTag) Return(rp1 *pb.RepositoryTag, err error) *RepositoryIMock { - if mmGetRepositoryTag.mock.funcGetRepositoryTag != nil { - mmGetRepositoryTag.mock.t.Fatalf("RepositoryIMock.GetRepositoryTag mock is already set by Set") + if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.params != nil { + mmGetKnowledgeBaseFilesByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs mock is already set by Expect") } - if mmGetRepositoryTag.defaultExpectation == nil { - mmGetRepositoryTag.defaultExpectation = &RepositoryIMockGetRepositoryTagExpectation{mock: mmGetRepositoryTag.mock} + if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.paramPtrs == nil { + mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.paramPtrs = &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParamPtrs{} } - mmGetRepositoryTag.defaultExpectation.results = &RepositoryIMockGetRepositoryTagResults{rp1, err} - return mmGetRepositoryTag.mock + mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.paramPtrs.columns = &columns + + return mmGetKnowledgeBaseFilesByFileUIDs } -// Set uses given function f to mock the RepositoryI.GetRepositoryTag method -func (mmGetRepositoryTag *mRepositoryIMockGetRepositoryTag) Set(f func(ctx context.Context, r1 utils.RepositoryTagName) (rp1 *pb.RepositoryTag, err error)) *RepositoryIMock { - if mmGetRepositoryTag.defaultExpectation != nil { - mmGetRepositoryTag.mock.t.Fatalf("Default expectation is already set for the RepositoryI.GetRepositoryTag method") +// Inspect accepts an inspector function that has same arguments as the RepositoryI.GetKnowledgeBaseFilesByFileUIDs +func (mmGetKnowledgeBaseFilesByFileUIDs *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs) Inspect(f func(ctx context.Context, fileUIDs []uuid.UUID, columns ...string)) *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs { + if mmGetKnowledgeBaseFilesByFileUIDs.mock.inspectFuncGetKnowledgeBaseFilesByFileUIDs != nil { + mmGetKnowledgeBaseFilesByFileUIDs.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs") } - if len(mmGetRepositoryTag.expectations) > 0 { - mmGetRepositoryTag.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetRepositoryTag method") - } + mmGetKnowledgeBaseFilesByFileUIDs.mock.inspectFuncGetKnowledgeBaseFilesByFileUIDs = f - mmGetRepositoryTag.mock.funcGetRepositoryTag = f - return mmGetRepositoryTag.mock + return mmGetKnowledgeBaseFilesByFileUIDs } -// When sets expectation for the RepositoryI.GetRepositoryTag which will trigger the result defined by the following -// Then helper -func (mmGetRepositoryTag *mRepositoryIMockGetRepositoryTag) When(ctx context.Context, r1 utils.RepositoryTagName) *RepositoryIMockGetRepositoryTagExpectation { - if mmGetRepositoryTag.mock.funcGetRepositoryTag != nil { - mmGetRepositoryTag.mock.t.Fatalf("RepositoryIMock.GetRepositoryTag mock is already set by Set") - } - - expectation := &RepositoryIMockGetRepositoryTagExpectation{ - mock: mmGetRepositoryTag.mock, - params: &RepositoryIMockGetRepositoryTagParams{ctx, r1}, +// Return sets up results that will be returned by RepositoryI.GetKnowledgeBaseFilesByFileUIDs +func (mmGetKnowledgeBaseFilesByFileUIDs *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs) Return(ka1 []mm_repository.KnowledgeBaseFile, err error) *RepositoryIMock { + if mmGetKnowledgeBaseFilesByFileUIDs.mock.funcGetKnowledgeBaseFilesByFileUIDs != nil { + mmGetKnowledgeBaseFilesByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs mock is already set by Set") } - mmGetRepositoryTag.expectations = append(mmGetRepositoryTag.expectations, expectation) + + if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation == nil { + mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation = &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation{mock: mmGetKnowledgeBaseFilesByFileUIDs.mock} + } + mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.results = &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsResults{ka1, err} + return mmGetKnowledgeBaseFilesByFileUIDs.mock +} + +// Set uses given function f to mock the RepositoryI.GetKnowledgeBaseFilesByFileUIDs method +func (mmGetKnowledgeBaseFilesByFileUIDs *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs) Set(f func(ctx context.Context, fileUIDs []uuid.UUID, columns ...string) (ka1 []mm_repository.KnowledgeBaseFile, err error)) *RepositoryIMock { + if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation != nil { + mmGetKnowledgeBaseFilesByFileUIDs.mock.t.Fatalf("Default expectation is already set for the RepositoryI.GetKnowledgeBaseFilesByFileUIDs method") + } + + if len(mmGetKnowledgeBaseFilesByFileUIDs.expectations) > 0 { + mmGetKnowledgeBaseFilesByFileUIDs.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetKnowledgeBaseFilesByFileUIDs method") + } + + mmGetKnowledgeBaseFilesByFileUIDs.mock.funcGetKnowledgeBaseFilesByFileUIDs = f + return mmGetKnowledgeBaseFilesByFileUIDs.mock +} + +// When sets expectation for the RepositoryI.GetKnowledgeBaseFilesByFileUIDs which will trigger the result defined by the following +// Then helper +func (mmGetKnowledgeBaseFilesByFileUIDs *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs) When(ctx context.Context, fileUIDs []uuid.UUID, columns ...string) *RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation { + if mmGetKnowledgeBaseFilesByFileUIDs.mock.funcGetKnowledgeBaseFilesByFileUIDs != nil { + mmGetKnowledgeBaseFilesByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs mock is already set by Set") + } + + expectation := &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation{ + mock: mmGetKnowledgeBaseFilesByFileUIDs.mock, + params: &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParams{ctx, fileUIDs, columns}, + } + mmGetKnowledgeBaseFilesByFileUIDs.expectations = append(mmGetKnowledgeBaseFilesByFileUIDs.expectations, expectation) return expectation } -// Then sets up RepositoryI.GetRepositoryTag return parameters for the expectation previously defined by the When method -func (e *RepositoryIMockGetRepositoryTagExpectation) Then(rp1 *pb.RepositoryTag, err error) *RepositoryIMock { - e.results = &RepositoryIMockGetRepositoryTagResults{rp1, err} +// Then sets up RepositoryI.GetKnowledgeBaseFilesByFileUIDs return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation) Then(ka1 []mm_repository.KnowledgeBaseFile, err error) *RepositoryIMock { + e.results = &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsResults{ka1, err} return e.mock } -// Times sets number of times RepositoryI.GetRepositoryTag should be invoked -func (mmGetRepositoryTag *mRepositoryIMockGetRepositoryTag) Times(n uint64) *mRepositoryIMockGetRepositoryTag { +// Times sets number of times RepositoryI.GetKnowledgeBaseFilesByFileUIDs should be invoked +func (mmGetKnowledgeBaseFilesByFileUIDs *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs) Times(n uint64) *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs { if n == 0 { - mmGetRepositoryTag.mock.t.Fatalf("Times of RepositoryIMock.GetRepositoryTag mock can not be zero") + mmGetKnowledgeBaseFilesByFileUIDs.mock.t.Fatalf("Times of RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs mock can not be zero") } - mm_atomic.StoreUint64(&mmGetRepositoryTag.expectedInvocations, n) - return mmGetRepositoryTag + mm_atomic.StoreUint64(&mmGetKnowledgeBaseFilesByFileUIDs.expectedInvocations, n) + return mmGetKnowledgeBaseFilesByFileUIDs } -func (mmGetRepositoryTag *mRepositoryIMockGetRepositoryTag) invocationsDone() bool { - if len(mmGetRepositoryTag.expectations) == 0 && mmGetRepositoryTag.defaultExpectation == nil && mmGetRepositoryTag.mock.funcGetRepositoryTag == nil { +func (mmGetKnowledgeBaseFilesByFileUIDs *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs) invocationsDone() bool { + if len(mmGetKnowledgeBaseFilesByFileUIDs.expectations) == 0 && mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation == nil && mmGetKnowledgeBaseFilesByFileUIDs.mock.funcGetKnowledgeBaseFilesByFileUIDs == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmGetRepositoryTag.mock.afterGetRepositoryTagCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmGetRepositoryTag.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmGetKnowledgeBaseFilesByFileUIDs.mock.afterGetKnowledgeBaseFilesByFileUIDsCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmGetKnowledgeBaseFilesByFileUIDs.expectedInvocations) return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) } -// GetRepositoryTag implements repository.RepositoryI -func (mmGetRepositoryTag *RepositoryIMock) GetRepositoryTag(ctx context.Context, r1 utils.RepositoryTagName) (rp1 *pb.RepositoryTag, err error) { - mm_atomic.AddUint64(&mmGetRepositoryTag.beforeGetRepositoryTagCounter, 1) - defer mm_atomic.AddUint64(&mmGetRepositoryTag.afterGetRepositoryTagCounter, 1) +// GetKnowledgeBaseFilesByFileUIDs implements repository.RepositoryI +func (mmGetKnowledgeBaseFilesByFileUIDs *RepositoryIMock) GetKnowledgeBaseFilesByFileUIDs(ctx context.Context, fileUIDs []uuid.UUID, columns ...string) (ka1 []mm_repository.KnowledgeBaseFile, err error) { + mm_atomic.AddUint64(&mmGetKnowledgeBaseFilesByFileUIDs.beforeGetKnowledgeBaseFilesByFileUIDsCounter, 1) + defer mm_atomic.AddUint64(&mmGetKnowledgeBaseFilesByFileUIDs.afterGetKnowledgeBaseFilesByFileUIDsCounter, 1) - if mmGetRepositoryTag.inspectFuncGetRepositoryTag != nil { - mmGetRepositoryTag.inspectFuncGetRepositoryTag(ctx, r1) + if mmGetKnowledgeBaseFilesByFileUIDs.inspectFuncGetKnowledgeBaseFilesByFileUIDs != nil { + mmGetKnowledgeBaseFilesByFileUIDs.inspectFuncGetKnowledgeBaseFilesByFileUIDs(ctx, fileUIDs, columns...) } - mm_params := RepositoryIMockGetRepositoryTagParams{ctx, r1} + mm_params := RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParams{ctx, fileUIDs, columns} // Record call args - mmGetRepositoryTag.GetRepositoryTagMock.mutex.Lock() - mmGetRepositoryTag.GetRepositoryTagMock.callArgs = append(mmGetRepositoryTag.GetRepositoryTagMock.callArgs, &mm_params) - mmGetRepositoryTag.GetRepositoryTagMock.mutex.Unlock() + mmGetKnowledgeBaseFilesByFileUIDs.GetKnowledgeBaseFilesByFileUIDsMock.mutex.Lock() + mmGetKnowledgeBaseFilesByFileUIDs.GetKnowledgeBaseFilesByFileUIDsMock.callArgs = append(mmGetKnowledgeBaseFilesByFileUIDs.GetKnowledgeBaseFilesByFileUIDsMock.callArgs, &mm_params) + mmGetKnowledgeBaseFilesByFileUIDs.GetKnowledgeBaseFilesByFileUIDsMock.mutex.Unlock() - for _, e := range mmGetRepositoryTag.GetRepositoryTagMock.expectations { + for _, e := range mmGetKnowledgeBaseFilesByFileUIDs.GetKnowledgeBaseFilesByFileUIDsMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.rp1, e.results.err + return e.results.ka1, e.results.err } } - if mmGetRepositoryTag.GetRepositoryTagMock.defaultExpectation != nil { - mm_atomic.AddUint64(&mmGetRepositoryTag.GetRepositoryTagMock.defaultExpectation.Counter, 1) - mm_want := mmGetRepositoryTag.GetRepositoryTagMock.defaultExpectation.params - mm_want_ptrs := mmGetRepositoryTag.GetRepositoryTagMock.defaultExpectation.paramPtrs + if mmGetKnowledgeBaseFilesByFileUIDs.GetKnowledgeBaseFilesByFileUIDsMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmGetKnowledgeBaseFilesByFileUIDs.GetKnowledgeBaseFilesByFileUIDsMock.defaultExpectation.Counter, 1) + mm_want := mmGetKnowledgeBaseFilesByFileUIDs.GetKnowledgeBaseFilesByFileUIDsMock.defaultExpectation.params + mm_want_ptrs := mmGetKnowledgeBaseFilesByFileUIDs.GetKnowledgeBaseFilesByFileUIDsMock.defaultExpectation.paramPtrs - mm_got := RepositoryIMockGetRepositoryTagParams{ctx, r1} + mm_got := RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParams{ctx, fileUIDs, columns} if mm_want_ptrs != nil { if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { - mmGetRepositoryTag.t.Errorf("RepositoryIMock.GetRepositoryTag got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) + mmGetKnowledgeBaseFilesByFileUIDs.t.Errorf("RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) } - if mm_want_ptrs.r1 != nil && !minimock.Equal(*mm_want_ptrs.r1, mm_got.r1) { - mmGetRepositoryTag.t.Errorf("RepositoryIMock.GetRepositoryTag got unexpected parameter r1, want: %#v, got: %#v%s\n", *mm_want_ptrs.r1, mm_got.r1, minimock.Diff(*mm_want_ptrs.r1, mm_got.r1)) + if mm_want_ptrs.fileUIDs != nil && !minimock.Equal(*mm_want_ptrs.fileUIDs, mm_got.fileUIDs) { + mmGetKnowledgeBaseFilesByFileUIDs.t.Errorf("RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs got unexpected parameter fileUIDs, want: %#v, got: %#v%s\n", *mm_want_ptrs.fileUIDs, mm_got.fileUIDs, minimock.Diff(*mm_want_ptrs.fileUIDs, mm_got.fileUIDs)) + } + + if mm_want_ptrs.columns != nil && !minimock.Equal(*mm_want_ptrs.columns, mm_got.columns) { + mmGetKnowledgeBaseFilesByFileUIDs.t.Errorf("RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs got unexpected parameter columns, want: %#v, got: %#v%s\n", *mm_want_ptrs.columns, mm_got.columns, minimock.Diff(*mm_want_ptrs.columns, mm_got.columns)) } } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { - mmGetRepositoryTag.t.Errorf("RepositoryIMock.GetRepositoryTag got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + mmGetKnowledgeBaseFilesByFileUIDs.t.Errorf("RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) } - mm_results := mmGetRepositoryTag.GetRepositoryTagMock.defaultExpectation.results + mm_results := mmGetKnowledgeBaseFilesByFileUIDs.GetKnowledgeBaseFilesByFileUIDsMock.defaultExpectation.results if mm_results == nil { - mmGetRepositoryTag.t.Fatal("No results are set for the RepositoryIMock.GetRepositoryTag") + mmGetKnowledgeBaseFilesByFileUIDs.t.Fatal("No results are set for the RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs") } - return (*mm_results).rp1, (*mm_results).err + return (*mm_results).ka1, (*mm_results).err } - if mmGetRepositoryTag.funcGetRepositoryTag != nil { - return mmGetRepositoryTag.funcGetRepositoryTag(ctx, r1) + if mmGetKnowledgeBaseFilesByFileUIDs.funcGetKnowledgeBaseFilesByFileUIDs != nil { + return mmGetKnowledgeBaseFilesByFileUIDs.funcGetKnowledgeBaseFilesByFileUIDs(ctx, fileUIDs, columns...) } - mmGetRepositoryTag.t.Fatalf("Unexpected call to RepositoryIMock.GetRepositoryTag. %v %v", ctx, r1) + mmGetKnowledgeBaseFilesByFileUIDs.t.Fatalf("Unexpected call to RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs. %v %v %v", ctx, fileUIDs, columns) return } -// GetRepositoryTagAfterCounter returns a count of finished RepositoryIMock.GetRepositoryTag invocations -func (mmGetRepositoryTag *RepositoryIMock) GetRepositoryTagAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetRepositoryTag.afterGetRepositoryTagCounter) +// GetKnowledgeBaseFilesByFileUIDsAfterCounter returns a count of finished RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs invocations +func (mmGetKnowledgeBaseFilesByFileUIDs *RepositoryIMock) GetKnowledgeBaseFilesByFileUIDsAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetKnowledgeBaseFilesByFileUIDs.afterGetKnowledgeBaseFilesByFileUIDsCounter) } -// GetRepositoryTagBeforeCounter returns a count of RepositoryIMock.GetRepositoryTag invocations -func (mmGetRepositoryTag *RepositoryIMock) GetRepositoryTagBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetRepositoryTag.beforeGetRepositoryTagCounter) +// GetKnowledgeBaseFilesByFileUIDsBeforeCounter returns a count of RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs invocations +func (mmGetKnowledgeBaseFilesByFileUIDs *RepositoryIMock) GetKnowledgeBaseFilesByFileUIDsBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetKnowledgeBaseFilesByFileUIDs.beforeGetKnowledgeBaseFilesByFileUIDsCounter) } -// Calls returns a list of arguments used in each call to RepositoryIMock.GetRepositoryTag. +// Calls returns a list of arguments used in each call to RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs. // The list is in the same order as the calls were made (i.e. recent calls have a higher index) -func (mmGetRepositoryTag *mRepositoryIMockGetRepositoryTag) Calls() []*RepositoryIMockGetRepositoryTagParams { - mmGetRepositoryTag.mutex.RLock() +func (mmGetKnowledgeBaseFilesByFileUIDs *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs) Calls() []*RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParams { + mmGetKnowledgeBaseFilesByFileUIDs.mutex.RLock() - argCopy := make([]*RepositoryIMockGetRepositoryTagParams, len(mmGetRepositoryTag.callArgs)) - copy(argCopy, mmGetRepositoryTag.callArgs) + argCopy := make([]*RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParams, len(mmGetKnowledgeBaseFilesByFileUIDs.callArgs)) + copy(argCopy, mmGetKnowledgeBaseFilesByFileUIDs.callArgs) - mmGetRepositoryTag.mutex.RUnlock() + mmGetKnowledgeBaseFilesByFileUIDs.mutex.RUnlock() return argCopy } -// MinimockGetRepositoryTagDone returns true if the count of the GetRepositoryTag invocations corresponds +// MinimockGetKnowledgeBaseFilesByFileUIDsDone returns true if the count of the GetKnowledgeBaseFilesByFileUIDs invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockGetRepositoryTagDone() bool { - for _, e := range m.GetRepositoryTagMock.expectations { +func (m *RepositoryIMock) MinimockGetKnowledgeBaseFilesByFileUIDsDone() bool { + for _, e := range m.GetKnowledgeBaseFilesByFileUIDsMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.GetRepositoryTagMock.invocationsDone() + return m.GetKnowledgeBaseFilesByFileUIDsMock.invocationsDone() } -// MinimockGetRepositoryTagInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockGetRepositoryTagInspect() { - for _, e := range m.GetRepositoryTagMock.expectations { +// MinimockGetKnowledgeBaseFilesByFileUIDsInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockGetKnowledgeBaseFilesByFileUIDsInspect() { + for _, e := range m.GetKnowledgeBaseFilesByFileUIDsMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { - m.t.Errorf("Expected call to RepositoryIMock.GetRepositoryTag with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs with params: %#v", *e.params) } } - afterGetRepositoryTagCounter := mm_atomic.LoadUint64(&m.afterGetRepositoryTagCounter) + afterGetKnowledgeBaseFilesByFileUIDsCounter := mm_atomic.LoadUint64(&m.afterGetKnowledgeBaseFilesByFileUIDsCounter) // if default expectation was set then invocations count should be greater than zero - if m.GetRepositoryTagMock.defaultExpectation != nil && afterGetRepositoryTagCounter < 1 { - if m.GetRepositoryTagMock.defaultExpectation.params == nil { - m.t.Error("Expected call to RepositoryIMock.GetRepositoryTag") + if m.GetKnowledgeBaseFilesByFileUIDsMock.defaultExpectation != nil && afterGetKnowledgeBaseFilesByFileUIDsCounter < 1 { + if m.GetKnowledgeBaseFilesByFileUIDsMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs") } else { - m.t.Errorf("Expected call to RepositoryIMock.GetRepositoryTag with params: %#v", *m.GetRepositoryTagMock.defaultExpectation.params) + m.t.Errorf("Expected call to RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs with params: %#v", *m.GetKnowledgeBaseFilesByFileUIDsMock.defaultExpectation.params) } } // if func was set then invocations count should be greater than zero - if m.funcGetRepositoryTag != nil && afterGetRepositoryTagCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.GetRepositoryTag") + if m.funcGetKnowledgeBaseFilesByFileUIDs != nil && afterGetKnowledgeBaseFilesByFileUIDsCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs") } - if !m.GetRepositoryTagMock.invocationsDone() && afterGetRepositoryTagCounter > 0 { - m.t.Errorf("Expected %d calls to RepositoryIMock.GetRepositoryTag but found %d calls", - mm_atomic.LoadUint64(&m.GetRepositoryTagMock.expectedInvocations), afterGetRepositoryTagCounter) + if !m.GetKnowledgeBaseFilesByFileUIDsMock.invocationsDone() && afterGetKnowledgeBaseFilesByFileUIDsCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs but found %d calls", + mm_atomic.LoadUint64(&m.GetKnowledgeBaseFilesByFileUIDsMock.expectedInvocations), afterGetKnowledgeBaseFilesByFileUIDsCounter) } } -type mRepositoryIMockGetSourceTableAndUIDByFileUIDs struct { +type mRepositoryIMockGetNeedProcessFiles struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockGetSourceTableAndUIDByFileUIDsExpectation - expectations []*RepositoryIMockGetSourceTableAndUIDByFileUIDsExpectation + defaultExpectation *RepositoryIMockGetNeedProcessFilesExpectation + expectations []*RepositoryIMockGetNeedProcessFilesExpectation - callArgs []*RepositoryIMockGetSourceTableAndUIDByFileUIDsParams + callArgs []*RepositoryIMockGetNeedProcessFilesParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockGetSourceTableAndUIDByFileUIDsExpectation specifies expectation struct of the RepositoryI.GetSourceTableAndUIDByFileUIDs -type RepositoryIMockGetSourceTableAndUIDByFileUIDsExpectation struct { +// RepositoryIMockGetNeedProcessFilesExpectation specifies expectation struct of the RepositoryI.GetNeedProcessFiles +type RepositoryIMockGetNeedProcessFilesExpectation struct { mock *RepositoryIMock - params *RepositoryIMockGetSourceTableAndUIDByFileUIDsParams - paramPtrs *RepositoryIMockGetSourceTableAndUIDByFileUIDsParamPtrs - results *RepositoryIMockGetSourceTableAndUIDByFileUIDsResults + params *RepositoryIMockGetNeedProcessFilesParams + paramPtrs *RepositoryIMockGetNeedProcessFilesParamPtrs + results *RepositoryIMockGetNeedProcessFilesResults Counter uint64 } -// RepositoryIMockGetSourceTableAndUIDByFileUIDsParams contains parameters of the RepositoryI.GetSourceTableAndUIDByFileUIDs -type RepositoryIMockGetSourceTableAndUIDByFileUIDsParams struct { - ctx context.Context - files []mm_repository.KnowledgeBaseFile +// RepositoryIMockGetNeedProcessFilesParams contains parameters of the RepositoryI.GetNeedProcessFiles +type RepositoryIMockGetNeedProcessFilesParams struct { + ctx context.Context } -// RepositoryIMockGetSourceTableAndUIDByFileUIDsParamPtrs contains pointers to parameters of the RepositoryI.GetSourceTableAndUIDByFileUIDs -type RepositoryIMockGetSourceTableAndUIDByFileUIDsParamPtrs struct { - ctx *context.Context - files *[]mm_repository.KnowledgeBaseFile +// RepositoryIMockGetNeedProcessFilesParamPtrs contains pointers to parameters of the RepositoryI.GetNeedProcessFiles +type RepositoryIMockGetNeedProcessFilesParamPtrs struct { + ctx *context.Context } -// RepositoryIMockGetSourceTableAndUIDByFileUIDsResults contains results of the RepositoryI.GetSourceTableAndUIDByFileUIDs -type RepositoryIMockGetSourceTableAndUIDByFileUIDsResults struct { - m1 map[mm_repository.FileUID]struct { - SourceTable string - SourceUID uuid.UUID - } - err error +// RepositoryIMockGetNeedProcessFilesResults contains results of the RepositoryI.GetNeedProcessFiles +type RepositoryIMockGetNeedProcessFilesResults struct { + ka1 []mm_repository.KnowledgeBaseFile } -// Expect sets up expected params for RepositoryI.GetSourceTableAndUIDByFileUIDs -func (mmGetSourceTableAndUIDByFileUIDs *mRepositoryIMockGetSourceTableAndUIDByFileUIDs) Expect(ctx context.Context, files []mm_repository.KnowledgeBaseFile) *mRepositoryIMockGetSourceTableAndUIDByFileUIDs { - if mmGetSourceTableAndUIDByFileUIDs.mock.funcGetSourceTableAndUIDByFileUIDs != nil { - mmGetSourceTableAndUIDByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetSourceTableAndUIDByFileUIDs mock is already set by Set") +// Expect sets up expected params for RepositoryI.GetNeedProcessFiles +func (mmGetNeedProcessFiles *mRepositoryIMockGetNeedProcessFiles) Expect(ctx context.Context) *mRepositoryIMockGetNeedProcessFiles { + if mmGetNeedProcessFiles.mock.funcGetNeedProcessFiles != nil { + mmGetNeedProcessFiles.mock.t.Fatalf("RepositoryIMock.GetNeedProcessFiles mock is already set by Set") } - if mmGetSourceTableAndUIDByFileUIDs.defaultExpectation == nil { - mmGetSourceTableAndUIDByFileUIDs.defaultExpectation = &RepositoryIMockGetSourceTableAndUIDByFileUIDsExpectation{} + if mmGetNeedProcessFiles.defaultExpectation == nil { + mmGetNeedProcessFiles.defaultExpectation = &RepositoryIMockGetNeedProcessFilesExpectation{} } - if mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.paramPtrs != nil { - mmGetSourceTableAndUIDByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetSourceTableAndUIDByFileUIDs mock is already set by ExpectParams functions") + if mmGetNeedProcessFiles.defaultExpectation.paramPtrs != nil { + mmGetNeedProcessFiles.mock.t.Fatalf("RepositoryIMock.GetNeedProcessFiles mock is already set by ExpectParams functions") } - mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.params = &RepositoryIMockGetSourceTableAndUIDByFileUIDsParams{ctx, files} - for _, e := range mmGetSourceTableAndUIDByFileUIDs.expectations { - if minimock.Equal(e.params, mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.params) { - mmGetSourceTableAndUIDByFileUIDs.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.params) + mmGetNeedProcessFiles.defaultExpectation.params = &RepositoryIMockGetNeedProcessFilesParams{ctx} + for _, e := range mmGetNeedProcessFiles.expectations { + if minimock.Equal(e.params, mmGetNeedProcessFiles.defaultExpectation.params) { + mmGetNeedProcessFiles.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetNeedProcessFiles.defaultExpectation.params) } } - return mmGetSourceTableAndUIDByFileUIDs + return mmGetNeedProcessFiles } -// ExpectCtxParam1 sets up expected param ctx for RepositoryI.GetSourceTableAndUIDByFileUIDs -func (mmGetSourceTableAndUIDByFileUIDs *mRepositoryIMockGetSourceTableAndUIDByFileUIDs) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockGetSourceTableAndUIDByFileUIDs { - if mmGetSourceTableAndUIDByFileUIDs.mock.funcGetSourceTableAndUIDByFileUIDs != nil { - mmGetSourceTableAndUIDByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetSourceTableAndUIDByFileUIDs mock is already set by Set") - } - - if mmGetSourceTableAndUIDByFileUIDs.defaultExpectation == nil { - mmGetSourceTableAndUIDByFileUIDs.defaultExpectation = &RepositoryIMockGetSourceTableAndUIDByFileUIDsExpectation{} - } - - if mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.params != nil { - mmGetSourceTableAndUIDByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetSourceTableAndUIDByFileUIDs mock is already set by Expect") - } - - if mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.paramPtrs == nil { - mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.paramPtrs = &RepositoryIMockGetSourceTableAndUIDByFileUIDsParamPtrs{} - } - mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.paramPtrs.ctx = &ctx - - return mmGetSourceTableAndUIDByFileUIDs -} - -// ExpectFilesParam2 sets up expected param files for RepositoryI.GetSourceTableAndUIDByFileUIDs -func (mmGetSourceTableAndUIDByFileUIDs *mRepositoryIMockGetSourceTableAndUIDByFileUIDs) ExpectFilesParam2(files []mm_repository.KnowledgeBaseFile) *mRepositoryIMockGetSourceTableAndUIDByFileUIDs { - if mmGetSourceTableAndUIDByFileUIDs.mock.funcGetSourceTableAndUIDByFileUIDs != nil { - mmGetSourceTableAndUIDByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetSourceTableAndUIDByFileUIDs mock is already set by Set") +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.GetNeedProcessFiles +func (mmGetNeedProcessFiles *mRepositoryIMockGetNeedProcessFiles) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockGetNeedProcessFiles { + if mmGetNeedProcessFiles.mock.funcGetNeedProcessFiles != nil { + mmGetNeedProcessFiles.mock.t.Fatalf("RepositoryIMock.GetNeedProcessFiles mock is already set by Set") } - if mmGetSourceTableAndUIDByFileUIDs.defaultExpectation == nil { - mmGetSourceTableAndUIDByFileUIDs.defaultExpectation = &RepositoryIMockGetSourceTableAndUIDByFileUIDsExpectation{} + if mmGetNeedProcessFiles.defaultExpectation == nil { + mmGetNeedProcessFiles.defaultExpectation = &RepositoryIMockGetNeedProcessFilesExpectation{} } - if mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.params != nil { - mmGetSourceTableAndUIDByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetSourceTableAndUIDByFileUIDs mock is already set by Expect") + if mmGetNeedProcessFiles.defaultExpectation.params != nil { + mmGetNeedProcessFiles.mock.t.Fatalf("RepositoryIMock.GetNeedProcessFiles mock is already set by Expect") } - if mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.paramPtrs == nil { - mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.paramPtrs = &RepositoryIMockGetSourceTableAndUIDByFileUIDsParamPtrs{} + if mmGetNeedProcessFiles.defaultExpectation.paramPtrs == nil { + mmGetNeedProcessFiles.defaultExpectation.paramPtrs = &RepositoryIMockGetNeedProcessFilesParamPtrs{} } - mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.paramPtrs.files = &files + mmGetNeedProcessFiles.defaultExpectation.paramPtrs.ctx = &ctx - return mmGetSourceTableAndUIDByFileUIDs + return mmGetNeedProcessFiles } -// Inspect accepts an inspector function that has same arguments as the RepositoryI.GetSourceTableAndUIDByFileUIDs -func (mmGetSourceTableAndUIDByFileUIDs *mRepositoryIMockGetSourceTableAndUIDByFileUIDs) Inspect(f func(ctx context.Context, files []mm_repository.KnowledgeBaseFile)) *mRepositoryIMockGetSourceTableAndUIDByFileUIDs { - if mmGetSourceTableAndUIDByFileUIDs.mock.inspectFuncGetSourceTableAndUIDByFileUIDs != nil { - mmGetSourceTableAndUIDByFileUIDs.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.GetSourceTableAndUIDByFileUIDs") +// Inspect accepts an inspector function that has same arguments as the RepositoryI.GetNeedProcessFiles +func (mmGetNeedProcessFiles *mRepositoryIMockGetNeedProcessFiles) Inspect(f func(ctx context.Context)) *mRepositoryIMockGetNeedProcessFiles { + if mmGetNeedProcessFiles.mock.inspectFuncGetNeedProcessFiles != nil { + mmGetNeedProcessFiles.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.GetNeedProcessFiles") } - mmGetSourceTableAndUIDByFileUIDs.mock.inspectFuncGetSourceTableAndUIDByFileUIDs = f + mmGetNeedProcessFiles.mock.inspectFuncGetNeedProcessFiles = f - return mmGetSourceTableAndUIDByFileUIDs + return mmGetNeedProcessFiles } -// Return sets up results that will be returned by RepositoryI.GetSourceTableAndUIDByFileUIDs -func (mmGetSourceTableAndUIDByFileUIDs *mRepositoryIMockGetSourceTableAndUIDByFileUIDs) Return(m1 map[mm_repository.FileUID]struct { - SourceTable string - SourceUID uuid.UUID -}, err error) *RepositoryIMock { - if mmGetSourceTableAndUIDByFileUIDs.mock.funcGetSourceTableAndUIDByFileUIDs != nil { - mmGetSourceTableAndUIDByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetSourceTableAndUIDByFileUIDs mock is already set by Set") +// Return sets up results that will be returned by RepositoryI.GetNeedProcessFiles +func (mmGetNeedProcessFiles *mRepositoryIMockGetNeedProcessFiles) Return(ka1 []mm_repository.KnowledgeBaseFile) *RepositoryIMock { + if mmGetNeedProcessFiles.mock.funcGetNeedProcessFiles != nil { + mmGetNeedProcessFiles.mock.t.Fatalf("RepositoryIMock.GetNeedProcessFiles mock is already set by Set") } - if mmGetSourceTableAndUIDByFileUIDs.defaultExpectation == nil { - mmGetSourceTableAndUIDByFileUIDs.defaultExpectation = &RepositoryIMockGetSourceTableAndUIDByFileUIDsExpectation{mock: mmGetSourceTableAndUIDByFileUIDs.mock} + if mmGetNeedProcessFiles.defaultExpectation == nil { + mmGetNeedProcessFiles.defaultExpectation = &RepositoryIMockGetNeedProcessFilesExpectation{mock: mmGetNeedProcessFiles.mock} } - mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.results = &RepositoryIMockGetSourceTableAndUIDByFileUIDsResults{m1, err} - return mmGetSourceTableAndUIDByFileUIDs.mock + mmGetNeedProcessFiles.defaultExpectation.results = &RepositoryIMockGetNeedProcessFilesResults{ka1} + return mmGetNeedProcessFiles.mock } -// Set uses given function f to mock the RepositoryI.GetSourceTableAndUIDByFileUIDs method -func (mmGetSourceTableAndUIDByFileUIDs *mRepositoryIMockGetSourceTableAndUIDByFileUIDs) Set(f func(ctx context.Context, files []mm_repository.KnowledgeBaseFile) (m1 map[mm_repository.FileUID]struct { - SourceTable string - SourceUID uuid.UUID -}, err error)) *RepositoryIMock { - if mmGetSourceTableAndUIDByFileUIDs.defaultExpectation != nil { - mmGetSourceTableAndUIDByFileUIDs.mock.t.Fatalf("Default expectation is already set for the RepositoryI.GetSourceTableAndUIDByFileUIDs method") +// Set uses given function f to mock the RepositoryI.GetNeedProcessFiles method +func (mmGetNeedProcessFiles *mRepositoryIMockGetNeedProcessFiles) Set(f func(ctx context.Context) (ka1 []mm_repository.KnowledgeBaseFile)) *RepositoryIMock { + if mmGetNeedProcessFiles.defaultExpectation != nil { + mmGetNeedProcessFiles.mock.t.Fatalf("Default expectation is already set for the RepositoryI.GetNeedProcessFiles method") } - if len(mmGetSourceTableAndUIDByFileUIDs.expectations) > 0 { - mmGetSourceTableAndUIDByFileUIDs.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetSourceTableAndUIDByFileUIDs method") + if len(mmGetNeedProcessFiles.expectations) > 0 { + mmGetNeedProcessFiles.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetNeedProcessFiles method") } - mmGetSourceTableAndUIDByFileUIDs.mock.funcGetSourceTableAndUIDByFileUIDs = f - return mmGetSourceTableAndUIDByFileUIDs.mock + mmGetNeedProcessFiles.mock.funcGetNeedProcessFiles = f + return mmGetNeedProcessFiles.mock } -// When sets expectation for the RepositoryI.GetSourceTableAndUIDByFileUIDs which will trigger the result defined by the following +// When sets expectation for the RepositoryI.GetNeedProcessFiles which will trigger the result defined by the following // Then helper -func (mmGetSourceTableAndUIDByFileUIDs *mRepositoryIMockGetSourceTableAndUIDByFileUIDs) When(ctx context.Context, files []mm_repository.KnowledgeBaseFile) *RepositoryIMockGetSourceTableAndUIDByFileUIDsExpectation { - if mmGetSourceTableAndUIDByFileUIDs.mock.funcGetSourceTableAndUIDByFileUIDs != nil { - mmGetSourceTableAndUIDByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetSourceTableAndUIDByFileUIDs mock is already set by Set") +func (mmGetNeedProcessFiles *mRepositoryIMockGetNeedProcessFiles) When(ctx context.Context) *RepositoryIMockGetNeedProcessFilesExpectation { + if mmGetNeedProcessFiles.mock.funcGetNeedProcessFiles != nil { + mmGetNeedProcessFiles.mock.t.Fatalf("RepositoryIMock.GetNeedProcessFiles mock is already set by Set") } - expectation := &RepositoryIMockGetSourceTableAndUIDByFileUIDsExpectation{ - mock: mmGetSourceTableAndUIDByFileUIDs.mock, - params: &RepositoryIMockGetSourceTableAndUIDByFileUIDsParams{ctx, files}, + expectation := &RepositoryIMockGetNeedProcessFilesExpectation{ + mock: mmGetNeedProcessFiles.mock, + params: &RepositoryIMockGetNeedProcessFilesParams{ctx}, } - mmGetSourceTableAndUIDByFileUIDs.expectations = append(mmGetSourceTableAndUIDByFileUIDs.expectations, expectation) + mmGetNeedProcessFiles.expectations = append(mmGetNeedProcessFiles.expectations, expectation) return expectation } -// Then sets up RepositoryI.GetSourceTableAndUIDByFileUIDs return parameters for the expectation previously defined by the When method -func (e *RepositoryIMockGetSourceTableAndUIDByFileUIDsExpectation) Then(m1 map[mm_repository.FileUID]struct { - SourceTable string - SourceUID uuid.UUID -}, err error) *RepositoryIMock { - e.results = &RepositoryIMockGetSourceTableAndUIDByFileUIDsResults{m1, err} +// Then sets up RepositoryI.GetNeedProcessFiles return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockGetNeedProcessFilesExpectation) Then(ka1 []mm_repository.KnowledgeBaseFile) *RepositoryIMock { + e.results = &RepositoryIMockGetNeedProcessFilesResults{ka1} return e.mock } -// Times sets number of times RepositoryI.GetSourceTableAndUIDByFileUIDs should be invoked -func (mmGetSourceTableAndUIDByFileUIDs *mRepositoryIMockGetSourceTableAndUIDByFileUIDs) Times(n uint64) *mRepositoryIMockGetSourceTableAndUIDByFileUIDs { +// Times sets number of times RepositoryI.GetNeedProcessFiles should be invoked +func (mmGetNeedProcessFiles *mRepositoryIMockGetNeedProcessFiles) Times(n uint64) *mRepositoryIMockGetNeedProcessFiles { if n == 0 { - mmGetSourceTableAndUIDByFileUIDs.mock.t.Fatalf("Times of RepositoryIMock.GetSourceTableAndUIDByFileUIDs mock can not be zero") + mmGetNeedProcessFiles.mock.t.Fatalf("Times of RepositoryIMock.GetNeedProcessFiles mock can not be zero") } - mm_atomic.StoreUint64(&mmGetSourceTableAndUIDByFileUIDs.expectedInvocations, n) - return mmGetSourceTableAndUIDByFileUIDs + mm_atomic.StoreUint64(&mmGetNeedProcessFiles.expectedInvocations, n) + return mmGetNeedProcessFiles } -func (mmGetSourceTableAndUIDByFileUIDs *mRepositoryIMockGetSourceTableAndUIDByFileUIDs) invocationsDone() bool { - if len(mmGetSourceTableAndUIDByFileUIDs.expectations) == 0 && mmGetSourceTableAndUIDByFileUIDs.defaultExpectation == nil && mmGetSourceTableAndUIDByFileUIDs.mock.funcGetSourceTableAndUIDByFileUIDs == nil { +func (mmGetNeedProcessFiles *mRepositoryIMockGetNeedProcessFiles) invocationsDone() bool { + if len(mmGetNeedProcessFiles.expectations) == 0 && mmGetNeedProcessFiles.defaultExpectation == nil && mmGetNeedProcessFiles.mock.funcGetNeedProcessFiles == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmGetSourceTableAndUIDByFileUIDs.mock.afterGetSourceTableAndUIDByFileUIDsCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmGetSourceTableAndUIDByFileUIDs.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmGetNeedProcessFiles.mock.afterGetNeedProcessFilesCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmGetNeedProcessFiles.expectedInvocations) return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) } -// GetSourceTableAndUIDByFileUIDs implements repository.RepositoryI -func (mmGetSourceTableAndUIDByFileUIDs *RepositoryIMock) GetSourceTableAndUIDByFileUIDs(ctx context.Context, files []mm_repository.KnowledgeBaseFile) (m1 map[mm_repository.FileUID]struct { - SourceTable string - SourceUID uuid.UUID -}, err error) { - mm_atomic.AddUint64(&mmGetSourceTableAndUIDByFileUIDs.beforeGetSourceTableAndUIDByFileUIDsCounter, 1) - defer mm_atomic.AddUint64(&mmGetSourceTableAndUIDByFileUIDs.afterGetSourceTableAndUIDByFileUIDsCounter, 1) +// GetNeedProcessFiles implements repository.RepositoryI +func (mmGetNeedProcessFiles *RepositoryIMock) GetNeedProcessFiles(ctx context.Context) (ka1 []mm_repository.KnowledgeBaseFile) { + mm_atomic.AddUint64(&mmGetNeedProcessFiles.beforeGetNeedProcessFilesCounter, 1) + defer mm_atomic.AddUint64(&mmGetNeedProcessFiles.afterGetNeedProcessFilesCounter, 1) - if mmGetSourceTableAndUIDByFileUIDs.inspectFuncGetSourceTableAndUIDByFileUIDs != nil { - mmGetSourceTableAndUIDByFileUIDs.inspectFuncGetSourceTableAndUIDByFileUIDs(ctx, files) + if mmGetNeedProcessFiles.inspectFuncGetNeedProcessFiles != nil { + mmGetNeedProcessFiles.inspectFuncGetNeedProcessFiles(ctx) } - mm_params := RepositoryIMockGetSourceTableAndUIDByFileUIDsParams{ctx, files} + mm_params := RepositoryIMockGetNeedProcessFilesParams{ctx} // Record call args - mmGetSourceTableAndUIDByFileUIDs.GetSourceTableAndUIDByFileUIDsMock.mutex.Lock() - mmGetSourceTableAndUIDByFileUIDs.GetSourceTableAndUIDByFileUIDsMock.callArgs = append(mmGetSourceTableAndUIDByFileUIDs.GetSourceTableAndUIDByFileUIDsMock.callArgs, &mm_params) - mmGetSourceTableAndUIDByFileUIDs.GetSourceTableAndUIDByFileUIDsMock.mutex.Unlock() + mmGetNeedProcessFiles.GetNeedProcessFilesMock.mutex.Lock() + mmGetNeedProcessFiles.GetNeedProcessFilesMock.callArgs = append(mmGetNeedProcessFiles.GetNeedProcessFilesMock.callArgs, &mm_params) + mmGetNeedProcessFiles.GetNeedProcessFilesMock.mutex.Unlock() - for _, e := range mmGetSourceTableAndUIDByFileUIDs.GetSourceTableAndUIDByFileUIDsMock.expectations { + for _, e := range mmGetNeedProcessFiles.GetNeedProcessFilesMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.m1, e.results.err + return e.results.ka1 } } - if mmGetSourceTableAndUIDByFileUIDs.GetSourceTableAndUIDByFileUIDsMock.defaultExpectation != nil { - mm_atomic.AddUint64(&mmGetSourceTableAndUIDByFileUIDs.GetSourceTableAndUIDByFileUIDsMock.defaultExpectation.Counter, 1) - mm_want := mmGetSourceTableAndUIDByFileUIDs.GetSourceTableAndUIDByFileUIDsMock.defaultExpectation.params - mm_want_ptrs := mmGetSourceTableAndUIDByFileUIDs.GetSourceTableAndUIDByFileUIDsMock.defaultExpectation.paramPtrs + if mmGetNeedProcessFiles.GetNeedProcessFilesMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmGetNeedProcessFiles.GetNeedProcessFilesMock.defaultExpectation.Counter, 1) + mm_want := mmGetNeedProcessFiles.GetNeedProcessFilesMock.defaultExpectation.params + mm_want_ptrs := mmGetNeedProcessFiles.GetNeedProcessFilesMock.defaultExpectation.paramPtrs - mm_got := RepositoryIMockGetSourceTableAndUIDByFileUIDsParams{ctx, files} + mm_got := RepositoryIMockGetNeedProcessFilesParams{ctx} if mm_want_ptrs != nil { if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { - mmGetSourceTableAndUIDByFileUIDs.t.Errorf("RepositoryIMock.GetSourceTableAndUIDByFileUIDs got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) - } - - if mm_want_ptrs.files != nil && !minimock.Equal(*mm_want_ptrs.files, mm_got.files) { - mmGetSourceTableAndUIDByFileUIDs.t.Errorf("RepositoryIMock.GetSourceTableAndUIDByFileUIDs got unexpected parameter files, want: %#v, got: %#v%s\n", *mm_want_ptrs.files, mm_got.files, minimock.Diff(*mm_want_ptrs.files, mm_got.files)) + mmGetNeedProcessFiles.t.Errorf("RepositoryIMock.GetNeedProcessFiles got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) } } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { - mmGetSourceTableAndUIDByFileUIDs.t.Errorf("RepositoryIMock.GetSourceTableAndUIDByFileUIDs got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + mmGetNeedProcessFiles.t.Errorf("RepositoryIMock.GetNeedProcessFiles got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) } - mm_results := mmGetSourceTableAndUIDByFileUIDs.GetSourceTableAndUIDByFileUIDsMock.defaultExpectation.results + mm_results := mmGetNeedProcessFiles.GetNeedProcessFilesMock.defaultExpectation.results if mm_results == nil { - mmGetSourceTableAndUIDByFileUIDs.t.Fatal("No results are set for the RepositoryIMock.GetSourceTableAndUIDByFileUIDs") + mmGetNeedProcessFiles.t.Fatal("No results are set for the RepositoryIMock.GetNeedProcessFiles") } - return (*mm_results).m1, (*mm_results).err + return (*mm_results).ka1 } - if mmGetSourceTableAndUIDByFileUIDs.funcGetSourceTableAndUIDByFileUIDs != nil { - return mmGetSourceTableAndUIDByFileUIDs.funcGetSourceTableAndUIDByFileUIDs(ctx, files) + if mmGetNeedProcessFiles.funcGetNeedProcessFiles != nil { + return mmGetNeedProcessFiles.funcGetNeedProcessFiles(ctx) } - mmGetSourceTableAndUIDByFileUIDs.t.Fatalf("Unexpected call to RepositoryIMock.GetSourceTableAndUIDByFileUIDs. %v %v", ctx, files) + mmGetNeedProcessFiles.t.Fatalf("Unexpected call to RepositoryIMock.GetNeedProcessFiles. %v", ctx) return } -// GetSourceTableAndUIDByFileUIDsAfterCounter returns a count of finished RepositoryIMock.GetSourceTableAndUIDByFileUIDs invocations -func (mmGetSourceTableAndUIDByFileUIDs *RepositoryIMock) GetSourceTableAndUIDByFileUIDsAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetSourceTableAndUIDByFileUIDs.afterGetSourceTableAndUIDByFileUIDsCounter) +// GetNeedProcessFilesAfterCounter returns a count of finished RepositoryIMock.GetNeedProcessFiles invocations +func (mmGetNeedProcessFiles *RepositoryIMock) GetNeedProcessFilesAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetNeedProcessFiles.afterGetNeedProcessFilesCounter) } -// GetSourceTableAndUIDByFileUIDsBeforeCounter returns a count of RepositoryIMock.GetSourceTableAndUIDByFileUIDs invocations -func (mmGetSourceTableAndUIDByFileUIDs *RepositoryIMock) GetSourceTableAndUIDByFileUIDsBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetSourceTableAndUIDByFileUIDs.beforeGetSourceTableAndUIDByFileUIDsCounter) +// GetNeedProcessFilesBeforeCounter returns a count of RepositoryIMock.GetNeedProcessFiles invocations +func (mmGetNeedProcessFiles *RepositoryIMock) GetNeedProcessFilesBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetNeedProcessFiles.beforeGetNeedProcessFilesCounter) } -// Calls returns a list of arguments used in each call to RepositoryIMock.GetSourceTableAndUIDByFileUIDs. +// Calls returns a list of arguments used in each call to RepositoryIMock.GetNeedProcessFiles. // The list is in the same order as the calls were made (i.e. recent calls have a higher index) -func (mmGetSourceTableAndUIDByFileUIDs *mRepositoryIMockGetSourceTableAndUIDByFileUIDs) Calls() []*RepositoryIMockGetSourceTableAndUIDByFileUIDsParams { - mmGetSourceTableAndUIDByFileUIDs.mutex.RLock() +func (mmGetNeedProcessFiles *mRepositoryIMockGetNeedProcessFiles) Calls() []*RepositoryIMockGetNeedProcessFilesParams { + mmGetNeedProcessFiles.mutex.RLock() - argCopy := make([]*RepositoryIMockGetSourceTableAndUIDByFileUIDsParams, len(mmGetSourceTableAndUIDByFileUIDs.callArgs)) - copy(argCopy, mmGetSourceTableAndUIDByFileUIDs.callArgs) + argCopy := make([]*RepositoryIMockGetNeedProcessFilesParams, len(mmGetNeedProcessFiles.callArgs)) + copy(argCopy, mmGetNeedProcessFiles.callArgs) - mmGetSourceTableAndUIDByFileUIDs.mutex.RUnlock() + mmGetNeedProcessFiles.mutex.RUnlock() return argCopy } -// MinimockGetSourceTableAndUIDByFileUIDsDone returns true if the count of the GetSourceTableAndUIDByFileUIDs invocations corresponds +// MinimockGetNeedProcessFilesDone returns true if the count of the GetNeedProcessFiles invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockGetSourceTableAndUIDByFileUIDsDone() bool { - for _, e := range m.GetSourceTableAndUIDByFileUIDsMock.expectations { +func (m *RepositoryIMock) MinimockGetNeedProcessFilesDone() bool { + for _, e := range m.GetNeedProcessFilesMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.GetSourceTableAndUIDByFileUIDsMock.invocationsDone() + return m.GetNeedProcessFilesMock.invocationsDone() } -// MinimockGetSourceTableAndUIDByFileUIDsInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockGetSourceTableAndUIDByFileUIDsInspect() { - for _, e := range m.GetSourceTableAndUIDByFileUIDsMock.expectations { +// MinimockGetNeedProcessFilesInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockGetNeedProcessFilesInspect() { + for _, e := range m.GetNeedProcessFilesMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { - m.t.Errorf("Expected call to RepositoryIMock.GetSourceTableAndUIDByFileUIDs with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.GetNeedProcessFiles with params: %#v", *e.params) } } - afterGetSourceTableAndUIDByFileUIDsCounter := mm_atomic.LoadUint64(&m.afterGetSourceTableAndUIDByFileUIDsCounter) + afterGetNeedProcessFilesCounter := mm_atomic.LoadUint64(&m.afterGetNeedProcessFilesCounter) // if default expectation was set then invocations count should be greater than zero - if m.GetSourceTableAndUIDByFileUIDsMock.defaultExpectation != nil && afterGetSourceTableAndUIDByFileUIDsCounter < 1 { - if m.GetSourceTableAndUIDByFileUIDsMock.defaultExpectation.params == nil { - m.t.Error("Expected call to RepositoryIMock.GetSourceTableAndUIDByFileUIDs") + if m.GetNeedProcessFilesMock.defaultExpectation != nil && afterGetNeedProcessFilesCounter < 1 { + if m.GetNeedProcessFilesMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.GetNeedProcessFiles") } else { - m.t.Errorf("Expected call to RepositoryIMock.GetSourceTableAndUIDByFileUIDs with params: %#v", *m.GetSourceTableAndUIDByFileUIDsMock.defaultExpectation.params) + m.t.Errorf("Expected call to RepositoryIMock.GetNeedProcessFiles with params: %#v", *m.GetNeedProcessFilesMock.defaultExpectation.params) } } // if func was set then invocations count should be greater than zero - if m.funcGetSourceTableAndUIDByFileUIDs != nil && afterGetSourceTableAndUIDByFileUIDsCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.GetSourceTableAndUIDByFileUIDs") + if m.funcGetNeedProcessFiles != nil && afterGetNeedProcessFilesCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.GetNeedProcessFiles") } - if !m.GetSourceTableAndUIDByFileUIDsMock.invocationsDone() && afterGetSourceTableAndUIDByFileUIDsCounter > 0 { - m.t.Errorf("Expected %d calls to RepositoryIMock.GetSourceTableAndUIDByFileUIDs but found %d calls", - mm_atomic.LoadUint64(&m.GetSourceTableAndUIDByFileUIDsMock.expectedInvocations), afterGetSourceTableAndUIDByFileUIDsCounter) + if !m.GetNeedProcessFilesMock.invocationsDone() && afterGetNeedProcessFilesCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.GetNeedProcessFiles but found %d calls", + mm_atomic.LoadUint64(&m.GetNeedProcessFilesMock.expectedInvocations), afterGetNeedProcessFilesCounter) } } -type mRepositoryIMockGetTextChunksBySource struct { +type mRepositoryIMockGetRepositoryTag struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockGetTextChunksBySourceExpectation - expectations []*RepositoryIMockGetTextChunksBySourceExpectation + defaultExpectation *RepositoryIMockGetRepositoryTagExpectation + expectations []*RepositoryIMockGetRepositoryTagExpectation - callArgs []*RepositoryIMockGetTextChunksBySourceParams + callArgs []*RepositoryIMockGetRepositoryTagParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockGetTextChunksBySourceExpectation specifies expectation struct of the RepositoryI.GetTextChunksBySource -type RepositoryIMockGetTextChunksBySourceExpectation struct { +// RepositoryIMockGetRepositoryTagExpectation specifies expectation struct of the RepositoryI.GetRepositoryTag +type RepositoryIMockGetRepositoryTagExpectation struct { mock *RepositoryIMock - params *RepositoryIMockGetTextChunksBySourceParams - paramPtrs *RepositoryIMockGetTextChunksBySourceParamPtrs - results *RepositoryIMockGetTextChunksBySourceResults + params *RepositoryIMockGetRepositoryTagParams + paramPtrs *RepositoryIMockGetRepositoryTagParamPtrs + results *RepositoryIMockGetRepositoryTagResults Counter uint64 } -// RepositoryIMockGetTextChunksBySourceParams contains parameters of the RepositoryI.GetTextChunksBySource -type RepositoryIMockGetTextChunksBySourceParams struct { - ctx context.Context - sourceTable string - sourceUID uuid.UUID +// RepositoryIMockGetRepositoryTagParams contains parameters of the RepositoryI.GetRepositoryTag +type RepositoryIMockGetRepositoryTagParams struct { + ctx context.Context + r1 utils.RepositoryTagName } -// RepositoryIMockGetTextChunksBySourceParamPtrs contains pointers to parameters of the RepositoryI.GetTextChunksBySource -type RepositoryIMockGetTextChunksBySourceParamPtrs struct { - ctx *context.Context - sourceTable *string - sourceUID *uuid.UUID +// RepositoryIMockGetRepositoryTagParamPtrs contains pointers to parameters of the RepositoryI.GetRepositoryTag +type RepositoryIMockGetRepositoryTagParamPtrs struct { + ctx *context.Context + r1 *utils.RepositoryTagName } -// RepositoryIMockGetTextChunksBySourceResults contains results of the RepositoryI.GetTextChunksBySource -type RepositoryIMockGetTextChunksBySourceResults struct { - ta1 []mm_repository.TextChunk +// RepositoryIMockGetRepositoryTagResults contains results of the RepositoryI.GetRepositoryTag +type RepositoryIMockGetRepositoryTagResults struct { + rp1 *pb.RepositoryTag err error } -// Expect sets up expected params for RepositoryI.GetTextChunksBySource -func (mmGetTextChunksBySource *mRepositoryIMockGetTextChunksBySource) Expect(ctx context.Context, sourceTable string, sourceUID uuid.UUID) *mRepositoryIMockGetTextChunksBySource { - if mmGetTextChunksBySource.mock.funcGetTextChunksBySource != nil { - mmGetTextChunksBySource.mock.t.Fatalf("RepositoryIMock.GetTextChunksBySource mock is already set by Set") +// Expect sets up expected params for RepositoryI.GetRepositoryTag +func (mmGetRepositoryTag *mRepositoryIMockGetRepositoryTag) Expect(ctx context.Context, r1 utils.RepositoryTagName) *mRepositoryIMockGetRepositoryTag { + if mmGetRepositoryTag.mock.funcGetRepositoryTag != nil { + mmGetRepositoryTag.mock.t.Fatalf("RepositoryIMock.GetRepositoryTag mock is already set by Set") } - if mmGetTextChunksBySource.defaultExpectation == nil { - mmGetTextChunksBySource.defaultExpectation = &RepositoryIMockGetTextChunksBySourceExpectation{} + if mmGetRepositoryTag.defaultExpectation == nil { + mmGetRepositoryTag.defaultExpectation = &RepositoryIMockGetRepositoryTagExpectation{} } - if mmGetTextChunksBySource.defaultExpectation.paramPtrs != nil { - mmGetTextChunksBySource.mock.t.Fatalf("RepositoryIMock.GetTextChunksBySource mock is already set by ExpectParams functions") + if mmGetRepositoryTag.defaultExpectation.paramPtrs != nil { + mmGetRepositoryTag.mock.t.Fatalf("RepositoryIMock.GetRepositoryTag mock is already set by ExpectParams functions") } - mmGetTextChunksBySource.defaultExpectation.params = &RepositoryIMockGetTextChunksBySourceParams{ctx, sourceTable, sourceUID} - for _, e := range mmGetTextChunksBySource.expectations { - if minimock.Equal(e.params, mmGetTextChunksBySource.defaultExpectation.params) { - mmGetTextChunksBySource.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetTextChunksBySource.defaultExpectation.params) + mmGetRepositoryTag.defaultExpectation.params = &RepositoryIMockGetRepositoryTagParams{ctx, r1} + for _, e := range mmGetRepositoryTag.expectations { + if minimock.Equal(e.params, mmGetRepositoryTag.defaultExpectation.params) { + mmGetRepositoryTag.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetRepositoryTag.defaultExpectation.params) } } - return mmGetTextChunksBySource -} - -// ExpectCtxParam1 sets up expected param ctx for RepositoryI.GetTextChunksBySource -func (mmGetTextChunksBySource *mRepositoryIMockGetTextChunksBySource) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockGetTextChunksBySource { - if mmGetTextChunksBySource.mock.funcGetTextChunksBySource != nil { - mmGetTextChunksBySource.mock.t.Fatalf("RepositoryIMock.GetTextChunksBySource mock is already set by Set") - } - - if mmGetTextChunksBySource.defaultExpectation == nil { - mmGetTextChunksBySource.defaultExpectation = &RepositoryIMockGetTextChunksBySourceExpectation{} - } - - if mmGetTextChunksBySource.defaultExpectation.params != nil { - mmGetTextChunksBySource.mock.t.Fatalf("RepositoryIMock.GetTextChunksBySource mock is already set by Expect") - } - - if mmGetTextChunksBySource.defaultExpectation.paramPtrs == nil { - mmGetTextChunksBySource.defaultExpectation.paramPtrs = &RepositoryIMockGetTextChunksBySourceParamPtrs{} - } - mmGetTextChunksBySource.defaultExpectation.paramPtrs.ctx = &ctx - - return mmGetTextChunksBySource + return mmGetRepositoryTag } -// ExpectSourceTableParam2 sets up expected param sourceTable for RepositoryI.GetTextChunksBySource -func (mmGetTextChunksBySource *mRepositoryIMockGetTextChunksBySource) ExpectSourceTableParam2(sourceTable string) *mRepositoryIMockGetTextChunksBySource { - if mmGetTextChunksBySource.mock.funcGetTextChunksBySource != nil { - mmGetTextChunksBySource.mock.t.Fatalf("RepositoryIMock.GetTextChunksBySource mock is already set by Set") +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.GetRepositoryTag +func (mmGetRepositoryTag *mRepositoryIMockGetRepositoryTag) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockGetRepositoryTag { + if mmGetRepositoryTag.mock.funcGetRepositoryTag != nil { + mmGetRepositoryTag.mock.t.Fatalf("RepositoryIMock.GetRepositoryTag mock is already set by Set") } - if mmGetTextChunksBySource.defaultExpectation == nil { - mmGetTextChunksBySource.defaultExpectation = &RepositoryIMockGetTextChunksBySourceExpectation{} + if mmGetRepositoryTag.defaultExpectation == nil { + mmGetRepositoryTag.defaultExpectation = &RepositoryIMockGetRepositoryTagExpectation{} } - if mmGetTextChunksBySource.defaultExpectation.params != nil { - mmGetTextChunksBySource.mock.t.Fatalf("RepositoryIMock.GetTextChunksBySource mock is already set by Expect") + if mmGetRepositoryTag.defaultExpectation.params != nil { + mmGetRepositoryTag.mock.t.Fatalf("RepositoryIMock.GetRepositoryTag mock is already set by Expect") } - if mmGetTextChunksBySource.defaultExpectation.paramPtrs == nil { - mmGetTextChunksBySource.defaultExpectation.paramPtrs = &RepositoryIMockGetTextChunksBySourceParamPtrs{} + if mmGetRepositoryTag.defaultExpectation.paramPtrs == nil { + mmGetRepositoryTag.defaultExpectation.paramPtrs = &RepositoryIMockGetRepositoryTagParamPtrs{} } - mmGetTextChunksBySource.defaultExpectation.paramPtrs.sourceTable = &sourceTable + mmGetRepositoryTag.defaultExpectation.paramPtrs.ctx = &ctx - return mmGetTextChunksBySource + return mmGetRepositoryTag } -// ExpectSourceUIDParam3 sets up expected param sourceUID for RepositoryI.GetTextChunksBySource -func (mmGetTextChunksBySource *mRepositoryIMockGetTextChunksBySource) ExpectSourceUIDParam3(sourceUID uuid.UUID) *mRepositoryIMockGetTextChunksBySource { - if mmGetTextChunksBySource.mock.funcGetTextChunksBySource != nil { - mmGetTextChunksBySource.mock.t.Fatalf("RepositoryIMock.GetTextChunksBySource mock is already set by Set") +// ExpectR1Param2 sets up expected param r1 for RepositoryI.GetRepositoryTag +func (mmGetRepositoryTag *mRepositoryIMockGetRepositoryTag) ExpectR1Param2(r1 utils.RepositoryTagName) *mRepositoryIMockGetRepositoryTag { + if mmGetRepositoryTag.mock.funcGetRepositoryTag != nil { + mmGetRepositoryTag.mock.t.Fatalf("RepositoryIMock.GetRepositoryTag mock is already set by Set") } - if mmGetTextChunksBySource.defaultExpectation == nil { - mmGetTextChunksBySource.defaultExpectation = &RepositoryIMockGetTextChunksBySourceExpectation{} + if mmGetRepositoryTag.defaultExpectation == nil { + mmGetRepositoryTag.defaultExpectation = &RepositoryIMockGetRepositoryTagExpectation{} } - if mmGetTextChunksBySource.defaultExpectation.params != nil { - mmGetTextChunksBySource.mock.t.Fatalf("RepositoryIMock.GetTextChunksBySource mock is already set by Expect") + if mmGetRepositoryTag.defaultExpectation.params != nil { + mmGetRepositoryTag.mock.t.Fatalf("RepositoryIMock.GetRepositoryTag mock is already set by Expect") } - if mmGetTextChunksBySource.defaultExpectation.paramPtrs == nil { - mmGetTextChunksBySource.defaultExpectation.paramPtrs = &RepositoryIMockGetTextChunksBySourceParamPtrs{} + if mmGetRepositoryTag.defaultExpectation.paramPtrs == nil { + mmGetRepositoryTag.defaultExpectation.paramPtrs = &RepositoryIMockGetRepositoryTagParamPtrs{} } - mmGetTextChunksBySource.defaultExpectation.paramPtrs.sourceUID = &sourceUID + mmGetRepositoryTag.defaultExpectation.paramPtrs.r1 = &r1 - return mmGetTextChunksBySource + return mmGetRepositoryTag } -// Inspect accepts an inspector function that has same arguments as the RepositoryI.GetTextChunksBySource -func (mmGetTextChunksBySource *mRepositoryIMockGetTextChunksBySource) Inspect(f func(ctx context.Context, sourceTable string, sourceUID uuid.UUID)) *mRepositoryIMockGetTextChunksBySource { - if mmGetTextChunksBySource.mock.inspectFuncGetTextChunksBySource != nil { - mmGetTextChunksBySource.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.GetTextChunksBySource") +// Inspect accepts an inspector function that has same arguments as the RepositoryI.GetRepositoryTag +func (mmGetRepositoryTag *mRepositoryIMockGetRepositoryTag) Inspect(f func(ctx context.Context, r1 utils.RepositoryTagName)) *mRepositoryIMockGetRepositoryTag { + if mmGetRepositoryTag.mock.inspectFuncGetRepositoryTag != nil { + mmGetRepositoryTag.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.GetRepositoryTag") } - mmGetTextChunksBySource.mock.inspectFuncGetTextChunksBySource = f + mmGetRepositoryTag.mock.inspectFuncGetRepositoryTag = f - return mmGetTextChunksBySource + return mmGetRepositoryTag } -// Return sets up results that will be returned by RepositoryI.GetTextChunksBySource -func (mmGetTextChunksBySource *mRepositoryIMockGetTextChunksBySource) Return(ta1 []mm_repository.TextChunk, err error) *RepositoryIMock { - if mmGetTextChunksBySource.mock.funcGetTextChunksBySource != nil { - mmGetTextChunksBySource.mock.t.Fatalf("RepositoryIMock.GetTextChunksBySource mock is already set by Set") +// Return sets up results that will be returned by RepositoryI.GetRepositoryTag +func (mmGetRepositoryTag *mRepositoryIMockGetRepositoryTag) Return(rp1 *pb.RepositoryTag, err error) *RepositoryIMock { + if mmGetRepositoryTag.mock.funcGetRepositoryTag != nil { + mmGetRepositoryTag.mock.t.Fatalf("RepositoryIMock.GetRepositoryTag mock is already set by Set") } - if mmGetTextChunksBySource.defaultExpectation == nil { - mmGetTextChunksBySource.defaultExpectation = &RepositoryIMockGetTextChunksBySourceExpectation{mock: mmGetTextChunksBySource.mock} + if mmGetRepositoryTag.defaultExpectation == nil { + mmGetRepositoryTag.defaultExpectation = &RepositoryIMockGetRepositoryTagExpectation{mock: mmGetRepositoryTag.mock} } - mmGetTextChunksBySource.defaultExpectation.results = &RepositoryIMockGetTextChunksBySourceResults{ta1, err} - return mmGetTextChunksBySource.mock + mmGetRepositoryTag.defaultExpectation.results = &RepositoryIMockGetRepositoryTagResults{rp1, err} + return mmGetRepositoryTag.mock } -// Set uses given function f to mock the RepositoryI.GetTextChunksBySource method -func (mmGetTextChunksBySource *mRepositoryIMockGetTextChunksBySource) Set(f func(ctx context.Context, sourceTable string, sourceUID uuid.UUID) (ta1 []mm_repository.TextChunk, err error)) *RepositoryIMock { - if mmGetTextChunksBySource.defaultExpectation != nil { - mmGetTextChunksBySource.mock.t.Fatalf("Default expectation is already set for the RepositoryI.GetTextChunksBySource method") +// Set uses given function f to mock the RepositoryI.GetRepositoryTag method +func (mmGetRepositoryTag *mRepositoryIMockGetRepositoryTag) Set(f func(ctx context.Context, r1 utils.RepositoryTagName) (rp1 *pb.RepositoryTag, err error)) *RepositoryIMock { + if mmGetRepositoryTag.defaultExpectation != nil { + mmGetRepositoryTag.mock.t.Fatalf("Default expectation is already set for the RepositoryI.GetRepositoryTag method") } - if len(mmGetTextChunksBySource.expectations) > 0 { - mmGetTextChunksBySource.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetTextChunksBySource method") + if len(mmGetRepositoryTag.expectations) > 0 { + mmGetRepositoryTag.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetRepositoryTag method") } - mmGetTextChunksBySource.mock.funcGetTextChunksBySource = f - return mmGetTextChunksBySource.mock + mmGetRepositoryTag.mock.funcGetRepositoryTag = f + return mmGetRepositoryTag.mock } -// When sets expectation for the RepositoryI.GetTextChunksBySource which will trigger the result defined by the following +// When sets expectation for the RepositoryI.GetRepositoryTag which will trigger the result defined by the following // Then helper -func (mmGetTextChunksBySource *mRepositoryIMockGetTextChunksBySource) When(ctx context.Context, sourceTable string, sourceUID uuid.UUID) *RepositoryIMockGetTextChunksBySourceExpectation { - if mmGetTextChunksBySource.mock.funcGetTextChunksBySource != nil { - mmGetTextChunksBySource.mock.t.Fatalf("RepositoryIMock.GetTextChunksBySource mock is already set by Set") +func (mmGetRepositoryTag *mRepositoryIMockGetRepositoryTag) When(ctx context.Context, r1 utils.RepositoryTagName) *RepositoryIMockGetRepositoryTagExpectation { + if mmGetRepositoryTag.mock.funcGetRepositoryTag != nil { + mmGetRepositoryTag.mock.t.Fatalf("RepositoryIMock.GetRepositoryTag mock is already set by Set") } - expectation := &RepositoryIMockGetTextChunksBySourceExpectation{ - mock: mmGetTextChunksBySource.mock, - params: &RepositoryIMockGetTextChunksBySourceParams{ctx, sourceTable, sourceUID}, + expectation := &RepositoryIMockGetRepositoryTagExpectation{ + mock: mmGetRepositoryTag.mock, + params: &RepositoryIMockGetRepositoryTagParams{ctx, r1}, } - mmGetTextChunksBySource.expectations = append(mmGetTextChunksBySource.expectations, expectation) + mmGetRepositoryTag.expectations = append(mmGetRepositoryTag.expectations, expectation) return expectation } -// Then sets up RepositoryI.GetTextChunksBySource return parameters for the expectation previously defined by the When method -func (e *RepositoryIMockGetTextChunksBySourceExpectation) Then(ta1 []mm_repository.TextChunk, err error) *RepositoryIMock { - e.results = &RepositoryIMockGetTextChunksBySourceResults{ta1, err} +// Then sets up RepositoryI.GetRepositoryTag return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockGetRepositoryTagExpectation) Then(rp1 *pb.RepositoryTag, err error) *RepositoryIMock { + e.results = &RepositoryIMockGetRepositoryTagResults{rp1, err} return e.mock } -// Times sets number of times RepositoryI.GetTextChunksBySource should be invoked -func (mmGetTextChunksBySource *mRepositoryIMockGetTextChunksBySource) Times(n uint64) *mRepositoryIMockGetTextChunksBySource { +// Times sets number of times RepositoryI.GetRepositoryTag should be invoked +func (mmGetRepositoryTag *mRepositoryIMockGetRepositoryTag) Times(n uint64) *mRepositoryIMockGetRepositoryTag { if n == 0 { - mmGetTextChunksBySource.mock.t.Fatalf("Times of RepositoryIMock.GetTextChunksBySource mock can not be zero") + mmGetRepositoryTag.mock.t.Fatalf("Times of RepositoryIMock.GetRepositoryTag mock can not be zero") } - mm_atomic.StoreUint64(&mmGetTextChunksBySource.expectedInvocations, n) - return mmGetTextChunksBySource + mm_atomic.StoreUint64(&mmGetRepositoryTag.expectedInvocations, n) + return mmGetRepositoryTag } -func (mmGetTextChunksBySource *mRepositoryIMockGetTextChunksBySource) invocationsDone() bool { - if len(mmGetTextChunksBySource.expectations) == 0 && mmGetTextChunksBySource.defaultExpectation == nil && mmGetTextChunksBySource.mock.funcGetTextChunksBySource == nil { +func (mmGetRepositoryTag *mRepositoryIMockGetRepositoryTag) invocationsDone() bool { + if len(mmGetRepositoryTag.expectations) == 0 && mmGetRepositoryTag.defaultExpectation == nil && mmGetRepositoryTag.mock.funcGetRepositoryTag == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmGetTextChunksBySource.mock.afterGetTextChunksBySourceCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmGetTextChunksBySource.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmGetRepositoryTag.mock.afterGetRepositoryTagCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmGetRepositoryTag.expectedInvocations) return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) } -// GetTextChunksBySource implements repository.RepositoryI -func (mmGetTextChunksBySource *RepositoryIMock) GetTextChunksBySource(ctx context.Context, sourceTable string, sourceUID uuid.UUID) (ta1 []mm_repository.TextChunk, err error) { - mm_atomic.AddUint64(&mmGetTextChunksBySource.beforeGetTextChunksBySourceCounter, 1) - defer mm_atomic.AddUint64(&mmGetTextChunksBySource.afterGetTextChunksBySourceCounter, 1) +// GetRepositoryTag implements repository.RepositoryI +func (mmGetRepositoryTag *RepositoryIMock) GetRepositoryTag(ctx context.Context, r1 utils.RepositoryTagName) (rp1 *pb.RepositoryTag, err error) { + mm_atomic.AddUint64(&mmGetRepositoryTag.beforeGetRepositoryTagCounter, 1) + defer mm_atomic.AddUint64(&mmGetRepositoryTag.afterGetRepositoryTagCounter, 1) - if mmGetTextChunksBySource.inspectFuncGetTextChunksBySource != nil { - mmGetTextChunksBySource.inspectFuncGetTextChunksBySource(ctx, sourceTable, sourceUID) + if mmGetRepositoryTag.inspectFuncGetRepositoryTag != nil { + mmGetRepositoryTag.inspectFuncGetRepositoryTag(ctx, r1) } - mm_params := RepositoryIMockGetTextChunksBySourceParams{ctx, sourceTable, sourceUID} + mm_params := RepositoryIMockGetRepositoryTagParams{ctx, r1} // Record call args - mmGetTextChunksBySource.GetTextChunksBySourceMock.mutex.Lock() - mmGetTextChunksBySource.GetTextChunksBySourceMock.callArgs = append(mmGetTextChunksBySource.GetTextChunksBySourceMock.callArgs, &mm_params) - mmGetTextChunksBySource.GetTextChunksBySourceMock.mutex.Unlock() + mmGetRepositoryTag.GetRepositoryTagMock.mutex.Lock() + mmGetRepositoryTag.GetRepositoryTagMock.callArgs = append(mmGetRepositoryTag.GetRepositoryTagMock.callArgs, &mm_params) + mmGetRepositoryTag.GetRepositoryTagMock.mutex.Unlock() - for _, e := range mmGetTextChunksBySource.GetTextChunksBySourceMock.expectations { + for _, e := range mmGetRepositoryTag.GetRepositoryTagMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.ta1, e.results.err + return e.results.rp1, e.results.err } } - if mmGetTextChunksBySource.GetTextChunksBySourceMock.defaultExpectation != nil { - mm_atomic.AddUint64(&mmGetTextChunksBySource.GetTextChunksBySourceMock.defaultExpectation.Counter, 1) - mm_want := mmGetTextChunksBySource.GetTextChunksBySourceMock.defaultExpectation.params - mm_want_ptrs := mmGetTextChunksBySource.GetTextChunksBySourceMock.defaultExpectation.paramPtrs + if mmGetRepositoryTag.GetRepositoryTagMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmGetRepositoryTag.GetRepositoryTagMock.defaultExpectation.Counter, 1) + mm_want := mmGetRepositoryTag.GetRepositoryTagMock.defaultExpectation.params + mm_want_ptrs := mmGetRepositoryTag.GetRepositoryTagMock.defaultExpectation.paramPtrs - mm_got := RepositoryIMockGetTextChunksBySourceParams{ctx, sourceTable, sourceUID} + mm_got := RepositoryIMockGetRepositoryTagParams{ctx, r1} if mm_want_ptrs != nil { if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { - mmGetTextChunksBySource.t.Errorf("RepositoryIMock.GetTextChunksBySource got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) + mmGetRepositoryTag.t.Errorf("RepositoryIMock.GetRepositoryTag got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) } - if mm_want_ptrs.sourceTable != nil && !minimock.Equal(*mm_want_ptrs.sourceTable, mm_got.sourceTable) { - mmGetTextChunksBySource.t.Errorf("RepositoryIMock.GetTextChunksBySource got unexpected parameter sourceTable, want: %#v, got: %#v%s\n", *mm_want_ptrs.sourceTable, mm_got.sourceTable, minimock.Diff(*mm_want_ptrs.sourceTable, mm_got.sourceTable)) - } - - if mm_want_ptrs.sourceUID != nil && !minimock.Equal(*mm_want_ptrs.sourceUID, mm_got.sourceUID) { - mmGetTextChunksBySource.t.Errorf("RepositoryIMock.GetTextChunksBySource got unexpected parameter sourceUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.sourceUID, mm_got.sourceUID, minimock.Diff(*mm_want_ptrs.sourceUID, mm_got.sourceUID)) + if mm_want_ptrs.r1 != nil && !minimock.Equal(*mm_want_ptrs.r1, mm_got.r1) { + mmGetRepositoryTag.t.Errorf("RepositoryIMock.GetRepositoryTag got unexpected parameter r1, want: %#v, got: %#v%s\n", *mm_want_ptrs.r1, mm_got.r1, minimock.Diff(*mm_want_ptrs.r1, mm_got.r1)) } } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { - mmGetTextChunksBySource.t.Errorf("RepositoryIMock.GetTextChunksBySource got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + mmGetRepositoryTag.t.Errorf("RepositoryIMock.GetRepositoryTag got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) } - mm_results := mmGetTextChunksBySource.GetTextChunksBySourceMock.defaultExpectation.results + mm_results := mmGetRepositoryTag.GetRepositoryTagMock.defaultExpectation.results if mm_results == nil { - mmGetTextChunksBySource.t.Fatal("No results are set for the RepositoryIMock.GetTextChunksBySource") + mmGetRepositoryTag.t.Fatal("No results are set for the RepositoryIMock.GetRepositoryTag") } - return (*mm_results).ta1, (*mm_results).err + return (*mm_results).rp1, (*mm_results).err } - if mmGetTextChunksBySource.funcGetTextChunksBySource != nil { - return mmGetTextChunksBySource.funcGetTextChunksBySource(ctx, sourceTable, sourceUID) + if mmGetRepositoryTag.funcGetRepositoryTag != nil { + return mmGetRepositoryTag.funcGetRepositoryTag(ctx, r1) } - mmGetTextChunksBySource.t.Fatalf("Unexpected call to RepositoryIMock.GetTextChunksBySource. %v %v %v", ctx, sourceTable, sourceUID) + mmGetRepositoryTag.t.Fatalf("Unexpected call to RepositoryIMock.GetRepositoryTag. %v %v", ctx, r1) return } -// GetTextChunksBySourceAfterCounter returns a count of finished RepositoryIMock.GetTextChunksBySource invocations -func (mmGetTextChunksBySource *RepositoryIMock) GetTextChunksBySourceAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetTextChunksBySource.afterGetTextChunksBySourceCounter) +// GetRepositoryTagAfterCounter returns a count of finished RepositoryIMock.GetRepositoryTag invocations +func (mmGetRepositoryTag *RepositoryIMock) GetRepositoryTagAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetRepositoryTag.afterGetRepositoryTagCounter) } -// GetTextChunksBySourceBeforeCounter returns a count of RepositoryIMock.GetTextChunksBySource invocations -func (mmGetTextChunksBySource *RepositoryIMock) GetTextChunksBySourceBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetTextChunksBySource.beforeGetTextChunksBySourceCounter) +// GetRepositoryTagBeforeCounter returns a count of RepositoryIMock.GetRepositoryTag invocations +func (mmGetRepositoryTag *RepositoryIMock) GetRepositoryTagBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetRepositoryTag.beforeGetRepositoryTagCounter) } -// Calls returns a list of arguments used in each call to RepositoryIMock.GetTextChunksBySource. +// Calls returns a list of arguments used in each call to RepositoryIMock.GetRepositoryTag. // The list is in the same order as the calls were made (i.e. recent calls have a higher index) -func (mmGetTextChunksBySource *mRepositoryIMockGetTextChunksBySource) Calls() []*RepositoryIMockGetTextChunksBySourceParams { - mmGetTextChunksBySource.mutex.RLock() +func (mmGetRepositoryTag *mRepositoryIMockGetRepositoryTag) Calls() []*RepositoryIMockGetRepositoryTagParams { + mmGetRepositoryTag.mutex.RLock() - argCopy := make([]*RepositoryIMockGetTextChunksBySourceParams, len(mmGetTextChunksBySource.callArgs)) - copy(argCopy, mmGetTextChunksBySource.callArgs) + argCopy := make([]*RepositoryIMockGetRepositoryTagParams, len(mmGetRepositoryTag.callArgs)) + copy(argCopy, mmGetRepositoryTag.callArgs) - mmGetTextChunksBySource.mutex.RUnlock() + mmGetRepositoryTag.mutex.RUnlock() return argCopy } -// MinimockGetTextChunksBySourceDone returns true if the count of the GetTextChunksBySource invocations corresponds +// MinimockGetRepositoryTagDone returns true if the count of the GetRepositoryTag invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockGetTextChunksBySourceDone() bool { - for _, e := range m.GetTextChunksBySourceMock.expectations { +func (m *RepositoryIMock) MinimockGetRepositoryTagDone() bool { + for _, e := range m.GetRepositoryTagMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.GetTextChunksBySourceMock.invocationsDone() + return m.GetRepositoryTagMock.invocationsDone() } -// MinimockGetTextChunksBySourceInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockGetTextChunksBySourceInspect() { - for _, e := range m.GetTextChunksBySourceMock.expectations { +// MinimockGetRepositoryTagInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockGetRepositoryTagInspect() { + for _, e := range m.GetRepositoryTagMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { - m.t.Errorf("Expected call to RepositoryIMock.GetTextChunksBySource with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.GetRepositoryTag with params: %#v", *e.params) } } - afterGetTextChunksBySourceCounter := mm_atomic.LoadUint64(&m.afterGetTextChunksBySourceCounter) + afterGetRepositoryTagCounter := mm_atomic.LoadUint64(&m.afterGetRepositoryTagCounter) // if default expectation was set then invocations count should be greater than zero - if m.GetTextChunksBySourceMock.defaultExpectation != nil && afterGetTextChunksBySourceCounter < 1 { - if m.GetTextChunksBySourceMock.defaultExpectation.params == nil { - m.t.Error("Expected call to RepositoryIMock.GetTextChunksBySource") + if m.GetRepositoryTagMock.defaultExpectation != nil && afterGetRepositoryTagCounter < 1 { + if m.GetRepositoryTagMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.GetRepositoryTag") } else { - m.t.Errorf("Expected call to RepositoryIMock.GetTextChunksBySource with params: %#v", *m.GetTextChunksBySourceMock.defaultExpectation.params) + m.t.Errorf("Expected call to RepositoryIMock.GetRepositoryTag with params: %#v", *m.GetRepositoryTagMock.defaultExpectation.params) } } // if func was set then invocations count should be greater than zero - if m.funcGetTextChunksBySource != nil && afterGetTextChunksBySourceCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.GetTextChunksBySource") + if m.funcGetRepositoryTag != nil && afterGetRepositoryTagCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.GetRepositoryTag") } - if !m.GetTextChunksBySourceMock.invocationsDone() && afterGetTextChunksBySourceCounter > 0 { - m.t.Errorf("Expected %d calls to RepositoryIMock.GetTextChunksBySource but found %d calls", - mm_atomic.LoadUint64(&m.GetTextChunksBySourceMock.expectedInvocations), afterGetTextChunksBySourceCounter) + if !m.GetRepositoryTagMock.invocationsDone() && afterGetRepositoryTagCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.GetRepositoryTag but found %d calls", + mm_atomic.LoadUint64(&m.GetRepositoryTagMock.expectedInvocations), afterGetRepositoryTagCounter) } } -type mRepositoryIMockGetTotalChunksBySources struct { +type mRepositoryIMockGetSourceTableAndUIDByFileUIDs struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockGetTotalChunksBySourcesExpectation - expectations []*RepositoryIMockGetTotalChunksBySourcesExpectation + defaultExpectation *RepositoryIMockGetSourceTableAndUIDByFileUIDsExpectation + expectations []*RepositoryIMockGetSourceTableAndUIDByFileUIDsExpectation - callArgs []*RepositoryIMockGetTotalChunksBySourcesParams + callArgs []*RepositoryIMockGetSourceTableAndUIDByFileUIDsParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockGetTotalChunksBySourcesExpectation specifies expectation struct of the RepositoryI.GetTotalChunksBySources -type RepositoryIMockGetTotalChunksBySourcesExpectation struct { +// RepositoryIMockGetSourceTableAndUIDByFileUIDsExpectation specifies expectation struct of the RepositoryI.GetSourceTableAndUIDByFileUIDs +type RepositoryIMockGetSourceTableAndUIDByFileUIDsExpectation struct { mock *RepositoryIMock - params *RepositoryIMockGetTotalChunksBySourcesParams - paramPtrs *RepositoryIMockGetTotalChunksBySourcesParamPtrs - results *RepositoryIMockGetTotalChunksBySourcesResults + params *RepositoryIMockGetSourceTableAndUIDByFileUIDsParams + paramPtrs *RepositoryIMockGetSourceTableAndUIDByFileUIDsParamPtrs + results *RepositoryIMockGetSourceTableAndUIDByFileUIDsResults Counter uint64 } -// RepositoryIMockGetTotalChunksBySourcesParams contains parameters of the RepositoryI.GetTotalChunksBySources -type RepositoryIMockGetTotalChunksBySourcesParams struct { - ctx context.Context - sources map[mm_repository.FileUID]struct { - SourceTable mm_repository.SourceTable - SourceUID mm_repository.SourceUID - } +// RepositoryIMockGetSourceTableAndUIDByFileUIDsParams contains parameters of the RepositoryI.GetSourceTableAndUIDByFileUIDs +type RepositoryIMockGetSourceTableAndUIDByFileUIDsParams struct { + ctx context.Context + files []mm_repository.KnowledgeBaseFile } -// RepositoryIMockGetTotalChunksBySourcesParamPtrs contains pointers to parameters of the RepositoryI.GetTotalChunksBySources -type RepositoryIMockGetTotalChunksBySourcesParamPtrs struct { - ctx *context.Context - sources *map[mm_repository.FileUID]struct { - SourceTable mm_repository.SourceTable - SourceUID mm_repository.SourceUID - } +// RepositoryIMockGetSourceTableAndUIDByFileUIDsParamPtrs contains pointers to parameters of the RepositoryI.GetSourceTableAndUIDByFileUIDs +type RepositoryIMockGetSourceTableAndUIDByFileUIDsParamPtrs struct { + ctx *context.Context + files *[]mm_repository.KnowledgeBaseFile } -// RepositoryIMockGetTotalChunksBySourcesResults contains results of the RepositoryI.GetTotalChunksBySources -type RepositoryIMockGetTotalChunksBySourcesResults struct { - m1 map[mm_repository.FileUID]int +// RepositoryIMockGetSourceTableAndUIDByFileUIDsResults contains results of the RepositoryI.GetSourceTableAndUIDByFileUIDs +type RepositoryIMockGetSourceTableAndUIDByFileUIDsResults struct { + m1 map[mm_repository.FileUID]struct { + SourceTable string + SourceUID uuid.UUID + } err error } -// Expect sets up expected params for RepositoryI.GetTotalChunksBySources -func (mmGetTotalChunksBySources *mRepositoryIMockGetTotalChunksBySources) Expect(ctx context.Context, sources map[mm_repository.FileUID]struct { - SourceTable mm_repository.SourceTable - SourceUID mm_repository.SourceUID -}) *mRepositoryIMockGetTotalChunksBySources { - if mmGetTotalChunksBySources.mock.funcGetTotalChunksBySources != nil { - mmGetTotalChunksBySources.mock.t.Fatalf("RepositoryIMock.GetTotalChunksBySources mock is already set by Set") +// Expect sets up expected params for RepositoryI.GetSourceTableAndUIDByFileUIDs +func (mmGetSourceTableAndUIDByFileUIDs *mRepositoryIMockGetSourceTableAndUIDByFileUIDs) Expect(ctx context.Context, files []mm_repository.KnowledgeBaseFile) *mRepositoryIMockGetSourceTableAndUIDByFileUIDs { + if mmGetSourceTableAndUIDByFileUIDs.mock.funcGetSourceTableAndUIDByFileUIDs != nil { + mmGetSourceTableAndUIDByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetSourceTableAndUIDByFileUIDs mock is already set by Set") } - if mmGetTotalChunksBySources.defaultExpectation == nil { - mmGetTotalChunksBySources.defaultExpectation = &RepositoryIMockGetTotalChunksBySourcesExpectation{} + if mmGetSourceTableAndUIDByFileUIDs.defaultExpectation == nil { + mmGetSourceTableAndUIDByFileUIDs.defaultExpectation = &RepositoryIMockGetSourceTableAndUIDByFileUIDsExpectation{} } - if mmGetTotalChunksBySources.defaultExpectation.paramPtrs != nil { - mmGetTotalChunksBySources.mock.t.Fatalf("RepositoryIMock.GetTotalChunksBySources mock is already set by ExpectParams functions") + if mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.paramPtrs != nil { + mmGetSourceTableAndUIDByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetSourceTableAndUIDByFileUIDs mock is already set by ExpectParams functions") } - mmGetTotalChunksBySources.defaultExpectation.params = &RepositoryIMockGetTotalChunksBySourcesParams{ctx, sources} - for _, e := range mmGetTotalChunksBySources.expectations { - if minimock.Equal(e.params, mmGetTotalChunksBySources.defaultExpectation.params) { - mmGetTotalChunksBySources.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetTotalChunksBySources.defaultExpectation.params) + mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.params = &RepositoryIMockGetSourceTableAndUIDByFileUIDsParams{ctx, files} + for _, e := range mmGetSourceTableAndUIDByFileUIDs.expectations { + if minimock.Equal(e.params, mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.params) { + mmGetSourceTableAndUIDByFileUIDs.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.params) } } - return mmGetTotalChunksBySources + return mmGetSourceTableAndUIDByFileUIDs } -// ExpectCtxParam1 sets up expected param ctx for RepositoryI.GetTotalChunksBySources -func (mmGetTotalChunksBySources *mRepositoryIMockGetTotalChunksBySources) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockGetTotalChunksBySources { - if mmGetTotalChunksBySources.mock.funcGetTotalChunksBySources != nil { - mmGetTotalChunksBySources.mock.t.Fatalf("RepositoryIMock.GetTotalChunksBySources mock is already set by Set") +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.GetSourceTableAndUIDByFileUIDs +func (mmGetSourceTableAndUIDByFileUIDs *mRepositoryIMockGetSourceTableAndUIDByFileUIDs) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockGetSourceTableAndUIDByFileUIDs { + if mmGetSourceTableAndUIDByFileUIDs.mock.funcGetSourceTableAndUIDByFileUIDs != nil { + mmGetSourceTableAndUIDByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetSourceTableAndUIDByFileUIDs mock is already set by Set") } - if mmGetTotalChunksBySources.defaultExpectation == nil { - mmGetTotalChunksBySources.defaultExpectation = &RepositoryIMockGetTotalChunksBySourcesExpectation{} + if mmGetSourceTableAndUIDByFileUIDs.defaultExpectation == nil { + mmGetSourceTableAndUIDByFileUIDs.defaultExpectation = &RepositoryIMockGetSourceTableAndUIDByFileUIDsExpectation{} } - if mmGetTotalChunksBySources.defaultExpectation.params != nil { - mmGetTotalChunksBySources.mock.t.Fatalf("RepositoryIMock.GetTotalChunksBySources mock is already set by Expect") + if mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.params != nil { + mmGetSourceTableAndUIDByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetSourceTableAndUIDByFileUIDs mock is already set by Expect") } - if mmGetTotalChunksBySources.defaultExpectation.paramPtrs == nil { - mmGetTotalChunksBySources.defaultExpectation.paramPtrs = &RepositoryIMockGetTotalChunksBySourcesParamPtrs{} + if mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.paramPtrs == nil { + mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.paramPtrs = &RepositoryIMockGetSourceTableAndUIDByFileUIDsParamPtrs{} } - mmGetTotalChunksBySources.defaultExpectation.paramPtrs.ctx = &ctx + mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.paramPtrs.ctx = &ctx - return mmGetTotalChunksBySources + return mmGetSourceTableAndUIDByFileUIDs } -// ExpectSourcesParam2 sets up expected param sources for RepositoryI.GetTotalChunksBySources -func (mmGetTotalChunksBySources *mRepositoryIMockGetTotalChunksBySources) ExpectSourcesParam2(sources map[mm_repository.FileUID]struct { - SourceTable mm_repository.SourceTable - SourceUID mm_repository.SourceUID -}) *mRepositoryIMockGetTotalChunksBySources { - if mmGetTotalChunksBySources.mock.funcGetTotalChunksBySources != nil { - mmGetTotalChunksBySources.mock.t.Fatalf("RepositoryIMock.GetTotalChunksBySources mock is already set by Set") +// ExpectFilesParam2 sets up expected param files for RepositoryI.GetSourceTableAndUIDByFileUIDs +func (mmGetSourceTableAndUIDByFileUIDs *mRepositoryIMockGetSourceTableAndUIDByFileUIDs) ExpectFilesParam2(files []mm_repository.KnowledgeBaseFile) *mRepositoryIMockGetSourceTableAndUIDByFileUIDs { + if mmGetSourceTableAndUIDByFileUIDs.mock.funcGetSourceTableAndUIDByFileUIDs != nil { + mmGetSourceTableAndUIDByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetSourceTableAndUIDByFileUIDs mock is already set by Set") } - if mmGetTotalChunksBySources.defaultExpectation == nil { - mmGetTotalChunksBySources.defaultExpectation = &RepositoryIMockGetTotalChunksBySourcesExpectation{} + if mmGetSourceTableAndUIDByFileUIDs.defaultExpectation == nil { + mmGetSourceTableAndUIDByFileUIDs.defaultExpectation = &RepositoryIMockGetSourceTableAndUIDByFileUIDsExpectation{} } - if mmGetTotalChunksBySources.defaultExpectation.params != nil { - mmGetTotalChunksBySources.mock.t.Fatalf("RepositoryIMock.GetTotalChunksBySources mock is already set by Expect") + if mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.params != nil { + mmGetSourceTableAndUIDByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetSourceTableAndUIDByFileUIDs mock is already set by Expect") } - if mmGetTotalChunksBySources.defaultExpectation.paramPtrs == nil { - mmGetTotalChunksBySources.defaultExpectation.paramPtrs = &RepositoryIMockGetTotalChunksBySourcesParamPtrs{} + if mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.paramPtrs == nil { + mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.paramPtrs = &RepositoryIMockGetSourceTableAndUIDByFileUIDsParamPtrs{} } - mmGetTotalChunksBySources.defaultExpectation.paramPtrs.sources = &sources + mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.paramPtrs.files = &files - return mmGetTotalChunksBySources + return mmGetSourceTableAndUIDByFileUIDs } -// Inspect accepts an inspector function that has same arguments as the RepositoryI.GetTotalChunksBySources -func (mmGetTotalChunksBySources *mRepositoryIMockGetTotalChunksBySources) Inspect(f func(ctx context.Context, sources map[mm_repository.FileUID]struct { - SourceTable mm_repository.SourceTable - SourceUID mm_repository.SourceUID -})) *mRepositoryIMockGetTotalChunksBySources { - if mmGetTotalChunksBySources.mock.inspectFuncGetTotalChunksBySources != nil { - mmGetTotalChunksBySources.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.GetTotalChunksBySources") +// Inspect accepts an inspector function that has same arguments as the RepositoryI.GetSourceTableAndUIDByFileUIDs +func (mmGetSourceTableAndUIDByFileUIDs *mRepositoryIMockGetSourceTableAndUIDByFileUIDs) Inspect(f func(ctx context.Context, files []mm_repository.KnowledgeBaseFile)) *mRepositoryIMockGetSourceTableAndUIDByFileUIDs { + if mmGetSourceTableAndUIDByFileUIDs.mock.inspectFuncGetSourceTableAndUIDByFileUIDs != nil { + mmGetSourceTableAndUIDByFileUIDs.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.GetSourceTableAndUIDByFileUIDs") } - mmGetTotalChunksBySources.mock.inspectFuncGetTotalChunksBySources = f + mmGetSourceTableAndUIDByFileUIDs.mock.inspectFuncGetSourceTableAndUIDByFileUIDs = f - return mmGetTotalChunksBySources + return mmGetSourceTableAndUIDByFileUIDs } -// Return sets up results that will be returned by RepositoryI.GetTotalChunksBySources -func (mmGetTotalChunksBySources *mRepositoryIMockGetTotalChunksBySources) Return(m1 map[mm_repository.FileUID]int, err error) *RepositoryIMock { - if mmGetTotalChunksBySources.mock.funcGetTotalChunksBySources != nil { - mmGetTotalChunksBySources.mock.t.Fatalf("RepositoryIMock.GetTotalChunksBySources mock is already set by Set") +// Return sets up results that will be returned by RepositoryI.GetSourceTableAndUIDByFileUIDs +func (mmGetSourceTableAndUIDByFileUIDs *mRepositoryIMockGetSourceTableAndUIDByFileUIDs) Return(m1 map[mm_repository.FileUID]struct { + SourceTable string + SourceUID uuid.UUID +}, err error) *RepositoryIMock { + if mmGetSourceTableAndUIDByFileUIDs.mock.funcGetSourceTableAndUIDByFileUIDs != nil { + mmGetSourceTableAndUIDByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetSourceTableAndUIDByFileUIDs mock is already set by Set") } - if mmGetTotalChunksBySources.defaultExpectation == nil { - mmGetTotalChunksBySources.defaultExpectation = &RepositoryIMockGetTotalChunksBySourcesExpectation{mock: mmGetTotalChunksBySources.mock} + if mmGetSourceTableAndUIDByFileUIDs.defaultExpectation == nil { + mmGetSourceTableAndUIDByFileUIDs.defaultExpectation = &RepositoryIMockGetSourceTableAndUIDByFileUIDsExpectation{mock: mmGetSourceTableAndUIDByFileUIDs.mock} } - mmGetTotalChunksBySources.defaultExpectation.results = &RepositoryIMockGetTotalChunksBySourcesResults{m1, err} - return mmGetTotalChunksBySources.mock + mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.results = &RepositoryIMockGetSourceTableAndUIDByFileUIDsResults{m1, err} + return mmGetSourceTableAndUIDByFileUIDs.mock } -// Set uses given function f to mock the RepositoryI.GetTotalChunksBySources method -func (mmGetTotalChunksBySources *mRepositoryIMockGetTotalChunksBySources) Set(f func(ctx context.Context, sources map[mm_repository.FileUID]struct { - SourceTable mm_repository.SourceTable - SourceUID mm_repository.SourceUID -}) (m1 map[mm_repository.FileUID]int, err error)) *RepositoryIMock { - if mmGetTotalChunksBySources.defaultExpectation != nil { - mmGetTotalChunksBySources.mock.t.Fatalf("Default expectation is already set for the RepositoryI.GetTotalChunksBySources method") - } - - if len(mmGetTotalChunksBySources.expectations) > 0 { - mmGetTotalChunksBySources.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetTotalChunksBySources method") - } - - mmGetTotalChunksBySources.mock.funcGetTotalChunksBySources = f - return mmGetTotalChunksBySources.mock +// Set uses given function f to mock the RepositoryI.GetSourceTableAndUIDByFileUIDs method +func (mmGetSourceTableAndUIDByFileUIDs *mRepositoryIMockGetSourceTableAndUIDByFileUIDs) Set(f func(ctx context.Context, files []mm_repository.KnowledgeBaseFile) (m1 map[mm_repository.FileUID]struct { + SourceTable string + SourceUID uuid.UUID +}, err error)) *RepositoryIMock { + if mmGetSourceTableAndUIDByFileUIDs.defaultExpectation != nil { + mmGetSourceTableAndUIDByFileUIDs.mock.t.Fatalf("Default expectation is already set for the RepositoryI.GetSourceTableAndUIDByFileUIDs method") + } + + if len(mmGetSourceTableAndUIDByFileUIDs.expectations) > 0 { + mmGetSourceTableAndUIDByFileUIDs.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetSourceTableAndUIDByFileUIDs method") + } + + mmGetSourceTableAndUIDByFileUIDs.mock.funcGetSourceTableAndUIDByFileUIDs = f + return mmGetSourceTableAndUIDByFileUIDs.mock } -// When sets expectation for the RepositoryI.GetTotalChunksBySources which will trigger the result defined by the following +// When sets expectation for the RepositoryI.GetSourceTableAndUIDByFileUIDs which will trigger the result defined by the following // Then helper -func (mmGetTotalChunksBySources *mRepositoryIMockGetTotalChunksBySources) When(ctx context.Context, sources map[mm_repository.FileUID]struct { - SourceTable mm_repository.SourceTable - SourceUID mm_repository.SourceUID -}) *RepositoryIMockGetTotalChunksBySourcesExpectation { - if mmGetTotalChunksBySources.mock.funcGetTotalChunksBySources != nil { - mmGetTotalChunksBySources.mock.t.Fatalf("RepositoryIMock.GetTotalChunksBySources mock is already set by Set") +func (mmGetSourceTableAndUIDByFileUIDs *mRepositoryIMockGetSourceTableAndUIDByFileUIDs) When(ctx context.Context, files []mm_repository.KnowledgeBaseFile) *RepositoryIMockGetSourceTableAndUIDByFileUIDsExpectation { + if mmGetSourceTableAndUIDByFileUIDs.mock.funcGetSourceTableAndUIDByFileUIDs != nil { + mmGetSourceTableAndUIDByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetSourceTableAndUIDByFileUIDs mock is already set by Set") } - expectation := &RepositoryIMockGetTotalChunksBySourcesExpectation{ - mock: mmGetTotalChunksBySources.mock, - params: &RepositoryIMockGetTotalChunksBySourcesParams{ctx, sources}, + expectation := &RepositoryIMockGetSourceTableAndUIDByFileUIDsExpectation{ + mock: mmGetSourceTableAndUIDByFileUIDs.mock, + params: &RepositoryIMockGetSourceTableAndUIDByFileUIDsParams{ctx, files}, } - mmGetTotalChunksBySources.expectations = append(mmGetTotalChunksBySources.expectations, expectation) + mmGetSourceTableAndUIDByFileUIDs.expectations = append(mmGetSourceTableAndUIDByFileUIDs.expectations, expectation) return expectation } -// Then sets up RepositoryI.GetTotalChunksBySources return parameters for the expectation previously defined by the When method -func (e *RepositoryIMockGetTotalChunksBySourcesExpectation) Then(m1 map[mm_repository.FileUID]int, err error) *RepositoryIMock { - e.results = &RepositoryIMockGetTotalChunksBySourcesResults{m1, err} +// Then sets up RepositoryI.GetSourceTableAndUIDByFileUIDs return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockGetSourceTableAndUIDByFileUIDsExpectation) Then(m1 map[mm_repository.FileUID]struct { + SourceTable string + SourceUID uuid.UUID +}, err error) *RepositoryIMock { + e.results = &RepositoryIMockGetSourceTableAndUIDByFileUIDsResults{m1, err} return e.mock } -// Times sets number of times RepositoryI.GetTotalChunksBySources should be invoked -func (mmGetTotalChunksBySources *mRepositoryIMockGetTotalChunksBySources) Times(n uint64) *mRepositoryIMockGetTotalChunksBySources { +// Times sets number of times RepositoryI.GetSourceTableAndUIDByFileUIDs should be invoked +func (mmGetSourceTableAndUIDByFileUIDs *mRepositoryIMockGetSourceTableAndUIDByFileUIDs) Times(n uint64) *mRepositoryIMockGetSourceTableAndUIDByFileUIDs { if n == 0 { - mmGetTotalChunksBySources.mock.t.Fatalf("Times of RepositoryIMock.GetTotalChunksBySources mock can not be zero") + mmGetSourceTableAndUIDByFileUIDs.mock.t.Fatalf("Times of RepositoryIMock.GetSourceTableAndUIDByFileUIDs mock can not be zero") } - mm_atomic.StoreUint64(&mmGetTotalChunksBySources.expectedInvocations, n) - return mmGetTotalChunksBySources + mm_atomic.StoreUint64(&mmGetSourceTableAndUIDByFileUIDs.expectedInvocations, n) + return mmGetSourceTableAndUIDByFileUIDs } -func (mmGetTotalChunksBySources *mRepositoryIMockGetTotalChunksBySources) invocationsDone() bool { - if len(mmGetTotalChunksBySources.expectations) == 0 && mmGetTotalChunksBySources.defaultExpectation == nil && mmGetTotalChunksBySources.mock.funcGetTotalChunksBySources == nil { +func (mmGetSourceTableAndUIDByFileUIDs *mRepositoryIMockGetSourceTableAndUIDByFileUIDs) invocationsDone() bool { + if len(mmGetSourceTableAndUIDByFileUIDs.expectations) == 0 && mmGetSourceTableAndUIDByFileUIDs.defaultExpectation == nil && mmGetSourceTableAndUIDByFileUIDs.mock.funcGetSourceTableAndUIDByFileUIDs == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmGetTotalChunksBySources.mock.afterGetTotalChunksBySourcesCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmGetTotalChunksBySources.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmGetSourceTableAndUIDByFileUIDs.mock.afterGetSourceTableAndUIDByFileUIDsCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmGetSourceTableAndUIDByFileUIDs.expectedInvocations) return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) } -// GetTotalChunksBySources implements repository.RepositoryI -func (mmGetTotalChunksBySources *RepositoryIMock) GetTotalChunksBySources(ctx context.Context, sources map[mm_repository.FileUID]struct { - SourceTable mm_repository.SourceTable - SourceUID mm_repository.SourceUID -}) (m1 map[mm_repository.FileUID]int, err error) { - mm_atomic.AddUint64(&mmGetTotalChunksBySources.beforeGetTotalChunksBySourcesCounter, 1) - defer mm_atomic.AddUint64(&mmGetTotalChunksBySources.afterGetTotalChunksBySourcesCounter, 1) +// GetSourceTableAndUIDByFileUIDs implements repository.RepositoryI +func (mmGetSourceTableAndUIDByFileUIDs *RepositoryIMock) GetSourceTableAndUIDByFileUIDs(ctx context.Context, files []mm_repository.KnowledgeBaseFile) (m1 map[mm_repository.FileUID]struct { + SourceTable string + SourceUID uuid.UUID +}, err error) { + mm_atomic.AddUint64(&mmGetSourceTableAndUIDByFileUIDs.beforeGetSourceTableAndUIDByFileUIDsCounter, 1) + defer mm_atomic.AddUint64(&mmGetSourceTableAndUIDByFileUIDs.afterGetSourceTableAndUIDByFileUIDsCounter, 1) - if mmGetTotalChunksBySources.inspectFuncGetTotalChunksBySources != nil { - mmGetTotalChunksBySources.inspectFuncGetTotalChunksBySources(ctx, sources) + if mmGetSourceTableAndUIDByFileUIDs.inspectFuncGetSourceTableAndUIDByFileUIDs != nil { + mmGetSourceTableAndUIDByFileUIDs.inspectFuncGetSourceTableAndUIDByFileUIDs(ctx, files) } - mm_params := RepositoryIMockGetTotalChunksBySourcesParams{ctx, sources} + mm_params := RepositoryIMockGetSourceTableAndUIDByFileUIDsParams{ctx, files} // Record call args - mmGetTotalChunksBySources.GetTotalChunksBySourcesMock.mutex.Lock() - mmGetTotalChunksBySources.GetTotalChunksBySourcesMock.callArgs = append(mmGetTotalChunksBySources.GetTotalChunksBySourcesMock.callArgs, &mm_params) - mmGetTotalChunksBySources.GetTotalChunksBySourcesMock.mutex.Unlock() + mmGetSourceTableAndUIDByFileUIDs.GetSourceTableAndUIDByFileUIDsMock.mutex.Lock() + mmGetSourceTableAndUIDByFileUIDs.GetSourceTableAndUIDByFileUIDsMock.callArgs = append(mmGetSourceTableAndUIDByFileUIDs.GetSourceTableAndUIDByFileUIDsMock.callArgs, &mm_params) + mmGetSourceTableAndUIDByFileUIDs.GetSourceTableAndUIDByFileUIDsMock.mutex.Unlock() - for _, e := range mmGetTotalChunksBySources.GetTotalChunksBySourcesMock.expectations { + for _, e := range mmGetSourceTableAndUIDByFileUIDs.GetSourceTableAndUIDByFileUIDsMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) return e.results.m1, e.results.err } } - if mmGetTotalChunksBySources.GetTotalChunksBySourcesMock.defaultExpectation != nil { - mm_atomic.AddUint64(&mmGetTotalChunksBySources.GetTotalChunksBySourcesMock.defaultExpectation.Counter, 1) - mm_want := mmGetTotalChunksBySources.GetTotalChunksBySourcesMock.defaultExpectation.params - mm_want_ptrs := mmGetTotalChunksBySources.GetTotalChunksBySourcesMock.defaultExpectation.paramPtrs + if mmGetSourceTableAndUIDByFileUIDs.GetSourceTableAndUIDByFileUIDsMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmGetSourceTableAndUIDByFileUIDs.GetSourceTableAndUIDByFileUIDsMock.defaultExpectation.Counter, 1) + mm_want := mmGetSourceTableAndUIDByFileUIDs.GetSourceTableAndUIDByFileUIDsMock.defaultExpectation.params + mm_want_ptrs := mmGetSourceTableAndUIDByFileUIDs.GetSourceTableAndUIDByFileUIDsMock.defaultExpectation.paramPtrs - mm_got := RepositoryIMockGetTotalChunksBySourcesParams{ctx, sources} + mm_got := RepositoryIMockGetSourceTableAndUIDByFileUIDsParams{ctx, files} if mm_want_ptrs != nil { if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { - mmGetTotalChunksBySources.t.Errorf("RepositoryIMock.GetTotalChunksBySources got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) + mmGetSourceTableAndUIDByFileUIDs.t.Errorf("RepositoryIMock.GetSourceTableAndUIDByFileUIDs got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) } - if mm_want_ptrs.sources != nil && !minimock.Equal(*mm_want_ptrs.sources, mm_got.sources) { - mmGetTotalChunksBySources.t.Errorf("RepositoryIMock.GetTotalChunksBySources got unexpected parameter sources, want: %#v, got: %#v%s\n", *mm_want_ptrs.sources, mm_got.sources, minimock.Diff(*mm_want_ptrs.sources, mm_got.sources)) + if mm_want_ptrs.files != nil && !minimock.Equal(*mm_want_ptrs.files, mm_got.files) { + mmGetSourceTableAndUIDByFileUIDs.t.Errorf("RepositoryIMock.GetSourceTableAndUIDByFileUIDs got unexpected parameter files, want: %#v, got: %#v%s\n", *mm_want_ptrs.files, mm_got.files, minimock.Diff(*mm_want_ptrs.files, mm_got.files)) } } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { - mmGetTotalChunksBySources.t.Errorf("RepositoryIMock.GetTotalChunksBySources got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + mmGetSourceTableAndUIDByFileUIDs.t.Errorf("RepositoryIMock.GetSourceTableAndUIDByFileUIDs got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) } - mm_results := mmGetTotalChunksBySources.GetTotalChunksBySourcesMock.defaultExpectation.results + mm_results := mmGetSourceTableAndUIDByFileUIDs.GetSourceTableAndUIDByFileUIDsMock.defaultExpectation.results if mm_results == nil { - mmGetTotalChunksBySources.t.Fatal("No results are set for the RepositoryIMock.GetTotalChunksBySources") + mmGetSourceTableAndUIDByFileUIDs.t.Fatal("No results are set for the RepositoryIMock.GetSourceTableAndUIDByFileUIDs") } return (*mm_results).m1, (*mm_results).err } - if mmGetTotalChunksBySources.funcGetTotalChunksBySources != nil { - return mmGetTotalChunksBySources.funcGetTotalChunksBySources(ctx, sources) + if mmGetSourceTableAndUIDByFileUIDs.funcGetSourceTableAndUIDByFileUIDs != nil { + return mmGetSourceTableAndUIDByFileUIDs.funcGetSourceTableAndUIDByFileUIDs(ctx, files) } - mmGetTotalChunksBySources.t.Fatalf("Unexpected call to RepositoryIMock.GetTotalChunksBySources. %v %v", ctx, sources) + mmGetSourceTableAndUIDByFileUIDs.t.Fatalf("Unexpected call to RepositoryIMock.GetSourceTableAndUIDByFileUIDs. %v %v", ctx, files) return } -// GetTotalChunksBySourcesAfterCounter returns a count of finished RepositoryIMock.GetTotalChunksBySources invocations -func (mmGetTotalChunksBySources *RepositoryIMock) GetTotalChunksBySourcesAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetTotalChunksBySources.afterGetTotalChunksBySourcesCounter) +// GetSourceTableAndUIDByFileUIDsAfterCounter returns a count of finished RepositoryIMock.GetSourceTableAndUIDByFileUIDs invocations +func (mmGetSourceTableAndUIDByFileUIDs *RepositoryIMock) GetSourceTableAndUIDByFileUIDsAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetSourceTableAndUIDByFileUIDs.afterGetSourceTableAndUIDByFileUIDsCounter) } -// GetTotalChunksBySourcesBeforeCounter returns a count of RepositoryIMock.GetTotalChunksBySources invocations -func (mmGetTotalChunksBySources *RepositoryIMock) GetTotalChunksBySourcesBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetTotalChunksBySources.beforeGetTotalChunksBySourcesCounter) +// GetSourceTableAndUIDByFileUIDsBeforeCounter returns a count of RepositoryIMock.GetSourceTableAndUIDByFileUIDs invocations +func (mmGetSourceTableAndUIDByFileUIDs *RepositoryIMock) GetSourceTableAndUIDByFileUIDsBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetSourceTableAndUIDByFileUIDs.beforeGetSourceTableAndUIDByFileUIDsCounter) } -// Calls returns a list of arguments used in each call to RepositoryIMock.GetTotalChunksBySources. +// Calls returns a list of arguments used in each call to RepositoryIMock.GetSourceTableAndUIDByFileUIDs. // The list is in the same order as the calls were made (i.e. recent calls have a higher index) -func (mmGetTotalChunksBySources *mRepositoryIMockGetTotalChunksBySources) Calls() []*RepositoryIMockGetTotalChunksBySourcesParams { - mmGetTotalChunksBySources.mutex.RLock() +func (mmGetSourceTableAndUIDByFileUIDs *mRepositoryIMockGetSourceTableAndUIDByFileUIDs) Calls() []*RepositoryIMockGetSourceTableAndUIDByFileUIDsParams { + mmGetSourceTableAndUIDByFileUIDs.mutex.RLock() - argCopy := make([]*RepositoryIMockGetTotalChunksBySourcesParams, len(mmGetTotalChunksBySources.callArgs)) - copy(argCopy, mmGetTotalChunksBySources.callArgs) + argCopy := make([]*RepositoryIMockGetSourceTableAndUIDByFileUIDsParams, len(mmGetSourceTableAndUIDByFileUIDs.callArgs)) + copy(argCopy, mmGetSourceTableAndUIDByFileUIDs.callArgs) - mmGetTotalChunksBySources.mutex.RUnlock() + mmGetSourceTableAndUIDByFileUIDs.mutex.RUnlock() return argCopy } -// MinimockGetTotalChunksBySourcesDone returns true if the count of the GetTotalChunksBySources invocations corresponds +// MinimockGetSourceTableAndUIDByFileUIDsDone returns true if the count of the GetSourceTableAndUIDByFileUIDs invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockGetTotalChunksBySourcesDone() bool { - for _, e := range m.GetTotalChunksBySourcesMock.expectations { +func (m *RepositoryIMock) MinimockGetSourceTableAndUIDByFileUIDsDone() bool { + for _, e := range m.GetSourceTableAndUIDByFileUIDsMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.GetTotalChunksBySourcesMock.invocationsDone() + return m.GetSourceTableAndUIDByFileUIDsMock.invocationsDone() } -// MinimockGetTotalChunksBySourcesInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockGetTotalChunksBySourcesInspect() { - for _, e := range m.GetTotalChunksBySourcesMock.expectations { +// MinimockGetSourceTableAndUIDByFileUIDsInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockGetSourceTableAndUIDByFileUIDsInspect() { + for _, e := range m.GetSourceTableAndUIDByFileUIDsMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { - m.t.Errorf("Expected call to RepositoryIMock.GetTotalChunksBySources with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.GetSourceTableAndUIDByFileUIDs with params: %#v", *e.params) } } - afterGetTotalChunksBySourcesCounter := mm_atomic.LoadUint64(&m.afterGetTotalChunksBySourcesCounter) + afterGetSourceTableAndUIDByFileUIDsCounter := mm_atomic.LoadUint64(&m.afterGetSourceTableAndUIDByFileUIDsCounter) // if default expectation was set then invocations count should be greater than zero - if m.GetTotalChunksBySourcesMock.defaultExpectation != nil && afterGetTotalChunksBySourcesCounter < 1 { - if m.GetTotalChunksBySourcesMock.defaultExpectation.params == nil { - m.t.Error("Expected call to RepositoryIMock.GetTotalChunksBySources") + if m.GetSourceTableAndUIDByFileUIDsMock.defaultExpectation != nil && afterGetSourceTableAndUIDByFileUIDsCounter < 1 { + if m.GetSourceTableAndUIDByFileUIDsMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.GetSourceTableAndUIDByFileUIDs") } else { - m.t.Errorf("Expected call to RepositoryIMock.GetTotalChunksBySources with params: %#v", *m.GetTotalChunksBySourcesMock.defaultExpectation.params) + m.t.Errorf("Expected call to RepositoryIMock.GetSourceTableAndUIDByFileUIDs with params: %#v", *m.GetSourceTableAndUIDByFileUIDsMock.defaultExpectation.params) } } // if func was set then invocations count should be greater than zero - if m.funcGetTotalChunksBySources != nil && afterGetTotalChunksBySourcesCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.GetTotalChunksBySources") + if m.funcGetSourceTableAndUIDByFileUIDs != nil && afterGetSourceTableAndUIDByFileUIDsCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.GetSourceTableAndUIDByFileUIDs") } - if !m.GetTotalChunksBySourcesMock.invocationsDone() && afterGetTotalChunksBySourcesCounter > 0 { - m.t.Errorf("Expected %d calls to RepositoryIMock.GetTotalChunksBySources but found %d calls", - mm_atomic.LoadUint64(&m.GetTotalChunksBySourcesMock.expectedInvocations), afterGetTotalChunksBySourcesCounter) + if !m.GetSourceTableAndUIDByFileUIDsMock.invocationsDone() && afterGetSourceTableAndUIDByFileUIDsCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.GetSourceTableAndUIDByFileUIDs but found %d calls", + mm_atomic.LoadUint64(&m.GetSourceTableAndUIDByFileUIDsMock.expectedInvocations), afterGetSourceTableAndUIDByFileUIDsCounter) } } -type mRepositoryIMockGetTotalTokensByListKBUIDs struct { +type mRepositoryIMockGetTextChunksBySource struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockGetTotalTokensByListKBUIDsExpectation - expectations []*RepositoryIMockGetTotalTokensByListKBUIDsExpectation + defaultExpectation *RepositoryIMockGetTextChunksBySourceExpectation + expectations []*RepositoryIMockGetTextChunksBySourceExpectation - callArgs []*RepositoryIMockGetTotalTokensByListKBUIDsParams + callArgs []*RepositoryIMockGetTextChunksBySourceParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockGetTotalTokensByListKBUIDsExpectation specifies expectation struct of the RepositoryI.GetTotalTokensByListKBUIDs -type RepositoryIMockGetTotalTokensByListKBUIDsExpectation struct { +// RepositoryIMockGetTextChunksBySourceExpectation specifies expectation struct of the RepositoryI.GetTextChunksBySource +type RepositoryIMockGetTextChunksBySourceExpectation struct { mock *RepositoryIMock - params *RepositoryIMockGetTotalTokensByListKBUIDsParams - paramPtrs *RepositoryIMockGetTotalTokensByListKBUIDsParamPtrs - results *RepositoryIMockGetTotalTokensByListKBUIDsResults + params *RepositoryIMockGetTextChunksBySourceParams + paramPtrs *RepositoryIMockGetTextChunksBySourceParamPtrs + results *RepositoryIMockGetTextChunksBySourceResults Counter uint64 } -// RepositoryIMockGetTotalTokensByListKBUIDsParams contains parameters of the RepositoryI.GetTotalTokensByListKBUIDs -type RepositoryIMockGetTotalTokensByListKBUIDsParams struct { - ctx context.Context - kbUIDs []uuid.UUID +// RepositoryIMockGetTextChunksBySourceParams contains parameters of the RepositoryI.GetTextChunksBySource +type RepositoryIMockGetTextChunksBySourceParams struct { + ctx context.Context + sourceTable string + sourceUID uuid.UUID } -// RepositoryIMockGetTotalTokensByListKBUIDsParamPtrs contains pointers to parameters of the RepositoryI.GetTotalTokensByListKBUIDs -type RepositoryIMockGetTotalTokensByListKBUIDsParamPtrs struct { - ctx *context.Context - kbUIDs *[]uuid.UUID +// RepositoryIMockGetTextChunksBySourceParamPtrs contains pointers to parameters of the RepositoryI.GetTextChunksBySource +type RepositoryIMockGetTextChunksBySourceParamPtrs struct { + ctx *context.Context + sourceTable *string + sourceUID *uuid.UUID } -// RepositoryIMockGetTotalTokensByListKBUIDsResults contains results of the RepositoryI.GetTotalTokensByListKBUIDs -type RepositoryIMockGetTotalTokensByListKBUIDsResults struct { - m1 map[uuid.UUID]int +// RepositoryIMockGetTextChunksBySourceResults contains results of the RepositoryI.GetTextChunksBySource +type RepositoryIMockGetTextChunksBySourceResults struct { + ta1 []mm_repository.TextChunk err error } -// Expect sets up expected params for RepositoryI.GetTotalTokensByListKBUIDs -func (mmGetTotalTokensByListKBUIDs *mRepositoryIMockGetTotalTokensByListKBUIDs) Expect(ctx context.Context, kbUIDs []uuid.UUID) *mRepositoryIMockGetTotalTokensByListKBUIDs { - if mmGetTotalTokensByListKBUIDs.mock.funcGetTotalTokensByListKBUIDs != nil { - mmGetTotalTokensByListKBUIDs.mock.t.Fatalf("RepositoryIMock.GetTotalTokensByListKBUIDs mock is already set by Set") +// Expect sets up expected params for RepositoryI.GetTextChunksBySource +func (mmGetTextChunksBySource *mRepositoryIMockGetTextChunksBySource) Expect(ctx context.Context, sourceTable string, sourceUID uuid.UUID) *mRepositoryIMockGetTextChunksBySource { + if mmGetTextChunksBySource.mock.funcGetTextChunksBySource != nil { + mmGetTextChunksBySource.mock.t.Fatalf("RepositoryIMock.GetTextChunksBySource mock is already set by Set") } - if mmGetTotalTokensByListKBUIDs.defaultExpectation == nil { - mmGetTotalTokensByListKBUIDs.defaultExpectation = &RepositoryIMockGetTotalTokensByListKBUIDsExpectation{} + if mmGetTextChunksBySource.defaultExpectation == nil { + mmGetTextChunksBySource.defaultExpectation = &RepositoryIMockGetTextChunksBySourceExpectation{} } - if mmGetTotalTokensByListKBUIDs.defaultExpectation.paramPtrs != nil { - mmGetTotalTokensByListKBUIDs.mock.t.Fatalf("RepositoryIMock.GetTotalTokensByListKBUIDs mock is already set by ExpectParams functions") + if mmGetTextChunksBySource.defaultExpectation.paramPtrs != nil { + mmGetTextChunksBySource.mock.t.Fatalf("RepositoryIMock.GetTextChunksBySource mock is already set by ExpectParams functions") } - mmGetTotalTokensByListKBUIDs.defaultExpectation.params = &RepositoryIMockGetTotalTokensByListKBUIDsParams{ctx, kbUIDs} - for _, e := range mmGetTotalTokensByListKBUIDs.expectations { - if minimock.Equal(e.params, mmGetTotalTokensByListKBUIDs.defaultExpectation.params) { - mmGetTotalTokensByListKBUIDs.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetTotalTokensByListKBUIDs.defaultExpectation.params) + mmGetTextChunksBySource.defaultExpectation.params = &RepositoryIMockGetTextChunksBySourceParams{ctx, sourceTable, sourceUID} + for _, e := range mmGetTextChunksBySource.expectations { + if minimock.Equal(e.params, mmGetTextChunksBySource.defaultExpectation.params) { + mmGetTextChunksBySource.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetTextChunksBySource.defaultExpectation.params) } } - return mmGetTotalTokensByListKBUIDs + return mmGetTextChunksBySource } -// ExpectCtxParam1 sets up expected param ctx for RepositoryI.GetTotalTokensByListKBUIDs -func (mmGetTotalTokensByListKBUIDs *mRepositoryIMockGetTotalTokensByListKBUIDs) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockGetTotalTokensByListKBUIDs { - if mmGetTotalTokensByListKBUIDs.mock.funcGetTotalTokensByListKBUIDs != nil { - mmGetTotalTokensByListKBUIDs.mock.t.Fatalf("RepositoryIMock.GetTotalTokensByListKBUIDs mock is already set by Set") +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.GetTextChunksBySource +func (mmGetTextChunksBySource *mRepositoryIMockGetTextChunksBySource) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockGetTextChunksBySource { + if mmGetTextChunksBySource.mock.funcGetTextChunksBySource != nil { + mmGetTextChunksBySource.mock.t.Fatalf("RepositoryIMock.GetTextChunksBySource mock is already set by Set") } - if mmGetTotalTokensByListKBUIDs.defaultExpectation == nil { - mmGetTotalTokensByListKBUIDs.defaultExpectation = &RepositoryIMockGetTotalTokensByListKBUIDsExpectation{} + if mmGetTextChunksBySource.defaultExpectation == nil { + mmGetTextChunksBySource.defaultExpectation = &RepositoryIMockGetTextChunksBySourceExpectation{} } - if mmGetTotalTokensByListKBUIDs.defaultExpectation.params != nil { - mmGetTotalTokensByListKBUIDs.mock.t.Fatalf("RepositoryIMock.GetTotalTokensByListKBUIDs mock is already set by Expect") + if mmGetTextChunksBySource.defaultExpectation.params != nil { + mmGetTextChunksBySource.mock.t.Fatalf("RepositoryIMock.GetTextChunksBySource mock is already set by Expect") } - if mmGetTotalTokensByListKBUIDs.defaultExpectation.paramPtrs == nil { - mmGetTotalTokensByListKBUIDs.defaultExpectation.paramPtrs = &RepositoryIMockGetTotalTokensByListKBUIDsParamPtrs{} + if mmGetTextChunksBySource.defaultExpectation.paramPtrs == nil { + mmGetTextChunksBySource.defaultExpectation.paramPtrs = &RepositoryIMockGetTextChunksBySourceParamPtrs{} } - mmGetTotalTokensByListKBUIDs.defaultExpectation.paramPtrs.ctx = &ctx + mmGetTextChunksBySource.defaultExpectation.paramPtrs.ctx = &ctx - return mmGetTotalTokensByListKBUIDs + return mmGetTextChunksBySource } -// ExpectKbUIDsParam2 sets up expected param kbUIDs for RepositoryI.GetTotalTokensByListKBUIDs -func (mmGetTotalTokensByListKBUIDs *mRepositoryIMockGetTotalTokensByListKBUIDs) ExpectKbUIDsParam2(kbUIDs []uuid.UUID) *mRepositoryIMockGetTotalTokensByListKBUIDs { - if mmGetTotalTokensByListKBUIDs.mock.funcGetTotalTokensByListKBUIDs != nil { - mmGetTotalTokensByListKBUIDs.mock.t.Fatalf("RepositoryIMock.GetTotalTokensByListKBUIDs mock is already set by Set") +// ExpectSourceTableParam2 sets up expected param sourceTable for RepositoryI.GetTextChunksBySource +func (mmGetTextChunksBySource *mRepositoryIMockGetTextChunksBySource) ExpectSourceTableParam2(sourceTable string) *mRepositoryIMockGetTextChunksBySource { + if mmGetTextChunksBySource.mock.funcGetTextChunksBySource != nil { + mmGetTextChunksBySource.mock.t.Fatalf("RepositoryIMock.GetTextChunksBySource mock is already set by Set") } - if mmGetTotalTokensByListKBUIDs.defaultExpectation == nil { - mmGetTotalTokensByListKBUIDs.defaultExpectation = &RepositoryIMockGetTotalTokensByListKBUIDsExpectation{} + if mmGetTextChunksBySource.defaultExpectation == nil { + mmGetTextChunksBySource.defaultExpectation = &RepositoryIMockGetTextChunksBySourceExpectation{} } - if mmGetTotalTokensByListKBUIDs.defaultExpectation.params != nil { - mmGetTotalTokensByListKBUIDs.mock.t.Fatalf("RepositoryIMock.GetTotalTokensByListKBUIDs mock is already set by Expect") + if mmGetTextChunksBySource.defaultExpectation.params != nil { + mmGetTextChunksBySource.mock.t.Fatalf("RepositoryIMock.GetTextChunksBySource mock is already set by Expect") } - if mmGetTotalTokensByListKBUIDs.defaultExpectation.paramPtrs == nil { - mmGetTotalTokensByListKBUIDs.defaultExpectation.paramPtrs = &RepositoryIMockGetTotalTokensByListKBUIDsParamPtrs{} + if mmGetTextChunksBySource.defaultExpectation.paramPtrs == nil { + mmGetTextChunksBySource.defaultExpectation.paramPtrs = &RepositoryIMockGetTextChunksBySourceParamPtrs{} } - mmGetTotalTokensByListKBUIDs.defaultExpectation.paramPtrs.kbUIDs = &kbUIDs + mmGetTextChunksBySource.defaultExpectation.paramPtrs.sourceTable = &sourceTable - return mmGetTotalTokensByListKBUIDs + return mmGetTextChunksBySource } -// Inspect accepts an inspector function that has same arguments as the RepositoryI.GetTotalTokensByListKBUIDs -func (mmGetTotalTokensByListKBUIDs *mRepositoryIMockGetTotalTokensByListKBUIDs) Inspect(f func(ctx context.Context, kbUIDs []uuid.UUID)) *mRepositoryIMockGetTotalTokensByListKBUIDs { - if mmGetTotalTokensByListKBUIDs.mock.inspectFuncGetTotalTokensByListKBUIDs != nil { - mmGetTotalTokensByListKBUIDs.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.GetTotalTokensByListKBUIDs") +// ExpectSourceUIDParam3 sets up expected param sourceUID for RepositoryI.GetTextChunksBySource +func (mmGetTextChunksBySource *mRepositoryIMockGetTextChunksBySource) ExpectSourceUIDParam3(sourceUID uuid.UUID) *mRepositoryIMockGetTextChunksBySource { + if mmGetTextChunksBySource.mock.funcGetTextChunksBySource != nil { + mmGetTextChunksBySource.mock.t.Fatalf("RepositoryIMock.GetTextChunksBySource mock is already set by Set") } - mmGetTotalTokensByListKBUIDs.mock.inspectFuncGetTotalTokensByListKBUIDs = f + if mmGetTextChunksBySource.defaultExpectation == nil { + mmGetTextChunksBySource.defaultExpectation = &RepositoryIMockGetTextChunksBySourceExpectation{} + } - return mmGetTotalTokensByListKBUIDs + if mmGetTextChunksBySource.defaultExpectation.params != nil { + mmGetTextChunksBySource.mock.t.Fatalf("RepositoryIMock.GetTextChunksBySource mock is already set by Expect") + } + + if mmGetTextChunksBySource.defaultExpectation.paramPtrs == nil { + mmGetTextChunksBySource.defaultExpectation.paramPtrs = &RepositoryIMockGetTextChunksBySourceParamPtrs{} + } + mmGetTextChunksBySource.defaultExpectation.paramPtrs.sourceUID = &sourceUID + + return mmGetTextChunksBySource } -// Return sets up results that will be returned by RepositoryI.GetTotalTokensByListKBUIDs -func (mmGetTotalTokensByListKBUIDs *mRepositoryIMockGetTotalTokensByListKBUIDs) Return(m1 map[uuid.UUID]int, err error) *RepositoryIMock { - if mmGetTotalTokensByListKBUIDs.mock.funcGetTotalTokensByListKBUIDs != nil { - mmGetTotalTokensByListKBUIDs.mock.t.Fatalf("RepositoryIMock.GetTotalTokensByListKBUIDs mock is already set by Set") +// Inspect accepts an inspector function that has same arguments as the RepositoryI.GetTextChunksBySource +func (mmGetTextChunksBySource *mRepositoryIMockGetTextChunksBySource) Inspect(f func(ctx context.Context, sourceTable string, sourceUID uuid.UUID)) *mRepositoryIMockGetTextChunksBySource { + if mmGetTextChunksBySource.mock.inspectFuncGetTextChunksBySource != nil { + mmGetTextChunksBySource.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.GetTextChunksBySource") } - if mmGetTotalTokensByListKBUIDs.defaultExpectation == nil { - mmGetTotalTokensByListKBUIDs.defaultExpectation = &RepositoryIMockGetTotalTokensByListKBUIDsExpectation{mock: mmGetTotalTokensByListKBUIDs.mock} + mmGetTextChunksBySource.mock.inspectFuncGetTextChunksBySource = f + + return mmGetTextChunksBySource +} + +// Return sets up results that will be returned by RepositoryI.GetTextChunksBySource +func (mmGetTextChunksBySource *mRepositoryIMockGetTextChunksBySource) Return(ta1 []mm_repository.TextChunk, err error) *RepositoryIMock { + if mmGetTextChunksBySource.mock.funcGetTextChunksBySource != nil { + mmGetTextChunksBySource.mock.t.Fatalf("RepositoryIMock.GetTextChunksBySource mock is already set by Set") } - mmGetTotalTokensByListKBUIDs.defaultExpectation.results = &RepositoryIMockGetTotalTokensByListKBUIDsResults{m1, err} - return mmGetTotalTokensByListKBUIDs.mock + + if mmGetTextChunksBySource.defaultExpectation == nil { + mmGetTextChunksBySource.defaultExpectation = &RepositoryIMockGetTextChunksBySourceExpectation{mock: mmGetTextChunksBySource.mock} + } + mmGetTextChunksBySource.defaultExpectation.results = &RepositoryIMockGetTextChunksBySourceResults{ta1, err} + return mmGetTextChunksBySource.mock } -// Set uses given function f to mock the RepositoryI.GetTotalTokensByListKBUIDs method -func (mmGetTotalTokensByListKBUIDs *mRepositoryIMockGetTotalTokensByListKBUIDs) Set(f func(ctx context.Context, kbUIDs []uuid.UUID) (m1 map[uuid.UUID]int, err error)) *RepositoryIMock { - if mmGetTotalTokensByListKBUIDs.defaultExpectation != nil { - mmGetTotalTokensByListKBUIDs.mock.t.Fatalf("Default expectation is already set for the RepositoryI.GetTotalTokensByListKBUIDs method") +// Set uses given function f to mock the RepositoryI.GetTextChunksBySource method +func (mmGetTextChunksBySource *mRepositoryIMockGetTextChunksBySource) Set(f func(ctx context.Context, sourceTable string, sourceUID uuid.UUID) (ta1 []mm_repository.TextChunk, err error)) *RepositoryIMock { + if mmGetTextChunksBySource.defaultExpectation != nil { + mmGetTextChunksBySource.mock.t.Fatalf("Default expectation is already set for the RepositoryI.GetTextChunksBySource method") } - if len(mmGetTotalTokensByListKBUIDs.expectations) > 0 { - mmGetTotalTokensByListKBUIDs.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetTotalTokensByListKBUIDs method") + if len(mmGetTextChunksBySource.expectations) > 0 { + mmGetTextChunksBySource.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetTextChunksBySource method") } - mmGetTotalTokensByListKBUIDs.mock.funcGetTotalTokensByListKBUIDs = f - return mmGetTotalTokensByListKBUIDs.mock + mmGetTextChunksBySource.mock.funcGetTextChunksBySource = f + return mmGetTextChunksBySource.mock } -// When sets expectation for the RepositoryI.GetTotalTokensByListKBUIDs which will trigger the result defined by the following +// When sets expectation for the RepositoryI.GetTextChunksBySource which will trigger the result defined by the following // Then helper -func (mmGetTotalTokensByListKBUIDs *mRepositoryIMockGetTotalTokensByListKBUIDs) When(ctx context.Context, kbUIDs []uuid.UUID) *RepositoryIMockGetTotalTokensByListKBUIDsExpectation { - if mmGetTotalTokensByListKBUIDs.mock.funcGetTotalTokensByListKBUIDs != nil { - mmGetTotalTokensByListKBUIDs.mock.t.Fatalf("RepositoryIMock.GetTotalTokensByListKBUIDs mock is already set by Set") +func (mmGetTextChunksBySource *mRepositoryIMockGetTextChunksBySource) When(ctx context.Context, sourceTable string, sourceUID uuid.UUID) *RepositoryIMockGetTextChunksBySourceExpectation { + if mmGetTextChunksBySource.mock.funcGetTextChunksBySource != nil { + mmGetTextChunksBySource.mock.t.Fatalf("RepositoryIMock.GetTextChunksBySource mock is already set by Set") } - expectation := &RepositoryIMockGetTotalTokensByListKBUIDsExpectation{ - mock: mmGetTotalTokensByListKBUIDs.mock, - params: &RepositoryIMockGetTotalTokensByListKBUIDsParams{ctx, kbUIDs}, + expectation := &RepositoryIMockGetTextChunksBySourceExpectation{ + mock: mmGetTextChunksBySource.mock, + params: &RepositoryIMockGetTextChunksBySourceParams{ctx, sourceTable, sourceUID}, } - mmGetTotalTokensByListKBUIDs.expectations = append(mmGetTotalTokensByListKBUIDs.expectations, expectation) + mmGetTextChunksBySource.expectations = append(mmGetTextChunksBySource.expectations, expectation) return expectation } -// Then sets up RepositoryI.GetTotalTokensByListKBUIDs return parameters for the expectation previously defined by the When method -func (e *RepositoryIMockGetTotalTokensByListKBUIDsExpectation) Then(m1 map[uuid.UUID]int, err error) *RepositoryIMock { - e.results = &RepositoryIMockGetTotalTokensByListKBUIDsResults{m1, err} +// Then sets up RepositoryI.GetTextChunksBySource return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockGetTextChunksBySourceExpectation) Then(ta1 []mm_repository.TextChunk, err error) *RepositoryIMock { + e.results = &RepositoryIMockGetTextChunksBySourceResults{ta1, err} return e.mock } -// Times sets number of times RepositoryI.GetTotalTokensByListKBUIDs should be invoked -func (mmGetTotalTokensByListKBUIDs *mRepositoryIMockGetTotalTokensByListKBUIDs) Times(n uint64) *mRepositoryIMockGetTotalTokensByListKBUIDs { +// Times sets number of times RepositoryI.GetTextChunksBySource should be invoked +func (mmGetTextChunksBySource *mRepositoryIMockGetTextChunksBySource) Times(n uint64) *mRepositoryIMockGetTextChunksBySource { if n == 0 { - mmGetTotalTokensByListKBUIDs.mock.t.Fatalf("Times of RepositoryIMock.GetTotalTokensByListKBUIDs mock can not be zero") + mmGetTextChunksBySource.mock.t.Fatalf("Times of RepositoryIMock.GetTextChunksBySource mock can not be zero") } - mm_atomic.StoreUint64(&mmGetTotalTokensByListKBUIDs.expectedInvocations, n) - return mmGetTotalTokensByListKBUIDs + mm_atomic.StoreUint64(&mmGetTextChunksBySource.expectedInvocations, n) + return mmGetTextChunksBySource } -func (mmGetTotalTokensByListKBUIDs *mRepositoryIMockGetTotalTokensByListKBUIDs) invocationsDone() bool { - if len(mmGetTotalTokensByListKBUIDs.expectations) == 0 && mmGetTotalTokensByListKBUIDs.defaultExpectation == nil && mmGetTotalTokensByListKBUIDs.mock.funcGetTotalTokensByListKBUIDs == nil { +func (mmGetTextChunksBySource *mRepositoryIMockGetTextChunksBySource) invocationsDone() bool { + if len(mmGetTextChunksBySource.expectations) == 0 && mmGetTextChunksBySource.defaultExpectation == nil && mmGetTextChunksBySource.mock.funcGetTextChunksBySource == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmGetTotalTokensByListKBUIDs.mock.afterGetTotalTokensByListKBUIDsCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmGetTotalTokensByListKBUIDs.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmGetTextChunksBySource.mock.afterGetTextChunksBySourceCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmGetTextChunksBySource.expectedInvocations) return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) } -// GetTotalTokensByListKBUIDs implements repository.RepositoryI -func (mmGetTotalTokensByListKBUIDs *RepositoryIMock) GetTotalTokensByListKBUIDs(ctx context.Context, kbUIDs []uuid.UUID) (m1 map[uuid.UUID]int, err error) { - mm_atomic.AddUint64(&mmGetTotalTokensByListKBUIDs.beforeGetTotalTokensByListKBUIDsCounter, 1) - defer mm_atomic.AddUint64(&mmGetTotalTokensByListKBUIDs.afterGetTotalTokensByListKBUIDsCounter, 1) +// GetTextChunksBySource implements repository.RepositoryI +func (mmGetTextChunksBySource *RepositoryIMock) GetTextChunksBySource(ctx context.Context, sourceTable string, sourceUID uuid.UUID) (ta1 []mm_repository.TextChunk, err error) { + mm_atomic.AddUint64(&mmGetTextChunksBySource.beforeGetTextChunksBySourceCounter, 1) + defer mm_atomic.AddUint64(&mmGetTextChunksBySource.afterGetTextChunksBySourceCounter, 1) - if mmGetTotalTokensByListKBUIDs.inspectFuncGetTotalTokensByListKBUIDs != nil { - mmGetTotalTokensByListKBUIDs.inspectFuncGetTotalTokensByListKBUIDs(ctx, kbUIDs) + if mmGetTextChunksBySource.inspectFuncGetTextChunksBySource != nil { + mmGetTextChunksBySource.inspectFuncGetTextChunksBySource(ctx, sourceTable, sourceUID) } - mm_params := RepositoryIMockGetTotalTokensByListKBUIDsParams{ctx, kbUIDs} + mm_params := RepositoryIMockGetTextChunksBySourceParams{ctx, sourceTable, sourceUID} // Record call args - mmGetTotalTokensByListKBUIDs.GetTotalTokensByListKBUIDsMock.mutex.Lock() - mmGetTotalTokensByListKBUIDs.GetTotalTokensByListKBUIDsMock.callArgs = append(mmGetTotalTokensByListKBUIDs.GetTotalTokensByListKBUIDsMock.callArgs, &mm_params) - mmGetTotalTokensByListKBUIDs.GetTotalTokensByListKBUIDsMock.mutex.Unlock() + mmGetTextChunksBySource.GetTextChunksBySourceMock.mutex.Lock() + mmGetTextChunksBySource.GetTextChunksBySourceMock.callArgs = append(mmGetTextChunksBySource.GetTextChunksBySourceMock.callArgs, &mm_params) + mmGetTextChunksBySource.GetTextChunksBySourceMock.mutex.Unlock() - for _, e := range mmGetTotalTokensByListKBUIDs.GetTotalTokensByListKBUIDsMock.expectations { + for _, e := range mmGetTextChunksBySource.GetTextChunksBySourceMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.m1, e.results.err + return e.results.ta1, e.results.err } } - if mmGetTotalTokensByListKBUIDs.GetTotalTokensByListKBUIDsMock.defaultExpectation != nil { - mm_atomic.AddUint64(&mmGetTotalTokensByListKBUIDs.GetTotalTokensByListKBUIDsMock.defaultExpectation.Counter, 1) - mm_want := mmGetTotalTokensByListKBUIDs.GetTotalTokensByListKBUIDsMock.defaultExpectation.params - mm_want_ptrs := mmGetTotalTokensByListKBUIDs.GetTotalTokensByListKBUIDsMock.defaultExpectation.paramPtrs + if mmGetTextChunksBySource.GetTextChunksBySourceMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmGetTextChunksBySource.GetTextChunksBySourceMock.defaultExpectation.Counter, 1) + mm_want := mmGetTextChunksBySource.GetTextChunksBySourceMock.defaultExpectation.params + mm_want_ptrs := mmGetTextChunksBySource.GetTextChunksBySourceMock.defaultExpectation.paramPtrs - mm_got := RepositoryIMockGetTotalTokensByListKBUIDsParams{ctx, kbUIDs} + mm_got := RepositoryIMockGetTextChunksBySourceParams{ctx, sourceTable, sourceUID} if mm_want_ptrs != nil { if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { - mmGetTotalTokensByListKBUIDs.t.Errorf("RepositoryIMock.GetTotalTokensByListKBUIDs got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) + mmGetTextChunksBySource.t.Errorf("RepositoryIMock.GetTextChunksBySource got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) } - if mm_want_ptrs.kbUIDs != nil && !minimock.Equal(*mm_want_ptrs.kbUIDs, mm_got.kbUIDs) { - mmGetTotalTokensByListKBUIDs.t.Errorf("RepositoryIMock.GetTotalTokensByListKBUIDs got unexpected parameter kbUIDs, want: %#v, got: %#v%s\n", *mm_want_ptrs.kbUIDs, mm_got.kbUIDs, minimock.Diff(*mm_want_ptrs.kbUIDs, mm_got.kbUIDs)) + if mm_want_ptrs.sourceTable != nil && !minimock.Equal(*mm_want_ptrs.sourceTable, mm_got.sourceTable) { + mmGetTextChunksBySource.t.Errorf("RepositoryIMock.GetTextChunksBySource got unexpected parameter sourceTable, want: %#v, got: %#v%s\n", *mm_want_ptrs.sourceTable, mm_got.sourceTable, minimock.Diff(*mm_want_ptrs.sourceTable, mm_got.sourceTable)) + } + + if mm_want_ptrs.sourceUID != nil && !minimock.Equal(*mm_want_ptrs.sourceUID, mm_got.sourceUID) { + mmGetTextChunksBySource.t.Errorf("RepositoryIMock.GetTextChunksBySource got unexpected parameter sourceUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.sourceUID, mm_got.sourceUID, minimock.Diff(*mm_want_ptrs.sourceUID, mm_got.sourceUID)) } } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { - mmGetTotalTokensByListKBUIDs.t.Errorf("RepositoryIMock.GetTotalTokensByListKBUIDs got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + mmGetTextChunksBySource.t.Errorf("RepositoryIMock.GetTextChunksBySource got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) } - mm_results := mmGetTotalTokensByListKBUIDs.GetTotalTokensByListKBUIDsMock.defaultExpectation.results + mm_results := mmGetTextChunksBySource.GetTextChunksBySourceMock.defaultExpectation.results if mm_results == nil { - mmGetTotalTokensByListKBUIDs.t.Fatal("No results are set for the RepositoryIMock.GetTotalTokensByListKBUIDs") + mmGetTextChunksBySource.t.Fatal("No results are set for the RepositoryIMock.GetTextChunksBySource") } - return (*mm_results).m1, (*mm_results).err + return (*mm_results).ta1, (*mm_results).err } - if mmGetTotalTokensByListKBUIDs.funcGetTotalTokensByListKBUIDs != nil { - return mmGetTotalTokensByListKBUIDs.funcGetTotalTokensByListKBUIDs(ctx, kbUIDs) + if mmGetTextChunksBySource.funcGetTextChunksBySource != nil { + return mmGetTextChunksBySource.funcGetTextChunksBySource(ctx, sourceTable, sourceUID) } - mmGetTotalTokensByListKBUIDs.t.Fatalf("Unexpected call to RepositoryIMock.GetTotalTokensByListKBUIDs. %v %v", ctx, kbUIDs) + mmGetTextChunksBySource.t.Fatalf("Unexpected call to RepositoryIMock.GetTextChunksBySource. %v %v %v", ctx, sourceTable, sourceUID) return } -// GetTotalTokensByListKBUIDsAfterCounter returns a count of finished RepositoryIMock.GetTotalTokensByListKBUIDs invocations -func (mmGetTotalTokensByListKBUIDs *RepositoryIMock) GetTotalTokensByListKBUIDsAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetTotalTokensByListKBUIDs.afterGetTotalTokensByListKBUIDsCounter) +// GetTextChunksBySourceAfterCounter returns a count of finished RepositoryIMock.GetTextChunksBySource invocations +func (mmGetTextChunksBySource *RepositoryIMock) GetTextChunksBySourceAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetTextChunksBySource.afterGetTextChunksBySourceCounter) } -// GetTotalTokensByListKBUIDsBeforeCounter returns a count of RepositoryIMock.GetTotalTokensByListKBUIDs invocations -func (mmGetTotalTokensByListKBUIDs *RepositoryIMock) GetTotalTokensByListKBUIDsBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetTotalTokensByListKBUIDs.beforeGetTotalTokensByListKBUIDsCounter) +// GetTextChunksBySourceBeforeCounter returns a count of RepositoryIMock.GetTextChunksBySource invocations +func (mmGetTextChunksBySource *RepositoryIMock) GetTextChunksBySourceBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetTextChunksBySource.beforeGetTextChunksBySourceCounter) } -// Calls returns a list of arguments used in each call to RepositoryIMock.GetTotalTokensByListKBUIDs. +// Calls returns a list of arguments used in each call to RepositoryIMock.GetTextChunksBySource. // The list is in the same order as the calls were made (i.e. recent calls have a higher index) -func (mmGetTotalTokensByListKBUIDs *mRepositoryIMockGetTotalTokensByListKBUIDs) Calls() []*RepositoryIMockGetTotalTokensByListKBUIDsParams { - mmGetTotalTokensByListKBUIDs.mutex.RLock() +func (mmGetTextChunksBySource *mRepositoryIMockGetTextChunksBySource) Calls() []*RepositoryIMockGetTextChunksBySourceParams { + mmGetTextChunksBySource.mutex.RLock() - argCopy := make([]*RepositoryIMockGetTotalTokensByListKBUIDsParams, len(mmGetTotalTokensByListKBUIDs.callArgs)) - copy(argCopy, mmGetTotalTokensByListKBUIDs.callArgs) + argCopy := make([]*RepositoryIMockGetTextChunksBySourceParams, len(mmGetTextChunksBySource.callArgs)) + copy(argCopy, mmGetTextChunksBySource.callArgs) - mmGetTotalTokensByListKBUIDs.mutex.RUnlock() + mmGetTextChunksBySource.mutex.RUnlock() return argCopy } -// MinimockGetTotalTokensByListKBUIDsDone returns true if the count of the GetTotalTokensByListKBUIDs invocations corresponds +// MinimockGetTextChunksBySourceDone returns true if the count of the GetTextChunksBySource invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockGetTotalTokensByListKBUIDsDone() bool { - for _, e := range m.GetTotalTokensByListKBUIDsMock.expectations { +func (m *RepositoryIMock) MinimockGetTextChunksBySourceDone() bool { + for _, e := range m.GetTextChunksBySourceMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.GetTotalTokensByListKBUIDsMock.invocationsDone() + return m.GetTextChunksBySourceMock.invocationsDone() } -// MinimockGetTotalTokensByListKBUIDsInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockGetTotalTokensByListKBUIDsInspect() { - for _, e := range m.GetTotalTokensByListKBUIDsMock.expectations { +// MinimockGetTextChunksBySourceInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockGetTextChunksBySourceInspect() { + for _, e := range m.GetTextChunksBySourceMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { - m.t.Errorf("Expected call to RepositoryIMock.GetTotalTokensByListKBUIDs with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.GetTextChunksBySource with params: %#v", *e.params) } } - afterGetTotalTokensByListKBUIDsCounter := mm_atomic.LoadUint64(&m.afterGetTotalTokensByListKBUIDsCounter) + afterGetTextChunksBySourceCounter := mm_atomic.LoadUint64(&m.afterGetTextChunksBySourceCounter) // if default expectation was set then invocations count should be greater than zero - if m.GetTotalTokensByListKBUIDsMock.defaultExpectation != nil && afterGetTotalTokensByListKBUIDsCounter < 1 { - if m.GetTotalTokensByListKBUIDsMock.defaultExpectation.params == nil { - m.t.Error("Expected call to RepositoryIMock.GetTotalTokensByListKBUIDs") + if m.GetTextChunksBySourceMock.defaultExpectation != nil && afterGetTextChunksBySourceCounter < 1 { + if m.GetTextChunksBySourceMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.GetTextChunksBySource") } else { - m.t.Errorf("Expected call to RepositoryIMock.GetTotalTokensByListKBUIDs with params: %#v", *m.GetTotalTokensByListKBUIDsMock.defaultExpectation.params) + m.t.Errorf("Expected call to RepositoryIMock.GetTextChunksBySource with params: %#v", *m.GetTextChunksBySourceMock.defaultExpectation.params) } } // if func was set then invocations count should be greater than zero - if m.funcGetTotalTokensByListKBUIDs != nil && afterGetTotalTokensByListKBUIDsCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.GetTotalTokensByListKBUIDs") - } + if m.funcGetTextChunksBySource != nil && afterGetTextChunksBySourceCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.GetTextChunksBySource") + } - if !m.GetTotalTokensByListKBUIDsMock.invocationsDone() && afterGetTotalTokensByListKBUIDsCounter > 0 { - m.t.Errorf("Expected %d calls to RepositoryIMock.GetTotalTokensByListKBUIDs but found %d calls", - mm_atomic.LoadUint64(&m.GetTotalTokensByListKBUIDsMock.expectedInvocations), afterGetTotalTokensByListKBUIDsCounter) + if !m.GetTextChunksBySourceMock.invocationsDone() && afterGetTextChunksBySourceCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.GetTextChunksBySource but found %d calls", + mm_atomic.LoadUint64(&m.GetTextChunksBySourceMock.expectedInvocations), afterGetTextChunksBySourceCounter) } } -type mRepositoryIMockGetTruthSourceByFileUID struct { +type mRepositoryIMockGetTotalChunksBySources struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockGetTruthSourceByFileUIDExpectation - expectations []*RepositoryIMockGetTruthSourceByFileUIDExpectation + defaultExpectation *RepositoryIMockGetTotalChunksBySourcesExpectation + expectations []*RepositoryIMockGetTotalChunksBySourcesExpectation - callArgs []*RepositoryIMockGetTruthSourceByFileUIDParams + callArgs []*RepositoryIMockGetTotalChunksBySourcesParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockGetTruthSourceByFileUIDExpectation specifies expectation struct of the RepositoryI.GetTruthSourceByFileUID -type RepositoryIMockGetTruthSourceByFileUIDExpectation struct { +// RepositoryIMockGetTotalChunksBySourcesExpectation specifies expectation struct of the RepositoryI.GetTotalChunksBySources +type RepositoryIMockGetTotalChunksBySourcesExpectation struct { mock *RepositoryIMock - params *RepositoryIMockGetTruthSourceByFileUIDParams - paramPtrs *RepositoryIMockGetTruthSourceByFileUIDParamPtrs - results *RepositoryIMockGetTruthSourceByFileUIDResults + params *RepositoryIMockGetTotalChunksBySourcesParams + paramPtrs *RepositoryIMockGetTotalChunksBySourcesParamPtrs + results *RepositoryIMockGetTotalChunksBySourcesResults Counter uint64 } -// RepositoryIMockGetTruthSourceByFileUIDParams contains parameters of the RepositoryI.GetTruthSourceByFileUID -type RepositoryIMockGetTruthSourceByFileUIDParams struct { +// RepositoryIMockGetTotalChunksBySourcesParams contains parameters of the RepositoryI.GetTotalChunksBySources +type RepositoryIMockGetTotalChunksBySourcesParams struct { ctx context.Context - fileUID uuid.UUID + sources map[mm_repository.FileUID]struct { + SourceTable mm_repository.SourceTable + SourceUID mm_repository.SourceUID + } } -// RepositoryIMockGetTruthSourceByFileUIDParamPtrs contains pointers to parameters of the RepositoryI.GetTruthSourceByFileUID -type RepositoryIMockGetTruthSourceByFileUIDParamPtrs struct { +// RepositoryIMockGetTotalChunksBySourcesParamPtrs contains pointers to parameters of the RepositoryI.GetTotalChunksBySources +type RepositoryIMockGetTotalChunksBySourcesParamPtrs struct { ctx *context.Context - fileUID *uuid.UUID + sources *map[mm_repository.FileUID]struct { + SourceTable mm_repository.SourceTable + SourceUID mm_repository.SourceUID + } } -// RepositoryIMockGetTruthSourceByFileUIDResults contains results of the RepositoryI.GetTruthSourceByFileUID -type RepositoryIMockGetTruthSourceByFileUIDResults struct { - sp1 *mm_repository.SourceMeta +// RepositoryIMockGetTotalChunksBySourcesResults contains results of the RepositoryI.GetTotalChunksBySources +type RepositoryIMockGetTotalChunksBySourcesResults struct { + m1 map[mm_repository.FileUID]int err error } -// Expect sets up expected params for RepositoryI.GetTruthSourceByFileUID -func (mmGetTruthSourceByFileUID *mRepositoryIMockGetTruthSourceByFileUID) Expect(ctx context.Context, fileUID uuid.UUID) *mRepositoryIMockGetTruthSourceByFileUID { - if mmGetTruthSourceByFileUID.mock.funcGetTruthSourceByFileUID != nil { - mmGetTruthSourceByFileUID.mock.t.Fatalf("RepositoryIMock.GetTruthSourceByFileUID mock is already set by Set") +// Expect sets up expected params for RepositoryI.GetTotalChunksBySources +func (mmGetTotalChunksBySources *mRepositoryIMockGetTotalChunksBySources) Expect(ctx context.Context, sources map[mm_repository.FileUID]struct { + SourceTable mm_repository.SourceTable + SourceUID mm_repository.SourceUID +}) *mRepositoryIMockGetTotalChunksBySources { + if mmGetTotalChunksBySources.mock.funcGetTotalChunksBySources != nil { + mmGetTotalChunksBySources.mock.t.Fatalf("RepositoryIMock.GetTotalChunksBySources mock is already set by Set") } - if mmGetTruthSourceByFileUID.defaultExpectation == nil { - mmGetTruthSourceByFileUID.defaultExpectation = &RepositoryIMockGetTruthSourceByFileUIDExpectation{} + if mmGetTotalChunksBySources.defaultExpectation == nil { + mmGetTotalChunksBySources.defaultExpectation = &RepositoryIMockGetTotalChunksBySourcesExpectation{} } - if mmGetTruthSourceByFileUID.defaultExpectation.paramPtrs != nil { - mmGetTruthSourceByFileUID.mock.t.Fatalf("RepositoryIMock.GetTruthSourceByFileUID mock is already set by ExpectParams functions") + if mmGetTotalChunksBySources.defaultExpectation.paramPtrs != nil { + mmGetTotalChunksBySources.mock.t.Fatalf("RepositoryIMock.GetTotalChunksBySources mock is already set by ExpectParams functions") } - mmGetTruthSourceByFileUID.defaultExpectation.params = &RepositoryIMockGetTruthSourceByFileUIDParams{ctx, fileUID} - for _, e := range mmGetTruthSourceByFileUID.expectations { - if minimock.Equal(e.params, mmGetTruthSourceByFileUID.defaultExpectation.params) { - mmGetTruthSourceByFileUID.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetTruthSourceByFileUID.defaultExpectation.params) + mmGetTotalChunksBySources.defaultExpectation.params = &RepositoryIMockGetTotalChunksBySourcesParams{ctx, sources} + for _, e := range mmGetTotalChunksBySources.expectations { + if minimock.Equal(e.params, mmGetTotalChunksBySources.defaultExpectation.params) { + mmGetTotalChunksBySources.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetTotalChunksBySources.defaultExpectation.params) } } - return mmGetTruthSourceByFileUID + return mmGetTotalChunksBySources } -// ExpectCtxParam1 sets up expected param ctx for RepositoryI.GetTruthSourceByFileUID -func (mmGetTruthSourceByFileUID *mRepositoryIMockGetTruthSourceByFileUID) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockGetTruthSourceByFileUID { - if mmGetTruthSourceByFileUID.mock.funcGetTruthSourceByFileUID != nil { - mmGetTruthSourceByFileUID.mock.t.Fatalf("RepositoryIMock.GetTruthSourceByFileUID mock is already set by Set") +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.GetTotalChunksBySources +func (mmGetTotalChunksBySources *mRepositoryIMockGetTotalChunksBySources) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockGetTotalChunksBySources { + if mmGetTotalChunksBySources.mock.funcGetTotalChunksBySources != nil { + mmGetTotalChunksBySources.mock.t.Fatalf("RepositoryIMock.GetTotalChunksBySources mock is already set by Set") } - if mmGetTruthSourceByFileUID.defaultExpectation == nil { - mmGetTruthSourceByFileUID.defaultExpectation = &RepositoryIMockGetTruthSourceByFileUIDExpectation{} + if mmGetTotalChunksBySources.defaultExpectation == nil { + mmGetTotalChunksBySources.defaultExpectation = &RepositoryIMockGetTotalChunksBySourcesExpectation{} } - if mmGetTruthSourceByFileUID.defaultExpectation.params != nil { - mmGetTruthSourceByFileUID.mock.t.Fatalf("RepositoryIMock.GetTruthSourceByFileUID mock is already set by Expect") + if mmGetTotalChunksBySources.defaultExpectation.params != nil { + mmGetTotalChunksBySources.mock.t.Fatalf("RepositoryIMock.GetTotalChunksBySources mock is already set by Expect") } - if mmGetTruthSourceByFileUID.defaultExpectation.paramPtrs == nil { - mmGetTruthSourceByFileUID.defaultExpectation.paramPtrs = &RepositoryIMockGetTruthSourceByFileUIDParamPtrs{} + if mmGetTotalChunksBySources.defaultExpectation.paramPtrs == nil { + mmGetTotalChunksBySources.defaultExpectation.paramPtrs = &RepositoryIMockGetTotalChunksBySourcesParamPtrs{} } - mmGetTruthSourceByFileUID.defaultExpectation.paramPtrs.ctx = &ctx + mmGetTotalChunksBySources.defaultExpectation.paramPtrs.ctx = &ctx - return mmGetTruthSourceByFileUID + return mmGetTotalChunksBySources } -// ExpectFileUIDParam2 sets up expected param fileUID for RepositoryI.GetTruthSourceByFileUID -func (mmGetTruthSourceByFileUID *mRepositoryIMockGetTruthSourceByFileUID) ExpectFileUIDParam2(fileUID uuid.UUID) *mRepositoryIMockGetTruthSourceByFileUID { - if mmGetTruthSourceByFileUID.mock.funcGetTruthSourceByFileUID != nil { - mmGetTruthSourceByFileUID.mock.t.Fatalf("RepositoryIMock.GetTruthSourceByFileUID mock is already set by Set") +// ExpectSourcesParam2 sets up expected param sources for RepositoryI.GetTotalChunksBySources +func (mmGetTotalChunksBySources *mRepositoryIMockGetTotalChunksBySources) ExpectSourcesParam2(sources map[mm_repository.FileUID]struct { + SourceTable mm_repository.SourceTable + SourceUID mm_repository.SourceUID +}) *mRepositoryIMockGetTotalChunksBySources { + if mmGetTotalChunksBySources.mock.funcGetTotalChunksBySources != nil { + mmGetTotalChunksBySources.mock.t.Fatalf("RepositoryIMock.GetTotalChunksBySources mock is already set by Set") } - if mmGetTruthSourceByFileUID.defaultExpectation == nil { - mmGetTruthSourceByFileUID.defaultExpectation = &RepositoryIMockGetTruthSourceByFileUIDExpectation{} + if mmGetTotalChunksBySources.defaultExpectation == nil { + mmGetTotalChunksBySources.defaultExpectation = &RepositoryIMockGetTotalChunksBySourcesExpectation{} } - if mmGetTruthSourceByFileUID.defaultExpectation.params != nil { - mmGetTruthSourceByFileUID.mock.t.Fatalf("RepositoryIMock.GetTruthSourceByFileUID mock is already set by Expect") + if mmGetTotalChunksBySources.defaultExpectation.params != nil { + mmGetTotalChunksBySources.mock.t.Fatalf("RepositoryIMock.GetTotalChunksBySources mock is already set by Expect") } - if mmGetTruthSourceByFileUID.defaultExpectation.paramPtrs == nil { - mmGetTruthSourceByFileUID.defaultExpectation.paramPtrs = &RepositoryIMockGetTruthSourceByFileUIDParamPtrs{} + if mmGetTotalChunksBySources.defaultExpectation.paramPtrs == nil { + mmGetTotalChunksBySources.defaultExpectation.paramPtrs = &RepositoryIMockGetTotalChunksBySourcesParamPtrs{} } - mmGetTruthSourceByFileUID.defaultExpectation.paramPtrs.fileUID = &fileUID + mmGetTotalChunksBySources.defaultExpectation.paramPtrs.sources = &sources - return mmGetTruthSourceByFileUID + return mmGetTotalChunksBySources } -// Inspect accepts an inspector function that has same arguments as the RepositoryI.GetTruthSourceByFileUID -func (mmGetTruthSourceByFileUID *mRepositoryIMockGetTruthSourceByFileUID) Inspect(f func(ctx context.Context, fileUID uuid.UUID)) *mRepositoryIMockGetTruthSourceByFileUID { - if mmGetTruthSourceByFileUID.mock.inspectFuncGetTruthSourceByFileUID != nil { - mmGetTruthSourceByFileUID.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.GetTruthSourceByFileUID") +// Inspect accepts an inspector function that has same arguments as the RepositoryI.GetTotalChunksBySources +func (mmGetTotalChunksBySources *mRepositoryIMockGetTotalChunksBySources) Inspect(f func(ctx context.Context, sources map[mm_repository.FileUID]struct { + SourceTable mm_repository.SourceTable + SourceUID mm_repository.SourceUID +})) *mRepositoryIMockGetTotalChunksBySources { + if mmGetTotalChunksBySources.mock.inspectFuncGetTotalChunksBySources != nil { + mmGetTotalChunksBySources.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.GetTotalChunksBySources") } - mmGetTruthSourceByFileUID.mock.inspectFuncGetTruthSourceByFileUID = f + mmGetTotalChunksBySources.mock.inspectFuncGetTotalChunksBySources = f - return mmGetTruthSourceByFileUID + return mmGetTotalChunksBySources } -// Return sets up results that will be returned by RepositoryI.GetTruthSourceByFileUID -func (mmGetTruthSourceByFileUID *mRepositoryIMockGetTruthSourceByFileUID) Return(sp1 *mm_repository.SourceMeta, err error) *RepositoryIMock { - if mmGetTruthSourceByFileUID.mock.funcGetTruthSourceByFileUID != nil { - mmGetTruthSourceByFileUID.mock.t.Fatalf("RepositoryIMock.GetTruthSourceByFileUID mock is already set by Set") +// Return sets up results that will be returned by RepositoryI.GetTotalChunksBySources +func (mmGetTotalChunksBySources *mRepositoryIMockGetTotalChunksBySources) Return(m1 map[mm_repository.FileUID]int, err error) *RepositoryIMock { + if mmGetTotalChunksBySources.mock.funcGetTotalChunksBySources != nil { + mmGetTotalChunksBySources.mock.t.Fatalf("RepositoryIMock.GetTotalChunksBySources mock is already set by Set") } - if mmGetTruthSourceByFileUID.defaultExpectation == nil { - mmGetTruthSourceByFileUID.defaultExpectation = &RepositoryIMockGetTruthSourceByFileUIDExpectation{mock: mmGetTruthSourceByFileUID.mock} + if mmGetTotalChunksBySources.defaultExpectation == nil { + mmGetTotalChunksBySources.defaultExpectation = &RepositoryIMockGetTotalChunksBySourcesExpectation{mock: mmGetTotalChunksBySources.mock} } - mmGetTruthSourceByFileUID.defaultExpectation.results = &RepositoryIMockGetTruthSourceByFileUIDResults{sp1, err} - return mmGetTruthSourceByFileUID.mock + mmGetTotalChunksBySources.defaultExpectation.results = &RepositoryIMockGetTotalChunksBySourcesResults{m1, err} + return mmGetTotalChunksBySources.mock } -// Set uses given function f to mock the RepositoryI.GetTruthSourceByFileUID method -func (mmGetTruthSourceByFileUID *mRepositoryIMockGetTruthSourceByFileUID) Set(f func(ctx context.Context, fileUID uuid.UUID) (sp1 *mm_repository.SourceMeta, err error)) *RepositoryIMock { - if mmGetTruthSourceByFileUID.defaultExpectation != nil { - mmGetTruthSourceByFileUID.mock.t.Fatalf("Default expectation is already set for the RepositoryI.GetTruthSourceByFileUID method") +// Set uses given function f to mock the RepositoryI.GetTotalChunksBySources method +func (mmGetTotalChunksBySources *mRepositoryIMockGetTotalChunksBySources) Set(f func(ctx context.Context, sources map[mm_repository.FileUID]struct { + SourceTable mm_repository.SourceTable + SourceUID mm_repository.SourceUID +}) (m1 map[mm_repository.FileUID]int, err error)) *RepositoryIMock { + if mmGetTotalChunksBySources.defaultExpectation != nil { + mmGetTotalChunksBySources.mock.t.Fatalf("Default expectation is already set for the RepositoryI.GetTotalChunksBySources method") } - if len(mmGetTruthSourceByFileUID.expectations) > 0 { - mmGetTruthSourceByFileUID.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetTruthSourceByFileUID method") + if len(mmGetTotalChunksBySources.expectations) > 0 { + mmGetTotalChunksBySources.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetTotalChunksBySources method") } - mmGetTruthSourceByFileUID.mock.funcGetTruthSourceByFileUID = f - return mmGetTruthSourceByFileUID.mock + mmGetTotalChunksBySources.mock.funcGetTotalChunksBySources = f + return mmGetTotalChunksBySources.mock } -// When sets expectation for the RepositoryI.GetTruthSourceByFileUID which will trigger the result defined by the following +// When sets expectation for the RepositoryI.GetTotalChunksBySources which will trigger the result defined by the following // Then helper -func (mmGetTruthSourceByFileUID *mRepositoryIMockGetTruthSourceByFileUID) When(ctx context.Context, fileUID uuid.UUID) *RepositoryIMockGetTruthSourceByFileUIDExpectation { - if mmGetTruthSourceByFileUID.mock.funcGetTruthSourceByFileUID != nil { - mmGetTruthSourceByFileUID.mock.t.Fatalf("RepositoryIMock.GetTruthSourceByFileUID mock is already set by Set") +func (mmGetTotalChunksBySources *mRepositoryIMockGetTotalChunksBySources) When(ctx context.Context, sources map[mm_repository.FileUID]struct { + SourceTable mm_repository.SourceTable + SourceUID mm_repository.SourceUID +}) *RepositoryIMockGetTotalChunksBySourcesExpectation { + if mmGetTotalChunksBySources.mock.funcGetTotalChunksBySources != nil { + mmGetTotalChunksBySources.mock.t.Fatalf("RepositoryIMock.GetTotalChunksBySources mock is already set by Set") } - expectation := &RepositoryIMockGetTruthSourceByFileUIDExpectation{ - mock: mmGetTruthSourceByFileUID.mock, - params: &RepositoryIMockGetTruthSourceByFileUIDParams{ctx, fileUID}, + expectation := &RepositoryIMockGetTotalChunksBySourcesExpectation{ + mock: mmGetTotalChunksBySources.mock, + params: &RepositoryIMockGetTotalChunksBySourcesParams{ctx, sources}, + } + mmGetTotalChunksBySources.expectations = append(mmGetTotalChunksBySources.expectations, expectation) + return expectation +} + +// Then sets up RepositoryI.GetTotalChunksBySources return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockGetTotalChunksBySourcesExpectation) Then(m1 map[mm_repository.FileUID]int, err error) *RepositoryIMock { + e.results = &RepositoryIMockGetTotalChunksBySourcesResults{m1, err} + return e.mock +} + +// Times sets number of times RepositoryI.GetTotalChunksBySources should be invoked +func (mmGetTotalChunksBySources *mRepositoryIMockGetTotalChunksBySources) Times(n uint64) *mRepositoryIMockGetTotalChunksBySources { + if n == 0 { + mmGetTotalChunksBySources.mock.t.Fatalf("Times of RepositoryIMock.GetTotalChunksBySources mock can not be zero") + } + mm_atomic.StoreUint64(&mmGetTotalChunksBySources.expectedInvocations, n) + return mmGetTotalChunksBySources +} + +func (mmGetTotalChunksBySources *mRepositoryIMockGetTotalChunksBySources) invocationsDone() bool { + if len(mmGetTotalChunksBySources.expectations) == 0 && mmGetTotalChunksBySources.defaultExpectation == nil && mmGetTotalChunksBySources.mock.funcGetTotalChunksBySources == nil { + return true + } + + totalInvocations := mm_atomic.LoadUint64(&mmGetTotalChunksBySources.mock.afterGetTotalChunksBySourcesCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmGetTotalChunksBySources.expectedInvocations) + + return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) +} + +// GetTotalChunksBySources implements repository.RepositoryI +func (mmGetTotalChunksBySources *RepositoryIMock) GetTotalChunksBySources(ctx context.Context, sources map[mm_repository.FileUID]struct { + SourceTable mm_repository.SourceTable + SourceUID mm_repository.SourceUID +}) (m1 map[mm_repository.FileUID]int, err error) { + mm_atomic.AddUint64(&mmGetTotalChunksBySources.beforeGetTotalChunksBySourcesCounter, 1) + defer mm_atomic.AddUint64(&mmGetTotalChunksBySources.afterGetTotalChunksBySourcesCounter, 1) + + if mmGetTotalChunksBySources.inspectFuncGetTotalChunksBySources != nil { + mmGetTotalChunksBySources.inspectFuncGetTotalChunksBySources(ctx, sources) + } + + mm_params := RepositoryIMockGetTotalChunksBySourcesParams{ctx, sources} + + // Record call args + mmGetTotalChunksBySources.GetTotalChunksBySourcesMock.mutex.Lock() + mmGetTotalChunksBySources.GetTotalChunksBySourcesMock.callArgs = append(mmGetTotalChunksBySources.GetTotalChunksBySourcesMock.callArgs, &mm_params) + mmGetTotalChunksBySources.GetTotalChunksBySourcesMock.mutex.Unlock() + + for _, e := range mmGetTotalChunksBySources.GetTotalChunksBySourcesMock.expectations { + if minimock.Equal(*e.params, mm_params) { + mm_atomic.AddUint64(&e.Counter, 1) + return e.results.m1, e.results.err + } + } + + if mmGetTotalChunksBySources.GetTotalChunksBySourcesMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmGetTotalChunksBySources.GetTotalChunksBySourcesMock.defaultExpectation.Counter, 1) + mm_want := mmGetTotalChunksBySources.GetTotalChunksBySourcesMock.defaultExpectation.params + mm_want_ptrs := mmGetTotalChunksBySources.GetTotalChunksBySourcesMock.defaultExpectation.paramPtrs + + mm_got := RepositoryIMockGetTotalChunksBySourcesParams{ctx, sources} + + if mm_want_ptrs != nil { + + if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { + mmGetTotalChunksBySources.t.Errorf("RepositoryIMock.GetTotalChunksBySources got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) + } + + if mm_want_ptrs.sources != nil && !minimock.Equal(*mm_want_ptrs.sources, mm_got.sources) { + mmGetTotalChunksBySources.t.Errorf("RepositoryIMock.GetTotalChunksBySources got unexpected parameter sources, want: %#v, got: %#v%s\n", *mm_want_ptrs.sources, mm_got.sources, minimock.Diff(*mm_want_ptrs.sources, mm_got.sources)) + } + + } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { + mmGetTotalChunksBySources.t.Errorf("RepositoryIMock.GetTotalChunksBySources got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + } + + mm_results := mmGetTotalChunksBySources.GetTotalChunksBySourcesMock.defaultExpectation.results + if mm_results == nil { + mmGetTotalChunksBySources.t.Fatal("No results are set for the RepositoryIMock.GetTotalChunksBySources") + } + return (*mm_results).m1, (*mm_results).err + } + if mmGetTotalChunksBySources.funcGetTotalChunksBySources != nil { + return mmGetTotalChunksBySources.funcGetTotalChunksBySources(ctx, sources) + } + mmGetTotalChunksBySources.t.Fatalf("Unexpected call to RepositoryIMock.GetTotalChunksBySources. %v %v", ctx, sources) + return +} + +// GetTotalChunksBySourcesAfterCounter returns a count of finished RepositoryIMock.GetTotalChunksBySources invocations +func (mmGetTotalChunksBySources *RepositoryIMock) GetTotalChunksBySourcesAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetTotalChunksBySources.afterGetTotalChunksBySourcesCounter) +} + +// GetTotalChunksBySourcesBeforeCounter returns a count of RepositoryIMock.GetTotalChunksBySources invocations +func (mmGetTotalChunksBySources *RepositoryIMock) GetTotalChunksBySourcesBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetTotalChunksBySources.beforeGetTotalChunksBySourcesCounter) +} + +// Calls returns a list of arguments used in each call to RepositoryIMock.GetTotalChunksBySources. +// The list is in the same order as the calls were made (i.e. recent calls have a higher index) +func (mmGetTotalChunksBySources *mRepositoryIMockGetTotalChunksBySources) Calls() []*RepositoryIMockGetTotalChunksBySourcesParams { + mmGetTotalChunksBySources.mutex.RLock() + + argCopy := make([]*RepositoryIMockGetTotalChunksBySourcesParams, len(mmGetTotalChunksBySources.callArgs)) + copy(argCopy, mmGetTotalChunksBySources.callArgs) + + mmGetTotalChunksBySources.mutex.RUnlock() + + return argCopy +} + +// MinimockGetTotalChunksBySourcesDone returns true if the count of the GetTotalChunksBySources invocations corresponds +// the number of defined expectations +func (m *RepositoryIMock) MinimockGetTotalChunksBySourcesDone() bool { + for _, e := range m.GetTotalChunksBySourcesMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + return false + } + } + + return m.GetTotalChunksBySourcesMock.invocationsDone() +} + +// MinimockGetTotalChunksBySourcesInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockGetTotalChunksBySourcesInspect() { + for _, e := range m.GetTotalChunksBySourcesMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + m.t.Errorf("Expected call to RepositoryIMock.GetTotalChunksBySources with params: %#v", *e.params) + } + } + + afterGetTotalChunksBySourcesCounter := mm_atomic.LoadUint64(&m.afterGetTotalChunksBySourcesCounter) + // if default expectation was set then invocations count should be greater than zero + if m.GetTotalChunksBySourcesMock.defaultExpectation != nil && afterGetTotalChunksBySourcesCounter < 1 { + if m.GetTotalChunksBySourcesMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.GetTotalChunksBySources") + } else { + m.t.Errorf("Expected call to RepositoryIMock.GetTotalChunksBySources with params: %#v", *m.GetTotalChunksBySourcesMock.defaultExpectation.params) + } + } + // if func was set then invocations count should be greater than zero + if m.funcGetTotalChunksBySources != nil && afterGetTotalChunksBySourcesCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.GetTotalChunksBySources") + } + + if !m.GetTotalChunksBySourcesMock.invocationsDone() && afterGetTotalChunksBySourcesCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.GetTotalChunksBySources but found %d calls", + mm_atomic.LoadUint64(&m.GetTotalChunksBySourcesMock.expectedInvocations), afterGetTotalChunksBySourcesCounter) + } +} + +type mRepositoryIMockGetTotalTokensByListKBUIDs struct { + mock *RepositoryIMock + defaultExpectation *RepositoryIMockGetTotalTokensByListKBUIDsExpectation + expectations []*RepositoryIMockGetTotalTokensByListKBUIDsExpectation + + callArgs []*RepositoryIMockGetTotalTokensByListKBUIDsParams + mutex sync.RWMutex + + expectedInvocations uint64 +} + +// RepositoryIMockGetTotalTokensByListKBUIDsExpectation specifies expectation struct of the RepositoryI.GetTotalTokensByListKBUIDs +type RepositoryIMockGetTotalTokensByListKBUIDsExpectation struct { + mock *RepositoryIMock + params *RepositoryIMockGetTotalTokensByListKBUIDsParams + paramPtrs *RepositoryIMockGetTotalTokensByListKBUIDsParamPtrs + results *RepositoryIMockGetTotalTokensByListKBUIDsResults + Counter uint64 +} + +// RepositoryIMockGetTotalTokensByListKBUIDsParams contains parameters of the RepositoryI.GetTotalTokensByListKBUIDs +type RepositoryIMockGetTotalTokensByListKBUIDsParams struct { + ctx context.Context + kbUIDs []uuid.UUID +} + +// RepositoryIMockGetTotalTokensByListKBUIDsParamPtrs contains pointers to parameters of the RepositoryI.GetTotalTokensByListKBUIDs +type RepositoryIMockGetTotalTokensByListKBUIDsParamPtrs struct { + ctx *context.Context + kbUIDs *[]uuid.UUID +} + +// RepositoryIMockGetTotalTokensByListKBUIDsResults contains results of the RepositoryI.GetTotalTokensByListKBUIDs +type RepositoryIMockGetTotalTokensByListKBUIDsResults struct { + m1 map[uuid.UUID]int + err error +} + +// Expect sets up expected params for RepositoryI.GetTotalTokensByListKBUIDs +func (mmGetTotalTokensByListKBUIDs *mRepositoryIMockGetTotalTokensByListKBUIDs) Expect(ctx context.Context, kbUIDs []uuid.UUID) *mRepositoryIMockGetTotalTokensByListKBUIDs { + if mmGetTotalTokensByListKBUIDs.mock.funcGetTotalTokensByListKBUIDs != nil { + mmGetTotalTokensByListKBUIDs.mock.t.Fatalf("RepositoryIMock.GetTotalTokensByListKBUIDs mock is already set by Set") + } + + if mmGetTotalTokensByListKBUIDs.defaultExpectation == nil { + mmGetTotalTokensByListKBUIDs.defaultExpectation = &RepositoryIMockGetTotalTokensByListKBUIDsExpectation{} + } + + if mmGetTotalTokensByListKBUIDs.defaultExpectation.paramPtrs != nil { + mmGetTotalTokensByListKBUIDs.mock.t.Fatalf("RepositoryIMock.GetTotalTokensByListKBUIDs mock is already set by ExpectParams functions") + } + + mmGetTotalTokensByListKBUIDs.defaultExpectation.params = &RepositoryIMockGetTotalTokensByListKBUIDsParams{ctx, kbUIDs} + for _, e := range mmGetTotalTokensByListKBUIDs.expectations { + if minimock.Equal(e.params, mmGetTotalTokensByListKBUIDs.defaultExpectation.params) { + mmGetTotalTokensByListKBUIDs.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetTotalTokensByListKBUIDs.defaultExpectation.params) + } + } + + return mmGetTotalTokensByListKBUIDs +} + +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.GetTotalTokensByListKBUIDs +func (mmGetTotalTokensByListKBUIDs *mRepositoryIMockGetTotalTokensByListKBUIDs) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockGetTotalTokensByListKBUIDs { + if mmGetTotalTokensByListKBUIDs.mock.funcGetTotalTokensByListKBUIDs != nil { + mmGetTotalTokensByListKBUIDs.mock.t.Fatalf("RepositoryIMock.GetTotalTokensByListKBUIDs mock is already set by Set") + } + + if mmGetTotalTokensByListKBUIDs.defaultExpectation == nil { + mmGetTotalTokensByListKBUIDs.defaultExpectation = &RepositoryIMockGetTotalTokensByListKBUIDsExpectation{} + } + + if mmGetTotalTokensByListKBUIDs.defaultExpectation.params != nil { + mmGetTotalTokensByListKBUIDs.mock.t.Fatalf("RepositoryIMock.GetTotalTokensByListKBUIDs mock is already set by Expect") + } + + if mmGetTotalTokensByListKBUIDs.defaultExpectation.paramPtrs == nil { + mmGetTotalTokensByListKBUIDs.defaultExpectation.paramPtrs = &RepositoryIMockGetTotalTokensByListKBUIDsParamPtrs{} + } + mmGetTotalTokensByListKBUIDs.defaultExpectation.paramPtrs.ctx = &ctx + + return mmGetTotalTokensByListKBUIDs +} + +// ExpectKbUIDsParam2 sets up expected param kbUIDs for RepositoryI.GetTotalTokensByListKBUIDs +func (mmGetTotalTokensByListKBUIDs *mRepositoryIMockGetTotalTokensByListKBUIDs) ExpectKbUIDsParam2(kbUIDs []uuid.UUID) *mRepositoryIMockGetTotalTokensByListKBUIDs { + if mmGetTotalTokensByListKBUIDs.mock.funcGetTotalTokensByListKBUIDs != nil { + mmGetTotalTokensByListKBUIDs.mock.t.Fatalf("RepositoryIMock.GetTotalTokensByListKBUIDs mock is already set by Set") + } + + if mmGetTotalTokensByListKBUIDs.defaultExpectation == nil { + mmGetTotalTokensByListKBUIDs.defaultExpectation = &RepositoryIMockGetTotalTokensByListKBUIDsExpectation{} + } + + if mmGetTotalTokensByListKBUIDs.defaultExpectation.params != nil { + mmGetTotalTokensByListKBUIDs.mock.t.Fatalf("RepositoryIMock.GetTotalTokensByListKBUIDs mock is already set by Expect") + } + + if mmGetTotalTokensByListKBUIDs.defaultExpectation.paramPtrs == nil { + mmGetTotalTokensByListKBUIDs.defaultExpectation.paramPtrs = &RepositoryIMockGetTotalTokensByListKBUIDsParamPtrs{} + } + mmGetTotalTokensByListKBUIDs.defaultExpectation.paramPtrs.kbUIDs = &kbUIDs + + return mmGetTotalTokensByListKBUIDs +} + +// Inspect accepts an inspector function that has same arguments as the RepositoryI.GetTotalTokensByListKBUIDs +func (mmGetTotalTokensByListKBUIDs *mRepositoryIMockGetTotalTokensByListKBUIDs) Inspect(f func(ctx context.Context, kbUIDs []uuid.UUID)) *mRepositoryIMockGetTotalTokensByListKBUIDs { + if mmGetTotalTokensByListKBUIDs.mock.inspectFuncGetTotalTokensByListKBUIDs != nil { + mmGetTotalTokensByListKBUIDs.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.GetTotalTokensByListKBUIDs") + } + + mmGetTotalTokensByListKBUIDs.mock.inspectFuncGetTotalTokensByListKBUIDs = f + + return mmGetTotalTokensByListKBUIDs +} + +// Return sets up results that will be returned by RepositoryI.GetTotalTokensByListKBUIDs +func (mmGetTotalTokensByListKBUIDs *mRepositoryIMockGetTotalTokensByListKBUIDs) Return(m1 map[uuid.UUID]int, err error) *RepositoryIMock { + if mmGetTotalTokensByListKBUIDs.mock.funcGetTotalTokensByListKBUIDs != nil { + mmGetTotalTokensByListKBUIDs.mock.t.Fatalf("RepositoryIMock.GetTotalTokensByListKBUIDs mock is already set by Set") + } + + if mmGetTotalTokensByListKBUIDs.defaultExpectation == nil { + mmGetTotalTokensByListKBUIDs.defaultExpectation = &RepositoryIMockGetTotalTokensByListKBUIDsExpectation{mock: mmGetTotalTokensByListKBUIDs.mock} + } + mmGetTotalTokensByListKBUIDs.defaultExpectation.results = &RepositoryIMockGetTotalTokensByListKBUIDsResults{m1, err} + return mmGetTotalTokensByListKBUIDs.mock +} + +// Set uses given function f to mock the RepositoryI.GetTotalTokensByListKBUIDs method +func (mmGetTotalTokensByListKBUIDs *mRepositoryIMockGetTotalTokensByListKBUIDs) Set(f func(ctx context.Context, kbUIDs []uuid.UUID) (m1 map[uuid.UUID]int, err error)) *RepositoryIMock { + if mmGetTotalTokensByListKBUIDs.defaultExpectation != nil { + mmGetTotalTokensByListKBUIDs.mock.t.Fatalf("Default expectation is already set for the RepositoryI.GetTotalTokensByListKBUIDs method") + } + + if len(mmGetTotalTokensByListKBUIDs.expectations) > 0 { + mmGetTotalTokensByListKBUIDs.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetTotalTokensByListKBUIDs method") + } + + mmGetTotalTokensByListKBUIDs.mock.funcGetTotalTokensByListKBUIDs = f + return mmGetTotalTokensByListKBUIDs.mock +} + +// When sets expectation for the RepositoryI.GetTotalTokensByListKBUIDs which will trigger the result defined by the following +// Then helper +func (mmGetTotalTokensByListKBUIDs *mRepositoryIMockGetTotalTokensByListKBUIDs) When(ctx context.Context, kbUIDs []uuid.UUID) *RepositoryIMockGetTotalTokensByListKBUIDsExpectation { + if mmGetTotalTokensByListKBUIDs.mock.funcGetTotalTokensByListKBUIDs != nil { + mmGetTotalTokensByListKBUIDs.mock.t.Fatalf("RepositoryIMock.GetTotalTokensByListKBUIDs mock is already set by Set") + } + + expectation := &RepositoryIMockGetTotalTokensByListKBUIDsExpectation{ + mock: mmGetTotalTokensByListKBUIDs.mock, + params: &RepositoryIMockGetTotalTokensByListKBUIDsParams{ctx, kbUIDs}, + } + mmGetTotalTokensByListKBUIDs.expectations = append(mmGetTotalTokensByListKBUIDs.expectations, expectation) + return expectation +} + +// Then sets up RepositoryI.GetTotalTokensByListKBUIDs return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockGetTotalTokensByListKBUIDsExpectation) Then(m1 map[uuid.UUID]int, err error) *RepositoryIMock { + e.results = &RepositoryIMockGetTotalTokensByListKBUIDsResults{m1, err} + return e.mock +} + +// Times sets number of times RepositoryI.GetTotalTokensByListKBUIDs should be invoked +func (mmGetTotalTokensByListKBUIDs *mRepositoryIMockGetTotalTokensByListKBUIDs) Times(n uint64) *mRepositoryIMockGetTotalTokensByListKBUIDs { + if n == 0 { + mmGetTotalTokensByListKBUIDs.mock.t.Fatalf("Times of RepositoryIMock.GetTotalTokensByListKBUIDs mock can not be zero") + } + mm_atomic.StoreUint64(&mmGetTotalTokensByListKBUIDs.expectedInvocations, n) + return mmGetTotalTokensByListKBUIDs +} + +func (mmGetTotalTokensByListKBUIDs *mRepositoryIMockGetTotalTokensByListKBUIDs) invocationsDone() bool { + if len(mmGetTotalTokensByListKBUIDs.expectations) == 0 && mmGetTotalTokensByListKBUIDs.defaultExpectation == nil && mmGetTotalTokensByListKBUIDs.mock.funcGetTotalTokensByListKBUIDs == nil { + return true + } + + totalInvocations := mm_atomic.LoadUint64(&mmGetTotalTokensByListKBUIDs.mock.afterGetTotalTokensByListKBUIDsCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmGetTotalTokensByListKBUIDs.expectedInvocations) + + return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) +} + +// GetTotalTokensByListKBUIDs implements repository.RepositoryI +func (mmGetTotalTokensByListKBUIDs *RepositoryIMock) GetTotalTokensByListKBUIDs(ctx context.Context, kbUIDs []uuid.UUID) (m1 map[uuid.UUID]int, err error) { + mm_atomic.AddUint64(&mmGetTotalTokensByListKBUIDs.beforeGetTotalTokensByListKBUIDsCounter, 1) + defer mm_atomic.AddUint64(&mmGetTotalTokensByListKBUIDs.afterGetTotalTokensByListKBUIDsCounter, 1) + + if mmGetTotalTokensByListKBUIDs.inspectFuncGetTotalTokensByListKBUIDs != nil { + mmGetTotalTokensByListKBUIDs.inspectFuncGetTotalTokensByListKBUIDs(ctx, kbUIDs) + } + + mm_params := RepositoryIMockGetTotalTokensByListKBUIDsParams{ctx, kbUIDs} + + // Record call args + mmGetTotalTokensByListKBUIDs.GetTotalTokensByListKBUIDsMock.mutex.Lock() + mmGetTotalTokensByListKBUIDs.GetTotalTokensByListKBUIDsMock.callArgs = append(mmGetTotalTokensByListKBUIDs.GetTotalTokensByListKBUIDsMock.callArgs, &mm_params) + mmGetTotalTokensByListKBUIDs.GetTotalTokensByListKBUIDsMock.mutex.Unlock() + + for _, e := range mmGetTotalTokensByListKBUIDs.GetTotalTokensByListKBUIDsMock.expectations { + if minimock.Equal(*e.params, mm_params) { + mm_atomic.AddUint64(&e.Counter, 1) + return e.results.m1, e.results.err + } + } + + if mmGetTotalTokensByListKBUIDs.GetTotalTokensByListKBUIDsMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmGetTotalTokensByListKBUIDs.GetTotalTokensByListKBUIDsMock.defaultExpectation.Counter, 1) + mm_want := mmGetTotalTokensByListKBUIDs.GetTotalTokensByListKBUIDsMock.defaultExpectation.params + mm_want_ptrs := mmGetTotalTokensByListKBUIDs.GetTotalTokensByListKBUIDsMock.defaultExpectation.paramPtrs + + mm_got := RepositoryIMockGetTotalTokensByListKBUIDsParams{ctx, kbUIDs} + + if mm_want_ptrs != nil { + + if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { + mmGetTotalTokensByListKBUIDs.t.Errorf("RepositoryIMock.GetTotalTokensByListKBUIDs got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) + } + + if mm_want_ptrs.kbUIDs != nil && !minimock.Equal(*mm_want_ptrs.kbUIDs, mm_got.kbUIDs) { + mmGetTotalTokensByListKBUIDs.t.Errorf("RepositoryIMock.GetTotalTokensByListKBUIDs got unexpected parameter kbUIDs, want: %#v, got: %#v%s\n", *mm_want_ptrs.kbUIDs, mm_got.kbUIDs, minimock.Diff(*mm_want_ptrs.kbUIDs, mm_got.kbUIDs)) + } + + } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { + mmGetTotalTokensByListKBUIDs.t.Errorf("RepositoryIMock.GetTotalTokensByListKBUIDs got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + } + + mm_results := mmGetTotalTokensByListKBUIDs.GetTotalTokensByListKBUIDsMock.defaultExpectation.results + if mm_results == nil { + mmGetTotalTokensByListKBUIDs.t.Fatal("No results are set for the RepositoryIMock.GetTotalTokensByListKBUIDs") + } + return (*mm_results).m1, (*mm_results).err + } + if mmGetTotalTokensByListKBUIDs.funcGetTotalTokensByListKBUIDs != nil { + return mmGetTotalTokensByListKBUIDs.funcGetTotalTokensByListKBUIDs(ctx, kbUIDs) + } + mmGetTotalTokensByListKBUIDs.t.Fatalf("Unexpected call to RepositoryIMock.GetTotalTokensByListKBUIDs. %v %v", ctx, kbUIDs) + return +} + +// GetTotalTokensByListKBUIDsAfterCounter returns a count of finished RepositoryIMock.GetTotalTokensByListKBUIDs invocations +func (mmGetTotalTokensByListKBUIDs *RepositoryIMock) GetTotalTokensByListKBUIDsAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetTotalTokensByListKBUIDs.afterGetTotalTokensByListKBUIDsCounter) +} + +// GetTotalTokensByListKBUIDsBeforeCounter returns a count of RepositoryIMock.GetTotalTokensByListKBUIDs invocations +func (mmGetTotalTokensByListKBUIDs *RepositoryIMock) GetTotalTokensByListKBUIDsBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetTotalTokensByListKBUIDs.beforeGetTotalTokensByListKBUIDsCounter) +} + +// Calls returns a list of arguments used in each call to RepositoryIMock.GetTotalTokensByListKBUIDs. +// The list is in the same order as the calls were made (i.e. recent calls have a higher index) +func (mmGetTotalTokensByListKBUIDs *mRepositoryIMockGetTotalTokensByListKBUIDs) Calls() []*RepositoryIMockGetTotalTokensByListKBUIDsParams { + mmGetTotalTokensByListKBUIDs.mutex.RLock() + + argCopy := make([]*RepositoryIMockGetTotalTokensByListKBUIDsParams, len(mmGetTotalTokensByListKBUIDs.callArgs)) + copy(argCopy, mmGetTotalTokensByListKBUIDs.callArgs) + + mmGetTotalTokensByListKBUIDs.mutex.RUnlock() + + return argCopy +} + +// MinimockGetTotalTokensByListKBUIDsDone returns true if the count of the GetTotalTokensByListKBUIDs invocations corresponds +// the number of defined expectations +func (m *RepositoryIMock) MinimockGetTotalTokensByListKBUIDsDone() bool { + for _, e := range m.GetTotalTokensByListKBUIDsMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + return false + } + } + + return m.GetTotalTokensByListKBUIDsMock.invocationsDone() +} + +// MinimockGetTotalTokensByListKBUIDsInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockGetTotalTokensByListKBUIDsInspect() { + for _, e := range m.GetTotalTokensByListKBUIDsMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + m.t.Errorf("Expected call to RepositoryIMock.GetTotalTokensByListKBUIDs with params: %#v", *e.params) + } + } + + afterGetTotalTokensByListKBUIDsCounter := mm_atomic.LoadUint64(&m.afterGetTotalTokensByListKBUIDsCounter) + // if default expectation was set then invocations count should be greater than zero + if m.GetTotalTokensByListKBUIDsMock.defaultExpectation != nil && afterGetTotalTokensByListKBUIDsCounter < 1 { + if m.GetTotalTokensByListKBUIDsMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.GetTotalTokensByListKBUIDs") + } else { + m.t.Errorf("Expected call to RepositoryIMock.GetTotalTokensByListKBUIDs with params: %#v", *m.GetTotalTokensByListKBUIDsMock.defaultExpectation.params) + } + } + // if func was set then invocations count should be greater than zero + if m.funcGetTotalTokensByListKBUIDs != nil && afterGetTotalTokensByListKBUIDsCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.GetTotalTokensByListKBUIDs") + } + + if !m.GetTotalTokensByListKBUIDsMock.invocationsDone() && afterGetTotalTokensByListKBUIDsCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.GetTotalTokensByListKBUIDs but found %d calls", + mm_atomic.LoadUint64(&m.GetTotalTokensByListKBUIDsMock.expectedInvocations), afterGetTotalTokensByListKBUIDsCounter) + } +} + +type mRepositoryIMockGetTruthSourceByFileUID struct { + mock *RepositoryIMock + defaultExpectation *RepositoryIMockGetTruthSourceByFileUIDExpectation + expectations []*RepositoryIMockGetTruthSourceByFileUIDExpectation + + callArgs []*RepositoryIMockGetTruthSourceByFileUIDParams + mutex sync.RWMutex + + expectedInvocations uint64 +} + +// RepositoryIMockGetTruthSourceByFileUIDExpectation specifies expectation struct of the RepositoryI.GetTruthSourceByFileUID +type RepositoryIMockGetTruthSourceByFileUIDExpectation struct { + mock *RepositoryIMock + params *RepositoryIMockGetTruthSourceByFileUIDParams + paramPtrs *RepositoryIMockGetTruthSourceByFileUIDParamPtrs + results *RepositoryIMockGetTruthSourceByFileUIDResults + Counter uint64 +} + +// RepositoryIMockGetTruthSourceByFileUIDParams contains parameters of the RepositoryI.GetTruthSourceByFileUID +type RepositoryIMockGetTruthSourceByFileUIDParams struct { + ctx context.Context + fileUID uuid.UUID +} + +// RepositoryIMockGetTruthSourceByFileUIDParamPtrs contains pointers to parameters of the RepositoryI.GetTruthSourceByFileUID +type RepositoryIMockGetTruthSourceByFileUIDParamPtrs struct { + ctx *context.Context + fileUID *uuid.UUID +} + +// RepositoryIMockGetTruthSourceByFileUIDResults contains results of the RepositoryI.GetTruthSourceByFileUID +type RepositoryIMockGetTruthSourceByFileUIDResults struct { + sp1 *mm_repository.SourceMeta + err error +} + +// Expect sets up expected params for RepositoryI.GetTruthSourceByFileUID +func (mmGetTruthSourceByFileUID *mRepositoryIMockGetTruthSourceByFileUID) Expect(ctx context.Context, fileUID uuid.UUID) *mRepositoryIMockGetTruthSourceByFileUID { + if mmGetTruthSourceByFileUID.mock.funcGetTruthSourceByFileUID != nil { + mmGetTruthSourceByFileUID.mock.t.Fatalf("RepositoryIMock.GetTruthSourceByFileUID mock is already set by Set") + } + + if mmGetTruthSourceByFileUID.defaultExpectation == nil { + mmGetTruthSourceByFileUID.defaultExpectation = &RepositoryIMockGetTruthSourceByFileUIDExpectation{} + } + + if mmGetTruthSourceByFileUID.defaultExpectation.paramPtrs != nil { + mmGetTruthSourceByFileUID.mock.t.Fatalf("RepositoryIMock.GetTruthSourceByFileUID mock is already set by ExpectParams functions") + } + + mmGetTruthSourceByFileUID.defaultExpectation.params = &RepositoryIMockGetTruthSourceByFileUIDParams{ctx, fileUID} + for _, e := range mmGetTruthSourceByFileUID.expectations { + if minimock.Equal(e.params, mmGetTruthSourceByFileUID.defaultExpectation.params) { + mmGetTruthSourceByFileUID.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetTruthSourceByFileUID.defaultExpectation.params) + } + } + + return mmGetTruthSourceByFileUID +} + +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.GetTruthSourceByFileUID +func (mmGetTruthSourceByFileUID *mRepositoryIMockGetTruthSourceByFileUID) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockGetTruthSourceByFileUID { + if mmGetTruthSourceByFileUID.mock.funcGetTruthSourceByFileUID != nil { + mmGetTruthSourceByFileUID.mock.t.Fatalf("RepositoryIMock.GetTruthSourceByFileUID mock is already set by Set") + } + + if mmGetTruthSourceByFileUID.defaultExpectation == nil { + mmGetTruthSourceByFileUID.defaultExpectation = &RepositoryIMockGetTruthSourceByFileUIDExpectation{} + } + + if mmGetTruthSourceByFileUID.defaultExpectation.params != nil { + mmGetTruthSourceByFileUID.mock.t.Fatalf("RepositoryIMock.GetTruthSourceByFileUID mock is already set by Expect") + } + + if mmGetTruthSourceByFileUID.defaultExpectation.paramPtrs == nil { + mmGetTruthSourceByFileUID.defaultExpectation.paramPtrs = &RepositoryIMockGetTruthSourceByFileUIDParamPtrs{} + } + mmGetTruthSourceByFileUID.defaultExpectation.paramPtrs.ctx = &ctx + + return mmGetTruthSourceByFileUID +} + +// ExpectFileUIDParam2 sets up expected param fileUID for RepositoryI.GetTruthSourceByFileUID +func (mmGetTruthSourceByFileUID *mRepositoryIMockGetTruthSourceByFileUID) ExpectFileUIDParam2(fileUID uuid.UUID) *mRepositoryIMockGetTruthSourceByFileUID { + if mmGetTruthSourceByFileUID.mock.funcGetTruthSourceByFileUID != nil { + mmGetTruthSourceByFileUID.mock.t.Fatalf("RepositoryIMock.GetTruthSourceByFileUID mock is already set by Set") + } + + if mmGetTruthSourceByFileUID.defaultExpectation == nil { + mmGetTruthSourceByFileUID.defaultExpectation = &RepositoryIMockGetTruthSourceByFileUIDExpectation{} + } + + if mmGetTruthSourceByFileUID.defaultExpectation.params != nil { + mmGetTruthSourceByFileUID.mock.t.Fatalf("RepositoryIMock.GetTruthSourceByFileUID mock is already set by Expect") + } + + if mmGetTruthSourceByFileUID.defaultExpectation.paramPtrs == nil { + mmGetTruthSourceByFileUID.defaultExpectation.paramPtrs = &RepositoryIMockGetTruthSourceByFileUIDParamPtrs{} + } + mmGetTruthSourceByFileUID.defaultExpectation.paramPtrs.fileUID = &fileUID + + return mmGetTruthSourceByFileUID +} + +// Inspect accepts an inspector function that has same arguments as the RepositoryI.GetTruthSourceByFileUID +func (mmGetTruthSourceByFileUID *mRepositoryIMockGetTruthSourceByFileUID) Inspect(f func(ctx context.Context, fileUID uuid.UUID)) *mRepositoryIMockGetTruthSourceByFileUID { + if mmGetTruthSourceByFileUID.mock.inspectFuncGetTruthSourceByFileUID != nil { + mmGetTruthSourceByFileUID.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.GetTruthSourceByFileUID") + } + + mmGetTruthSourceByFileUID.mock.inspectFuncGetTruthSourceByFileUID = f + + return mmGetTruthSourceByFileUID +} + +// Return sets up results that will be returned by RepositoryI.GetTruthSourceByFileUID +func (mmGetTruthSourceByFileUID *mRepositoryIMockGetTruthSourceByFileUID) Return(sp1 *mm_repository.SourceMeta, err error) *RepositoryIMock { + if mmGetTruthSourceByFileUID.mock.funcGetTruthSourceByFileUID != nil { + mmGetTruthSourceByFileUID.mock.t.Fatalf("RepositoryIMock.GetTruthSourceByFileUID mock is already set by Set") + } + + if mmGetTruthSourceByFileUID.defaultExpectation == nil { + mmGetTruthSourceByFileUID.defaultExpectation = &RepositoryIMockGetTruthSourceByFileUIDExpectation{mock: mmGetTruthSourceByFileUID.mock} + } + mmGetTruthSourceByFileUID.defaultExpectation.results = &RepositoryIMockGetTruthSourceByFileUIDResults{sp1, err} + return mmGetTruthSourceByFileUID.mock +} + +// Set uses given function f to mock the RepositoryI.GetTruthSourceByFileUID method +func (mmGetTruthSourceByFileUID *mRepositoryIMockGetTruthSourceByFileUID) Set(f func(ctx context.Context, fileUID uuid.UUID) (sp1 *mm_repository.SourceMeta, err error)) *RepositoryIMock { + if mmGetTruthSourceByFileUID.defaultExpectation != nil { + mmGetTruthSourceByFileUID.mock.t.Fatalf("Default expectation is already set for the RepositoryI.GetTruthSourceByFileUID method") + } + + if len(mmGetTruthSourceByFileUID.expectations) > 0 { + mmGetTruthSourceByFileUID.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetTruthSourceByFileUID method") + } + + mmGetTruthSourceByFileUID.mock.funcGetTruthSourceByFileUID = f + return mmGetTruthSourceByFileUID.mock +} + +// When sets expectation for the RepositoryI.GetTruthSourceByFileUID which will trigger the result defined by the following +// Then helper +func (mmGetTruthSourceByFileUID *mRepositoryIMockGetTruthSourceByFileUID) When(ctx context.Context, fileUID uuid.UUID) *RepositoryIMockGetTruthSourceByFileUIDExpectation { + if mmGetTruthSourceByFileUID.mock.funcGetTruthSourceByFileUID != nil { + mmGetTruthSourceByFileUID.mock.t.Fatalf("RepositoryIMock.GetTruthSourceByFileUID mock is already set by Set") + } + + expectation := &RepositoryIMockGetTruthSourceByFileUIDExpectation{ + mock: mmGetTruthSourceByFileUID.mock, + params: &RepositoryIMockGetTruthSourceByFileUIDParams{ctx, fileUID}, + } + mmGetTruthSourceByFileUID.expectations = append(mmGetTruthSourceByFileUID.expectations, expectation) + return expectation +} + +// Then sets up RepositoryI.GetTruthSourceByFileUID return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockGetTruthSourceByFileUIDExpectation) Then(sp1 *mm_repository.SourceMeta, err error) *RepositoryIMock { + e.results = &RepositoryIMockGetTruthSourceByFileUIDResults{sp1, err} + return e.mock +} + +// Times sets number of times RepositoryI.GetTruthSourceByFileUID should be invoked +func (mmGetTruthSourceByFileUID *mRepositoryIMockGetTruthSourceByFileUID) Times(n uint64) *mRepositoryIMockGetTruthSourceByFileUID { + if n == 0 { + mmGetTruthSourceByFileUID.mock.t.Fatalf("Times of RepositoryIMock.GetTruthSourceByFileUID mock can not be zero") + } + mm_atomic.StoreUint64(&mmGetTruthSourceByFileUID.expectedInvocations, n) + return mmGetTruthSourceByFileUID +} + +func (mmGetTruthSourceByFileUID *mRepositoryIMockGetTruthSourceByFileUID) invocationsDone() bool { + if len(mmGetTruthSourceByFileUID.expectations) == 0 && mmGetTruthSourceByFileUID.defaultExpectation == nil && mmGetTruthSourceByFileUID.mock.funcGetTruthSourceByFileUID == nil { + return true + } + + totalInvocations := mm_atomic.LoadUint64(&mmGetTruthSourceByFileUID.mock.afterGetTruthSourceByFileUIDCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmGetTruthSourceByFileUID.expectedInvocations) + + return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) +} + +// GetTruthSourceByFileUID implements repository.RepositoryI +func (mmGetTruthSourceByFileUID *RepositoryIMock) GetTruthSourceByFileUID(ctx context.Context, fileUID uuid.UUID) (sp1 *mm_repository.SourceMeta, err error) { + mm_atomic.AddUint64(&mmGetTruthSourceByFileUID.beforeGetTruthSourceByFileUIDCounter, 1) + defer mm_atomic.AddUint64(&mmGetTruthSourceByFileUID.afterGetTruthSourceByFileUIDCounter, 1) + + if mmGetTruthSourceByFileUID.inspectFuncGetTruthSourceByFileUID != nil { + mmGetTruthSourceByFileUID.inspectFuncGetTruthSourceByFileUID(ctx, fileUID) + } + + mm_params := RepositoryIMockGetTruthSourceByFileUIDParams{ctx, fileUID} + + // Record call args + mmGetTruthSourceByFileUID.GetTruthSourceByFileUIDMock.mutex.Lock() + mmGetTruthSourceByFileUID.GetTruthSourceByFileUIDMock.callArgs = append(mmGetTruthSourceByFileUID.GetTruthSourceByFileUIDMock.callArgs, &mm_params) + mmGetTruthSourceByFileUID.GetTruthSourceByFileUIDMock.mutex.Unlock() + + for _, e := range mmGetTruthSourceByFileUID.GetTruthSourceByFileUIDMock.expectations { + if minimock.Equal(*e.params, mm_params) { + mm_atomic.AddUint64(&e.Counter, 1) + return e.results.sp1, e.results.err + } + } + + if mmGetTruthSourceByFileUID.GetTruthSourceByFileUIDMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmGetTruthSourceByFileUID.GetTruthSourceByFileUIDMock.defaultExpectation.Counter, 1) + mm_want := mmGetTruthSourceByFileUID.GetTruthSourceByFileUIDMock.defaultExpectation.params + mm_want_ptrs := mmGetTruthSourceByFileUID.GetTruthSourceByFileUIDMock.defaultExpectation.paramPtrs + + mm_got := RepositoryIMockGetTruthSourceByFileUIDParams{ctx, fileUID} + + if mm_want_ptrs != nil { + + if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { + mmGetTruthSourceByFileUID.t.Errorf("RepositoryIMock.GetTruthSourceByFileUID got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) + } + + if mm_want_ptrs.fileUID != nil && !minimock.Equal(*mm_want_ptrs.fileUID, mm_got.fileUID) { + mmGetTruthSourceByFileUID.t.Errorf("RepositoryIMock.GetTruthSourceByFileUID got unexpected parameter fileUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.fileUID, mm_got.fileUID, minimock.Diff(*mm_want_ptrs.fileUID, mm_got.fileUID)) + } + + } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { + mmGetTruthSourceByFileUID.t.Errorf("RepositoryIMock.GetTruthSourceByFileUID got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + } + + mm_results := mmGetTruthSourceByFileUID.GetTruthSourceByFileUIDMock.defaultExpectation.results + if mm_results == nil { + mmGetTruthSourceByFileUID.t.Fatal("No results are set for the RepositoryIMock.GetTruthSourceByFileUID") + } + return (*mm_results).sp1, (*mm_results).err + } + if mmGetTruthSourceByFileUID.funcGetTruthSourceByFileUID != nil { + return mmGetTruthSourceByFileUID.funcGetTruthSourceByFileUID(ctx, fileUID) + } + mmGetTruthSourceByFileUID.t.Fatalf("Unexpected call to RepositoryIMock.GetTruthSourceByFileUID. %v %v", ctx, fileUID) + return +} + +// GetTruthSourceByFileUIDAfterCounter returns a count of finished RepositoryIMock.GetTruthSourceByFileUID invocations +func (mmGetTruthSourceByFileUID *RepositoryIMock) GetTruthSourceByFileUIDAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetTruthSourceByFileUID.afterGetTruthSourceByFileUIDCounter) +} + +// GetTruthSourceByFileUIDBeforeCounter returns a count of RepositoryIMock.GetTruthSourceByFileUID invocations +func (mmGetTruthSourceByFileUID *RepositoryIMock) GetTruthSourceByFileUIDBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetTruthSourceByFileUID.beforeGetTruthSourceByFileUIDCounter) +} + +// Calls returns a list of arguments used in each call to RepositoryIMock.GetTruthSourceByFileUID. +// The list is in the same order as the calls were made (i.e. recent calls have a higher index) +func (mmGetTruthSourceByFileUID *mRepositoryIMockGetTruthSourceByFileUID) Calls() []*RepositoryIMockGetTruthSourceByFileUIDParams { + mmGetTruthSourceByFileUID.mutex.RLock() + + argCopy := make([]*RepositoryIMockGetTruthSourceByFileUIDParams, len(mmGetTruthSourceByFileUID.callArgs)) + copy(argCopy, mmGetTruthSourceByFileUID.callArgs) + + mmGetTruthSourceByFileUID.mutex.RUnlock() + + return argCopy +} + +// MinimockGetTruthSourceByFileUIDDone returns true if the count of the GetTruthSourceByFileUID invocations corresponds +// the number of defined expectations +func (m *RepositoryIMock) MinimockGetTruthSourceByFileUIDDone() bool { + for _, e := range m.GetTruthSourceByFileUIDMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + return false + } + } + + return m.GetTruthSourceByFileUIDMock.invocationsDone() +} + +// MinimockGetTruthSourceByFileUIDInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockGetTruthSourceByFileUIDInspect() { + for _, e := range m.GetTruthSourceByFileUIDMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + m.t.Errorf("Expected call to RepositoryIMock.GetTruthSourceByFileUID with params: %#v", *e.params) + } + } + + afterGetTruthSourceByFileUIDCounter := mm_atomic.LoadUint64(&m.afterGetTruthSourceByFileUIDCounter) + // if default expectation was set then invocations count should be greater than zero + if m.GetTruthSourceByFileUIDMock.defaultExpectation != nil && afterGetTruthSourceByFileUIDCounter < 1 { + if m.GetTruthSourceByFileUIDMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.GetTruthSourceByFileUID") + } else { + m.t.Errorf("Expected call to RepositoryIMock.GetTruthSourceByFileUID with params: %#v", *m.GetTruthSourceByFileUIDMock.defaultExpectation.params) + } + } + // if func was set then invocations count should be greater than zero + if m.funcGetTruthSourceByFileUID != nil && afterGetTruthSourceByFileUIDCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.GetTruthSourceByFileUID") + } + + if !m.GetTruthSourceByFileUIDMock.invocationsDone() && afterGetTruthSourceByFileUIDCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.GetTruthSourceByFileUID but found %d calls", + mm_atomic.LoadUint64(&m.GetTruthSourceByFileUIDMock.expectedInvocations), afterGetTruthSourceByFileUIDCounter) + } +} + +type mRepositoryIMockHardDeleteChunksByKbFileUID struct { + mock *RepositoryIMock + defaultExpectation *RepositoryIMockHardDeleteChunksByKbFileUIDExpectation + expectations []*RepositoryIMockHardDeleteChunksByKbFileUIDExpectation + + callArgs []*RepositoryIMockHardDeleteChunksByKbFileUIDParams + mutex sync.RWMutex + + expectedInvocations uint64 +} + +// RepositoryIMockHardDeleteChunksByKbFileUIDExpectation specifies expectation struct of the RepositoryI.HardDeleteChunksByKbFileUID +type RepositoryIMockHardDeleteChunksByKbFileUIDExpectation struct { + mock *RepositoryIMock + params *RepositoryIMockHardDeleteChunksByKbFileUIDParams + paramPtrs *RepositoryIMockHardDeleteChunksByKbFileUIDParamPtrs + results *RepositoryIMockHardDeleteChunksByKbFileUIDResults + Counter uint64 +} + +// RepositoryIMockHardDeleteChunksByKbFileUIDParams contains parameters of the RepositoryI.HardDeleteChunksByKbFileUID +type RepositoryIMockHardDeleteChunksByKbFileUIDParams struct { + ctx context.Context + kbFileUID uuid.UUID +} + +// RepositoryIMockHardDeleteChunksByKbFileUIDParamPtrs contains pointers to parameters of the RepositoryI.HardDeleteChunksByKbFileUID +type RepositoryIMockHardDeleteChunksByKbFileUIDParamPtrs struct { + ctx *context.Context + kbFileUID *uuid.UUID +} + +// RepositoryIMockHardDeleteChunksByKbFileUIDResults contains results of the RepositoryI.HardDeleteChunksByKbFileUID +type RepositoryIMockHardDeleteChunksByKbFileUIDResults struct { + err error +} + +// Expect sets up expected params for RepositoryI.HardDeleteChunksByKbFileUID +func (mmHardDeleteChunksByKbFileUID *mRepositoryIMockHardDeleteChunksByKbFileUID) Expect(ctx context.Context, kbFileUID uuid.UUID) *mRepositoryIMockHardDeleteChunksByKbFileUID { + if mmHardDeleteChunksByKbFileUID.mock.funcHardDeleteChunksByKbFileUID != nil { + mmHardDeleteChunksByKbFileUID.mock.t.Fatalf("RepositoryIMock.HardDeleteChunksByKbFileUID mock is already set by Set") + } + + if mmHardDeleteChunksByKbFileUID.defaultExpectation == nil { + mmHardDeleteChunksByKbFileUID.defaultExpectation = &RepositoryIMockHardDeleteChunksByKbFileUIDExpectation{} + } + + if mmHardDeleteChunksByKbFileUID.defaultExpectation.paramPtrs != nil { + mmHardDeleteChunksByKbFileUID.mock.t.Fatalf("RepositoryIMock.HardDeleteChunksByKbFileUID mock is already set by ExpectParams functions") + } + + mmHardDeleteChunksByKbFileUID.defaultExpectation.params = &RepositoryIMockHardDeleteChunksByKbFileUIDParams{ctx, kbFileUID} + for _, e := range mmHardDeleteChunksByKbFileUID.expectations { + if minimock.Equal(e.params, mmHardDeleteChunksByKbFileUID.defaultExpectation.params) { + mmHardDeleteChunksByKbFileUID.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmHardDeleteChunksByKbFileUID.defaultExpectation.params) + } + } + + return mmHardDeleteChunksByKbFileUID +} + +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.HardDeleteChunksByKbFileUID +func (mmHardDeleteChunksByKbFileUID *mRepositoryIMockHardDeleteChunksByKbFileUID) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockHardDeleteChunksByKbFileUID { + if mmHardDeleteChunksByKbFileUID.mock.funcHardDeleteChunksByKbFileUID != nil { + mmHardDeleteChunksByKbFileUID.mock.t.Fatalf("RepositoryIMock.HardDeleteChunksByKbFileUID mock is already set by Set") + } + + if mmHardDeleteChunksByKbFileUID.defaultExpectation == nil { + mmHardDeleteChunksByKbFileUID.defaultExpectation = &RepositoryIMockHardDeleteChunksByKbFileUIDExpectation{} + } + + if mmHardDeleteChunksByKbFileUID.defaultExpectation.params != nil { + mmHardDeleteChunksByKbFileUID.mock.t.Fatalf("RepositoryIMock.HardDeleteChunksByKbFileUID mock is already set by Expect") + } + + if mmHardDeleteChunksByKbFileUID.defaultExpectation.paramPtrs == nil { + mmHardDeleteChunksByKbFileUID.defaultExpectation.paramPtrs = &RepositoryIMockHardDeleteChunksByKbFileUIDParamPtrs{} + } + mmHardDeleteChunksByKbFileUID.defaultExpectation.paramPtrs.ctx = &ctx + + return mmHardDeleteChunksByKbFileUID +} + +// ExpectKbFileUIDParam2 sets up expected param kbFileUID for RepositoryI.HardDeleteChunksByKbFileUID +func (mmHardDeleteChunksByKbFileUID *mRepositoryIMockHardDeleteChunksByKbFileUID) ExpectKbFileUIDParam2(kbFileUID uuid.UUID) *mRepositoryIMockHardDeleteChunksByKbFileUID { + if mmHardDeleteChunksByKbFileUID.mock.funcHardDeleteChunksByKbFileUID != nil { + mmHardDeleteChunksByKbFileUID.mock.t.Fatalf("RepositoryIMock.HardDeleteChunksByKbFileUID mock is already set by Set") + } + + if mmHardDeleteChunksByKbFileUID.defaultExpectation == nil { + mmHardDeleteChunksByKbFileUID.defaultExpectation = &RepositoryIMockHardDeleteChunksByKbFileUIDExpectation{} + } + + if mmHardDeleteChunksByKbFileUID.defaultExpectation.params != nil { + mmHardDeleteChunksByKbFileUID.mock.t.Fatalf("RepositoryIMock.HardDeleteChunksByKbFileUID mock is already set by Expect") + } + + if mmHardDeleteChunksByKbFileUID.defaultExpectation.paramPtrs == nil { + mmHardDeleteChunksByKbFileUID.defaultExpectation.paramPtrs = &RepositoryIMockHardDeleteChunksByKbFileUIDParamPtrs{} + } + mmHardDeleteChunksByKbFileUID.defaultExpectation.paramPtrs.kbFileUID = &kbFileUID + + return mmHardDeleteChunksByKbFileUID +} + +// Inspect accepts an inspector function that has same arguments as the RepositoryI.HardDeleteChunksByKbFileUID +func (mmHardDeleteChunksByKbFileUID *mRepositoryIMockHardDeleteChunksByKbFileUID) Inspect(f func(ctx context.Context, kbFileUID uuid.UUID)) *mRepositoryIMockHardDeleteChunksByKbFileUID { + if mmHardDeleteChunksByKbFileUID.mock.inspectFuncHardDeleteChunksByKbFileUID != nil { + mmHardDeleteChunksByKbFileUID.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.HardDeleteChunksByKbFileUID") + } + + mmHardDeleteChunksByKbFileUID.mock.inspectFuncHardDeleteChunksByKbFileUID = f + + return mmHardDeleteChunksByKbFileUID +} + +// Return sets up results that will be returned by RepositoryI.HardDeleteChunksByKbFileUID +func (mmHardDeleteChunksByKbFileUID *mRepositoryIMockHardDeleteChunksByKbFileUID) Return(err error) *RepositoryIMock { + if mmHardDeleteChunksByKbFileUID.mock.funcHardDeleteChunksByKbFileUID != nil { + mmHardDeleteChunksByKbFileUID.mock.t.Fatalf("RepositoryIMock.HardDeleteChunksByKbFileUID mock is already set by Set") + } + + if mmHardDeleteChunksByKbFileUID.defaultExpectation == nil { + mmHardDeleteChunksByKbFileUID.defaultExpectation = &RepositoryIMockHardDeleteChunksByKbFileUIDExpectation{mock: mmHardDeleteChunksByKbFileUID.mock} + } + mmHardDeleteChunksByKbFileUID.defaultExpectation.results = &RepositoryIMockHardDeleteChunksByKbFileUIDResults{err} + return mmHardDeleteChunksByKbFileUID.mock +} + +// Set uses given function f to mock the RepositoryI.HardDeleteChunksByKbFileUID method +func (mmHardDeleteChunksByKbFileUID *mRepositoryIMockHardDeleteChunksByKbFileUID) Set(f func(ctx context.Context, kbFileUID uuid.UUID) (err error)) *RepositoryIMock { + if mmHardDeleteChunksByKbFileUID.defaultExpectation != nil { + mmHardDeleteChunksByKbFileUID.mock.t.Fatalf("Default expectation is already set for the RepositoryI.HardDeleteChunksByKbFileUID method") + } + + if len(mmHardDeleteChunksByKbFileUID.expectations) > 0 { + mmHardDeleteChunksByKbFileUID.mock.t.Fatalf("Some expectations are already set for the RepositoryI.HardDeleteChunksByKbFileUID method") + } + + mmHardDeleteChunksByKbFileUID.mock.funcHardDeleteChunksByKbFileUID = f + return mmHardDeleteChunksByKbFileUID.mock +} + +// When sets expectation for the RepositoryI.HardDeleteChunksByKbFileUID which will trigger the result defined by the following +// Then helper +func (mmHardDeleteChunksByKbFileUID *mRepositoryIMockHardDeleteChunksByKbFileUID) When(ctx context.Context, kbFileUID uuid.UUID) *RepositoryIMockHardDeleteChunksByKbFileUIDExpectation { + if mmHardDeleteChunksByKbFileUID.mock.funcHardDeleteChunksByKbFileUID != nil { + mmHardDeleteChunksByKbFileUID.mock.t.Fatalf("RepositoryIMock.HardDeleteChunksByKbFileUID mock is already set by Set") + } + + expectation := &RepositoryIMockHardDeleteChunksByKbFileUIDExpectation{ + mock: mmHardDeleteChunksByKbFileUID.mock, + params: &RepositoryIMockHardDeleteChunksByKbFileUIDParams{ctx, kbFileUID}, + } + mmHardDeleteChunksByKbFileUID.expectations = append(mmHardDeleteChunksByKbFileUID.expectations, expectation) + return expectation +} + +// Then sets up RepositoryI.HardDeleteChunksByKbFileUID return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockHardDeleteChunksByKbFileUIDExpectation) Then(err error) *RepositoryIMock { + e.results = &RepositoryIMockHardDeleteChunksByKbFileUIDResults{err} + return e.mock +} + +// Times sets number of times RepositoryI.HardDeleteChunksByKbFileUID should be invoked +func (mmHardDeleteChunksByKbFileUID *mRepositoryIMockHardDeleteChunksByKbFileUID) Times(n uint64) *mRepositoryIMockHardDeleteChunksByKbFileUID { + if n == 0 { + mmHardDeleteChunksByKbFileUID.mock.t.Fatalf("Times of RepositoryIMock.HardDeleteChunksByKbFileUID mock can not be zero") + } + mm_atomic.StoreUint64(&mmHardDeleteChunksByKbFileUID.expectedInvocations, n) + return mmHardDeleteChunksByKbFileUID +} + +func (mmHardDeleteChunksByKbFileUID *mRepositoryIMockHardDeleteChunksByKbFileUID) invocationsDone() bool { + if len(mmHardDeleteChunksByKbFileUID.expectations) == 0 && mmHardDeleteChunksByKbFileUID.defaultExpectation == nil && mmHardDeleteChunksByKbFileUID.mock.funcHardDeleteChunksByKbFileUID == nil { + return true + } + + totalInvocations := mm_atomic.LoadUint64(&mmHardDeleteChunksByKbFileUID.mock.afterHardDeleteChunksByKbFileUIDCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmHardDeleteChunksByKbFileUID.expectedInvocations) + + return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) +} + +// HardDeleteChunksByKbFileUID implements repository.RepositoryI +func (mmHardDeleteChunksByKbFileUID *RepositoryIMock) HardDeleteChunksByKbFileUID(ctx context.Context, kbFileUID uuid.UUID) (err error) { + mm_atomic.AddUint64(&mmHardDeleteChunksByKbFileUID.beforeHardDeleteChunksByKbFileUIDCounter, 1) + defer mm_atomic.AddUint64(&mmHardDeleteChunksByKbFileUID.afterHardDeleteChunksByKbFileUIDCounter, 1) + + if mmHardDeleteChunksByKbFileUID.inspectFuncHardDeleteChunksByKbFileUID != nil { + mmHardDeleteChunksByKbFileUID.inspectFuncHardDeleteChunksByKbFileUID(ctx, kbFileUID) + } + + mm_params := RepositoryIMockHardDeleteChunksByKbFileUIDParams{ctx, kbFileUID} + + // Record call args + mmHardDeleteChunksByKbFileUID.HardDeleteChunksByKbFileUIDMock.mutex.Lock() + mmHardDeleteChunksByKbFileUID.HardDeleteChunksByKbFileUIDMock.callArgs = append(mmHardDeleteChunksByKbFileUID.HardDeleteChunksByKbFileUIDMock.callArgs, &mm_params) + mmHardDeleteChunksByKbFileUID.HardDeleteChunksByKbFileUIDMock.mutex.Unlock() + + for _, e := range mmHardDeleteChunksByKbFileUID.HardDeleteChunksByKbFileUIDMock.expectations { + if minimock.Equal(*e.params, mm_params) { + mm_atomic.AddUint64(&e.Counter, 1) + return e.results.err + } + } + + if mmHardDeleteChunksByKbFileUID.HardDeleteChunksByKbFileUIDMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmHardDeleteChunksByKbFileUID.HardDeleteChunksByKbFileUIDMock.defaultExpectation.Counter, 1) + mm_want := mmHardDeleteChunksByKbFileUID.HardDeleteChunksByKbFileUIDMock.defaultExpectation.params + mm_want_ptrs := mmHardDeleteChunksByKbFileUID.HardDeleteChunksByKbFileUIDMock.defaultExpectation.paramPtrs + + mm_got := RepositoryIMockHardDeleteChunksByKbFileUIDParams{ctx, kbFileUID} + + if mm_want_ptrs != nil { + + if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { + mmHardDeleteChunksByKbFileUID.t.Errorf("RepositoryIMock.HardDeleteChunksByKbFileUID got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) + } + + if mm_want_ptrs.kbFileUID != nil && !minimock.Equal(*mm_want_ptrs.kbFileUID, mm_got.kbFileUID) { + mmHardDeleteChunksByKbFileUID.t.Errorf("RepositoryIMock.HardDeleteChunksByKbFileUID got unexpected parameter kbFileUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.kbFileUID, mm_got.kbFileUID, minimock.Diff(*mm_want_ptrs.kbFileUID, mm_got.kbFileUID)) + } + + } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { + mmHardDeleteChunksByKbFileUID.t.Errorf("RepositoryIMock.HardDeleteChunksByKbFileUID got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + } + + mm_results := mmHardDeleteChunksByKbFileUID.HardDeleteChunksByKbFileUIDMock.defaultExpectation.results + if mm_results == nil { + mmHardDeleteChunksByKbFileUID.t.Fatal("No results are set for the RepositoryIMock.HardDeleteChunksByKbFileUID") + } + return (*mm_results).err + } + if mmHardDeleteChunksByKbFileUID.funcHardDeleteChunksByKbFileUID != nil { + return mmHardDeleteChunksByKbFileUID.funcHardDeleteChunksByKbFileUID(ctx, kbFileUID) + } + mmHardDeleteChunksByKbFileUID.t.Fatalf("Unexpected call to RepositoryIMock.HardDeleteChunksByKbFileUID. %v %v", ctx, kbFileUID) + return +} + +// HardDeleteChunksByKbFileUIDAfterCounter returns a count of finished RepositoryIMock.HardDeleteChunksByKbFileUID invocations +func (mmHardDeleteChunksByKbFileUID *RepositoryIMock) HardDeleteChunksByKbFileUIDAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmHardDeleteChunksByKbFileUID.afterHardDeleteChunksByKbFileUIDCounter) +} + +// HardDeleteChunksByKbFileUIDBeforeCounter returns a count of RepositoryIMock.HardDeleteChunksByKbFileUID invocations +func (mmHardDeleteChunksByKbFileUID *RepositoryIMock) HardDeleteChunksByKbFileUIDBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmHardDeleteChunksByKbFileUID.beforeHardDeleteChunksByKbFileUIDCounter) +} + +// Calls returns a list of arguments used in each call to RepositoryIMock.HardDeleteChunksByKbFileUID. +// The list is in the same order as the calls were made (i.e. recent calls have a higher index) +func (mmHardDeleteChunksByKbFileUID *mRepositoryIMockHardDeleteChunksByKbFileUID) Calls() []*RepositoryIMockHardDeleteChunksByKbFileUIDParams { + mmHardDeleteChunksByKbFileUID.mutex.RLock() + + argCopy := make([]*RepositoryIMockHardDeleteChunksByKbFileUIDParams, len(mmHardDeleteChunksByKbFileUID.callArgs)) + copy(argCopy, mmHardDeleteChunksByKbFileUID.callArgs) + + mmHardDeleteChunksByKbFileUID.mutex.RUnlock() + + return argCopy +} + +// MinimockHardDeleteChunksByKbFileUIDDone returns true if the count of the HardDeleteChunksByKbFileUID invocations corresponds +// the number of defined expectations +func (m *RepositoryIMock) MinimockHardDeleteChunksByKbFileUIDDone() bool { + for _, e := range m.HardDeleteChunksByKbFileUIDMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + return false + } + } + + return m.HardDeleteChunksByKbFileUIDMock.invocationsDone() +} + +// MinimockHardDeleteChunksByKbFileUIDInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockHardDeleteChunksByKbFileUIDInspect() { + for _, e := range m.HardDeleteChunksByKbFileUIDMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + m.t.Errorf("Expected call to RepositoryIMock.HardDeleteChunksByKbFileUID with params: %#v", *e.params) + } + } + + afterHardDeleteChunksByKbFileUIDCounter := mm_atomic.LoadUint64(&m.afterHardDeleteChunksByKbFileUIDCounter) + // if default expectation was set then invocations count should be greater than zero + if m.HardDeleteChunksByKbFileUIDMock.defaultExpectation != nil && afterHardDeleteChunksByKbFileUIDCounter < 1 { + if m.HardDeleteChunksByKbFileUIDMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.HardDeleteChunksByKbFileUID") + } else { + m.t.Errorf("Expected call to RepositoryIMock.HardDeleteChunksByKbFileUID with params: %#v", *m.HardDeleteChunksByKbFileUIDMock.defaultExpectation.params) + } + } + // if func was set then invocations count should be greater than zero + if m.funcHardDeleteChunksByKbFileUID != nil && afterHardDeleteChunksByKbFileUIDCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.HardDeleteChunksByKbFileUID") + } + + if !m.HardDeleteChunksByKbFileUIDMock.invocationsDone() && afterHardDeleteChunksByKbFileUIDCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.HardDeleteChunksByKbFileUID but found %d calls", + mm_atomic.LoadUint64(&m.HardDeleteChunksByKbFileUIDMock.expectedInvocations), afterHardDeleteChunksByKbFileUIDCounter) + } +} + +type mRepositoryIMockHardDeleteChunksByKbUID struct { + mock *RepositoryIMock + defaultExpectation *RepositoryIMockHardDeleteChunksByKbUIDExpectation + expectations []*RepositoryIMockHardDeleteChunksByKbUIDExpectation + + callArgs []*RepositoryIMockHardDeleteChunksByKbUIDParams + mutex sync.RWMutex + + expectedInvocations uint64 +} + +// RepositoryIMockHardDeleteChunksByKbUIDExpectation specifies expectation struct of the RepositoryI.HardDeleteChunksByKbUID +type RepositoryIMockHardDeleteChunksByKbUIDExpectation struct { + mock *RepositoryIMock + params *RepositoryIMockHardDeleteChunksByKbUIDParams + paramPtrs *RepositoryIMockHardDeleteChunksByKbUIDParamPtrs + results *RepositoryIMockHardDeleteChunksByKbUIDResults + Counter uint64 +} + +// RepositoryIMockHardDeleteChunksByKbUIDParams contains parameters of the RepositoryI.HardDeleteChunksByKbUID +type RepositoryIMockHardDeleteChunksByKbUIDParams struct { + ctx context.Context + kbUID uuid.UUID +} + +// RepositoryIMockHardDeleteChunksByKbUIDParamPtrs contains pointers to parameters of the RepositoryI.HardDeleteChunksByKbUID +type RepositoryIMockHardDeleteChunksByKbUIDParamPtrs struct { + ctx *context.Context + kbUID *uuid.UUID +} + +// RepositoryIMockHardDeleteChunksByKbUIDResults contains results of the RepositoryI.HardDeleteChunksByKbUID +type RepositoryIMockHardDeleteChunksByKbUIDResults struct { + err error +} + +// Expect sets up expected params for RepositoryI.HardDeleteChunksByKbUID +func (mmHardDeleteChunksByKbUID *mRepositoryIMockHardDeleteChunksByKbUID) Expect(ctx context.Context, kbUID uuid.UUID) *mRepositoryIMockHardDeleteChunksByKbUID { + if mmHardDeleteChunksByKbUID.mock.funcHardDeleteChunksByKbUID != nil { + mmHardDeleteChunksByKbUID.mock.t.Fatalf("RepositoryIMock.HardDeleteChunksByKbUID mock is already set by Set") + } + + if mmHardDeleteChunksByKbUID.defaultExpectation == nil { + mmHardDeleteChunksByKbUID.defaultExpectation = &RepositoryIMockHardDeleteChunksByKbUIDExpectation{} + } + + if mmHardDeleteChunksByKbUID.defaultExpectation.paramPtrs != nil { + mmHardDeleteChunksByKbUID.mock.t.Fatalf("RepositoryIMock.HardDeleteChunksByKbUID mock is already set by ExpectParams functions") + } + + mmHardDeleteChunksByKbUID.defaultExpectation.params = &RepositoryIMockHardDeleteChunksByKbUIDParams{ctx, kbUID} + for _, e := range mmHardDeleteChunksByKbUID.expectations { + if minimock.Equal(e.params, mmHardDeleteChunksByKbUID.defaultExpectation.params) { + mmHardDeleteChunksByKbUID.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmHardDeleteChunksByKbUID.defaultExpectation.params) + } + } + + return mmHardDeleteChunksByKbUID +} + +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.HardDeleteChunksByKbUID +func (mmHardDeleteChunksByKbUID *mRepositoryIMockHardDeleteChunksByKbUID) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockHardDeleteChunksByKbUID { + if mmHardDeleteChunksByKbUID.mock.funcHardDeleteChunksByKbUID != nil { + mmHardDeleteChunksByKbUID.mock.t.Fatalf("RepositoryIMock.HardDeleteChunksByKbUID mock is already set by Set") + } + + if mmHardDeleteChunksByKbUID.defaultExpectation == nil { + mmHardDeleteChunksByKbUID.defaultExpectation = &RepositoryIMockHardDeleteChunksByKbUIDExpectation{} + } + + if mmHardDeleteChunksByKbUID.defaultExpectation.params != nil { + mmHardDeleteChunksByKbUID.mock.t.Fatalf("RepositoryIMock.HardDeleteChunksByKbUID mock is already set by Expect") + } + + if mmHardDeleteChunksByKbUID.defaultExpectation.paramPtrs == nil { + mmHardDeleteChunksByKbUID.defaultExpectation.paramPtrs = &RepositoryIMockHardDeleteChunksByKbUIDParamPtrs{} + } + mmHardDeleteChunksByKbUID.defaultExpectation.paramPtrs.ctx = &ctx + + return mmHardDeleteChunksByKbUID +} + +// ExpectKbUIDParam2 sets up expected param kbUID for RepositoryI.HardDeleteChunksByKbUID +func (mmHardDeleteChunksByKbUID *mRepositoryIMockHardDeleteChunksByKbUID) ExpectKbUIDParam2(kbUID uuid.UUID) *mRepositoryIMockHardDeleteChunksByKbUID { + if mmHardDeleteChunksByKbUID.mock.funcHardDeleteChunksByKbUID != nil { + mmHardDeleteChunksByKbUID.mock.t.Fatalf("RepositoryIMock.HardDeleteChunksByKbUID mock is already set by Set") + } + + if mmHardDeleteChunksByKbUID.defaultExpectation == nil { + mmHardDeleteChunksByKbUID.defaultExpectation = &RepositoryIMockHardDeleteChunksByKbUIDExpectation{} + } + + if mmHardDeleteChunksByKbUID.defaultExpectation.params != nil { + mmHardDeleteChunksByKbUID.mock.t.Fatalf("RepositoryIMock.HardDeleteChunksByKbUID mock is already set by Expect") + } + + if mmHardDeleteChunksByKbUID.defaultExpectation.paramPtrs == nil { + mmHardDeleteChunksByKbUID.defaultExpectation.paramPtrs = &RepositoryIMockHardDeleteChunksByKbUIDParamPtrs{} + } + mmHardDeleteChunksByKbUID.defaultExpectation.paramPtrs.kbUID = &kbUID + + return mmHardDeleteChunksByKbUID +} + +// Inspect accepts an inspector function that has same arguments as the RepositoryI.HardDeleteChunksByKbUID +func (mmHardDeleteChunksByKbUID *mRepositoryIMockHardDeleteChunksByKbUID) Inspect(f func(ctx context.Context, kbUID uuid.UUID)) *mRepositoryIMockHardDeleteChunksByKbUID { + if mmHardDeleteChunksByKbUID.mock.inspectFuncHardDeleteChunksByKbUID != nil { + mmHardDeleteChunksByKbUID.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.HardDeleteChunksByKbUID") + } + + mmHardDeleteChunksByKbUID.mock.inspectFuncHardDeleteChunksByKbUID = f + + return mmHardDeleteChunksByKbUID +} + +// Return sets up results that will be returned by RepositoryI.HardDeleteChunksByKbUID +func (mmHardDeleteChunksByKbUID *mRepositoryIMockHardDeleteChunksByKbUID) Return(err error) *RepositoryIMock { + if mmHardDeleteChunksByKbUID.mock.funcHardDeleteChunksByKbUID != nil { + mmHardDeleteChunksByKbUID.mock.t.Fatalf("RepositoryIMock.HardDeleteChunksByKbUID mock is already set by Set") + } + + if mmHardDeleteChunksByKbUID.defaultExpectation == nil { + mmHardDeleteChunksByKbUID.defaultExpectation = &RepositoryIMockHardDeleteChunksByKbUIDExpectation{mock: mmHardDeleteChunksByKbUID.mock} + } + mmHardDeleteChunksByKbUID.defaultExpectation.results = &RepositoryIMockHardDeleteChunksByKbUIDResults{err} + return mmHardDeleteChunksByKbUID.mock +} + +// Set uses given function f to mock the RepositoryI.HardDeleteChunksByKbUID method +func (mmHardDeleteChunksByKbUID *mRepositoryIMockHardDeleteChunksByKbUID) Set(f func(ctx context.Context, kbUID uuid.UUID) (err error)) *RepositoryIMock { + if mmHardDeleteChunksByKbUID.defaultExpectation != nil { + mmHardDeleteChunksByKbUID.mock.t.Fatalf("Default expectation is already set for the RepositoryI.HardDeleteChunksByKbUID method") + } + + if len(mmHardDeleteChunksByKbUID.expectations) > 0 { + mmHardDeleteChunksByKbUID.mock.t.Fatalf("Some expectations are already set for the RepositoryI.HardDeleteChunksByKbUID method") + } + + mmHardDeleteChunksByKbUID.mock.funcHardDeleteChunksByKbUID = f + return mmHardDeleteChunksByKbUID.mock +} + +// When sets expectation for the RepositoryI.HardDeleteChunksByKbUID which will trigger the result defined by the following +// Then helper +func (mmHardDeleteChunksByKbUID *mRepositoryIMockHardDeleteChunksByKbUID) When(ctx context.Context, kbUID uuid.UUID) *RepositoryIMockHardDeleteChunksByKbUIDExpectation { + if mmHardDeleteChunksByKbUID.mock.funcHardDeleteChunksByKbUID != nil { + mmHardDeleteChunksByKbUID.mock.t.Fatalf("RepositoryIMock.HardDeleteChunksByKbUID mock is already set by Set") + } + + expectation := &RepositoryIMockHardDeleteChunksByKbUIDExpectation{ + mock: mmHardDeleteChunksByKbUID.mock, + params: &RepositoryIMockHardDeleteChunksByKbUIDParams{ctx, kbUID}, + } + mmHardDeleteChunksByKbUID.expectations = append(mmHardDeleteChunksByKbUID.expectations, expectation) + return expectation +} + +// Then sets up RepositoryI.HardDeleteChunksByKbUID return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockHardDeleteChunksByKbUIDExpectation) Then(err error) *RepositoryIMock { + e.results = &RepositoryIMockHardDeleteChunksByKbUIDResults{err} + return e.mock +} + +// Times sets number of times RepositoryI.HardDeleteChunksByKbUID should be invoked +func (mmHardDeleteChunksByKbUID *mRepositoryIMockHardDeleteChunksByKbUID) Times(n uint64) *mRepositoryIMockHardDeleteChunksByKbUID { + if n == 0 { + mmHardDeleteChunksByKbUID.mock.t.Fatalf("Times of RepositoryIMock.HardDeleteChunksByKbUID mock can not be zero") + } + mm_atomic.StoreUint64(&mmHardDeleteChunksByKbUID.expectedInvocations, n) + return mmHardDeleteChunksByKbUID +} + +func (mmHardDeleteChunksByKbUID *mRepositoryIMockHardDeleteChunksByKbUID) invocationsDone() bool { + if len(mmHardDeleteChunksByKbUID.expectations) == 0 && mmHardDeleteChunksByKbUID.defaultExpectation == nil && mmHardDeleteChunksByKbUID.mock.funcHardDeleteChunksByKbUID == nil { + return true + } + + totalInvocations := mm_atomic.LoadUint64(&mmHardDeleteChunksByKbUID.mock.afterHardDeleteChunksByKbUIDCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmHardDeleteChunksByKbUID.expectedInvocations) + + return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) +} + +// HardDeleteChunksByKbUID implements repository.RepositoryI +func (mmHardDeleteChunksByKbUID *RepositoryIMock) HardDeleteChunksByKbUID(ctx context.Context, kbUID uuid.UUID) (err error) { + mm_atomic.AddUint64(&mmHardDeleteChunksByKbUID.beforeHardDeleteChunksByKbUIDCounter, 1) + defer mm_atomic.AddUint64(&mmHardDeleteChunksByKbUID.afterHardDeleteChunksByKbUIDCounter, 1) + + if mmHardDeleteChunksByKbUID.inspectFuncHardDeleteChunksByKbUID != nil { + mmHardDeleteChunksByKbUID.inspectFuncHardDeleteChunksByKbUID(ctx, kbUID) + } + + mm_params := RepositoryIMockHardDeleteChunksByKbUIDParams{ctx, kbUID} + + // Record call args + mmHardDeleteChunksByKbUID.HardDeleteChunksByKbUIDMock.mutex.Lock() + mmHardDeleteChunksByKbUID.HardDeleteChunksByKbUIDMock.callArgs = append(mmHardDeleteChunksByKbUID.HardDeleteChunksByKbUIDMock.callArgs, &mm_params) + mmHardDeleteChunksByKbUID.HardDeleteChunksByKbUIDMock.mutex.Unlock() + + for _, e := range mmHardDeleteChunksByKbUID.HardDeleteChunksByKbUIDMock.expectations { + if minimock.Equal(*e.params, mm_params) { + mm_atomic.AddUint64(&e.Counter, 1) + return e.results.err + } + } + + if mmHardDeleteChunksByKbUID.HardDeleteChunksByKbUIDMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmHardDeleteChunksByKbUID.HardDeleteChunksByKbUIDMock.defaultExpectation.Counter, 1) + mm_want := mmHardDeleteChunksByKbUID.HardDeleteChunksByKbUIDMock.defaultExpectation.params + mm_want_ptrs := mmHardDeleteChunksByKbUID.HardDeleteChunksByKbUIDMock.defaultExpectation.paramPtrs + + mm_got := RepositoryIMockHardDeleteChunksByKbUIDParams{ctx, kbUID} + + if mm_want_ptrs != nil { + + if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { + mmHardDeleteChunksByKbUID.t.Errorf("RepositoryIMock.HardDeleteChunksByKbUID got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) + } + + if mm_want_ptrs.kbUID != nil && !minimock.Equal(*mm_want_ptrs.kbUID, mm_got.kbUID) { + mmHardDeleteChunksByKbUID.t.Errorf("RepositoryIMock.HardDeleteChunksByKbUID got unexpected parameter kbUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.kbUID, mm_got.kbUID, minimock.Diff(*mm_want_ptrs.kbUID, mm_got.kbUID)) + } + + } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { + mmHardDeleteChunksByKbUID.t.Errorf("RepositoryIMock.HardDeleteChunksByKbUID got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + } + + mm_results := mmHardDeleteChunksByKbUID.HardDeleteChunksByKbUIDMock.defaultExpectation.results + if mm_results == nil { + mmHardDeleteChunksByKbUID.t.Fatal("No results are set for the RepositoryIMock.HardDeleteChunksByKbUID") + } + return (*mm_results).err + } + if mmHardDeleteChunksByKbUID.funcHardDeleteChunksByKbUID != nil { + return mmHardDeleteChunksByKbUID.funcHardDeleteChunksByKbUID(ctx, kbUID) + } + mmHardDeleteChunksByKbUID.t.Fatalf("Unexpected call to RepositoryIMock.HardDeleteChunksByKbUID. %v %v", ctx, kbUID) + return +} + +// HardDeleteChunksByKbUIDAfterCounter returns a count of finished RepositoryIMock.HardDeleteChunksByKbUID invocations +func (mmHardDeleteChunksByKbUID *RepositoryIMock) HardDeleteChunksByKbUIDAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmHardDeleteChunksByKbUID.afterHardDeleteChunksByKbUIDCounter) +} + +// HardDeleteChunksByKbUIDBeforeCounter returns a count of RepositoryIMock.HardDeleteChunksByKbUID invocations +func (mmHardDeleteChunksByKbUID *RepositoryIMock) HardDeleteChunksByKbUIDBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmHardDeleteChunksByKbUID.beforeHardDeleteChunksByKbUIDCounter) +} + +// Calls returns a list of arguments used in each call to RepositoryIMock.HardDeleteChunksByKbUID. +// The list is in the same order as the calls were made (i.e. recent calls have a higher index) +func (mmHardDeleteChunksByKbUID *mRepositoryIMockHardDeleteChunksByKbUID) Calls() []*RepositoryIMockHardDeleteChunksByKbUIDParams { + mmHardDeleteChunksByKbUID.mutex.RLock() + + argCopy := make([]*RepositoryIMockHardDeleteChunksByKbUIDParams, len(mmHardDeleteChunksByKbUID.callArgs)) + copy(argCopy, mmHardDeleteChunksByKbUID.callArgs) + + mmHardDeleteChunksByKbUID.mutex.RUnlock() + + return argCopy +} + +// MinimockHardDeleteChunksByKbUIDDone returns true if the count of the HardDeleteChunksByKbUID invocations corresponds +// the number of defined expectations +func (m *RepositoryIMock) MinimockHardDeleteChunksByKbUIDDone() bool { + for _, e := range m.HardDeleteChunksByKbUIDMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + return false + } + } + + return m.HardDeleteChunksByKbUIDMock.invocationsDone() +} + +// MinimockHardDeleteChunksByKbUIDInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockHardDeleteChunksByKbUIDInspect() { + for _, e := range m.HardDeleteChunksByKbUIDMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + m.t.Errorf("Expected call to RepositoryIMock.HardDeleteChunksByKbUID with params: %#v", *e.params) + } + } + + afterHardDeleteChunksByKbUIDCounter := mm_atomic.LoadUint64(&m.afterHardDeleteChunksByKbUIDCounter) + // if default expectation was set then invocations count should be greater than zero + if m.HardDeleteChunksByKbUIDMock.defaultExpectation != nil && afterHardDeleteChunksByKbUIDCounter < 1 { + if m.HardDeleteChunksByKbUIDMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.HardDeleteChunksByKbUID") + } else { + m.t.Errorf("Expected call to RepositoryIMock.HardDeleteChunksByKbUID with params: %#v", *m.HardDeleteChunksByKbUIDMock.defaultExpectation.params) + } + } + // if func was set then invocations count should be greater than zero + if m.funcHardDeleteChunksByKbUID != nil && afterHardDeleteChunksByKbUIDCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.HardDeleteChunksByKbUID") + } + + if !m.HardDeleteChunksByKbUIDMock.invocationsDone() && afterHardDeleteChunksByKbUIDCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.HardDeleteChunksByKbUID but found %d calls", + mm_atomic.LoadUint64(&m.HardDeleteChunksByKbUIDMock.expectedInvocations), afterHardDeleteChunksByKbUIDCounter) + } +} + +type mRepositoryIMockHardDeleteConvertedFileByFileUID struct { + mock *RepositoryIMock + defaultExpectation *RepositoryIMockHardDeleteConvertedFileByFileUIDExpectation + expectations []*RepositoryIMockHardDeleteConvertedFileByFileUIDExpectation + + callArgs []*RepositoryIMockHardDeleteConvertedFileByFileUIDParams + mutex sync.RWMutex + + expectedInvocations uint64 +} + +// RepositoryIMockHardDeleteConvertedFileByFileUIDExpectation specifies expectation struct of the RepositoryI.HardDeleteConvertedFileByFileUID +type RepositoryIMockHardDeleteConvertedFileByFileUIDExpectation struct { + mock *RepositoryIMock + params *RepositoryIMockHardDeleteConvertedFileByFileUIDParams + paramPtrs *RepositoryIMockHardDeleteConvertedFileByFileUIDParamPtrs + results *RepositoryIMockHardDeleteConvertedFileByFileUIDResults + Counter uint64 +} + +// RepositoryIMockHardDeleteConvertedFileByFileUIDParams contains parameters of the RepositoryI.HardDeleteConvertedFileByFileUID +type RepositoryIMockHardDeleteConvertedFileByFileUIDParams struct { + ctx context.Context + fileUID uuid.UUID +} + +// RepositoryIMockHardDeleteConvertedFileByFileUIDParamPtrs contains pointers to parameters of the RepositoryI.HardDeleteConvertedFileByFileUID +type RepositoryIMockHardDeleteConvertedFileByFileUIDParamPtrs struct { + ctx *context.Context + fileUID *uuid.UUID +} + +// RepositoryIMockHardDeleteConvertedFileByFileUIDResults contains results of the RepositoryI.HardDeleteConvertedFileByFileUID +type RepositoryIMockHardDeleteConvertedFileByFileUIDResults struct { + err error +} + +// Expect sets up expected params for RepositoryI.HardDeleteConvertedFileByFileUID +func (mmHardDeleteConvertedFileByFileUID *mRepositoryIMockHardDeleteConvertedFileByFileUID) Expect(ctx context.Context, fileUID uuid.UUID) *mRepositoryIMockHardDeleteConvertedFileByFileUID { + if mmHardDeleteConvertedFileByFileUID.mock.funcHardDeleteConvertedFileByFileUID != nil { + mmHardDeleteConvertedFileByFileUID.mock.t.Fatalf("RepositoryIMock.HardDeleteConvertedFileByFileUID mock is already set by Set") + } + + if mmHardDeleteConvertedFileByFileUID.defaultExpectation == nil { + mmHardDeleteConvertedFileByFileUID.defaultExpectation = &RepositoryIMockHardDeleteConvertedFileByFileUIDExpectation{} + } + + if mmHardDeleteConvertedFileByFileUID.defaultExpectation.paramPtrs != nil { + mmHardDeleteConvertedFileByFileUID.mock.t.Fatalf("RepositoryIMock.HardDeleteConvertedFileByFileUID mock is already set by ExpectParams functions") + } + + mmHardDeleteConvertedFileByFileUID.defaultExpectation.params = &RepositoryIMockHardDeleteConvertedFileByFileUIDParams{ctx, fileUID} + for _, e := range mmHardDeleteConvertedFileByFileUID.expectations { + if minimock.Equal(e.params, mmHardDeleteConvertedFileByFileUID.defaultExpectation.params) { + mmHardDeleteConvertedFileByFileUID.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmHardDeleteConvertedFileByFileUID.defaultExpectation.params) + } + } + + return mmHardDeleteConvertedFileByFileUID +} + +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.HardDeleteConvertedFileByFileUID +func (mmHardDeleteConvertedFileByFileUID *mRepositoryIMockHardDeleteConvertedFileByFileUID) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockHardDeleteConvertedFileByFileUID { + if mmHardDeleteConvertedFileByFileUID.mock.funcHardDeleteConvertedFileByFileUID != nil { + mmHardDeleteConvertedFileByFileUID.mock.t.Fatalf("RepositoryIMock.HardDeleteConvertedFileByFileUID mock is already set by Set") + } + + if mmHardDeleteConvertedFileByFileUID.defaultExpectation == nil { + mmHardDeleteConvertedFileByFileUID.defaultExpectation = &RepositoryIMockHardDeleteConvertedFileByFileUIDExpectation{} + } + + if mmHardDeleteConvertedFileByFileUID.defaultExpectation.params != nil { + mmHardDeleteConvertedFileByFileUID.mock.t.Fatalf("RepositoryIMock.HardDeleteConvertedFileByFileUID mock is already set by Expect") + } + + if mmHardDeleteConvertedFileByFileUID.defaultExpectation.paramPtrs == nil { + mmHardDeleteConvertedFileByFileUID.defaultExpectation.paramPtrs = &RepositoryIMockHardDeleteConvertedFileByFileUIDParamPtrs{} + } + mmHardDeleteConvertedFileByFileUID.defaultExpectation.paramPtrs.ctx = &ctx + + return mmHardDeleteConvertedFileByFileUID +} + +// ExpectFileUIDParam2 sets up expected param fileUID for RepositoryI.HardDeleteConvertedFileByFileUID +func (mmHardDeleteConvertedFileByFileUID *mRepositoryIMockHardDeleteConvertedFileByFileUID) ExpectFileUIDParam2(fileUID uuid.UUID) *mRepositoryIMockHardDeleteConvertedFileByFileUID { + if mmHardDeleteConvertedFileByFileUID.mock.funcHardDeleteConvertedFileByFileUID != nil { + mmHardDeleteConvertedFileByFileUID.mock.t.Fatalf("RepositoryIMock.HardDeleteConvertedFileByFileUID mock is already set by Set") + } + + if mmHardDeleteConvertedFileByFileUID.defaultExpectation == nil { + mmHardDeleteConvertedFileByFileUID.defaultExpectation = &RepositoryIMockHardDeleteConvertedFileByFileUIDExpectation{} + } + + if mmHardDeleteConvertedFileByFileUID.defaultExpectation.params != nil { + mmHardDeleteConvertedFileByFileUID.mock.t.Fatalf("RepositoryIMock.HardDeleteConvertedFileByFileUID mock is already set by Expect") + } + + if mmHardDeleteConvertedFileByFileUID.defaultExpectation.paramPtrs == nil { + mmHardDeleteConvertedFileByFileUID.defaultExpectation.paramPtrs = &RepositoryIMockHardDeleteConvertedFileByFileUIDParamPtrs{} + } + mmHardDeleteConvertedFileByFileUID.defaultExpectation.paramPtrs.fileUID = &fileUID + + return mmHardDeleteConvertedFileByFileUID +} + +// Inspect accepts an inspector function that has same arguments as the RepositoryI.HardDeleteConvertedFileByFileUID +func (mmHardDeleteConvertedFileByFileUID *mRepositoryIMockHardDeleteConvertedFileByFileUID) Inspect(f func(ctx context.Context, fileUID uuid.UUID)) *mRepositoryIMockHardDeleteConvertedFileByFileUID { + if mmHardDeleteConvertedFileByFileUID.mock.inspectFuncHardDeleteConvertedFileByFileUID != nil { + mmHardDeleteConvertedFileByFileUID.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.HardDeleteConvertedFileByFileUID") + } + + mmHardDeleteConvertedFileByFileUID.mock.inspectFuncHardDeleteConvertedFileByFileUID = f + + return mmHardDeleteConvertedFileByFileUID +} + +// Return sets up results that will be returned by RepositoryI.HardDeleteConvertedFileByFileUID +func (mmHardDeleteConvertedFileByFileUID *mRepositoryIMockHardDeleteConvertedFileByFileUID) Return(err error) *RepositoryIMock { + if mmHardDeleteConvertedFileByFileUID.mock.funcHardDeleteConvertedFileByFileUID != nil { + mmHardDeleteConvertedFileByFileUID.mock.t.Fatalf("RepositoryIMock.HardDeleteConvertedFileByFileUID mock is already set by Set") + } + + if mmHardDeleteConvertedFileByFileUID.defaultExpectation == nil { + mmHardDeleteConvertedFileByFileUID.defaultExpectation = &RepositoryIMockHardDeleteConvertedFileByFileUIDExpectation{mock: mmHardDeleteConvertedFileByFileUID.mock} + } + mmHardDeleteConvertedFileByFileUID.defaultExpectation.results = &RepositoryIMockHardDeleteConvertedFileByFileUIDResults{err} + return mmHardDeleteConvertedFileByFileUID.mock +} + +// Set uses given function f to mock the RepositoryI.HardDeleteConvertedFileByFileUID method +func (mmHardDeleteConvertedFileByFileUID *mRepositoryIMockHardDeleteConvertedFileByFileUID) Set(f func(ctx context.Context, fileUID uuid.UUID) (err error)) *RepositoryIMock { + if mmHardDeleteConvertedFileByFileUID.defaultExpectation != nil { + mmHardDeleteConvertedFileByFileUID.mock.t.Fatalf("Default expectation is already set for the RepositoryI.HardDeleteConvertedFileByFileUID method") + } + + if len(mmHardDeleteConvertedFileByFileUID.expectations) > 0 { + mmHardDeleteConvertedFileByFileUID.mock.t.Fatalf("Some expectations are already set for the RepositoryI.HardDeleteConvertedFileByFileUID method") + } + + mmHardDeleteConvertedFileByFileUID.mock.funcHardDeleteConvertedFileByFileUID = f + return mmHardDeleteConvertedFileByFileUID.mock +} + +// When sets expectation for the RepositoryI.HardDeleteConvertedFileByFileUID which will trigger the result defined by the following +// Then helper +func (mmHardDeleteConvertedFileByFileUID *mRepositoryIMockHardDeleteConvertedFileByFileUID) When(ctx context.Context, fileUID uuid.UUID) *RepositoryIMockHardDeleteConvertedFileByFileUIDExpectation { + if mmHardDeleteConvertedFileByFileUID.mock.funcHardDeleteConvertedFileByFileUID != nil { + mmHardDeleteConvertedFileByFileUID.mock.t.Fatalf("RepositoryIMock.HardDeleteConvertedFileByFileUID mock is already set by Set") + } + + expectation := &RepositoryIMockHardDeleteConvertedFileByFileUIDExpectation{ + mock: mmHardDeleteConvertedFileByFileUID.mock, + params: &RepositoryIMockHardDeleteConvertedFileByFileUIDParams{ctx, fileUID}, + } + mmHardDeleteConvertedFileByFileUID.expectations = append(mmHardDeleteConvertedFileByFileUID.expectations, expectation) + return expectation +} + +// Then sets up RepositoryI.HardDeleteConvertedFileByFileUID return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockHardDeleteConvertedFileByFileUIDExpectation) Then(err error) *RepositoryIMock { + e.results = &RepositoryIMockHardDeleteConvertedFileByFileUIDResults{err} + return e.mock +} + +// Times sets number of times RepositoryI.HardDeleteConvertedFileByFileUID should be invoked +func (mmHardDeleteConvertedFileByFileUID *mRepositoryIMockHardDeleteConvertedFileByFileUID) Times(n uint64) *mRepositoryIMockHardDeleteConvertedFileByFileUID { + if n == 0 { + mmHardDeleteConvertedFileByFileUID.mock.t.Fatalf("Times of RepositoryIMock.HardDeleteConvertedFileByFileUID mock can not be zero") + } + mm_atomic.StoreUint64(&mmHardDeleteConvertedFileByFileUID.expectedInvocations, n) + return mmHardDeleteConvertedFileByFileUID +} + +func (mmHardDeleteConvertedFileByFileUID *mRepositoryIMockHardDeleteConvertedFileByFileUID) invocationsDone() bool { + if len(mmHardDeleteConvertedFileByFileUID.expectations) == 0 && mmHardDeleteConvertedFileByFileUID.defaultExpectation == nil && mmHardDeleteConvertedFileByFileUID.mock.funcHardDeleteConvertedFileByFileUID == nil { + return true + } + + totalInvocations := mm_atomic.LoadUint64(&mmHardDeleteConvertedFileByFileUID.mock.afterHardDeleteConvertedFileByFileUIDCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmHardDeleteConvertedFileByFileUID.expectedInvocations) + + return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) +} + +// HardDeleteConvertedFileByFileUID implements repository.RepositoryI +func (mmHardDeleteConvertedFileByFileUID *RepositoryIMock) HardDeleteConvertedFileByFileUID(ctx context.Context, fileUID uuid.UUID) (err error) { + mm_atomic.AddUint64(&mmHardDeleteConvertedFileByFileUID.beforeHardDeleteConvertedFileByFileUIDCounter, 1) + defer mm_atomic.AddUint64(&mmHardDeleteConvertedFileByFileUID.afterHardDeleteConvertedFileByFileUIDCounter, 1) + + if mmHardDeleteConvertedFileByFileUID.inspectFuncHardDeleteConvertedFileByFileUID != nil { + mmHardDeleteConvertedFileByFileUID.inspectFuncHardDeleteConvertedFileByFileUID(ctx, fileUID) + } + + mm_params := RepositoryIMockHardDeleteConvertedFileByFileUIDParams{ctx, fileUID} + + // Record call args + mmHardDeleteConvertedFileByFileUID.HardDeleteConvertedFileByFileUIDMock.mutex.Lock() + mmHardDeleteConvertedFileByFileUID.HardDeleteConvertedFileByFileUIDMock.callArgs = append(mmHardDeleteConvertedFileByFileUID.HardDeleteConvertedFileByFileUIDMock.callArgs, &mm_params) + mmHardDeleteConvertedFileByFileUID.HardDeleteConvertedFileByFileUIDMock.mutex.Unlock() + + for _, e := range mmHardDeleteConvertedFileByFileUID.HardDeleteConvertedFileByFileUIDMock.expectations { + if minimock.Equal(*e.params, mm_params) { + mm_atomic.AddUint64(&e.Counter, 1) + return e.results.err + } + } + + if mmHardDeleteConvertedFileByFileUID.HardDeleteConvertedFileByFileUIDMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmHardDeleteConvertedFileByFileUID.HardDeleteConvertedFileByFileUIDMock.defaultExpectation.Counter, 1) + mm_want := mmHardDeleteConvertedFileByFileUID.HardDeleteConvertedFileByFileUIDMock.defaultExpectation.params + mm_want_ptrs := mmHardDeleteConvertedFileByFileUID.HardDeleteConvertedFileByFileUIDMock.defaultExpectation.paramPtrs + + mm_got := RepositoryIMockHardDeleteConvertedFileByFileUIDParams{ctx, fileUID} + + if mm_want_ptrs != nil { + + if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { + mmHardDeleteConvertedFileByFileUID.t.Errorf("RepositoryIMock.HardDeleteConvertedFileByFileUID got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) + } + + if mm_want_ptrs.fileUID != nil && !minimock.Equal(*mm_want_ptrs.fileUID, mm_got.fileUID) { + mmHardDeleteConvertedFileByFileUID.t.Errorf("RepositoryIMock.HardDeleteConvertedFileByFileUID got unexpected parameter fileUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.fileUID, mm_got.fileUID, minimock.Diff(*mm_want_ptrs.fileUID, mm_got.fileUID)) + } + + } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { + mmHardDeleteConvertedFileByFileUID.t.Errorf("RepositoryIMock.HardDeleteConvertedFileByFileUID got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + } + + mm_results := mmHardDeleteConvertedFileByFileUID.HardDeleteConvertedFileByFileUIDMock.defaultExpectation.results + if mm_results == nil { + mmHardDeleteConvertedFileByFileUID.t.Fatal("No results are set for the RepositoryIMock.HardDeleteConvertedFileByFileUID") + } + return (*mm_results).err + } + if mmHardDeleteConvertedFileByFileUID.funcHardDeleteConvertedFileByFileUID != nil { + return mmHardDeleteConvertedFileByFileUID.funcHardDeleteConvertedFileByFileUID(ctx, fileUID) + } + mmHardDeleteConvertedFileByFileUID.t.Fatalf("Unexpected call to RepositoryIMock.HardDeleteConvertedFileByFileUID. %v %v", ctx, fileUID) + return +} + +// HardDeleteConvertedFileByFileUIDAfterCounter returns a count of finished RepositoryIMock.HardDeleteConvertedFileByFileUID invocations +func (mmHardDeleteConvertedFileByFileUID *RepositoryIMock) HardDeleteConvertedFileByFileUIDAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmHardDeleteConvertedFileByFileUID.afterHardDeleteConvertedFileByFileUIDCounter) +} + +// HardDeleteConvertedFileByFileUIDBeforeCounter returns a count of RepositoryIMock.HardDeleteConvertedFileByFileUID invocations +func (mmHardDeleteConvertedFileByFileUID *RepositoryIMock) HardDeleteConvertedFileByFileUIDBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmHardDeleteConvertedFileByFileUID.beforeHardDeleteConvertedFileByFileUIDCounter) +} + +// Calls returns a list of arguments used in each call to RepositoryIMock.HardDeleteConvertedFileByFileUID. +// The list is in the same order as the calls were made (i.e. recent calls have a higher index) +func (mmHardDeleteConvertedFileByFileUID *mRepositoryIMockHardDeleteConvertedFileByFileUID) Calls() []*RepositoryIMockHardDeleteConvertedFileByFileUIDParams { + mmHardDeleteConvertedFileByFileUID.mutex.RLock() + + argCopy := make([]*RepositoryIMockHardDeleteConvertedFileByFileUIDParams, len(mmHardDeleteConvertedFileByFileUID.callArgs)) + copy(argCopy, mmHardDeleteConvertedFileByFileUID.callArgs) + + mmHardDeleteConvertedFileByFileUID.mutex.RUnlock() + + return argCopy +} + +// MinimockHardDeleteConvertedFileByFileUIDDone returns true if the count of the HardDeleteConvertedFileByFileUID invocations corresponds +// the number of defined expectations +func (m *RepositoryIMock) MinimockHardDeleteConvertedFileByFileUIDDone() bool { + for _, e := range m.HardDeleteConvertedFileByFileUIDMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + return false + } + } + + return m.HardDeleteConvertedFileByFileUIDMock.invocationsDone() +} + +// MinimockHardDeleteConvertedFileByFileUIDInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockHardDeleteConvertedFileByFileUIDInspect() { + for _, e := range m.HardDeleteConvertedFileByFileUIDMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + m.t.Errorf("Expected call to RepositoryIMock.HardDeleteConvertedFileByFileUID with params: %#v", *e.params) + } + } + + afterHardDeleteConvertedFileByFileUIDCounter := mm_atomic.LoadUint64(&m.afterHardDeleteConvertedFileByFileUIDCounter) + // if default expectation was set then invocations count should be greater than zero + if m.HardDeleteConvertedFileByFileUIDMock.defaultExpectation != nil && afterHardDeleteConvertedFileByFileUIDCounter < 1 { + if m.HardDeleteConvertedFileByFileUIDMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.HardDeleteConvertedFileByFileUID") + } else { + m.t.Errorf("Expected call to RepositoryIMock.HardDeleteConvertedFileByFileUID with params: %#v", *m.HardDeleteConvertedFileByFileUIDMock.defaultExpectation.params) + } + } + // if func was set then invocations count should be greater than zero + if m.funcHardDeleteConvertedFileByFileUID != nil && afterHardDeleteConvertedFileByFileUIDCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.HardDeleteConvertedFileByFileUID") + } + + if !m.HardDeleteConvertedFileByFileUIDMock.invocationsDone() && afterHardDeleteConvertedFileByFileUIDCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.HardDeleteConvertedFileByFileUID but found %d calls", + mm_atomic.LoadUint64(&m.HardDeleteConvertedFileByFileUIDMock.expectedInvocations), afterHardDeleteConvertedFileByFileUIDCounter) + } +} + +type mRepositoryIMockHardDeleteEmbeddingsByKbFileUID struct { + mock *RepositoryIMock + defaultExpectation *RepositoryIMockHardDeleteEmbeddingsByKbFileUIDExpectation + expectations []*RepositoryIMockHardDeleteEmbeddingsByKbFileUIDExpectation + + callArgs []*RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParams + mutex sync.RWMutex + + expectedInvocations uint64 +} + +// RepositoryIMockHardDeleteEmbeddingsByKbFileUIDExpectation specifies expectation struct of the RepositoryI.HardDeleteEmbeddingsByKbFileUID +type RepositoryIMockHardDeleteEmbeddingsByKbFileUIDExpectation struct { + mock *RepositoryIMock + params *RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParams + paramPtrs *RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParamPtrs + results *RepositoryIMockHardDeleteEmbeddingsByKbFileUIDResults + Counter uint64 +} + +// RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParams contains parameters of the RepositoryI.HardDeleteEmbeddingsByKbFileUID +type RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParams struct { + ctx context.Context + kbFileUID uuid.UUID +} + +// RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParamPtrs contains pointers to parameters of the RepositoryI.HardDeleteEmbeddingsByKbFileUID +type RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParamPtrs struct { + ctx *context.Context + kbFileUID *uuid.UUID +} + +// RepositoryIMockHardDeleteEmbeddingsByKbFileUIDResults contains results of the RepositoryI.HardDeleteEmbeddingsByKbFileUID +type RepositoryIMockHardDeleteEmbeddingsByKbFileUIDResults struct { + err error +} + +// Expect sets up expected params for RepositoryI.HardDeleteEmbeddingsByKbFileUID +func (mmHardDeleteEmbeddingsByKbFileUID *mRepositoryIMockHardDeleteEmbeddingsByKbFileUID) Expect(ctx context.Context, kbFileUID uuid.UUID) *mRepositoryIMockHardDeleteEmbeddingsByKbFileUID { + if mmHardDeleteEmbeddingsByKbFileUID.mock.funcHardDeleteEmbeddingsByKbFileUID != nil { + mmHardDeleteEmbeddingsByKbFileUID.mock.t.Fatalf("RepositoryIMock.HardDeleteEmbeddingsByKbFileUID mock is already set by Set") + } + + if mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation == nil { + mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation = &RepositoryIMockHardDeleteEmbeddingsByKbFileUIDExpectation{} + } + + if mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation.paramPtrs != nil { + mmHardDeleteEmbeddingsByKbFileUID.mock.t.Fatalf("RepositoryIMock.HardDeleteEmbeddingsByKbFileUID mock is already set by ExpectParams functions") + } + + mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation.params = &RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParams{ctx, kbFileUID} + for _, e := range mmHardDeleteEmbeddingsByKbFileUID.expectations { + if minimock.Equal(e.params, mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation.params) { + mmHardDeleteEmbeddingsByKbFileUID.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation.params) + } + } + + return mmHardDeleteEmbeddingsByKbFileUID +} + +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.HardDeleteEmbeddingsByKbFileUID +func (mmHardDeleteEmbeddingsByKbFileUID *mRepositoryIMockHardDeleteEmbeddingsByKbFileUID) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockHardDeleteEmbeddingsByKbFileUID { + if mmHardDeleteEmbeddingsByKbFileUID.mock.funcHardDeleteEmbeddingsByKbFileUID != nil { + mmHardDeleteEmbeddingsByKbFileUID.mock.t.Fatalf("RepositoryIMock.HardDeleteEmbeddingsByKbFileUID mock is already set by Set") + } + + if mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation == nil { + mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation = &RepositoryIMockHardDeleteEmbeddingsByKbFileUIDExpectation{} + } + + if mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation.params != nil { + mmHardDeleteEmbeddingsByKbFileUID.mock.t.Fatalf("RepositoryIMock.HardDeleteEmbeddingsByKbFileUID mock is already set by Expect") + } + + if mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation.paramPtrs == nil { + mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation.paramPtrs = &RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParamPtrs{} + } + mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation.paramPtrs.ctx = &ctx + + return mmHardDeleteEmbeddingsByKbFileUID +} + +// ExpectKbFileUIDParam2 sets up expected param kbFileUID for RepositoryI.HardDeleteEmbeddingsByKbFileUID +func (mmHardDeleteEmbeddingsByKbFileUID *mRepositoryIMockHardDeleteEmbeddingsByKbFileUID) ExpectKbFileUIDParam2(kbFileUID uuid.UUID) *mRepositoryIMockHardDeleteEmbeddingsByKbFileUID { + if mmHardDeleteEmbeddingsByKbFileUID.mock.funcHardDeleteEmbeddingsByKbFileUID != nil { + mmHardDeleteEmbeddingsByKbFileUID.mock.t.Fatalf("RepositoryIMock.HardDeleteEmbeddingsByKbFileUID mock is already set by Set") + } + + if mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation == nil { + mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation = &RepositoryIMockHardDeleteEmbeddingsByKbFileUIDExpectation{} + } + + if mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation.params != nil { + mmHardDeleteEmbeddingsByKbFileUID.mock.t.Fatalf("RepositoryIMock.HardDeleteEmbeddingsByKbFileUID mock is already set by Expect") + } + + if mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation.paramPtrs == nil { + mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation.paramPtrs = &RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParamPtrs{} + } + mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation.paramPtrs.kbFileUID = &kbFileUID + + return mmHardDeleteEmbeddingsByKbFileUID +} + +// Inspect accepts an inspector function that has same arguments as the RepositoryI.HardDeleteEmbeddingsByKbFileUID +func (mmHardDeleteEmbeddingsByKbFileUID *mRepositoryIMockHardDeleteEmbeddingsByKbFileUID) Inspect(f func(ctx context.Context, kbFileUID uuid.UUID)) *mRepositoryIMockHardDeleteEmbeddingsByKbFileUID { + if mmHardDeleteEmbeddingsByKbFileUID.mock.inspectFuncHardDeleteEmbeddingsByKbFileUID != nil { + mmHardDeleteEmbeddingsByKbFileUID.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.HardDeleteEmbeddingsByKbFileUID") + } + + mmHardDeleteEmbeddingsByKbFileUID.mock.inspectFuncHardDeleteEmbeddingsByKbFileUID = f + + return mmHardDeleteEmbeddingsByKbFileUID +} + +// Return sets up results that will be returned by RepositoryI.HardDeleteEmbeddingsByKbFileUID +func (mmHardDeleteEmbeddingsByKbFileUID *mRepositoryIMockHardDeleteEmbeddingsByKbFileUID) Return(err error) *RepositoryIMock { + if mmHardDeleteEmbeddingsByKbFileUID.mock.funcHardDeleteEmbeddingsByKbFileUID != nil { + mmHardDeleteEmbeddingsByKbFileUID.mock.t.Fatalf("RepositoryIMock.HardDeleteEmbeddingsByKbFileUID mock is already set by Set") + } + + if mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation == nil { + mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation = &RepositoryIMockHardDeleteEmbeddingsByKbFileUIDExpectation{mock: mmHardDeleteEmbeddingsByKbFileUID.mock} + } + mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation.results = &RepositoryIMockHardDeleteEmbeddingsByKbFileUIDResults{err} + return mmHardDeleteEmbeddingsByKbFileUID.mock +} + +// Set uses given function f to mock the RepositoryI.HardDeleteEmbeddingsByKbFileUID method +func (mmHardDeleteEmbeddingsByKbFileUID *mRepositoryIMockHardDeleteEmbeddingsByKbFileUID) Set(f func(ctx context.Context, kbFileUID uuid.UUID) (err error)) *RepositoryIMock { + if mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation != nil { + mmHardDeleteEmbeddingsByKbFileUID.mock.t.Fatalf("Default expectation is already set for the RepositoryI.HardDeleteEmbeddingsByKbFileUID method") + } + + if len(mmHardDeleteEmbeddingsByKbFileUID.expectations) > 0 { + mmHardDeleteEmbeddingsByKbFileUID.mock.t.Fatalf("Some expectations are already set for the RepositoryI.HardDeleteEmbeddingsByKbFileUID method") + } + + mmHardDeleteEmbeddingsByKbFileUID.mock.funcHardDeleteEmbeddingsByKbFileUID = f + return mmHardDeleteEmbeddingsByKbFileUID.mock +} + +// When sets expectation for the RepositoryI.HardDeleteEmbeddingsByKbFileUID which will trigger the result defined by the following +// Then helper +func (mmHardDeleteEmbeddingsByKbFileUID *mRepositoryIMockHardDeleteEmbeddingsByKbFileUID) When(ctx context.Context, kbFileUID uuid.UUID) *RepositoryIMockHardDeleteEmbeddingsByKbFileUIDExpectation { + if mmHardDeleteEmbeddingsByKbFileUID.mock.funcHardDeleteEmbeddingsByKbFileUID != nil { + mmHardDeleteEmbeddingsByKbFileUID.mock.t.Fatalf("RepositoryIMock.HardDeleteEmbeddingsByKbFileUID mock is already set by Set") + } + + expectation := &RepositoryIMockHardDeleteEmbeddingsByKbFileUIDExpectation{ + mock: mmHardDeleteEmbeddingsByKbFileUID.mock, + params: &RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParams{ctx, kbFileUID}, + } + mmHardDeleteEmbeddingsByKbFileUID.expectations = append(mmHardDeleteEmbeddingsByKbFileUID.expectations, expectation) + return expectation +} + +// Then sets up RepositoryI.HardDeleteEmbeddingsByKbFileUID return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockHardDeleteEmbeddingsByKbFileUIDExpectation) Then(err error) *RepositoryIMock { + e.results = &RepositoryIMockHardDeleteEmbeddingsByKbFileUIDResults{err} + return e.mock +} + +// Times sets number of times RepositoryI.HardDeleteEmbeddingsByKbFileUID should be invoked +func (mmHardDeleteEmbeddingsByKbFileUID *mRepositoryIMockHardDeleteEmbeddingsByKbFileUID) Times(n uint64) *mRepositoryIMockHardDeleteEmbeddingsByKbFileUID { + if n == 0 { + mmHardDeleteEmbeddingsByKbFileUID.mock.t.Fatalf("Times of RepositoryIMock.HardDeleteEmbeddingsByKbFileUID mock can not be zero") + } + mm_atomic.StoreUint64(&mmHardDeleteEmbeddingsByKbFileUID.expectedInvocations, n) + return mmHardDeleteEmbeddingsByKbFileUID +} + +func (mmHardDeleteEmbeddingsByKbFileUID *mRepositoryIMockHardDeleteEmbeddingsByKbFileUID) invocationsDone() bool { + if len(mmHardDeleteEmbeddingsByKbFileUID.expectations) == 0 && mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation == nil && mmHardDeleteEmbeddingsByKbFileUID.mock.funcHardDeleteEmbeddingsByKbFileUID == nil { + return true + } + + totalInvocations := mm_atomic.LoadUint64(&mmHardDeleteEmbeddingsByKbFileUID.mock.afterHardDeleteEmbeddingsByKbFileUIDCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmHardDeleteEmbeddingsByKbFileUID.expectedInvocations) + + return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) +} + +// HardDeleteEmbeddingsByKbFileUID implements repository.RepositoryI +func (mmHardDeleteEmbeddingsByKbFileUID *RepositoryIMock) HardDeleteEmbeddingsByKbFileUID(ctx context.Context, kbFileUID uuid.UUID) (err error) { + mm_atomic.AddUint64(&mmHardDeleteEmbeddingsByKbFileUID.beforeHardDeleteEmbeddingsByKbFileUIDCounter, 1) + defer mm_atomic.AddUint64(&mmHardDeleteEmbeddingsByKbFileUID.afterHardDeleteEmbeddingsByKbFileUIDCounter, 1) + + if mmHardDeleteEmbeddingsByKbFileUID.inspectFuncHardDeleteEmbeddingsByKbFileUID != nil { + mmHardDeleteEmbeddingsByKbFileUID.inspectFuncHardDeleteEmbeddingsByKbFileUID(ctx, kbFileUID) + } + + mm_params := RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParams{ctx, kbFileUID} + + // Record call args + mmHardDeleteEmbeddingsByKbFileUID.HardDeleteEmbeddingsByKbFileUIDMock.mutex.Lock() + mmHardDeleteEmbeddingsByKbFileUID.HardDeleteEmbeddingsByKbFileUIDMock.callArgs = append(mmHardDeleteEmbeddingsByKbFileUID.HardDeleteEmbeddingsByKbFileUIDMock.callArgs, &mm_params) + mmHardDeleteEmbeddingsByKbFileUID.HardDeleteEmbeddingsByKbFileUIDMock.mutex.Unlock() + + for _, e := range mmHardDeleteEmbeddingsByKbFileUID.HardDeleteEmbeddingsByKbFileUIDMock.expectations { + if minimock.Equal(*e.params, mm_params) { + mm_atomic.AddUint64(&e.Counter, 1) + return e.results.err + } + } + + if mmHardDeleteEmbeddingsByKbFileUID.HardDeleteEmbeddingsByKbFileUIDMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmHardDeleteEmbeddingsByKbFileUID.HardDeleteEmbeddingsByKbFileUIDMock.defaultExpectation.Counter, 1) + mm_want := mmHardDeleteEmbeddingsByKbFileUID.HardDeleteEmbeddingsByKbFileUIDMock.defaultExpectation.params + mm_want_ptrs := mmHardDeleteEmbeddingsByKbFileUID.HardDeleteEmbeddingsByKbFileUIDMock.defaultExpectation.paramPtrs + + mm_got := RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParams{ctx, kbFileUID} + + if mm_want_ptrs != nil { + + if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { + mmHardDeleteEmbeddingsByKbFileUID.t.Errorf("RepositoryIMock.HardDeleteEmbeddingsByKbFileUID got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) + } + + if mm_want_ptrs.kbFileUID != nil && !minimock.Equal(*mm_want_ptrs.kbFileUID, mm_got.kbFileUID) { + mmHardDeleteEmbeddingsByKbFileUID.t.Errorf("RepositoryIMock.HardDeleteEmbeddingsByKbFileUID got unexpected parameter kbFileUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.kbFileUID, mm_got.kbFileUID, minimock.Diff(*mm_want_ptrs.kbFileUID, mm_got.kbFileUID)) + } + + } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { + mmHardDeleteEmbeddingsByKbFileUID.t.Errorf("RepositoryIMock.HardDeleteEmbeddingsByKbFileUID got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + } + + mm_results := mmHardDeleteEmbeddingsByKbFileUID.HardDeleteEmbeddingsByKbFileUIDMock.defaultExpectation.results + if mm_results == nil { + mmHardDeleteEmbeddingsByKbFileUID.t.Fatal("No results are set for the RepositoryIMock.HardDeleteEmbeddingsByKbFileUID") + } + return (*mm_results).err + } + if mmHardDeleteEmbeddingsByKbFileUID.funcHardDeleteEmbeddingsByKbFileUID != nil { + return mmHardDeleteEmbeddingsByKbFileUID.funcHardDeleteEmbeddingsByKbFileUID(ctx, kbFileUID) + } + mmHardDeleteEmbeddingsByKbFileUID.t.Fatalf("Unexpected call to RepositoryIMock.HardDeleteEmbeddingsByKbFileUID. %v %v", ctx, kbFileUID) + return +} + +// HardDeleteEmbeddingsByKbFileUIDAfterCounter returns a count of finished RepositoryIMock.HardDeleteEmbeddingsByKbFileUID invocations +func (mmHardDeleteEmbeddingsByKbFileUID *RepositoryIMock) HardDeleteEmbeddingsByKbFileUIDAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmHardDeleteEmbeddingsByKbFileUID.afterHardDeleteEmbeddingsByKbFileUIDCounter) +} + +// HardDeleteEmbeddingsByKbFileUIDBeforeCounter returns a count of RepositoryIMock.HardDeleteEmbeddingsByKbFileUID invocations +func (mmHardDeleteEmbeddingsByKbFileUID *RepositoryIMock) HardDeleteEmbeddingsByKbFileUIDBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmHardDeleteEmbeddingsByKbFileUID.beforeHardDeleteEmbeddingsByKbFileUIDCounter) +} + +// Calls returns a list of arguments used in each call to RepositoryIMock.HardDeleteEmbeddingsByKbFileUID. +// The list is in the same order as the calls were made (i.e. recent calls have a higher index) +func (mmHardDeleteEmbeddingsByKbFileUID *mRepositoryIMockHardDeleteEmbeddingsByKbFileUID) Calls() []*RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParams { + mmHardDeleteEmbeddingsByKbFileUID.mutex.RLock() + + argCopy := make([]*RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParams, len(mmHardDeleteEmbeddingsByKbFileUID.callArgs)) + copy(argCopy, mmHardDeleteEmbeddingsByKbFileUID.callArgs) + + mmHardDeleteEmbeddingsByKbFileUID.mutex.RUnlock() + + return argCopy +} + +// MinimockHardDeleteEmbeddingsByKbFileUIDDone returns true if the count of the HardDeleteEmbeddingsByKbFileUID invocations corresponds +// the number of defined expectations +func (m *RepositoryIMock) MinimockHardDeleteEmbeddingsByKbFileUIDDone() bool { + for _, e := range m.HardDeleteEmbeddingsByKbFileUIDMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + return false + } + } + + return m.HardDeleteEmbeddingsByKbFileUIDMock.invocationsDone() +} + +// MinimockHardDeleteEmbeddingsByKbFileUIDInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockHardDeleteEmbeddingsByKbFileUIDInspect() { + for _, e := range m.HardDeleteEmbeddingsByKbFileUIDMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + m.t.Errorf("Expected call to RepositoryIMock.HardDeleteEmbeddingsByKbFileUID with params: %#v", *e.params) + } + } + + afterHardDeleteEmbeddingsByKbFileUIDCounter := mm_atomic.LoadUint64(&m.afterHardDeleteEmbeddingsByKbFileUIDCounter) + // if default expectation was set then invocations count should be greater than zero + if m.HardDeleteEmbeddingsByKbFileUIDMock.defaultExpectation != nil && afterHardDeleteEmbeddingsByKbFileUIDCounter < 1 { + if m.HardDeleteEmbeddingsByKbFileUIDMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.HardDeleteEmbeddingsByKbFileUID") + } else { + m.t.Errorf("Expected call to RepositoryIMock.HardDeleteEmbeddingsByKbFileUID with params: %#v", *m.HardDeleteEmbeddingsByKbFileUIDMock.defaultExpectation.params) + } + } + // if func was set then invocations count should be greater than zero + if m.funcHardDeleteEmbeddingsByKbFileUID != nil && afterHardDeleteEmbeddingsByKbFileUIDCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.HardDeleteEmbeddingsByKbFileUID") + } + + if !m.HardDeleteEmbeddingsByKbFileUIDMock.invocationsDone() && afterHardDeleteEmbeddingsByKbFileUIDCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.HardDeleteEmbeddingsByKbFileUID but found %d calls", + mm_atomic.LoadUint64(&m.HardDeleteEmbeddingsByKbFileUIDMock.expectedInvocations), afterHardDeleteEmbeddingsByKbFileUIDCounter) + } +} + +type mRepositoryIMockHardDeleteEmbeddingsByKbUID struct { + mock *RepositoryIMock + defaultExpectation *RepositoryIMockHardDeleteEmbeddingsByKbUIDExpectation + expectations []*RepositoryIMockHardDeleteEmbeddingsByKbUIDExpectation + + callArgs []*RepositoryIMockHardDeleteEmbeddingsByKbUIDParams + mutex sync.RWMutex + + expectedInvocations uint64 +} + +// RepositoryIMockHardDeleteEmbeddingsByKbUIDExpectation specifies expectation struct of the RepositoryI.HardDeleteEmbeddingsByKbUID +type RepositoryIMockHardDeleteEmbeddingsByKbUIDExpectation struct { + mock *RepositoryIMock + params *RepositoryIMockHardDeleteEmbeddingsByKbUIDParams + paramPtrs *RepositoryIMockHardDeleteEmbeddingsByKbUIDParamPtrs + results *RepositoryIMockHardDeleteEmbeddingsByKbUIDResults + Counter uint64 +} + +// RepositoryIMockHardDeleteEmbeddingsByKbUIDParams contains parameters of the RepositoryI.HardDeleteEmbeddingsByKbUID +type RepositoryIMockHardDeleteEmbeddingsByKbUIDParams struct { + ctx context.Context + kbUID uuid.UUID +} + +// RepositoryIMockHardDeleteEmbeddingsByKbUIDParamPtrs contains pointers to parameters of the RepositoryI.HardDeleteEmbeddingsByKbUID +type RepositoryIMockHardDeleteEmbeddingsByKbUIDParamPtrs struct { + ctx *context.Context + kbUID *uuid.UUID +} + +// RepositoryIMockHardDeleteEmbeddingsByKbUIDResults contains results of the RepositoryI.HardDeleteEmbeddingsByKbUID +type RepositoryIMockHardDeleteEmbeddingsByKbUIDResults struct { + err error +} + +// Expect sets up expected params for RepositoryI.HardDeleteEmbeddingsByKbUID +func (mmHardDeleteEmbeddingsByKbUID *mRepositoryIMockHardDeleteEmbeddingsByKbUID) Expect(ctx context.Context, kbUID uuid.UUID) *mRepositoryIMockHardDeleteEmbeddingsByKbUID { + if mmHardDeleteEmbeddingsByKbUID.mock.funcHardDeleteEmbeddingsByKbUID != nil { + mmHardDeleteEmbeddingsByKbUID.mock.t.Fatalf("RepositoryIMock.HardDeleteEmbeddingsByKbUID mock is already set by Set") + } + + if mmHardDeleteEmbeddingsByKbUID.defaultExpectation == nil { + mmHardDeleteEmbeddingsByKbUID.defaultExpectation = &RepositoryIMockHardDeleteEmbeddingsByKbUIDExpectation{} + } + + if mmHardDeleteEmbeddingsByKbUID.defaultExpectation.paramPtrs != nil { + mmHardDeleteEmbeddingsByKbUID.mock.t.Fatalf("RepositoryIMock.HardDeleteEmbeddingsByKbUID mock is already set by ExpectParams functions") + } + + mmHardDeleteEmbeddingsByKbUID.defaultExpectation.params = &RepositoryIMockHardDeleteEmbeddingsByKbUIDParams{ctx, kbUID} + for _, e := range mmHardDeleteEmbeddingsByKbUID.expectations { + if minimock.Equal(e.params, mmHardDeleteEmbeddingsByKbUID.defaultExpectation.params) { + mmHardDeleteEmbeddingsByKbUID.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmHardDeleteEmbeddingsByKbUID.defaultExpectation.params) + } + } + + return mmHardDeleteEmbeddingsByKbUID +} + +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.HardDeleteEmbeddingsByKbUID +func (mmHardDeleteEmbeddingsByKbUID *mRepositoryIMockHardDeleteEmbeddingsByKbUID) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockHardDeleteEmbeddingsByKbUID { + if mmHardDeleteEmbeddingsByKbUID.mock.funcHardDeleteEmbeddingsByKbUID != nil { + mmHardDeleteEmbeddingsByKbUID.mock.t.Fatalf("RepositoryIMock.HardDeleteEmbeddingsByKbUID mock is already set by Set") + } + + if mmHardDeleteEmbeddingsByKbUID.defaultExpectation == nil { + mmHardDeleteEmbeddingsByKbUID.defaultExpectation = &RepositoryIMockHardDeleteEmbeddingsByKbUIDExpectation{} + } + + if mmHardDeleteEmbeddingsByKbUID.defaultExpectation.params != nil { + mmHardDeleteEmbeddingsByKbUID.mock.t.Fatalf("RepositoryIMock.HardDeleteEmbeddingsByKbUID mock is already set by Expect") + } + + if mmHardDeleteEmbeddingsByKbUID.defaultExpectation.paramPtrs == nil { + mmHardDeleteEmbeddingsByKbUID.defaultExpectation.paramPtrs = &RepositoryIMockHardDeleteEmbeddingsByKbUIDParamPtrs{} + } + mmHardDeleteEmbeddingsByKbUID.defaultExpectation.paramPtrs.ctx = &ctx + + return mmHardDeleteEmbeddingsByKbUID +} + +// ExpectKbUIDParam2 sets up expected param kbUID for RepositoryI.HardDeleteEmbeddingsByKbUID +func (mmHardDeleteEmbeddingsByKbUID *mRepositoryIMockHardDeleteEmbeddingsByKbUID) ExpectKbUIDParam2(kbUID uuid.UUID) *mRepositoryIMockHardDeleteEmbeddingsByKbUID { + if mmHardDeleteEmbeddingsByKbUID.mock.funcHardDeleteEmbeddingsByKbUID != nil { + mmHardDeleteEmbeddingsByKbUID.mock.t.Fatalf("RepositoryIMock.HardDeleteEmbeddingsByKbUID mock is already set by Set") + } + + if mmHardDeleteEmbeddingsByKbUID.defaultExpectation == nil { + mmHardDeleteEmbeddingsByKbUID.defaultExpectation = &RepositoryIMockHardDeleteEmbeddingsByKbUIDExpectation{} + } + + if mmHardDeleteEmbeddingsByKbUID.defaultExpectation.params != nil { + mmHardDeleteEmbeddingsByKbUID.mock.t.Fatalf("RepositoryIMock.HardDeleteEmbeddingsByKbUID mock is already set by Expect") + } + + if mmHardDeleteEmbeddingsByKbUID.defaultExpectation.paramPtrs == nil { + mmHardDeleteEmbeddingsByKbUID.defaultExpectation.paramPtrs = &RepositoryIMockHardDeleteEmbeddingsByKbUIDParamPtrs{} + } + mmHardDeleteEmbeddingsByKbUID.defaultExpectation.paramPtrs.kbUID = &kbUID + + return mmHardDeleteEmbeddingsByKbUID +} + +// Inspect accepts an inspector function that has same arguments as the RepositoryI.HardDeleteEmbeddingsByKbUID +func (mmHardDeleteEmbeddingsByKbUID *mRepositoryIMockHardDeleteEmbeddingsByKbUID) Inspect(f func(ctx context.Context, kbUID uuid.UUID)) *mRepositoryIMockHardDeleteEmbeddingsByKbUID { + if mmHardDeleteEmbeddingsByKbUID.mock.inspectFuncHardDeleteEmbeddingsByKbUID != nil { + mmHardDeleteEmbeddingsByKbUID.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.HardDeleteEmbeddingsByKbUID") + } + + mmHardDeleteEmbeddingsByKbUID.mock.inspectFuncHardDeleteEmbeddingsByKbUID = f + + return mmHardDeleteEmbeddingsByKbUID +} + +// Return sets up results that will be returned by RepositoryI.HardDeleteEmbeddingsByKbUID +func (mmHardDeleteEmbeddingsByKbUID *mRepositoryIMockHardDeleteEmbeddingsByKbUID) Return(err error) *RepositoryIMock { + if mmHardDeleteEmbeddingsByKbUID.mock.funcHardDeleteEmbeddingsByKbUID != nil { + mmHardDeleteEmbeddingsByKbUID.mock.t.Fatalf("RepositoryIMock.HardDeleteEmbeddingsByKbUID mock is already set by Set") + } + + if mmHardDeleteEmbeddingsByKbUID.defaultExpectation == nil { + mmHardDeleteEmbeddingsByKbUID.defaultExpectation = &RepositoryIMockHardDeleteEmbeddingsByKbUIDExpectation{mock: mmHardDeleteEmbeddingsByKbUID.mock} + } + mmHardDeleteEmbeddingsByKbUID.defaultExpectation.results = &RepositoryIMockHardDeleteEmbeddingsByKbUIDResults{err} + return mmHardDeleteEmbeddingsByKbUID.mock +} + +// Set uses given function f to mock the RepositoryI.HardDeleteEmbeddingsByKbUID method +func (mmHardDeleteEmbeddingsByKbUID *mRepositoryIMockHardDeleteEmbeddingsByKbUID) Set(f func(ctx context.Context, kbUID uuid.UUID) (err error)) *RepositoryIMock { + if mmHardDeleteEmbeddingsByKbUID.defaultExpectation != nil { + mmHardDeleteEmbeddingsByKbUID.mock.t.Fatalf("Default expectation is already set for the RepositoryI.HardDeleteEmbeddingsByKbUID method") + } + + if len(mmHardDeleteEmbeddingsByKbUID.expectations) > 0 { + mmHardDeleteEmbeddingsByKbUID.mock.t.Fatalf("Some expectations are already set for the RepositoryI.HardDeleteEmbeddingsByKbUID method") + } + + mmHardDeleteEmbeddingsByKbUID.mock.funcHardDeleteEmbeddingsByKbUID = f + return mmHardDeleteEmbeddingsByKbUID.mock +} + +// When sets expectation for the RepositoryI.HardDeleteEmbeddingsByKbUID which will trigger the result defined by the following +// Then helper +func (mmHardDeleteEmbeddingsByKbUID *mRepositoryIMockHardDeleteEmbeddingsByKbUID) When(ctx context.Context, kbUID uuid.UUID) *RepositoryIMockHardDeleteEmbeddingsByKbUIDExpectation { + if mmHardDeleteEmbeddingsByKbUID.mock.funcHardDeleteEmbeddingsByKbUID != nil { + mmHardDeleteEmbeddingsByKbUID.mock.t.Fatalf("RepositoryIMock.HardDeleteEmbeddingsByKbUID mock is already set by Set") + } + + expectation := &RepositoryIMockHardDeleteEmbeddingsByKbUIDExpectation{ + mock: mmHardDeleteEmbeddingsByKbUID.mock, + params: &RepositoryIMockHardDeleteEmbeddingsByKbUIDParams{ctx, kbUID}, + } + mmHardDeleteEmbeddingsByKbUID.expectations = append(mmHardDeleteEmbeddingsByKbUID.expectations, expectation) + return expectation +} + +// Then sets up RepositoryI.HardDeleteEmbeddingsByKbUID return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockHardDeleteEmbeddingsByKbUIDExpectation) Then(err error) *RepositoryIMock { + e.results = &RepositoryIMockHardDeleteEmbeddingsByKbUIDResults{err} + return e.mock +} + +// Times sets number of times RepositoryI.HardDeleteEmbeddingsByKbUID should be invoked +func (mmHardDeleteEmbeddingsByKbUID *mRepositoryIMockHardDeleteEmbeddingsByKbUID) Times(n uint64) *mRepositoryIMockHardDeleteEmbeddingsByKbUID { + if n == 0 { + mmHardDeleteEmbeddingsByKbUID.mock.t.Fatalf("Times of RepositoryIMock.HardDeleteEmbeddingsByKbUID mock can not be zero") + } + mm_atomic.StoreUint64(&mmHardDeleteEmbeddingsByKbUID.expectedInvocations, n) + return mmHardDeleteEmbeddingsByKbUID +} + +func (mmHardDeleteEmbeddingsByKbUID *mRepositoryIMockHardDeleteEmbeddingsByKbUID) invocationsDone() bool { + if len(mmHardDeleteEmbeddingsByKbUID.expectations) == 0 && mmHardDeleteEmbeddingsByKbUID.defaultExpectation == nil && mmHardDeleteEmbeddingsByKbUID.mock.funcHardDeleteEmbeddingsByKbUID == nil { + return true + } + + totalInvocations := mm_atomic.LoadUint64(&mmHardDeleteEmbeddingsByKbUID.mock.afterHardDeleteEmbeddingsByKbUIDCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmHardDeleteEmbeddingsByKbUID.expectedInvocations) + + return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) +} + +// HardDeleteEmbeddingsByKbUID implements repository.RepositoryI +func (mmHardDeleteEmbeddingsByKbUID *RepositoryIMock) HardDeleteEmbeddingsByKbUID(ctx context.Context, kbUID uuid.UUID) (err error) { + mm_atomic.AddUint64(&mmHardDeleteEmbeddingsByKbUID.beforeHardDeleteEmbeddingsByKbUIDCounter, 1) + defer mm_atomic.AddUint64(&mmHardDeleteEmbeddingsByKbUID.afterHardDeleteEmbeddingsByKbUIDCounter, 1) + + if mmHardDeleteEmbeddingsByKbUID.inspectFuncHardDeleteEmbeddingsByKbUID != nil { + mmHardDeleteEmbeddingsByKbUID.inspectFuncHardDeleteEmbeddingsByKbUID(ctx, kbUID) + } + + mm_params := RepositoryIMockHardDeleteEmbeddingsByKbUIDParams{ctx, kbUID} + + // Record call args + mmHardDeleteEmbeddingsByKbUID.HardDeleteEmbeddingsByKbUIDMock.mutex.Lock() + mmHardDeleteEmbeddingsByKbUID.HardDeleteEmbeddingsByKbUIDMock.callArgs = append(mmHardDeleteEmbeddingsByKbUID.HardDeleteEmbeddingsByKbUIDMock.callArgs, &mm_params) + mmHardDeleteEmbeddingsByKbUID.HardDeleteEmbeddingsByKbUIDMock.mutex.Unlock() + + for _, e := range mmHardDeleteEmbeddingsByKbUID.HardDeleteEmbeddingsByKbUIDMock.expectations { + if minimock.Equal(*e.params, mm_params) { + mm_atomic.AddUint64(&e.Counter, 1) + return e.results.err + } + } + + if mmHardDeleteEmbeddingsByKbUID.HardDeleteEmbeddingsByKbUIDMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmHardDeleteEmbeddingsByKbUID.HardDeleteEmbeddingsByKbUIDMock.defaultExpectation.Counter, 1) + mm_want := mmHardDeleteEmbeddingsByKbUID.HardDeleteEmbeddingsByKbUIDMock.defaultExpectation.params + mm_want_ptrs := mmHardDeleteEmbeddingsByKbUID.HardDeleteEmbeddingsByKbUIDMock.defaultExpectation.paramPtrs + + mm_got := RepositoryIMockHardDeleteEmbeddingsByKbUIDParams{ctx, kbUID} + + if mm_want_ptrs != nil { + + if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { + mmHardDeleteEmbeddingsByKbUID.t.Errorf("RepositoryIMock.HardDeleteEmbeddingsByKbUID got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) + } + + if mm_want_ptrs.kbUID != nil && !minimock.Equal(*mm_want_ptrs.kbUID, mm_got.kbUID) { + mmHardDeleteEmbeddingsByKbUID.t.Errorf("RepositoryIMock.HardDeleteEmbeddingsByKbUID got unexpected parameter kbUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.kbUID, mm_got.kbUID, minimock.Diff(*mm_want_ptrs.kbUID, mm_got.kbUID)) + } + + } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { + mmHardDeleteEmbeddingsByKbUID.t.Errorf("RepositoryIMock.HardDeleteEmbeddingsByKbUID got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + } + + mm_results := mmHardDeleteEmbeddingsByKbUID.HardDeleteEmbeddingsByKbUIDMock.defaultExpectation.results + if mm_results == nil { + mmHardDeleteEmbeddingsByKbUID.t.Fatal("No results are set for the RepositoryIMock.HardDeleteEmbeddingsByKbUID") + } + return (*mm_results).err + } + if mmHardDeleteEmbeddingsByKbUID.funcHardDeleteEmbeddingsByKbUID != nil { + return mmHardDeleteEmbeddingsByKbUID.funcHardDeleteEmbeddingsByKbUID(ctx, kbUID) + } + mmHardDeleteEmbeddingsByKbUID.t.Fatalf("Unexpected call to RepositoryIMock.HardDeleteEmbeddingsByKbUID. %v %v", ctx, kbUID) + return +} + +// HardDeleteEmbeddingsByKbUIDAfterCounter returns a count of finished RepositoryIMock.HardDeleteEmbeddingsByKbUID invocations +func (mmHardDeleteEmbeddingsByKbUID *RepositoryIMock) HardDeleteEmbeddingsByKbUIDAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmHardDeleteEmbeddingsByKbUID.afterHardDeleteEmbeddingsByKbUIDCounter) +} + +// HardDeleteEmbeddingsByKbUIDBeforeCounter returns a count of RepositoryIMock.HardDeleteEmbeddingsByKbUID invocations +func (mmHardDeleteEmbeddingsByKbUID *RepositoryIMock) HardDeleteEmbeddingsByKbUIDBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmHardDeleteEmbeddingsByKbUID.beforeHardDeleteEmbeddingsByKbUIDCounter) +} + +// Calls returns a list of arguments used in each call to RepositoryIMock.HardDeleteEmbeddingsByKbUID. +// The list is in the same order as the calls were made (i.e. recent calls have a higher index) +func (mmHardDeleteEmbeddingsByKbUID *mRepositoryIMockHardDeleteEmbeddingsByKbUID) Calls() []*RepositoryIMockHardDeleteEmbeddingsByKbUIDParams { + mmHardDeleteEmbeddingsByKbUID.mutex.RLock() + + argCopy := make([]*RepositoryIMockHardDeleteEmbeddingsByKbUIDParams, len(mmHardDeleteEmbeddingsByKbUID.callArgs)) + copy(argCopy, mmHardDeleteEmbeddingsByKbUID.callArgs) + + mmHardDeleteEmbeddingsByKbUID.mutex.RUnlock() + + return argCopy +} + +// MinimockHardDeleteEmbeddingsByKbUIDDone returns true if the count of the HardDeleteEmbeddingsByKbUID invocations corresponds +// the number of defined expectations +func (m *RepositoryIMock) MinimockHardDeleteEmbeddingsByKbUIDDone() bool { + for _, e := range m.HardDeleteEmbeddingsByKbUIDMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + return false + } + } + + return m.HardDeleteEmbeddingsByKbUIDMock.invocationsDone() +} + +// MinimockHardDeleteEmbeddingsByKbUIDInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockHardDeleteEmbeddingsByKbUIDInspect() { + for _, e := range m.HardDeleteEmbeddingsByKbUIDMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + m.t.Errorf("Expected call to RepositoryIMock.HardDeleteEmbeddingsByKbUID with params: %#v", *e.params) + } + } + + afterHardDeleteEmbeddingsByKbUIDCounter := mm_atomic.LoadUint64(&m.afterHardDeleteEmbeddingsByKbUIDCounter) + // if default expectation was set then invocations count should be greater than zero + if m.HardDeleteEmbeddingsByKbUIDMock.defaultExpectation != nil && afterHardDeleteEmbeddingsByKbUIDCounter < 1 { + if m.HardDeleteEmbeddingsByKbUIDMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.HardDeleteEmbeddingsByKbUID") + } else { + m.t.Errorf("Expected call to RepositoryIMock.HardDeleteEmbeddingsByKbUID with params: %#v", *m.HardDeleteEmbeddingsByKbUIDMock.defaultExpectation.params) + } + } + // if func was set then invocations count should be greater than zero + if m.funcHardDeleteEmbeddingsByKbUID != nil && afterHardDeleteEmbeddingsByKbUIDCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.HardDeleteEmbeddingsByKbUID") + } + + if !m.HardDeleteEmbeddingsByKbUIDMock.invocationsDone() && afterHardDeleteEmbeddingsByKbUIDCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.HardDeleteEmbeddingsByKbUID but found %d calls", + mm_atomic.LoadUint64(&m.HardDeleteEmbeddingsByKbUIDMock.expectedInvocations), afterHardDeleteEmbeddingsByKbUIDCounter) + } +} + +type mRepositoryIMockIncreaseKnowledgeBaseUsage struct { + mock *RepositoryIMock + defaultExpectation *RepositoryIMockIncreaseKnowledgeBaseUsageExpectation + expectations []*RepositoryIMockIncreaseKnowledgeBaseUsageExpectation + + callArgs []*RepositoryIMockIncreaseKnowledgeBaseUsageParams + mutex sync.RWMutex + + expectedInvocations uint64 +} + +// RepositoryIMockIncreaseKnowledgeBaseUsageExpectation specifies expectation struct of the RepositoryI.IncreaseKnowledgeBaseUsage +type RepositoryIMockIncreaseKnowledgeBaseUsageExpectation struct { + mock *RepositoryIMock + params *RepositoryIMockIncreaseKnowledgeBaseUsageParams + paramPtrs *RepositoryIMockIncreaseKnowledgeBaseUsageParamPtrs + results *RepositoryIMockIncreaseKnowledgeBaseUsageResults + Counter uint64 +} + +// RepositoryIMockIncreaseKnowledgeBaseUsageParams contains parameters of the RepositoryI.IncreaseKnowledgeBaseUsage +type RepositoryIMockIncreaseKnowledgeBaseUsageParams struct { + ctx context.Context + kbUID string + amount int +} + +// RepositoryIMockIncreaseKnowledgeBaseUsageParamPtrs contains pointers to parameters of the RepositoryI.IncreaseKnowledgeBaseUsage +type RepositoryIMockIncreaseKnowledgeBaseUsageParamPtrs struct { + ctx *context.Context + kbUID *string + amount *int +} + +// RepositoryIMockIncreaseKnowledgeBaseUsageResults contains results of the RepositoryI.IncreaseKnowledgeBaseUsage +type RepositoryIMockIncreaseKnowledgeBaseUsageResults struct { + err error +} + +// Expect sets up expected params for RepositoryI.IncreaseKnowledgeBaseUsage +func (mmIncreaseKnowledgeBaseUsage *mRepositoryIMockIncreaseKnowledgeBaseUsage) Expect(ctx context.Context, kbUID string, amount int) *mRepositoryIMockIncreaseKnowledgeBaseUsage { + if mmIncreaseKnowledgeBaseUsage.mock.funcIncreaseKnowledgeBaseUsage != nil { + mmIncreaseKnowledgeBaseUsage.mock.t.Fatalf("RepositoryIMock.IncreaseKnowledgeBaseUsage mock is already set by Set") + } + + if mmIncreaseKnowledgeBaseUsage.defaultExpectation == nil { + mmIncreaseKnowledgeBaseUsage.defaultExpectation = &RepositoryIMockIncreaseKnowledgeBaseUsageExpectation{} + } + + if mmIncreaseKnowledgeBaseUsage.defaultExpectation.paramPtrs != nil { + mmIncreaseKnowledgeBaseUsage.mock.t.Fatalf("RepositoryIMock.IncreaseKnowledgeBaseUsage mock is already set by ExpectParams functions") + } + + mmIncreaseKnowledgeBaseUsage.defaultExpectation.params = &RepositoryIMockIncreaseKnowledgeBaseUsageParams{ctx, kbUID, amount} + for _, e := range mmIncreaseKnowledgeBaseUsage.expectations { + if minimock.Equal(e.params, mmIncreaseKnowledgeBaseUsage.defaultExpectation.params) { + mmIncreaseKnowledgeBaseUsage.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmIncreaseKnowledgeBaseUsage.defaultExpectation.params) + } + } + + return mmIncreaseKnowledgeBaseUsage +} + +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.IncreaseKnowledgeBaseUsage +func (mmIncreaseKnowledgeBaseUsage *mRepositoryIMockIncreaseKnowledgeBaseUsage) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockIncreaseKnowledgeBaseUsage { + if mmIncreaseKnowledgeBaseUsage.mock.funcIncreaseKnowledgeBaseUsage != nil { + mmIncreaseKnowledgeBaseUsage.mock.t.Fatalf("RepositoryIMock.IncreaseKnowledgeBaseUsage mock is already set by Set") + } + + if mmIncreaseKnowledgeBaseUsage.defaultExpectation == nil { + mmIncreaseKnowledgeBaseUsage.defaultExpectation = &RepositoryIMockIncreaseKnowledgeBaseUsageExpectation{} + } + + if mmIncreaseKnowledgeBaseUsage.defaultExpectation.params != nil { + mmIncreaseKnowledgeBaseUsage.mock.t.Fatalf("RepositoryIMock.IncreaseKnowledgeBaseUsage mock is already set by Expect") + } + + if mmIncreaseKnowledgeBaseUsage.defaultExpectation.paramPtrs == nil { + mmIncreaseKnowledgeBaseUsage.defaultExpectation.paramPtrs = &RepositoryIMockIncreaseKnowledgeBaseUsageParamPtrs{} + } + mmIncreaseKnowledgeBaseUsage.defaultExpectation.paramPtrs.ctx = &ctx + + return mmIncreaseKnowledgeBaseUsage +} + +// ExpectKbUIDParam2 sets up expected param kbUID for RepositoryI.IncreaseKnowledgeBaseUsage +func (mmIncreaseKnowledgeBaseUsage *mRepositoryIMockIncreaseKnowledgeBaseUsage) ExpectKbUIDParam2(kbUID string) *mRepositoryIMockIncreaseKnowledgeBaseUsage { + if mmIncreaseKnowledgeBaseUsage.mock.funcIncreaseKnowledgeBaseUsage != nil { + mmIncreaseKnowledgeBaseUsage.mock.t.Fatalf("RepositoryIMock.IncreaseKnowledgeBaseUsage mock is already set by Set") + } + + if mmIncreaseKnowledgeBaseUsage.defaultExpectation == nil { + mmIncreaseKnowledgeBaseUsage.defaultExpectation = &RepositoryIMockIncreaseKnowledgeBaseUsageExpectation{} + } + + if mmIncreaseKnowledgeBaseUsage.defaultExpectation.params != nil { + mmIncreaseKnowledgeBaseUsage.mock.t.Fatalf("RepositoryIMock.IncreaseKnowledgeBaseUsage mock is already set by Expect") + } + + if mmIncreaseKnowledgeBaseUsage.defaultExpectation.paramPtrs == nil { + mmIncreaseKnowledgeBaseUsage.defaultExpectation.paramPtrs = &RepositoryIMockIncreaseKnowledgeBaseUsageParamPtrs{} + } + mmIncreaseKnowledgeBaseUsage.defaultExpectation.paramPtrs.kbUID = &kbUID + + return mmIncreaseKnowledgeBaseUsage +} + +// ExpectAmountParam3 sets up expected param amount for RepositoryI.IncreaseKnowledgeBaseUsage +func (mmIncreaseKnowledgeBaseUsage *mRepositoryIMockIncreaseKnowledgeBaseUsage) ExpectAmountParam3(amount int) *mRepositoryIMockIncreaseKnowledgeBaseUsage { + if mmIncreaseKnowledgeBaseUsage.mock.funcIncreaseKnowledgeBaseUsage != nil { + mmIncreaseKnowledgeBaseUsage.mock.t.Fatalf("RepositoryIMock.IncreaseKnowledgeBaseUsage mock is already set by Set") + } + + if mmIncreaseKnowledgeBaseUsage.defaultExpectation == nil { + mmIncreaseKnowledgeBaseUsage.defaultExpectation = &RepositoryIMockIncreaseKnowledgeBaseUsageExpectation{} + } + + if mmIncreaseKnowledgeBaseUsage.defaultExpectation.params != nil { + mmIncreaseKnowledgeBaseUsage.mock.t.Fatalf("RepositoryIMock.IncreaseKnowledgeBaseUsage mock is already set by Expect") + } + + if mmIncreaseKnowledgeBaseUsage.defaultExpectation.paramPtrs == nil { + mmIncreaseKnowledgeBaseUsage.defaultExpectation.paramPtrs = &RepositoryIMockIncreaseKnowledgeBaseUsageParamPtrs{} + } + mmIncreaseKnowledgeBaseUsage.defaultExpectation.paramPtrs.amount = &amount + + return mmIncreaseKnowledgeBaseUsage +} + +// Inspect accepts an inspector function that has same arguments as the RepositoryI.IncreaseKnowledgeBaseUsage +func (mmIncreaseKnowledgeBaseUsage *mRepositoryIMockIncreaseKnowledgeBaseUsage) Inspect(f func(ctx context.Context, kbUID string, amount int)) *mRepositoryIMockIncreaseKnowledgeBaseUsage { + if mmIncreaseKnowledgeBaseUsage.mock.inspectFuncIncreaseKnowledgeBaseUsage != nil { + mmIncreaseKnowledgeBaseUsage.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.IncreaseKnowledgeBaseUsage") + } + + mmIncreaseKnowledgeBaseUsage.mock.inspectFuncIncreaseKnowledgeBaseUsage = f + + return mmIncreaseKnowledgeBaseUsage +} + +// Return sets up results that will be returned by RepositoryI.IncreaseKnowledgeBaseUsage +func (mmIncreaseKnowledgeBaseUsage *mRepositoryIMockIncreaseKnowledgeBaseUsage) Return(err error) *RepositoryIMock { + if mmIncreaseKnowledgeBaseUsage.mock.funcIncreaseKnowledgeBaseUsage != nil { + mmIncreaseKnowledgeBaseUsage.mock.t.Fatalf("RepositoryIMock.IncreaseKnowledgeBaseUsage mock is already set by Set") + } + + if mmIncreaseKnowledgeBaseUsage.defaultExpectation == nil { + mmIncreaseKnowledgeBaseUsage.defaultExpectation = &RepositoryIMockIncreaseKnowledgeBaseUsageExpectation{mock: mmIncreaseKnowledgeBaseUsage.mock} + } + mmIncreaseKnowledgeBaseUsage.defaultExpectation.results = &RepositoryIMockIncreaseKnowledgeBaseUsageResults{err} + return mmIncreaseKnowledgeBaseUsage.mock +} + +// Set uses given function f to mock the RepositoryI.IncreaseKnowledgeBaseUsage method +func (mmIncreaseKnowledgeBaseUsage *mRepositoryIMockIncreaseKnowledgeBaseUsage) Set(f func(ctx context.Context, kbUID string, amount int) (err error)) *RepositoryIMock { + if mmIncreaseKnowledgeBaseUsage.defaultExpectation != nil { + mmIncreaseKnowledgeBaseUsage.mock.t.Fatalf("Default expectation is already set for the RepositoryI.IncreaseKnowledgeBaseUsage method") + } + + if len(mmIncreaseKnowledgeBaseUsage.expectations) > 0 { + mmIncreaseKnowledgeBaseUsage.mock.t.Fatalf("Some expectations are already set for the RepositoryI.IncreaseKnowledgeBaseUsage method") + } + + mmIncreaseKnowledgeBaseUsage.mock.funcIncreaseKnowledgeBaseUsage = f + return mmIncreaseKnowledgeBaseUsage.mock +} + +// When sets expectation for the RepositoryI.IncreaseKnowledgeBaseUsage which will trigger the result defined by the following +// Then helper +func (mmIncreaseKnowledgeBaseUsage *mRepositoryIMockIncreaseKnowledgeBaseUsage) When(ctx context.Context, kbUID string, amount int) *RepositoryIMockIncreaseKnowledgeBaseUsageExpectation { + if mmIncreaseKnowledgeBaseUsage.mock.funcIncreaseKnowledgeBaseUsage != nil { + mmIncreaseKnowledgeBaseUsage.mock.t.Fatalf("RepositoryIMock.IncreaseKnowledgeBaseUsage mock is already set by Set") + } + + expectation := &RepositoryIMockIncreaseKnowledgeBaseUsageExpectation{ + mock: mmIncreaseKnowledgeBaseUsage.mock, + params: &RepositoryIMockIncreaseKnowledgeBaseUsageParams{ctx, kbUID, amount}, + } + mmIncreaseKnowledgeBaseUsage.expectations = append(mmIncreaseKnowledgeBaseUsage.expectations, expectation) + return expectation +} + +// Then sets up RepositoryI.IncreaseKnowledgeBaseUsage return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockIncreaseKnowledgeBaseUsageExpectation) Then(err error) *RepositoryIMock { + e.results = &RepositoryIMockIncreaseKnowledgeBaseUsageResults{err} + return e.mock +} + +// Times sets number of times RepositoryI.IncreaseKnowledgeBaseUsage should be invoked +func (mmIncreaseKnowledgeBaseUsage *mRepositoryIMockIncreaseKnowledgeBaseUsage) Times(n uint64) *mRepositoryIMockIncreaseKnowledgeBaseUsage { + if n == 0 { + mmIncreaseKnowledgeBaseUsage.mock.t.Fatalf("Times of RepositoryIMock.IncreaseKnowledgeBaseUsage mock can not be zero") + } + mm_atomic.StoreUint64(&mmIncreaseKnowledgeBaseUsage.expectedInvocations, n) + return mmIncreaseKnowledgeBaseUsage +} + +func (mmIncreaseKnowledgeBaseUsage *mRepositoryIMockIncreaseKnowledgeBaseUsage) invocationsDone() bool { + if len(mmIncreaseKnowledgeBaseUsage.expectations) == 0 && mmIncreaseKnowledgeBaseUsage.defaultExpectation == nil && mmIncreaseKnowledgeBaseUsage.mock.funcIncreaseKnowledgeBaseUsage == nil { + return true + } + + totalInvocations := mm_atomic.LoadUint64(&mmIncreaseKnowledgeBaseUsage.mock.afterIncreaseKnowledgeBaseUsageCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmIncreaseKnowledgeBaseUsage.expectedInvocations) + + return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) +} + +// IncreaseKnowledgeBaseUsage implements repository.RepositoryI +func (mmIncreaseKnowledgeBaseUsage *RepositoryIMock) IncreaseKnowledgeBaseUsage(ctx context.Context, kbUID string, amount int) (err error) { + mm_atomic.AddUint64(&mmIncreaseKnowledgeBaseUsage.beforeIncreaseKnowledgeBaseUsageCounter, 1) + defer mm_atomic.AddUint64(&mmIncreaseKnowledgeBaseUsage.afterIncreaseKnowledgeBaseUsageCounter, 1) + + if mmIncreaseKnowledgeBaseUsage.inspectFuncIncreaseKnowledgeBaseUsage != nil { + mmIncreaseKnowledgeBaseUsage.inspectFuncIncreaseKnowledgeBaseUsage(ctx, kbUID, amount) + } + + mm_params := RepositoryIMockIncreaseKnowledgeBaseUsageParams{ctx, kbUID, amount} + + // Record call args + mmIncreaseKnowledgeBaseUsage.IncreaseKnowledgeBaseUsageMock.mutex.Lock() + mmIncreaseKnowledgeBaseUsage.IncreaseKnowledgeBaseUsageMock.callArgs = append(mmIncreaseKnowledgeBaseUsage.IncreaseKnowledgeBaseUsageMock.callArgs, &mm_params) + mmIncreaseKnowledgeBaseUsage.IncreaseKnowledgeBaseUsageMock.mutex.Unlock() + + for _, e := range mmIncreaseKnowledgeBaseUsage.IncreaseKnowledgeBaseUsageMock.expectations { + if minimock.Equal(*e.params, mm_params) { + mm_atomic.AddUint64(&e.Counter, 1) + return e.results.err + } + } + + if mmIncreaseKnowledgeBaseUsage.IncreaseKnowledgeBaseUsageMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmIncreaseKnowledgeBaseUsage.IncreaseKnowledgeBaseUsageMock.defaultExpectation.Counter, 1) + mm_want := mmIncreaseKnowledgeBaseUsage.IncreaseKnowledgeBaseUsageMock.defaultExpectation.params + mm_want_ptrs := mmIncreaseKnowledgeBaseUsage.IncreaseKnowledgeBaseUsageMock.defaultExpectation.paramPtrs + + mm_got := RepositoryIMockIncreaseKnowledgeBaseUsageParams{ctx, kbUID, amount} + + if mm_want_ptrs != nil { + + if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { + mmIncreaseKnowledgeBaseUsage.t.Errorf("RepositoryIMock.IncreaseKnowledgeBaseUsage got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) + } + + if mm_want_ptrs.kbUID != nil && !minimock.Equal(*mm_want_ptrs.kbUID, mm_got.kbUID) { + mmIncreaseKnowledgeBaseUsage.t.Errorf("RepositoryIMock.IncreaseKnowledgeBaseUsage got unexpected parameter kbUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.kbUID, mm_got.kbUID, minimock.Diff(*mm_want_ptrs.kbUID, mm_got.kbUID)) + } + + if mm_want_ptrs.amount != nil && !minimock.Equal(*mm_want_ptrs.amount, mm_got.amount) { + mmIncreaseKnowledgeBaseUsage.t.Errorf("RepositoryIMock.IncreaseKnowledgeBaseUsage got unexpected parameter amount, want: %#v, got: %#v%s\n", *mm_want_ptrs.amount, mm_got.amount, minimock.Diff(*mm_want_ptrs.amount, mm_got.amount)) + } + + } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { + mmIncreaseKnowledgeBaseUsage.t.Errorf("RepositoryIMock.IncreaseKnowledgeBaseUsage got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + } + + mm_results := mmIncreaseKnowledgeBaseUsage.IncreaseKnowledgeBaseUsageMock.defaultExpectation.results + if mm_results == nil { + mmIncreaseKnowledgeBaseUsage.t.Fatal("No results are set for the RepositoryIMock.IncreaseKnowledgeBaseUsage") + } + return (*mm_results).err + } + if mmIncreaseKnowledgeBaseUsage.funcIncreaseKnowledgeBaseUsage != nil { + return mmIncreaseKnowledgeBaseUsage.funcIncreaseKnowledgeBaseUsage(ctx, kbUID, amount) + } + mmIncreaseKnowledgeBaseUsage.t.Fatalf("Unexpected call to RepositoryIMock.IncreaseKnowledgeBaseUsage. %v %v %v", ctx, kbUID, amount) + return +} + +// IncreaseKnowledgeBaseUsageAfterCounter returns a count of finished RepositoryIMock.IncreaseKnowledgeBaseUsage invocations +func (mmIncreaseKnowledgeBaseUsage *RepositoryIMock) IncreaseKnowledgeBaseUsageAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmIncreaseKnowledgeBaseUsage.afterIncreaseKnowledgeBaseUsageCounter) +} + +// IncreaseKnowledgeBaseUsageBeforeCounter returns a count of RepositoryIMock.IncreaseKnowledgeBaseUsage invocations +func (mmIncreaseKnowledgeBaseUsage *RepositoryIMock) IncreaseKnowledgeBaseUsageBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmIncreaseKnowledgeBaseUsage.beforeIncreaseKnowledgeBaseUsageCounter) +} + +// Calls returns a list of arguments used in each call to RepositoryIMock.IncreaseKnowledgeBaseUsage. +// The list is in the same order as the calls were made (i.e. recent calls have a higher index) +func (mmIncreaseKnowledgeBaseUsage *mRepositoryIMockIncreaseKnowledgeBaseUsage) Calls() []*RepositoryIMockIncreaseKnowledgeBaseUsageParams { + mmIncreaseKnowledgeBaseUsage.mutex.RLock() + + argCopy := make([]*RepositoryIMockIncreaseKnowledgeBaseUsageParams, len(mmIncreaseKnowledgeBaseUsage.callArgs)) + copy(argCopy, mmIncreaseKnowledgeBaseUsage.callArgs) + + mmIncreaseKnowledgeBaseUsage.mutex.RUnlock() + + return argCopy +} + +// MinimockIncreaseKnowledgeBaseUsageDone returns true if the count of the IncreaseKnowledgeBaseUsage invocations corresponds +// the number of defined expectations +func (m *RepositoryIMock) MinimockIncreaseKnowledgeBaseUsageDone() bool { + for _, e := range m.IncreaseKnowledgeBaseUsageMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + return false + } + } + + return m.IncreaseKnowledgeBaseUsageMock.invocationsDone() +} + +// MinimockIncreaseKnowledgeBaseUsageInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockIncreaseKnowledgeBaseUsageInspect() { + for _, e := range m.IncreaseKnowledgeBaseUsageMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + m.t.Errorf("Expected call to RepositoryIMock.IncreaseKnowledgeBaseUsage with params: %#v", *e.params) + } + } + + afterIncreaseKnowledgeBaseUsageCounter := mm_atomic.LoadUint64(&m.afterIncreaseKnowledgeBaseUsageCounter) + // if default expectation was set then invocations count should be greater than zero + if m.IncreaseKnowledgeBaseUsageMock.defaultExpectation != nil && afterIncreaseKnowledgeBaseUsageCounter < 1 { + if m.IncreaseKnowledgeBaseUsageMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.IncreaseKnowledgeBaseUsage") + } else { + m.t.Errorf("Expected call to RepositoryIMock.IncreaseKnowledgeBaseUsage with params: %#v", *m.IncreaseKnowledgeBaseUsageMock.defaultExpectation.params) + } + } + // if func was set then invocations count should be greater than zero + if m.funcIncreaseKnowledgeBaseUsage != nil && afterIncreaseKnowledgeBaseUsageCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.IncreaseKnowledgeBaseUsage") + } + + if !m.IncreaseKnowledgeBaseUsageMock.invocationsDone() && afterIncreaseKnowledgeBaseUsageCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.IncreaseKnowledgeBaseUsage but found %d calls", + mm_atomic.LoadUint64(&m.IncreaseKnowledgeBaseUsageMock.expectedInvocations), afterIncreaseKnowledgeBaseUsageCounter) + } +} + +type mRepositoryIMockKnowledgeBaseFileTableName struct { + mock *RepositoryIMock + defaultExpectation *RepositoryIMockKnowledgeBaseFileTableNameExpectation + expectations []*RepositoryIMockKnowledgeBaseFileTableNameExpectation + + expectedInvocations uint64 +} + +// RepositoryIMockKnowledgeBaseFileTableNameExpectation specifies expectation struct of the RepositoryI.KnowledgeBaseFileTableName +type RepositoryIMockKnowledgeBaseFileTableNameExpectation struct { + mock *RepositoryIMock + + results *RepositoryIMockKnowledgeBaseFileTableNameResults + Counter uint64 +} + +// RepositoryIMockKnowledgeBaseFileTableNameResults contains results of the RepositoryI.KnowledgeBaseFileTableName +type RepositoryIMockKnowledgeBaseFileTableNameResults struct { + s1 string +} + +// Expect sets up expected params for RepositoryI.KnowledgeBaseFileTableName +func (mmKnowledgeBaseFileTableName *mRepositoryIMockKnowledgeBaseFileTableName) Expect() *mRepositoryIMockKnowledgeBaseFileTableName { + if mmKnowledgeBaseFileTableName.mock.funcKnowledgeBaseFileTableName != nil { + mmKnowledgeBaseFileTableName.mock.t.Fatalf("RepositoryIMock.KnowledgeBaseFileTableName mock is already set by Set") + } + + if mmKnowledgeBaseFileTableName.defaultExpectation == nil { + mmKnowledgeBaseFileTableName.defaultExpectation = &RepositoryIMockKnowledgeBaseFileTableNameExpectation{} + } + + return mmKnowledgeBaseFileTableName +} + +// Inspect accepts an inspector function that has same arguments as the RepositoryI.KnowledgeBaseFileTableName +func (mmKnowledgeBaseFileTableName *mRepositoryIMockKnowledgeBaseFileTableName) Inspect(f func()) *mRepositoryIMockKnowledgeBaseFileTableName { + if mmKnowledgeBaseFileTableName.mock.inspectFuncKnowledgeBaseFileTableName != nil { + mmKnowledgeBaseFileTableName.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.KnowledgeBaseFileTableName") + } + + mmKnowledgeBaseFileTableName.mock.inspectFuncKnowledgeBaseFileTableName = f + + return mmKnowledgeBaseFileTableName +} + +// Return sets up results that will be returned by RepositoryI.KnowledgeBaseFileTableName +func (mmKnowledgeBaseFileTableName *mRepositoryIMockKnowledgeBaseFileTableName) Return(s1 string) *RepositoryIMock { + if mmKnowledgeBaseFileTableName.mock.funcKnowledgeBaseFileTableName != nil { + mmKnowledgeBaseFileTableName.mock.t.Fatalf("RepositoryIMock.KnowledgeBaseFileTableName mock is already set by Set") + } + + if mmKnowledgeBaseFileTableName.defaultExpectation == nil { + mmKnowledgeBaseFileTableName.defaultExpectation = &RepositoryIMockKnowledgeBaseFileTableNameExpectation{mock: mmKnowledgeBaseFileTableName.mock} + } + mmKnowledgeBaseFileTableName.defaultExpectation.results = &RepositoryIMockKnowledgeBaseFileTableNameResults{s1} + return mmKnowledgeBaseFileTableName.mock +} + +// Set uses given function f to mock the RepositoryI.KnowledgeBaseFileTableName method +func (mmKnowledgeBaseFileTableName *mRepositoryIMockKnowledgeBaseFileTableName) Set(f func() (s1 string)) *RepositoryIMock { + if mmKnowledgeBaseFileTableName.defaultExpectation != nil { + mmKnowledgeBaseFileTableName.mock.t.Fatalf("Default expectation is already set for the RepositoryI.KnowledgeBaseFileTableName method") } - mmGetTruthSourceByFileUID.expectations = append(mmGetTruthSourceByFileUID.expectations, expectation) - return expectation -} -// Then sets up RepositoryI.GetTruthSourceByFileUID return parameters for the expectation previously defined by the When method -func (e *RepositoryIMockGetTruthSourceByFileUIDExpectation) Then(sp1 *mm_repository.SourceMeta, err error) *RepositoryIMock { - e.results = &RepositoryIMockGetTruthSourceByFileUIDResults{sp1, err} - return e.mock + if len(mmKnowledgeBaseFileTableName.expectations) > 0 { + mmKnowledgeBaseFileTableName.mock.t.Fatalf("Some expectations are already set for the RepositoryI.KnowledgeBaseFileTableName method") + } + + mmKnowledgeBaseFileTableName.mock.funcKnowledgeBaseFileTableName = f + return mmKnowledgeBaseFileTableName.mock } -// Times sets number of times RepositoryI.GetTruthSourceByFileUID should be invoked -func (mmGetTruthSourceByFileUID *mRepositoryIMockGetTruthSourceByFileUID) Times(n uint64) *mRepositoryIMockGetTruthSourceByFileUID { +// Times sets number of times RepositoryI.KnowledgeBaseFileTableName should be invoked +func (mmKnowledgeBaseFileTableName *mRepositoryIMockKnowledgeBaseFileTableName) Times(n uint64) *mRepositoryIMockKnowledgeBaseFileTableName { if n == 0 { - mmGetTruthSourceByFileUID.mock.t.Fatalf("Times of RepositoryIMock.GetTruthSourceByFileUID mock can not be zero") + mmKnowledgeBaseFileTableName.mock.t.Fatalf("Times of RepositoryIMock.KnowledgeBaseFileTableName mock can not be zero") } - mm_atomic.StoreUint64(&mmGetTruthSourceByFileUID.expectedInvocations, n) - return mmGetTruthSourceByFileUID + mm_atomic.StoreUint64(&mmKnowledgeBaseFileTableName.expectedInvocations, n) + return mmKnowledgeBaseFileTableName } -func (mmGetTruthSourceByFileUID *mRepositoryIMockGetTruthSourceByFileUID) invocationsDone() bool { - if len(mmGetTruthSourceByFileUID.expectations) == 0 && mmGetTruthSourceByFileUID.defaultExpectation == nil && mmGetTruthSourceByFileUID.mock.funcGetTruthSourceByFileUID == nil { +func (mmKnowledgeBaseFileTableName *mRepositoryIMockKnowledgeBaseFileTableName) invocationsDone() bool { + if len(mmKnowledgeBaseFileTableName.expectations) == 0 && mmKnowledgeBaseFileTableName.defaultExpectation == nil && mmKnowledgeBaseFileTableName.mock.funcKnowledgeBaseFileTableName == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmGetTruthSourceByFileUID.mock.afterGetTruthSourceByFileUIDCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmGetTruthSourceByFileUID.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmKnowledgeBaseFileTableName.mock.afterKnowledgeBaseFileTableNameCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmKnowledgeBaseFileTableName.expectedInvocations) return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) } -// GetTruthSourceByFileUID implements repository.RepositoryI -func (mmGetTruthSourceByFileUID *RepositoryIMock) GetTruthSourceByFileUID(ctx context.Context, fileUID uuid.UUID) (sp1 *mm_repository.SourceMeta, err error) { - mm_atomic.AddUint64(&mmGetTruthSourceByFileUID.beforeGetTruthSourceByFileUIDCounter, 1) - defer mm_atomic.AddUint64(&mmGetTruthSourceByFileUID.afterGetTruthSourceByFileUIDCounter, 1) - - if mmGetTruthSourceByFileUID.inspectFuncGetTruthSourceByFileUID != nil { - mmGetTruthSourceByFileUID.inspectFuncGetTruthSourceByFileUID(ctx, fileUID) - } - - mm_params := RepositoryIMockGetTruthSourceByFileUIDParams{ctx, fileUID} - - // Record call args - mmGetTruthSourceByFileUID.GetTruthSourceByFileUIDMock.mutex.Lock() - mmGetTruthSourceByFileUID.GetTruthSourceByFileUIDMock.callArgs = append(mmGetTruthSourceByFileUID.GetTruthSourceByFileUIDMock.callArgs, &mm_params) - mmGetTruthSourceByFileUID.GetTruthSourceByFileUIDMock.mutex.Unlock() +// KnowledgeBaseFileTableName implements repository.RepositoryI +func (mmKnowledgeBaseFileTableName *RepositoryIMock) KnowledgeBaseFileTableName() (s1 string) { + mm_atomic.AddUint64(&mmKnowledgeBaseFileTableName.beforeKnowledgeBaseFileTableNameCounter, 1) + defer mm_atomic.AddUint64(&mmKnowledgeBaseFileTableName.afterKnowledgeBaseFileTableNameCounter, 1) - for _, e := range mmGetTruthSourceByFileUID.GetTruthSourceByFileUIDMock.expectations { - if minimock.Equal(*e.params, mm_params) { - mm_atomic.AddUint64(&e.Counter, 1) - return e.results.sp1, e.results.err - } + if mmKnowledgeBaseFileTableName.inspectFuncKnowledgeBaseFileTableName != nil { + mmKnowledgeBaseFileTableName.inspectFuncKnowledgeBaseFileTableName() } - if mmGetTruthSourceByFileUID.GetTruthSourceByFileUIDMock.defaultExpectation != nil { - mm_atomic.AddUint64(&mmGetTruthSourceByFileUID.GetTruthSourceByFileUIDMock.defaultExpectation.Counter, 1) - mm_want := mmGetTruthSourceByFileUID.GetTruthSourceByFileUIDMock.defaultExpectation.params - mm_want_ptrs := mmGetTruthSourceByFileUID.GetTruthSourceByFileUIDMock.defaultExpectation.paramPtrs - - mm_got := RepositoryIMockGetTruthSourceByFileUIDParams{ctx, fileUID} - - if mm_want_ptrs != nil { - - if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { - mmGetTruthSourceByFileUID.t.Errorf("RepositoryIMock.GetTruthSourceByFileUID got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) - } - - if mm_want_ptrs.fileUID != nil && !minimock.Equal(*mm_want_ptrs.fileUID, mm_got.fileUID) { - mmGetTruthSourceByFileUID.t.Errorf("RepositoryIMock.GetTruthSourceByFileUID got unexpected parameter fileUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.fileUID, mm_got.fileUID, minimock.Diff(*mm_want_ptrs.fileUID, mm_got.fileUID)) - } - - } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { - mmGetTruthSourceByFileUID.t.Errorf("RepositoryIMock.GetTruthSourceByFileUID got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) - } + if mmKnowledgeBaseFileTableName.KnowledgeBaseFileTableNameMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmKnowledgeBaseFileTableName.KnowledgeBaseFileTableNameMock.defaultExpectation.Counter, 1) - mm_results := mmGetTruthSourceByFileUID.GetTruthSourceByFileUIDMock.defaultExpectation.results + mm_results := mmKnowledgeBaseFileTableName.KnowledgeBaseFileTableNameMock.defaultExpectation.results if mm_results == nil { - mmGetTruthSourceByFileUID.t.Fatal("No results are set for the RepositoryIMock.GetTruthSourceByFileUID") + mmKnowledgeBaseFileTableName.t.Fatal("No results are set for the RepositoryIMock.KnowledgeBaseFileTableName") } - return (*mm_results).sp1, (*mm_results).err + return (*mm_results).s1 } - if mmGetTruthSourceByFileUID.funcGetTruthSourceByFileUID != nil { - return mmGetTruthSourceByFileUID.funcGetTruthSourceByFileUID(ctx, fileUID) + if mmKnowledgeBaseFileTableName.funcKnowledgeBaseFileTableName != nil { + return mmKnowledgeBaseFileTableName.funcKnowledgeBaseFileTableName() } - mmGetTruthSourceByFileUID.t.Fatalf("Unexpected call to RepositoryIMock.GetTruthSourceByFileUID. %v %v", ctx, fileUID) + mmKnowledgeBaseFileTableName.t.Fatalf("Unexpected call to RepositoryIMock.KnowledgeBaseFileTableName.") return } -// GetTruthSourceByFileUIDAfterCounter returns a count of finished RepositoryIMock.GetTruthSourceByFileUID invocations -func (mmGetTruthSourceByFileUID *RepositoryIMock) GetTruthSourceByFileUIDAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetTruthSourceByFileUID.afterGetTruthSourceByFileUIDCounter) -} - -// GetTruthSourceByFileUIDBeforeCounter returns a count of RepositoryIMock.GetTruthSourceByFileUID invocations -func (mmGetTruthSourceByFileUID *RepositoryIMock) GetTruthSourceByFileUIDBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetTruthSourceByFileUID.beforeGetTruthSourceByFileUIDCounter) +// KnowledgeBaseFileTableNameAfterCounter returns a count of finished RepositoryIMock.KnowledgeBaseFileTableName invocations +func (mmKnowledgeBaseFileTableName *RepositoryIMock) KnowledgeBaseFileTableNameAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmKnowledgeBaseFileTableName.afterKnowledgeBaseFileTableNameCounter) } -// Calls returns a list of arguments used in each call to RepositoryIMock.GetTruthSourceByFileUID. -// The list is in the same order as the calls were made (i.e. recent calls have a higher index) -func (mmGetTruthSourceByFileUID *mRepositoryIMockGetTruthSourceByFileUID) Calls() []*RepositoryIMockGetTruthSourceByFileUIDParams { - mmGetTruthSourceByFileUID.mutex.RLock() - - argCopy := make([]*RepositoryIMockGetTruthSourceByFileUIDParams, len(mmGetTruthSourceByFileUID.callArgs)) - copy(argCopy, mmGetTruthSourceByFileUID.callArgs) - - mmGetTruthSourceByFileUID.mutex.RUnlock() - - return argCopy +// KnowledgeBaseFileTableNameBeforeCounter returns a count of RepositoryIMock.KnowledgeBaseFileTableName invocations +func (mmKnowledgeBaseFileTableName *RepositoryIMock) KnowledgeBaseFileTableNameBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmKnowledgeBaseFileTableName.beforeKnowledgeBaseFileTableNameCounter) } -// MinimockGetTruthSourceByFileUIDDone returns true if the count of the GetTruthSourceByFileUID invocations corresponds +// MinimockKnowledgeBaseFileTableNameDone returns true if the count of the KnowledgeBaseFileTableName invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockGetTruthSourceByFileUIDDone() bool { - for _, e := range m.GetTruthSourceByFileUIDMock.expectations { +func (m *RepositoryIMock) MinimockKnowledgeBaseFileTableNameDone() bool { + for _, e := range m.KnowledgeBaseFileTableNameMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.GetTruthSourceByFileUIDMock.invocationsDone() + return m.KnowledgeBaseFileTableNameMock.invocationsDone() } -// MinimockGetTruthSourceByFileUIDInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockGetTruthSourceByFileUIDInspect() { - for _, e := range m.GetTruthSourceByFileUIDMock.expectations { +// MinimockKnowledgeBaseFileTableNameInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockKnowledgeBaseFileTableNameInspect() { + for _, e := range m.KnowledgeBaseFileTableNameMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { - m.t.Errorf("Expected call to RepositoryIMock.GetTruthSourceByFileUID with params: %#v", *e.params) + m.t.Error("Expected call to RepositoryIMock.KnowledgeBaseFileTableName") } } - afterGetTruthSourceByFileUIDCounter := mm_atomic.LoadUint64(&m.afterGetTruthSourceByFileUIDCounter) + afterKnowledgeBaseFileTableNameCounter := mm_atomic.LoadUint64(&m.afterKnowledgeBaseFileTableNameCounter) // if default expectation was set then invocations count should be greater than zero - if m.GetTruthSourceByFileUIDMock.defaultExpectation != nil && afterGetTruthSourceByFileUIDCounter < 1 { - if m.GetTruthSourceByFileUIDMock.defaultExpectation.params == nil { - m.t.Error("Expected call to RepositoryIMock.GetTruthSourceByFileUID") - } else { - m.t.Errorf("Expected call to RepositoryIMock.GetTruthSourceByFileUID with params: %#v", *m.GetTruthSourceByFileUIDMock.defaultExpectation.params) - } + if m.KnowledgeBaseFileTableNameMock.defaultExpectation != nil && afterKnowledgeBaseFileTableNameCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.KnowledgeBaseFileTableName") } // if func was set then invocations count should be greater than zero - if m.funcGetTruthSourceByFileUID != nil && afterGetTruthSourceByFileUIDCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.GetTruthSourceByFileUID") + if m.funcKnowledgeBaseFileTableName != nil && afterKnowledgeBaseFileTableNameCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.KnowledgeBaseFileTableName") } - if !m.GetTruthSourceByFileUIDMock.invocationsDone() && afterGetTruthSourceByFileUIDCounter > 0 { - m.t.Errorf("Expected %d calls to RepositoryIMock.GetTruthSourceByFileUID but found %d calls", - mm_atomic.LoadUint64(&m.GetTruthSourceByFileUIDMock.expectedInvocations), afterGetTruthSourceByFileUIDCounter) + if !m.KnowledgeBaseFileTableNameMock.invocationsDone() && afterKnowledgeBaseFileTableNameCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.KnowledgeBaseFileTableName but found %d calls", + mm_atomic.LoadUint64(&m.KnowledgeBaseFileTableNameMock.expectedInvocations), afterKnowledgeBaseFileTableNameCounter) } } -type mRepositoryIMockIncreaseKnowledgeBaseUsage struct { +type mRepositoryIMockListChunksByKbFileUID struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockIncreaseKnowledgeBaseUsageExpectation - expectations []*RepositoryIMockIncreaseKnowledgeBaseUsageExpectation + defaultExpectation *RepositoryIMockListChunksByKbFileUIDExpectation + expectations []*RepositoryIMockListChunksByKbFileUIDExpectation - callArgs []*RepositoryIMockIncreaseKnowledgeBaseUsageParams + callArgs []*RepositoryIMockListChunksByKbFileUIDParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockIncreaseKnowledgeBaseUsageExpectation specifies expectation struct of the RepositoryI.IncreaseKnowledgeBaseUsage -type RepositoryIMockIncreaseKnowledgeBaseUsageExpectation struct { +// RepositoryIMockListChunksByKbFileUIDExpectation specifies expectation struct of the RepositoryI.ListChunksByKbFileUID +type RepositoryIMockListChunksByKbFileUIDExpectation struct { mock *RepositoryIMock - params *RepositoryIMockIncreaseKnowledgeBaseUsageParams - paramPtrs *RepositoryIMockIncreaseKnowledgeBaseUsageParamPtrs - results *RepositoryIMockIncreaseKnowledgeBaseUsageResults + params *RepositoryIMockListChunksByKbFileUIDParams + paramPtrs *RepositoryIMockListChunksByKbFileUIDParamPtrs + results *RepositoryIMockListChunksByKbFileUIDResults Counter uint64 } -// RepositoryIMockIncreaseKnowledgeBaseUsageParams contains parameters of the RepositoryI.IncreaseKnowledgeBaseUsage -type RepositoryIMockIncreaseKnowledgeBaseUsageParams struct { - ctx context.Context - kbUID string - amount int +// RepositoryIMockListChunksByKbFileUIDParams contains parameters of the RepositoryI.ListChunksByKbFileUID +type RepositoryIMockListChunksByKbFileUIDParams struct { + ctx context.Context + kbFileUID uuid.UUID } -// RepositoryIMockIncreaseKnowledgeBaseUsageParamPtrs contains pointers to parameters of the RepositoryI.IncreaseKnowledgeBaseUsage -type RepositoryIMockIncreaseKnowledgeBaseUsageParamPtrs struct { - ctx *context.Context - kbUID *string - amount *int +// RepositoryIMockListChunksByKbFileUIDParamPtrs contains pointers to parameters of the RepositoryI.ListChunksByKbFileUID +type RepositoryIMockListChunksByKbFileUIDParamPtrs struct { + ctx *context.Context + kbFileUID *uuid.UUID } -// RepositoryIMockIncreaseKnowledgeBaseUsageResults contains results of the RepositoryI.IncreaseKnowledgeBaseUsage -type RepositoryIMockIncreaseKnowledgeBaseUsageResults struct { +// RepositoryIMockListChunksByKbFileUIDResults contains results of the RepositoryI.ListChunksByKbFileUID +type RepositoryIMockListChunksByKbFileUIDResults struct { + ta1 []mm_repository.TextChunk err error } -// Expect sets up expected params for RepositoryI.IncreaseKnowledgeBaseUsage -func (mmIncreaseKnowledgeBaseUsage *mRepositoryIMockIncreaseKnowledgeBaseUsage) Expect(ctx context.Context, kbUID string, amount int) *mRepositoryIMockIncreaseKnowledgeBaseUsage { - if mmIncreaseKnowledgeBaseUsage.mock.funcIncreaseKnowledgeBaseUsage != nil { - mmIncreaseKnowledgeBaseUsage.mock.t.Fatalf("RepositoryIMock.IncreaseKnowledgeBaseUsage mock is already set by Set") +// Expect sets up expected params for RepositoryI.ListChunksByKbFileUID +func (mmListChunksByKbFileUID *mRepositoryIMockListChunksByKbFileUID) Expect(ctx context.Context, kbFileUID uuid.UUID) *mRepositoryIMockListChunksByKbFileUID { + if mmListChunksByKbFileUID.mock.funcListChunksByKbFileUID != nil { + mmListChunksByKbFileUID.mock.t.Fatalf("RepositoryIMock.ListChunksByKbFileUID mock is already set by Set") } - if mmIncreaseKnowledgeBaseUsage.defaultExpectation == nil { - mmIncreaseKnowledgeBaseUsage.defaultExpectation = &RepositoryIMockIncreaseKnowledgeBaseUsageExpectation{} + if mmListChunksByKbFileUID.defaultExpectation == nil { + mmListChunksByKbFileUID.defaultExpectation = &RepositoryIMockListChunksByKbFileUIDExpectation{} } - if mmIncreaseKnowledgeBaseUsage.defaultExpectation.paramPtrs != nil { - mmIncreaseKnowledgeBaseUsage.mock.t.Fatalf("RepositoryIMock.IncreaseKnowledgeBaseUsage mock is already set by ExpectParams functions") + if mmListChunksByKbFileUID.defaultExpectation.paramPtrs != nil { + mmListChunksByKbFileUID.mock.t.Fatalf("RepositoryIMock.ListChunksByKbFileUID mock is already set by ExpectParams functions") } - mmIncreaseKnowledgeBaseUsage.defaultExpectation.params = &RepositoryIMockIncreaseKnowledgeBaseUsageParams{ctx, kbUID, amount} - for _, e := range mmIncreaseKnowledgeBaseUsage.expectations { - if minimock.Equal(e.params, mmIncreaseKnowledgeBaseUsage.defaultExpectation.params) { - mmIncreaseKnowledgeBaseUsage.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmIncreaseKnowledgeBaseUsage.defaultExpectation.params) + mmListChunksByKbFileUID.defaultExpectation.params = &RepositoryIMockListChunksByKbFileUIDParams{ctx, kbFileUID} + for _, e := range mmListChunksByKbFileUID.expectations { + if minimock.Equal(e.params, mmListChunksByKbFileUID.defaultExpectation.params) { + mmListChunksByKbFileUID.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmListChunksByKbFileUID.defaultExpectation.params) } } - return mmIncreaseKnowledgeBaseUsage -} - -// ExpectCtxParam1 sets up expected param ctx for RepositoryI.IncreaseKnowledgeBaseUsage -func (mmIncreaseKnowledgeBaseUsage *mRepositoryIMockIncreaseKnowledgeBaseUsage) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockIncreaseKnowledgeBaseUsage { - if mmIncreaseKnowledgeBaseUsage.mock.funcIncreaseKnowledgeBaseUsage != nil { - mmIncreaseKnowledgeBaseUsage.mock.t.Fatalf("RepositoryIMock.IncreaseKnowledgeBaseUsage mock is already set by Set") - } - - if mmIncreaseKnowledgeBaseUsage.defaultExpectation == nil { - mmIncreaseKnowledgeBaseUsage.defaultExpectation = &RepositoryIMockIncreaseKnowledgeBaseUsageExpectation{} - } - - if mmIncreaseKnowledgeBaseUsage.defaultExpectation.params != nil { - mmIncreaseKnowledgeBaseUsage.mock.t.Fatalf("RepositoryIMock.IncreaseKnowledgeBaseUsage mock is already set by Expect") - } - - if mmIncreaseKnowledgeBaseUsage.defaultExpectation.paramPtrs == nil { - mmIncreaseKnowledgeBaseUsage.defaultExpectation.paramPtrs = &RepositoryIMockIncreaseKnowledgeBaseUsageParamPtrs{} - } - mmIncreaseKnowledgeBaseUsage.defaultExpectation.paramPtrs.ctx = &ctx - - return mmIncreaseKnowledgeBaseUsage + return mmListChunksByKbFileUID } -// ExpectKbUIDParam2 sets up expected param kbUID for RepositoryI.IncreaseKnowledgeBaseUsage -func (mmIncreaseKnowledgeBaseUsage *mRepositoryIMockIncreaseKnowledgeBaseUsage) ExpectKbUIDParam2(kbUID string) *mRepositoryIMockIncreaseKnowledgeBaseUsage { - if mmIncreaseKnowledgeBaseUsage.mock.funcIncreaseKnowledgeBaseUsage != nil { - mmIncreaseKnowledgeBaseUsage.mock.t.Fatalf("RepositoryIMock.IncreaseKnowledgeBaseUsage mock is already set by Set") +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.ListChunksByKbFileUID +func (mmListChunksByKbFileUID *mRepositoryIMockListChunksByKbFileUID) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockListChunksByKbFileUID { + if mmListChunksByKbFileUID.mock.funcListChunksByKbFileUID != nil { + mmListChunksByKbFileUID.mock.t.Fatalf("RepositoryIMock.ListChunksByKbFileUID mock is already set by Set") } - if mmIncreaseKnowledgeBaseUsage.defaultExpectation == nil { - mmIncreaseKnowledgeBaseUsage.defaultExpectation = &RepositoryIMockIncreaseKnowledgeBaseUsageExpectation{} + if mmListChunksByKbFileUID.defaultExpectation == nil { + mmListChunksByKbFileUID.defaultExpectation = &RepositoryIMockListChunksByKbFileUIDExpectation{} } - if mmIncreaseKnowledgeBaseUsage.defaultExpectation.params != nil { - mmIncreaseKnowledgeBaseUsage.mock.t.Fatalf("RepositoryIMock.IncreaseKnowledgeBaseUsage mock is already set by Expect") + if mmListChunksByKbFileUID.defaultExpectation.params != nil { + mmListChunksByKbFileUID.mock.t.Fatalf("RepositoryIMock.ListChunksByKbFileUID mock is already set by Expect") } - if mmIncreaseKnowledgeBaseUsage.defaultExpectation.paramPtrs == nil { - mmIncreaseKnowledgeBaseUsage.defaultExpectation.paramPtrs = &RepositoryIMockIncreaseKnowledgeBaseUsageParamPtrs{} + if mmListChunksByKbFileUID.defaultExpectation.paramPtrs == nil { + mmListChunksByKbFileUID.defaultExpectation.paramPtrs = &RepositoryIMockListChunksByKbFileUIDParamPtrs{} } - mmIncreaseKnowledgeBaseUsage.defaultExpectation.paramPtrs.kbUID = &kbUID + mmListChunksByKbFileUID.defaultExpectation.paramPtrs.ctx = &ctx - return mmIncreaseKnowledgeBaseUsage + return mmListChunksByKbFileUID } -// ExpectAmountParam3 sets up expected param amount for RepositoryI.IncreaseKnowledgeBaseUsage -func (mmIncreaseKnowledgeBaseUsage *mRepositoryIMockIncreaseKnowledgeBaseUsage) ExpectAmountParam3(amount int) *mRepositoryIMockIncreaseKnowledgeBaseUsage { - if mmIncreaseKnowledgeBaseUsage.mock.funcIncreaseKnowledgeBaseUsage != nil { - mmIncreaseKnowledgeBaseUsage.mock.t.Fatalf("RepositoryIMock.IncreaseKnowledgeBaseUsage mock is already set by Set") +// ExpectKbFileUIDParam2 sets up expected param kbFileUID for RepositoryI.ListChunksByKbFileUID +func (mmListChunksByKbFileUID *mRepositoryIMockListChunksByKbFileUID) ExpectKbFileUIDParam2(kbFileUID uuid.UUID) *mRepositoryIMockListChunksByKbFileUID { + if mmListChunksByKbFileUID.mock.funcListChunksByKbFileUID != nil { + mmListChunksByKbFileUID.mock.t.Fatalf("RepositoryIMock.ListChunksByKbFileUID mock is already set by Set") } - if mmIncreaseKnowledgeBaseUsage.defaultExpectation == nil { - mmIncreaseKnowledgeBaseUsage.defaultExpectation = &RepositoryIMockIncreaseKnowledgeBaseUsageExpectation{} + if mmListChunksByKbFileUID.defaultExpectation == nil { + mmListChunksByKbFileUID.defaultExpectation = &RepositoryIMockListChunksByKbFileUIDExpectation{} } - if mmIncreaseKnowledgeBaseUsage.defaultExpectation.params != nil { - mmIncreaseKnowledgeBaseUsage.mock.t.Fatalf("RepositoryIMock.IncreaseKnowledgeBaseUsage mock is already set by Expect") + if mmListChunksByKbFileUID.defaultExpectation.params != nil { + mmListChunksByKbFileUID.mock.t.Fatalf("RepositoryIMock.ListChunksByKbFileUID mock is already set by Expect") } - if mmIncreaseKnowledgeBaseUsage.defaultExpectation.paramPtrs == nil { - mmIncreaseKnowledgeBaseUsage.defaultExpectation.paramPtrs = &RepositoryIMockIncreaseKnowledgeBaseUsageParamPtrs{} + if mmListChunksByKbFileUID.defaultExpectation.paramPtrs == nil { + mmListChunksByKbFileUID.defaultExpectation.paramPtrs = &RepositoryIMockListChunksByKbFileUIDParamPtrs{} } - mmIncreaseKnowledgeBaseUsage.defaultExpectation.paramPtrs.amount = &amount + mmListChunksByKbFileUID.defaultExpectation.paramPtrs.kbFileUID = &kbFileUID - return mmIncreaseKnowledgeBaseUsage + return mmListChunksByKbFileUID } -// Inspect accepts an inspector function that has same arguments as the RepositoryI.IncreaseKnowledgeBaseUsage -func (mmIncreaseKnowledgeBaseUsage *mRepositoryIMockIncreaseKnowledgeBaseUsage) Inspect(f func(ctx context.Context, kbUID string, amount int)) *mRepositoryIMockIncreaseKnowledgeBaseUsage { - if mmIncreaseKnowledgeBaseUsage.mock.inspectFuncIncreaseKnowledgeBaseUsage != nil { - mmIncreaseKnowledgeBaseUsage.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.IncreaseKnowledgeBaseUsage") +// Inspect accepts an inspector function that has same arguments as the RepositoryI.ListChunksByKbFileUID +func (mmListChunksByKbFileUID *mRepositoryIMockListChunksByKbFileUID) Inspect(f func(ctx context.Context, kbFileUID uuid.UUID)) *mRepositoryIMockListChunksByKbFileUID { + if mmListChunksByKbFileUID.mock.inspectFuncListChunksByKbFileUID != nil { + mmListChunksByKbFileUID.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.ListChunksByKbFileUID") } - mmIncreaseKnowledgeBaseUsage.mock.inspectFuncIncreaseKnowledgeBaseUsage = f + mmListChunksByKbFileUID.mock.inspectFuncListChunksByKbFileUID = f - return mmIncreaseKnowledgeBaseUsage + return mmListChunksByKbFileUID } -// Return sets up results that will be returned by RepositoryI.IncreaseKnowledgeBaseUsage -func (mmIncreaseKnowledgeBaseUsage *mRepositoryIMockIncreaseKnowledgeBaseUsage) Return(err error) *RepositoryIMock { - if mmIncreaseKnowledgeBaseUsage.mock.funcIncreaseKnowledgeBaseUsage != nil { - mmIncreaseKnowledgeBaseUsage.mock.t.Fatalf("RepositoryIMock.IncreaseKnowledgeBaseUsage mock is already set by Set") +// Return sets up results that will be returned by RepositoryI.ListChunksByKbFileUID +func (mmListChunksByKbFileUID *mRepositoryIMockListChunksByKbFileUID) Return(ta1 []mm_repository.TextChunk, err error) *RepositoryIMock { + if mmListChunksByKbFileUID.mock.funcListChunksByKbFileUID != nil { + mmListChunksByKbFileUID.mock.t.Fatalf("RepositoryIMock.ListChunksByKbFileUID mock is already set by Set") } - if mmIncreaseKnowledgeBaseUsage.defaultExpectation == nil { - mmIncreaseKnowledgeBaseUsage.defaultExpectation = &RepositoryIMockIncreaseKnowledgeBaseUsageExpectation{mock: mmIncreaseKnowledgeBaseUsage.mock} + if mmListChunksByKbFileUID.defaultExpectation == nil { + mmListChunksByKbFileUID.defaultExpectation = &RepositoryIMockListChunksByKbFileUIDExpectation{mock: mmListChunksByKbFileUID.mock} } - mmIncreaseKnowledgeBaseUsage.defaultExpectation.results = &RepositoryIMockIncreaseKnowledgeBaseUsageResults{err} - return mmIncreaseKnowledgeBaseUsage.mock + mmListChunksByKbFileUID.defaultExpectation.results = &RepositoryIMockListChunksByKbFileUIDResults{ta1, err} + return mmListChunksByKbFileUID.mock } -// Set uses given function f to mock the RepositoryI.IncreaseKnowledgeBaseUsage method -func (mmIncreaseKnowledgeBaseUsage *mRepositoryIMockIncreaseKnowledgeBaseUsage) Set(f func(ctx context.Context, kbUID string, amount int) (err error)) *RepositoryIMock { - if mmIncreaseKnowledgeBaseUsage.defaultExpectation != nil { - mmIncreaseKnowledgeBaseUsage.mock.t.Fatalf("Default expectation is already set for the RepositoryI.IncreaseKnowledgeBaseUsage method") +// Set uses given function f to mock the RepositoryI.ListChunksByKbFileUID method +func (mmListChunksByKbFileUID *mRepositoryIMockListChunksByKbFileUID) Set(f func(ctx context.Context, kbFileUID uuid.UUID) (ta1 []mm_repository.TextChunk, err error)) *RepositoryIMock { + if mmListChunksByKbFileUID.defaultExpectation != nil { + mmListChunksByKbFileUID.mock.t.Fatalf("Default expectation is already set for the RepositoryI.ListChunksByKbFileUID method") } - - if len(mmIncreaseKnowledgeBaseUsage.expectations) > 0 { - mmIncreaseKnowledgeBaseUsage.mock.t.Fatalf("Some expectations are already set for the RepositoryI.IncreaseKnowledgeBaseUsage method") + + if len(mmListChunksByKbFileUID.expectations) > 0 { + mmListChunksByKbFileUID.mock.t.Fatalf("Some expectations are already set for the RepositoryI.ListChunksByKbFileUID method") } - mmIncreaseKnowledgeBaseUsage.mock.funcIncreaseKnowledgeBaseUsage = f - return mmIncreaseKnowledgeBaseUsage.mock + mmListChunksByKbFileUID.mock.funcListChunksByKbFileUID = f + return mmListChunksByKbFileUID.mock } -// When sets expectation for the RepositoryI.IncreaseKnowledgeBaseUsage which will trigger the result defined by the following +// When sets expectation for the RepositoryI.ListChunksByKbFileUID which will trigger the result defined by the following // Then helper -func (mmIncreaseKnowledgeBaseUsage *mRepositoryIMockIncreaseKnowledgeBaseUsage) When(ctx context.Context, kbUID string, amount int) *RepositoryIMockIncreaseKnowledgeBaseUsageExpectation { - if mmIncreaseKnowledgeBaseUsage.mock.funcIncreaseKnowledgeBaseUsage != nil { - mmIncreaseKnowledgeBaseUsage.mock.t.Fatalf("RepositoryIMock.IncreaseKnowledgeBaseUsage mock is already set by Set") +func (mmListChunksByKbFileUID *mRepositoryIMockListChunksByKbFileUID) When(ctx context.Context, kbFileUID uuid.UUID) *RepositoryIMockListChunksByKbFileUIDExpectation { + if mmListChunksByKbFileUID.mock.funcListChunksByKbFileUID != nil { + mmListChunksByKbFileUID.mock.t.Fatalf("RepositoryIMock.ListChunksByKbFileUID mock is already set by Set") } - expectation := &RepositoryIMockIncreaseKnowledgeBaseUsageExpectation{ - mock: mmIncreaseKnowledgeBaseUsage.mock, - params: &RepositoryIMockIncreaseKnowledgeBaseUsageParams{ctx, kbUID, amount}, + expectation := &RepositoryIMockListChunksByKbFileUIDExpectation{ + mock: mmListChunksByKbFileUID.mock, + params: &RepositoryIMockListChunksByKbFileUIDParams{ctx, kbFileUID}, } - mmIncreaseKnowledgeBaseUsage.expectations = append(mmIncreaseKnowledgeBaseUsage.expectations, expectation) + mmListChunksByKbFileUID.expectations = append(mmListChunksByKbFileUID.expectations, expectation) return expectation } -// Then sets up RepositoryI.IncreaseKnowledgeBaseUsage return parameters for the expectation previously defined by the When method -func (e *RepositoryIMockIncreaseKnowledgeBaseUsageExpectation) Then(err error) *RepositoryIMock { - e.results = &RepositoryIMockIncreaseKnowledgeBaseUsageResults{err} +// Then sets up RepositoryI.ListChunksByKbFileUID return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockListChunksByKbFileUIDExpectation) Then(ta1 []mm_repository.TextChunk, err error) *RepositoryIMock { + e.results = &RepositoryIMockListChunksByKbFileUIDResults{ta1, err} return e.mock } -// Times sets number of times RepositoryI.IncreaseKnowledgeBaseUsage should be invoked -func (mmIncreaseKnowledgeBaseUsage *mRepositoryIMockIncreaseKnowledgeBaseUsage) Times(n uint64) *mRepositoryIMockIncreaseKnowledgeBaseUsage { +// Times sets number of times RepositoryI.ListChunksByKbFileUID should be invoked +func (mmListChunksByKbFileUID *mRepositoryIMockListChunksByKbFileUID) Times(n uint64) *mRepositoryIMockListChunksByKbFileUID { if n == 0 { - mmIncreaseKnowledgeBaseUsage.mock.t.Fatalf("Times of RepositoryIMock.IncreaseKnowledgeBaseUsage mock can not be zero") + mmListChunksByKbFileUID.mock.t.Fatalf("Times of RepositoryIMock.ListChunksByKbFileUID mock can not be zero") } - mm_atomic.StoreUint64(&mmIncreaseKnowledgeBaseUsage.expectedInvocations, n) - return mmIncreaseKnowledgeBaseUsage + mm_atomic.StoreUint64(&mmListChunksByKbFileUID.expectedInvocations, n) + return mmListChunksByKbFileUID } -func (mmIncreaseKnowledgeBaseUsage *mRepositoryIMockIncreaseKnowledgeBaseUsage) invocationsDone() bool { - if len(mmIncreaseKnowledgeBaseUsage.expectations) == 0 && mmIncreaseKnowledgeBaseUsage.defaultExpectation == nil && mmIncreaseKnowledgeBaseUsage.mock.funcIncreaseKnowledgeBaseUsage == nil { +func (mmListChunksByKbFileUID *mRepositoryIMockListChunksByKbFileUID) invocationsDone() bool { + if len(mmListChunksByKbFileUID.expectations) == 0 && mmListChunksByKbFileUID.defaultExpectation == nil && mmListChunksByKbFileUID.mock.funcListChunksByKbFileUID == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmIncreaseKnowledgeBaseUsage.mock.afterIncreaseKnowledgeBaseUsageCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmIncreaseKnowledgeBaseUsage.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmListChunksByKbFileUID.mock.afterListChunksByKbFileUIDCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmListChunksByKbFileUID.expectedInvocations) return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) } -// IncreaseKnowledgeBaseUsage implements repository.RepositoryI -func (mmIncreaseKnowledgeBaseUsage *RepositoryIMock) IncreaseKnowledgeBaseUsage(ctx context.Context, kbUID string, amount int) (err error) { - mm_atomic.AddUint64(&mmIncreaseKnowledgeBaseUsage.beforeIncreaseKnowledgeBaseUsageCounter, 1) - defer mm_atomic.AddUint64(&mmIncreaseKnowledgeBaseUsage.afterIncreaseKnowledgeBaseUsageCounter, 1) +// ListChunksByKbFileUID implements repository.RepositoryI +func (mmListChunksByKbFileUID *RepositoryIMock) ListChunksByKbFileUID(ctx context.Context, kbFileUID uuid.UUID) (ta1 []mm_repository.TextChunk, err error) { + mm_atomic.AddUint64(&mmListChunksByKbFileUID.beforeListChunksByKbFileUIDCounter, 1) + defer mm_atomic.AddUint64(&mmListChunksByKbFileUID.afterListChunksByKbFileUIDCounter, 1) - if mmIncreaseKnowledgeBaseUsage.inspectFuncIncreaseKnowledgeBaseUsage != nil { - mmIncreaseKnowledgeBaseUsage.inspectFuncIncreaseKnowledgeBaseUsage(ctx, kbUID, amount) + if mmListChunksByKbFileUID.inspectFuncListChunksByKbFileUID != nil { + mmListChunksByKbFileUID.inspectFuncListChunksByKbFileUID(ctx, kbFileUID) } - mm_params := RepositoryIMockIncreaseKnowledgeBaseUsageParams{ctx, kbUID, amount} + mm_params := RepositoryIMockListChunksByKbFileUIDParams{ctx, kbFileUID} // Record call args - mmIncreaseKnowledgeBaseUsage.IncreaseKnowledgeBaseUsageMock.mutex.Lock() - mmIncreaseKnowledgeBaseUsage.IncreaseKnowledgeBaseUsageMock.callArgs = append(mmIncreaseKnowledgeBaseUsage.IncreaseKnowledgeBaseUsageMock.callArgs, &mm_params) - mmIncreaseKnowledgeBaseUsage.IncreaseKnowledgeBaseUsageMock.mutex.Unlock() + mmListChunksByKbFileUID.ListChunksByKbFileUIDMock.mutex.Lock() + mmListChunksByKbFileUID.ListChunksByKbFileUIDMock.callArgs = append(mmListChunksByKbFileUID.ListChunksByKbFileUIDMock.callArgs, &mm_params) + mmListChunksByKbFileUID.ListChunksByKbFileUIDMock.mutex.Unlock() - for _, e := range mmIncreaseKnowledgeBaseUsage.IncreaseKnowledgeBaseUsageMock.expectations { + for _, e := range mmListChunksByKbFileUID.ListChunksByKbFileUIDMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.err + return e.results.ta1, e.results.err } } - if mmIncreaseKnowledgeBaseUsage.IncreaseKnowledgeBaseUsageMock.defaultExpectation != nil { - mm_atomic.AddUint64(&mmIncreaseKnowledgeBaseUsage.IncreaseKnowledgeBaseUsageMock.defaultExpectation.Counter, 1) - mm_want := mmIncreaseKnowledgeBaseUsage.IncreaseKnowledgeBaseUsageMock.defaultExpectation.params - mm_want_ptrs := mmIncreaseKnowledgeBaseUsage.IncreaseKnowledgeBaseUsageMock.defaultExpectation.paramPtrs + if mmListChunksByKbFileUID.ListChunksByKbFileUIDMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmListChunksByKbFileUID.ListChunksByKbFileUIDMock.defaultExpectation.Counter, 1) + mm_want := mmListChunksByKbFileUID.ListChunksByKbFileUIDMock.defaultExpectation.params + mm_want_ptrs := mmListChunksByKbFileUID.ListChunksByKbFileUIDMock.defaultExpectation.paramPtrs - mm_got := RepositoryIMockIncreaseKnowledgeBaseUsageParams{ctx, kbUID, amount} + mm_got := RepositoryIMockListChunksByKbFileUIDParams{ctx, kbFileUID} if mm_want_ptrs != nil { if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { - mmIncreaseKnowledgeBaseUsage.t.Errorf("RepositoryIMock.IncreaseKnowledgeBaseUsage got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) - } - - if mm_want_ptrs.kbUID != nil && !minimock.Equal(*mm_want_ptrs.kbUID, mm_got.kbUID) { - mmIncreaseKnowledgeBaseUsage.t.Errorf("RepositoryIMock.IncreaseKnowledgeBaseUsage got unexpected parameter kbUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.kbUID, mm_got.kbUID, minimock.Diff(*mm_want_ptrs.kbUID, mm_got.kbUID)) + mmListChunksByKbFileUID.t.Errorf("RepositoryIMock.ListChunksByKbFileUID got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) } - if mm_want_ptrs.amount != nil && !minimock.Equal(*mm_want_ptrs.amount, mm_got.amount) { - mmIncreaseKnowledgeBaseUsage.t.Errorf("RepositoryIMock.IncreaseKnowledgeBaseUsage got unexpected parameter amount, want: %#v, got: %#v%s\n", *mm_want_ptrs.amount, mm_got.amount, minimock.Diff(*mm_want_ptrs.amount, mm_got.amount)) + if mm_want_ptrs.kbFileUID != nil && !minimock.Equal(*mm_want_ptrs.kbFileUID, mm_got.kbFileUID) { + mmListChunksByKbFileUID.t.Errorf("RepositoryIMock.ListChunksByKbFileUID got unexpected parameter kbFileUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.kbFileUID, mm_got.kbFileUID, minimock.Diff(*mm_want_ptrs.kbFileUID, mm_got.kbFileUID)) } } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { - mmIncreaseKnowledgeBaseUsage.t.Errorf("RepositoryIMock.IncreaseKnowledgeBaseUsage got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + mmListChunksByKbFileUID.t.Errorf("RepositoryIMock.ListChunksByKbFileUID got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) } - mm_results := mmIncreaseKnowledgeBaseUsage.IncreaseKnowledgeBaseUsageMock.defaultExpectation.results + mm_results := mmListChunksByKbFileUID.ListChunksByKbFileUIDMock.defaultExpectation.results if mm_results == nil { - mmIncreaseKnowledgeBaseUsage.t.Fatal("No results are set for the RepositoryIMock.IncreaseKnowledgeBaseUsage") + mmListChunksByKbFileUID.t.Fatal("No results are set for the RepositoryIMock.ListChunksByKbFileUID") } - return (*mm_results).err + return (*mm_results).ta1, (*mm_results).err } - if mmIncreaseKnowledgeBaseUsage.funcIncreaseKnowledgeBaseUsage != nil { - return mmIncreaseKnowledgeBaseUsage.funcIncreaseKnowledgeBaseUsage(ctx, kbUID, amount) + if mmListChunksByKbFileUID.funcListChunksByKbFileUID != nil { + return mmListChunksByKbFileUID.funcListChunksByKbFileUID(ctx, kbFileUID) } - mmIncreaseKnowledgeBaseUsage.t.Fatalf("Unexpected call to RepositoryIMock.IncreaseKnowledgeBaseUsage. %v %v %v", ctx, kbUID, amount) + mmListChunksByKbFileUID.t.Fatalf("Unexpected call to RepositoryIMock.ListChunksByKbFileUID. %v %v", ctx, kbFileUID) return } -// IncreaseKnowledgeBaseUsageAfterCounter returns a count of finished RepositoryIMock.IncreaseKnowledgeBaseUsage invocations -func (mmIncreaseKnowledgeBaseUsage *RepositoryIMock) IncreaseKnowledgeBaseUsageAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmIncreaseKnowledgeBaseUsage.afterIncreaseKnowledgeBaseUsageCounter) +// ListChunksByKbFileUIDAfterCounter returns a count of finished RepositoryIMock.ListChunksByKbFileUID invocations +func (mmListChunksByKbFileUID *RepositoryIMock) ListChunksByKbFileUIDAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmListChunksByKbFileUID.afterListChunksByKbFileUIDCounter) } -// IncreaseKnowledgeBaseUsageBeforeCounter returns a count of RepositoryIMock.IncreaseKnowledgeBaseUsage invocations -func (mmIncreaseKnowledgeBaseUsage *RepositoryIMock) IncreaseKnowledgeBaseUsageBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmIncreaseKnowledgeBaseUsage.beforeIncreaseKnowledgeBaseUsageCounter) +// ListChunksByKbFileUIDBeforeCounter returns a count of RepositoryIMock.ListChunksByKbFileUID invocations +func (mmListChunksByKbFileUID *RepositoryIMock) ListChunksByKbFileUIDBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmListChunksByKbFileUID.beforeListChunksByKbFileUIDCounter) } -// Calls returns a list of arguments used in each call to RepositoryIMock.IncreaseKnowledgeBaseUsage. +// Calls returns a list of arguments used in each call to RepositoryIMock.ListChunksByKbFileUID. // The list is in the same order as the calls were made (i.e. recent calls have a higher index) -func (mmIncreaseKnowledgeBaseUsage *mRepositoryIMockIncreaseKnowledgeBaseUsage) Calls() []*RepositoryIMockIncreaseKnowledgeBaseUsageParams { - mmIncreaseKnowledgeBaseUsage.mutex.RLock() +func (mmListChunksByKbFileUID *mRepositoryIMockListChunksByKbFileUID) Calls() []*RepositoryIMockListChunksByKbFileUIDParams { + mmListChunksByKbFileUID.mutex.RLock() - argCopy := make([]*RepositoryIMockIncreaseKnowledgeBaseUsageParams, len(mmIncreaseKnowledgeBaseUsage.callArgs)) - copy(argCopy, mmIncreaseKnowledgeBaseUsage.callArgs) + argCopy := make([]*RepositoryIMockListChunksByKbFileUIDParams, len(mmListChunksByKbFileUID.callArgs)) + copy(argCopy, mmListChunksByKbFileUID.callArgs) - mmIncreaseKnowledgeBaseUsage.mutex.RUnlock() + mmListChunksByKbFileUID.mutex.RUnlock() return argCopy } -// MinimockIncreaseKnowledgeBaseUsageDone returns true if the count of the IncreaseKnowledgeBaseUsage invocations corresponds +// MinimockListChunksByKbFileUIDDone returns true if the count of the ListChunksByKbFileUID invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockIncreaseKnowledgeBaseUsageDone() bool { - for _, e := range m.IncreaseKnowledgeBaseUsageMock.expectations { +func (m *RepositoryIMock) MinimockListChunksByKbFileUIDDone() bool { + for _, e := range m.ListChunksByKbFileUIDMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.IncreaseKnowledgeBaseUsageMock.invocationsDone() + return m.ListChunksByKbFileUIDMock.invocationsDone() } -// MinimockIncreaseKnowledgeBaseUsageInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockIncreaseKnowledgeBaseUsageInspect() { - for _, e := range m.IncreaseKnowledgeBaseUsageMock.expectations { +// MinimockListChunksByKbFileUIDInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockListChunksByKbFileUIDInspect() { + for _, e := range m.ListChunksByKbFileUIDMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { - m.t.Errorf("Expected call to RepositoryIMock.IncreaseKnowledgeBaseUsage with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.ListChunksByKbFileUID with params: %#v", *e.params) } } - afterIncreaseKnowledgeBaseUsageCounter := mm_atomic.LoadUint64(&m.afterIncreaseKnowledgeBaseUsageCounter) + afterListChunksByKbFileUIDCounter := mm_atomic.LoadUint64(&m.afterListChunksByKbFileUIDCounter) // if default expectation was set then invocations count should be greater than zero - if m.IncreaseKnowledgeBaseUsageMock.defaultExpectation != nil && afterIncreaseKnowledgeBaseUsageCounter < 1 { - if m.IncreaseKnowledgeBaseUsageMock.defaultExpectation.params == nil { - m.t.Error("Expected call to RepositoryIMock.IncreaseKnowledgeBaseUsage") + if m.ListChunksByKbFileUIDMock.defaultExpectation != nil && afterListChunksByKbFileUIDCounter < 1 { + if m.ListChunksByKbFileUIDMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.ListChunksByKbFileUID") } else { - m.t.Errorf("Expected call to RepositoryIMock.IncreaseKnowledgeBaseUsage with params: %#v", *m.IncreaseKnowledgeBaseUsageMock.defaultExpectation.params) + m.t.Errorf("Expected call to RepositoryIMock.ListChunksByKbFileUID with params: %#v", *m.ListChunksByKbFileUIDMock.defaultExpectation.params) } } // if func was set then invocations count should be greater than zero - if m.funcIncreaseKnowledgeBaseUsage != nil && afterIncreaseKnowledgeBaseUsageCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.IncreaseKnowledgeBaseUsage") + if m.funcListChunksByKbFileUID != nil && afterListChunksByKbFileUIDCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.ListChunksByKbFileUID") } - if !m.IncreaseKnowledgeBaseUsageMock.invocationsDone() && afterIncreaseKnowledgeBaseUsageCounter > 0 { - m.t.Errorf("Expected %d calls to RepositoryIMock.IncreaseKnowledgeBaseUsage but found %d calls", - mm_atomic.LoadUint64(&m.IncreaseKnowledgeBaseUsageMock.expectedInvocations), afterIncreaseKnowledgeBaseUsageCounter) + if !m.ListChunksByKbFileUIDMock.invocationsDone() && afterListChunksByKbFileUIDCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.ListChunksByKbFileUID but found %d calls", + mm_atomic.LoadUint64(&m.ListChunksByKbFileUIDMock.expectedInvocations), afterListChunksByKbFileUIDCounter) } } -type mRepositoryIMockKnowledgeBaseFileTableName struct { +type mRepositoryIMockListEmbeddingsByKbFileUID struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockKnowledgeBaseFileTableNameExpectation - expectations []*RepositoryIMockKnowledgeBaseFileTableNameExpectation + defaultExpectation *RepositoryIMockListEmbeddingsByKbFileUIDExpectation + expectations []*RepositoryIMockListEmbeddingsByKbFileUIDExpectation + + callArgs []*RepositoryIMockListEmbeddingsByKbFileUIDParams + mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockKnowledgeBaseFileTableNameExpectation specifies expectation struct of the RepositoryI.KnowledgeBaseFileTableName -type RepositoryIMockKnowledgeBaseFileTableNameExpectation struct { - mock *RepositoryIMock +// RepositoryIMockListEmbeddingsByKbFileUIDExpectation specifies expectation struct of the RepositoryI.ListEmbeddingsByKbFileUID +type RepositoryIMockListEmbeddingsByKbFileUIDExpectation struct { + mock *RepositoryIMock + params *RepositoryIMockListEmbeddingsByKbFileUIDParams + paramPtrs *RepositoryIMockListEmbeddingsByKbFileUIDParamPtrs + results *RepositoryIMockListEmbeddingsByKbFileUIDResults + Counter uint64 +} - results *RepositoryIMockKnowledgeBaseFileTableNameResults - Counter uint64 +// RepositoryIMockListEmbeddingsByKbFileUIDParams contains parameters of the RepositoryI.ListEmbeddingsByKbFileUID +type RepositoryIMockListEmbeddingsByKbFileUIDParams struct { + ctx context.Context + kbFileUID uuid.UUID } -// RepositoryIMockKnowledgeBaseFileTableNameResults contains results of the RepositoryI.KnowledgeBaseFileTableName -type RepositoryIMockKnowledgeBaseFileTableNameResults struct { - s1 string +// RepositoryIMockListEmbeddingsByKbFileUIDParamPtrs contains pointers to parameters of the RepositoryI.ListEmbeddingsByKbFileUID +type RepositoryIMockListEmbeddingsByKbFileUIDParamPtrs struct { + ctx *context.Context + kbFileUID *uuid.UUID } -// Expect sets up expected params for RepositoryI.KnowledgeBaseFileTableName -func (mmKnowledgeBaseFileTableName *mRepositoryIMockKnowledgeBaseFileTableName) Expect() *mRepositoryIMockKnowledgeBaseFileTableName { - if mmKnowledgeBaseFileTableName.mock.funcKnowledgeBaseFileTableName != nil { - mmKnowledgeBaseFileTableName.mock.t.Fatalf("RepositoryIMock.KnowledgeBaseFileTableName mock is already set by Set") +// RepositoryIMockListEmbeddingsByKbFileUIDResults contains results of the RepositoryI.ListEmbeddingsByKbFileUID +type RepositoryIMockListEmbeddingsByKbFileUIDResults struct { + ea1 []mm_repository.Embedding + err error +} + +// Expect sets up expected params for RepositoryI.ListEmbeddingsByKbFileUID +func (mmListEmbeddingsByKbFileUID *mRepositoryIMockListEmbeddingsByKbFileUID) Expect(ctx context.Context, kbFileUID uuid.UUID) *mRepositoryIMockListEmbeddingsByKbFileUID { + if mmListEmbeddingsByKbFileUID.mock.funcListEmbeddingsByKbFileUID != nil { + mmListEmbeddingsByKbFileUID.mock.t.Fatalf("RepositoryIMock.ListEmbeddingsByKbFileUID mock is already set by Set") } - if mmKnowledgeBaseFileTableName.defaultExpectation == nil { - mmKnowledgeBaseFileTableName.defaultExpectation = &RepositoryIMockKnowledgeBaseFileTableNameExpectation{} + if mmListEmbeddingsByKbFileUID.defaultExpectation == nil { + mmListEmbeddingsByKbFileUID.defaultExpectation = &RepositoryIMockListEmbeddingsByKbFileUIDExpectation{} } - return mmKnowledgeBaseFileTableName + if mmListEmbeddingsByKbFileUID.defaultExpectation.paramPtrs != nil { + mmListEmbeddingsByKbFileUID.mock.t.Fatalf("RepositoryIMock.ListEmbeddingsByKbFileUID mock is already set by ExpectParams functions") + } + + mmListEmbeddingsByKbFileUID.defaultExpectation.params = &RepositoryIMockListEmbeddingsByKbFileUIDParams{ctx, kbFileUID} + for _, e := range mmListEmbeddingsByKbFileUID.expectations { + if minimock.Equal(e.params, mmListEmbeddingsByKbFileUID.defaultExpectation.params) { + mmListEmbeddingsByKbFileUID.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmListEmbeddingsByKbFileUID.defaultExpectation.params) + } + } + + return mmListEmbeddingsByKbFileUID } -// Inspect accepts an inspector function that has same arguments as the RepositoryI.KnowledgeBaseFileTableName -func (mmKnowledgeBaseFileTableName *mRepositoryIMockKnowledgeBaseFileTableName) Inspect(f func()) *mRepositoryIMockKnowledgeBaseFileTableName { - if mmKnowledgeBaseFileTableName.mock.inspectFuncKnowledgeBaseFileTableName != nil { - mmKnowledgeBaseFileTableName.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.KnowledgeBaseFileTableName") +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.ListEmbeddingsByKbFileUID +func (mmListEmbeddingsByKbFileUID *mRepositoryIMockListEmbeddingsByKbFileUID) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockListEmbeddingsByKbFileUID { + if mmListEmbeddingsByKbFileUID.mock.funcListEmbeddingsByKbFileUID != nil { + mmListEmbeddingsByKbFileUID.mock.t.Fatalf("RepositoryIMock.ListEmbeddingsByKbFileUID mock is already set by Set") } - mmKnowledgeBaseFileTableName.mock.inspectFuncKnowledgeBaseFileTableName = f + if mmListEmbeddingsByKbFileUID.defaultExpectation == nil { + mmListEmbeddingsByKbFileUID.defaultExpectation = &RepositoryIMockListEmbeddingsByKbFileUIDExpectation{} + } - return mmKnowledgeBaseFileTableName + if mmListEmbeddingsByKbFileUID.defaultExpectation.params != nil { + mmListEmbeddingsByKbFileUID.mock.t.Fatalf("RepositoryIMock.ListEmbeddingsByKbFileUID mock is already set by Expect") + } + + if mmListEmbeddingsByKbFileUID.defaultExpectation.paramPtrs == nil { + mmListEmbeddingsByKbFileUID.defaultExpectation.paramPtrs = &RepositoryIMockListEmbeddingsByKbFileUIDParamPtrs{} + } + mmListEmbeddingsByKbFileUID.defaultExpectation.paramPtrs.ctx = &ctx + + return mmListEmbeddingsByKbFileUID } -// Return sets up results that will be returned by RepositoryI.KnowledgeBaseFileTableName -func (mmKnowledgeBaseFileTableName *mRepositoryIMockKnowledgeBaseFileTableName) Return(s1 string) *RepositoryIMock { - if mmKnowledgeBaseFileTableName.mock.funcKnowledgeBaseFileTableName != nil { - mmKnowledgeBaseFileTableName.mock.t.Fatalf("RepositoryIMock.KnowledgeBaseFileTableName mock is already set by Set") +// ExpectKbFileUIDParam2 sets up expected param kbFileUID for RepositoryI.ListEmbeddingsByKbFileUID +func (mmListEmbeddingsByKbFileUID *mRepositoryIMockListEmbeddingsByKbFileUID) ExpectKbFileUIDParam2(kbFileUID uuid.UUID) *mRepositoryIMockListEmbeddingsByKbFileUID { + if mmListEmbeddingsByKbFileUID.mock.funcListEmbeddingsByKbFileUID != nil { + mmListEmbeddingsByKbFileUID.mock.t.Fatalf("RepositoryIMock.ListEmbeddingsByKbFileUID mock is already set by Set") } - if mmKnowledgeBaseFileTableName.defaultExpectation == nil { - mmKnowledgeBaseFileTableName.defaultExpectation = &RepositoryIMockKnowledgeBaseFileTableNameExpectation{mock: mmKnowledgeBaseFileTableName.mock} + if mmListEmbeddingsByKbFileUID.defaultExpectation == nil { + mmListEmbeddingsByKbFileUID.defaultExpectation = &RepositoryIMockListEmbeddingsByKbFileUIDExpectation{} } - mmKnowledgeBaseFileTableName.defaultExpectation.results = &RepositoryIMockKnowledgeBaseFileTableNameResults{s1} - return mmKnowledgeBaseFileTableName.mock + + if mmListEmbeddingsByKbFileUID.defaultExpectation.params != nil { + mmListEmbeddingsByKbFileUID.mock.t.Fatalf("RepositoryIMock.ListEmbeddingsByKbFileUID mock is already set by Expect") + } + + if mmListEmbeddingsByKbFileUID.defaultExpectation.paramPtrs == nil { + mmListEmbeddingsByKbFileUID.defaultExpectation.paramPtrs = &RepositoryIMockListEmbeddingsByKbFileUIDParamPtrs{} + } + mmListEmbeddingsByKbFileUID.defaultExpectation.paramPtrs.kbFileUID = &kbFileUID + + return mmListEmbeddingsByKbFileUID } -// Set uses given function f to mock the RepositoryI.KnowledgeBaseFileTableName method -func (mmKnowledgeBaseFileTableName *mRepositoryIMockKnowledgeBaseFileTableName) Set(f func() (s1 string)) *RepositoryIMock { - if mmKnowledgeBaseFileTableName.defaultExpectation != nil { - mmKnowledgeBaseFileTableName.mock.t.Fatalf("Default expectation is already set for the RepositoryI.KnowledgeBaseFileTableName method") +// Inspect accepts an inspector function that has same arguments as the RepositoryI.ListEmbeddingsByKbFileUID +func (mmListEmbeddingsByKbFileUID *mRepositoryIMockListEmbeddingsByKbFileUID) Inspect(f func(ctx context.Context, kbFileUID uuid.UUID)) *mRepositoryIMockListEmbeddingsByKbFileUID { + if mmListEmbeddingsByKbFileUID.mock.inspectFuncListEmbeddingsByKbFileUID != nil { + mmListEmbeddingsByKbFileUID.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.ListEmbeddingsByKbFileUID") } - if len(mmKnowledgeBaseFileTableName.expectations) > 0 { - mmKnowledgeBaseFileTableName.mock.t.Fatalf("Some expectations are already set for the RepositoryI.KnowledgeBaseFileTableName method") + mmListEmbeddingsByKbFileUID.mock.inspectFuncListEmbeddingsByKbFileUID = f + + return mmListEmbeddingsByKbFileUID +} + +// Return sets up results that will be returned by RepositoryI.ListEmbeddingsByKbFileUID +func (mmListEmbeddingsByKbFileUID *mRepositoryIMockListEmbeddingsByKbFileUID) Return(ea1 []mm_repository.Embedding, err error) *RepositoryIMock { + if mmListEmbeddingsByKbFileUID.mock.funcListEmbeddingsByKbFileUID != nil { + mmListEmbeddingsByKbFileUID.mock.t.Fatalf("RepositoryIMock.ListEmbeddingsByKbFileUID mock is already set by Set") } - mmKnowledgeBaseFileTableName.mock.funcKnowledgeBaseFileTableName = f - return mmKnowledgeBaseFileTableName.mock + if mmListEmbeddingsByKbFileUID.defaultExpectation == nil { + mmListEmbeddingsByKbFileUID.defaultExpectation = &RepositoryIMockListEmbeddingsByKbFileUIDExpectation{mock: mmListEmbeddingsByKbFileUID.mock} + } + mmListEmbeddingsByKbFileUID.defaultExpectation.results = &RepositoryIMockListEmbeddingsByKbFileUIDResults{ea1, err} + return mmListEmbeddingsByKbFileUID.mock } -// Times sets number of times RepositoryI.KnowledgeBaseFileTableName should be invoked -func (mmKnowledgeBaseFileTableName *mRepositoryIMockKnowledgeBaseFileTableName) Times(n uint64) *mRepositoryIMockKnowledgeBaseFileTableName { +// Set uses given function f to mock the RepositoryI.ListEmbeddingsByKbFileUID method +func (mmListEmbeddingsByKbFileUID *mRepositoryIMockListEmbeddingsByKbFileUID) Set(f func(ctx context.Context, kbFileUID uuid.UUID) (ea1 []mm_repository.Embedding, err error)) *RepositoryIMock { + if mmListEmbeddingsByKbFileUID.defaultExpectation != nil { + mmListEmbeddingsByKbFileUID.mock.t.Fatalf("Default expectation is already set for the RepositoryI.ListEmbeddingsByKbFileUID method") + } + + if len(mmListEmbeddingsByKbFileUID.expectations) > 0 { + mmListEmbeddingsByKbFileUID.mock.t.Fatalf("Some expectations are already set for the RepositoryI.ListEmbeddingsByKbFileUID method") + } + + mmListEmbeddingsByKbFileUID.mock.funcListEmbeddingsByKbFileUID = f + return mmListEmbeddingsByKbFileUID.mock +} + +// When sets expectation for the RepositoryI.ListEmbeddingsByKbFileUID which will trigger the result defined by the following +// Then helper +func (mmListEmbeddingsByKbFileUID *mRepositoryIMockListEmbeddingsByKbFileUID) When(ctx context.Context, kbFileUID uuid.UUID) *RepositoryIMockListEmbeddingsByKbFileUIDExpectation { + if mmListEmbeddingsByKbFileUID.mock.funcListEmbeddingsByKbFileUID != nil { + mmListEmbeddingsByKbFileUID.mock.t.Fatalf("RepositoryIMock.ListEmbeddingsByKbFileUID mock is already set by Set") + } + + expectation := &RepositoryIMockListEmbeddingsByKbFileUIDExpectation{ + mock: mmListEmbeddingsByKbFileUID.mock, + params: &RepositoryIMockListEmbeddingsByKbFileUIDParams{ctx, kbFileUID}, + } + mmListEmbeddingsByKbFileUID.expectations = append(mmListEmbeddingsByKbFileUID.expectations, expectation) + return expectation +} + +// Then sets up RepositoryI.ListEmbeddingsByKbFileUID return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockListEmbeddingsByKbFileUIDExpectation) Then(ea1 []mm_repository.Embedding, err error) *RepositoryIMock { + e.results = &RepositoryIMockListEmbeddingsByKbFileUIDResults{ea1, err} + return e.mock +} + +// Times sets number of times RepositoryI.ListEmbeddingsByKbFileUID should be invoked +func (mmListEmbeddingsByKbFileUID *mRepositoryIMockListEmbeddingsByKbFileUID) Times(n uint64) *mRepositoryIMockListEmbeddingsByKbFileUID { if n == 0 { - mmKnowledgeBaseFileTableName.mock.t.Fatalf("Times of RepositoryIMock.KnowledgeBaseFileTableName mock can not be zero") + mmListEmbeddingsByKbFileUID.mock.t.Fatalf("Times of RepositoryIMock.ListEmbeddingsByKbFileUID mock can not be zero") } - mm_atomic.StoreUint64(&mmKnowledgeBaseFileTableName.expectedInvocations, n) - return mmKnowledgeBaseFileTableName + mm_atomic.StoreUint64(&mmListEmbeddingsByKbFileUID.expectedInvocations, n) + return mmListEmbeddingsByKbFileUID } -func (mmKnowledgeBaseFileTableName *mRepositoryIMockKnowledgeBaseFileTableName) invocationsDone() bool { - if len(mmKnowledgeBaseFileTableName.expectations) == 0 && mmKnowledgeBaseFileTableName.defaultExpectation == nil && mmKnowledgeBaseFileTableName.mock.funcKnowledgeBaseFileTableName == nil { +func (mmListEmbeddingsByKbFileUID *mRepositoryIMockListEmbeddingsByKbFileUID) invocationsDone() bool { + if len(mmListEmbeddingsByKbFileUID.expectations) == 0 && mmListEmbeddingsByKbFileUID.defaultExpectation == nil && mmListEmbeddingsByKbFileUID.mock.funcListEmbeddingsByKbFileUID == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmKnowledgeBaseFileTableName.mock.afterKnowledgeBaseFileTableNameCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmKnowledgeBaseFileTableName.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmListEmbeddingsByKbFileUID.mock.afterListEmbeddingsByKbFileUIDCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmListEmbeddingsByKbFileUID.expectedInvocations) return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) } -// KnowledgeBaseFileTableName implements repository.RepositoryI -func (mmKnowledgeBaseFileTableName *RepositoryIMock) KnowledgeBaseFileTableName() (s1 string) { - mm_atomic.AddUint64(&mmKnowledgeBaseFileTableName.beforeKnowledgeBaseFileTableNameCounter, 1) - defer mm_atomic.AddUint64(&mmKnowledgeBaseFileTableName.afterKnowledgeBaseFileTableNameCounter, 1) +// ListEmbeddingsByKbFileUID implements repository.RepositoryI +func (mmListEmbeddingsByKbFileUID *RepositoryIMock) ListEmbeddingsByKbFileUID(ctx context.Context, kbFileUID uuid.UUID) (ea1 []mm_repository.Embedding, err error) { + mm_atomic.AddUint64(&mmListEmbeddingsByKbFileUID.beforeListEmbeddingsByKbFileUIDCounter, 1) + defer mm_atomic.AddUint64(&mmListEmbeddingsByKbFileUID.afterListEmbeddingsByKbFileUIDCounter, 1) - if mmKnowledgeBaseFileTableName.inspectFuncKnowledgeBaseFileTableName != nil { - mmKnowledgeBaseFileTableName.inspectFuncKnowledgeBaseFileTableName() + if mmListEmbeddingsByKbFileUID.inspectFuncListEmbeddingsByKbFileUID != nil { + mmListEmbeddingsByKbFileUID.inspectFuncListEmbeddingsByKbFileUID(ctx, kbFileUID) } - if mmKnowledgeBaseFileTableName.KnowledgeBaseFileTableNameMock.defaultExpectation != nil { - mm_atomic.AddUint64(&mmKnowledgeBaseFileTableName.KnowledgeBaseFileTableNameMock.defaultExpectation.Counter, 1) + mm_params := RepositoryIMockListEmbeddingsByKbFileUIDParams{ctx, kbFileUID} - mm_results := mmKnowledgeBaseFileTableName.KnowledgeBaseFileTableNameMock.defaultExpectation.results + // Record call args + mmListEmbeddingsByKbFileUID.ListEmbeddingsByKbFileUIDMock.mutex.Lock() + mmListEmbeddingsByKbFileUID.ListEmbeddingsByKbFileUIDMock.callArgs = append(mmListEmbeddingsByKbFileUID.ListEmbeddingsByKbFileUIDMock.callArgs, &mm_params) + mmListEmbeddingsByKbFileUID.ListEmbeddingsByKbFileUIDMock.mutex.Unlock() + + for _, e := range mmListEmbeddingsByKbFileUID.ListEmbeddingsByKbFileUIDMock.expectations { + if minimock.Equal(*e.params, mm_params) { + mm_atomic.AddUint64(&e.Counter, 1) + return e.results.ea1, e.results.err + } + } + + if mmListEmbeddingsByKbFileUID.ListEmbeddingsByKbFileUIDMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmListEmbeddingsByKbFileUID.ListEmbeddingsByKbFileUIDMock.defaultExpectation.Counter, 1) + mm_want := mmListEmbeddingsByKbFileUID.ListEmbeddingsByKbFileUIDMock.defaultExpectation.params + mm_want_ptrs := mmListEmbeddingsByKbFileUID.ListEmbeddingsByKbFileUIDMock.defaultExpectation.paramPtrs + + mm_got := RepositoryIMockListEmbeddingsByKbFileUIDParams{ctx, kbFileUID} + + if mm_want_ptrs != nil { + + if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { + mmListEmbeddingsByKbFileUID.t.Errorf("RepositoryIMock.ListEmbeddingsByKbFileUID got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) + } + + if mm_want_ptrs.kbFileUID != nil && !minimock.Equal(*mm_want_ptrs.kbFileUID, mm_got.kbFileUID) { + mmListEmbeddingsByKbFileUID.t.Errorf("RepositoryIMock.ListEmbeddingsByKbFileUID got unexpected parameter kbFileUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.kbFileUID, mm_got.kbFileUID, minimock.Diff(*mm_want_ptrs.kbFileUID, mm_got.kbFileUID)) + } + + } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { + mmListEmbeddingsByKbFileUID.t.Errorf("RepositoryIMock.ListEmbeddingsByKbFileUID got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + } + + mm_results := mmListEmbeddingsByKbFileUID.ListEmbeddingsByKbFileUIDMock.defaultExpectation.results if mm_results == nil { - mmKnowledgeBaseFileTableName.t.Fatal("No results are set for the RepositoryIMock.KnowledgeBaseFileTableName") + mmListEmbeddingsByKbFileUID.t.Fatal("No results are set for the RepositoryIMock.ListEmbeddingsByKbFileUID") } - return (*mm_results).s1 + return (*mm_results).ea1, (*mm_results).err } - if mmKnowledgeBaseFileTableName.funcKnowledgeBaseFileTableName != nil { - return mmKnowledgeBaseFileTableName.funcKnowledgeBaseFileTableName() + if mmListEmbeddingsByKbFileUID.funcListEmbeddingsByKbFileUID != nil { + return mmListEmbeddingsByKbFileUID.funcListEmbeddingsByKbFileUID(ctx, kbFileUID) } - mmKnowledgeBaseFileTableName.t.Fatalf("Unexpected call to RepositoryIMock.KnowledgeBaseFileTableName.") + mmListEmbeddingsByKbFileUID.t.Fatalf("Unexpected call to RepositoryIMock.ListEmbeddingsByKbFileUID. %v %v", ctx, kbFileUID) return } -// KnowledgeBaseFileTableNameAfterCounter returns a count of finished RepositoryIMock.KnowledgeBaseFileTableName invocations -func (mmKnowledgeBaseFileTableName *RepositoryIMock) KnowledgeBaseFileTableNameAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmKnowledgeBaseFileTableName.afterKnowledgeBaseFileTableNameCounter) +// ListEmbeddingsByKbFileUIDAfterCounter returns a count of finished RepositoryIMock.ListEmbeddingsByKbFileUID invocations +func (mmListEmbeddingsByKbFileUID *RepositoryIMock) ListEmbeddingsByKbFileUIDAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmListEmbeddingsByKbFileUID.afterListEmbeddingsByKbFileUIDCounter) } -// KnowledgeBaseFileTableNameBeforeCounter returns a count of RepositoryIMock.KnowledgeBaseFileTableName invocations -func (mmKnowledgeBaseFileTableName *RepositoryIMock) KnowledgeBaseFileTableNameBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmKnowledgeBaseFileTableName.beforeKnowledgeBaseFileTableNameCounter) +// ListEmbeddingsByKbFileUIDBeforeCounter returns a count of RepositoryIMock.ListEmbeddingsByKbFileUID invocations +func (mmListEmbeddingsByKbFileUID *RepositoryIMock) ListEmbeddingsByKbFileUIDBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmListEmbeddingsByKbFileUID.beforeListEmbeddingsByKbFileUIDCounter) } -// MinimockKnowledgeBaseFileTableNameDone returns true if the count of the KnowledgeBaseFileTableName invocations corresponds +// Calls returns a list of arguments used in each call to RepositoryIMock.ListEmbeddingsByKbFileUID. +// The list is in the same order as the calls were made (i.e. recent calls have a higher index) +func (mmListEmbeddingsByKbFileUID *mRepositoryIMockListEmbeddingsByKbFileUID) Calls() []*RepositoryIMockListEmbeddingsByKbFileUIDParams { + mmListEmbeddingsByKbFileUID.mutex.RLock() + + argCopy := make([]*RepositoryIMockListEmbeddingsByKbFileUIDParams, len(mmListEmbeddingsByKbFileUID.callArgs)) + copy(argCopy, mmListEmbeddingsByKbFileUID.callArgs) + + mmListEmbeddingsByKbFileUID.mutex.RUnlock() + + return argCopy +} + +// MinimockListEmbeddingsByKbFileUIDDone returns true if the count of the ListEmbeddingsByKbFileUID invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockKnowledgeBaseFileTableNameDone() bool { - for _, e := range m.KnowledgeBaseFileTableNameMock.expectations { +func (m *RepositoryIMock) MinimockListEmbeddingsByKbFileUIDDone() bool { + for _, e := range m.ListEmbeddingsByKbFileUIDMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.KnowledgeBaseFileTableNameMock.invocationsDone() + return m.ListEmbeddingsByKbFileUIDMock.invocationsDone() } -// MinimockKnowledgeBaseFileTableNameInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockKnowledgeBaseFileTableNameInspect() { - for _, e := range m.KnowledgeBaseFileTableNameMock.expectations { +// MinimockListEmbeddingsByKbFileUIDInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockListEmbeddingsByKbFileUIDInspect() { + for _, e := range m.ListEmbeddingsByKbFileUIDMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { - m.t.Error("Expected call to RepositoryIMock.KnowledgeBaseFileTableName") + m.t.Errorf("Expected call to RepositoryIMock.ListEmbeddingsByKbFileUID with params: %#v", *e.params) } } - afterKnowledgeBaseFileTableNameCounter := mm_atomic.LoadUint64(&m.afterKnowledgeBaseFileTableNameCounter) + afterListEmbeddingsByKbFileUIDCounter := mm_atomic.LoadUint64(&m.afterListEmbeddingsByKbFileUIDCounter) // if default expectation was set then invocations count should be greater than zero - if m.KnowledgeBaseFileTableNameMock.defaultExpectation != nil && afterKnowledgeBaseFileTableNameCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.KnowledgeBaseFileTableName") + if m.ListEmbeddingsByKbFileUIDMock.defaultExpectation != nil && afterListEmbeddingsByKbFileUIDCounter < 1 { + if m.ListEmbeddingsByKbFileUIDMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.ListEmbeddingsByKbFileUID") + } else { + m.t.Errorf("Expected call to RepositoryIMock.ListEmbeddingsByKbFileUID with params: %#v", *m.ListEmbeddingsByKbFileUIDMock.defaultExpectation.params) + } } // if func was set then invocations count should be greater than zero - if m.funcKnowledgeBaseFileTableName != nil && afterKnowledgeBaseFileTableNameCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.KnowledgeBaseFileTableName") + if m.funcListEmbeddingsByKbFileUID != nil && afterListEmbeddingsByKbFileUIDCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.ListEmbeddingsByKbFileUID") } - if !m.KnowledgeBaseFileTableNameMock.invocationsDone() && afterKnowledgeBaseFileTableNameCounter > 0 { - m.t.Errorf("Expected %d calls to RepositoryIMock.KnowledgeBaseFileTableName but found %d calls", - mm_atomic.LoadUint64(&m.KnowledgeBaseFileTableNameMock.expectedInvocations), afterKnowledgeBaseFileTableNameCounter) + if !m.ListEmbeddingsByKbFileUIDMock.invocationsDone() && afterListEmbeddingsByKbFileUIDCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.ListEmbeddingsByKbFileUID but found %d calls", + mm_atomic.LoadUint64(&m.ListEmbeddingsByKbFileUIDMock.expectedInvocations), afterListEmbeddingsByKbFileUIDCounter) } } @@ -12522,6 +15341,10 @@ func (m *RepositoryIMock) MinimockFinish() { m.MinimockCreateKnowledgeBaseFileInspect() + m.MinimockDeleteAllConvertedFilesinKbInspect() + + m.MinimockDeleteAllKnowledgeBaseFilesInspect() + m.MinimockDeleteAndCreateChunksInspect() m.MinimockDeleteChunksBySourceInspect() @@ -12570,10 +15393,24 @@ func (m *RepositoryIMock) MinimockFinish() { m.MinimockGetTruthSourceByFileUIDInspect() + m.MinimockHardDeleteChunksByKbFileUIDInspect() + + m.MinimockHardDeleteChunksByKbUIDInspect() + + m.MinimockHardDeleteConvertedFileByFileUIDInspect() + + m.MinimockHardDeleteEmbeddingsByKbFileUIDInspect() + + m.MinimockHardDeleteEmbeddingsByKbUIDInspect() + m.MinimockIncreaseKnowledgeBaseUsageInspect() m.MinimockKnowledgeBaseFileTableNameInspect() + m.MinimockListChunksByKbFileUIDInspect() + + m.MinimockListEmbeddingsByKbFileUIDInspect() + m.MinimockListKnowledgeBaseFilesInspect() m.MinimockListKnowledgeBasesInspect() @@ -12619,6 +15456,8 @@ func (m *RepositoryIMock) minimockDone() bool { m.MinimockCreateConvertedFileDone() && m.MinimockCreateKnowledgeBaseDone() && m.MinimockCreateKnowledgeBaseFileDone() && + m.MinimockDeleteAllConvertedFilesinKbDone() && + m.MinimockDeleteAllKnowledgeBaseFilesDone() && m.MinimockDeleteAndCreateChunksDone() && m.MinimockDeleteChunksBySourceDone() && m.MinimockDeleteChunksByUIDsDone() && @@ -12643,8 +15482,15 @@ func (m *RepositoryIMock) minimockDone() bool { m.MinimockGetTotalChunksBySourcesDone() && m.MinimockGetTotalTokensByListKBUIDsDone() && m.MinimockGetTruthSourceByFileUIDDone() && + m.MinimockHardDeleteChunksByKbFileUIDDone() && + m.MinimockHardDeleteChunksByKbUIDDone() && + m.MinimockHardDeleteConvertedFileByFileUIDDone() && + m.MinimockHardDeleteEmbeddingsByKbFileUIDDone() && + m.MinimockHardDeleteEmbeddingsByKbUIDDone() && m.MinimockIncreaseKnowledgeBaseUsageDone() && m.MinimockKnowledgeBaseFileTableNameDone() && + m.MinimockListChunksByKbFileUIDDone() && + m.MinimockListEmbeddingsByKbFileUIDDone() && m.MinimockListKnowledgeBaseFilesDone() && m.MinimockListKnowledgeBasesDone() && m.MinimockProcessKnowledgeBaseFilesDone() && diff --git a/pkg/repository/chunk.go b/pkg/repository/chunk.go index aebfb07..4b9796a 100644 --- a/pkg/repository/chunk.go +++ b/pkg/repository/chunk.go @@ -17,9 +17,14 @@ type TextChunkI interface { DeleteAndCreateChunks(ctx context.Context, sourceTable string, sourceUID uuid.UUID, chunks []*TextChunk, externalServiceCall func(chunkUIDs []string) (map[string]any, error)) ([]*TextChunk, error) DeleteChunksBySource(ctx context.Context, sourceTable string, sourceUID uuid.UUID) error DeleteChunksByUIDs(ctx context.Context, chunkUIDs []uuid.UUID) error + // HardDeleteChunksByKbUID deletes all the chunks associated with a certain kbUID. + HardDeleteChunksByKbUID(ctx context.Context, kbUID uuid.UUID) error + // HardDeleteChunksByKbFileUID deletes all the chunks associated with a certain kbFileUID. + HardDeleteChunksByKbFileUID(ctx context.Context, kbFileUID uuid.UUID) error GetTextChunksBySource(ctx context.Context, sourceTable string, sourceUID uuid.UUID) ([]TextChunk, error) GetChunksByUIDs(ctx context.Context, chunkUIDs []uuid.UUID) ([]TextChunk, error) GetTotalTokensByListKBUIDs(ctx context.Context, kbUIDs []uuid.UUID) (map[uuid.UUID]int, error) + ListChunksByKbFileUID(ctx context.Context, kbFileUID uuid.UUID) ([]TextChunk, error) GetFilesTotalTokens(ctx context.Context, sources map[FileUID]struct { SourceTable SourceTable SourceUID SourceUID @@ -66,6 +71,8 @@ type TextChunkColumns struct { Order string CreateTime string UpdateTime string + KbUID string + KbFileUID string } var TextChunkColumn = TextChunkColumns{ @@ -80,6 +87,8 @@ var TextChunkColumn = TextChunkColumns{ Order: "in_order", CreateTime: "create_time", UpdateTime: "update_time", + KbUID: "kb_uid", + KbFileUID: "kb_file_uid", } // TableName returns the table name of the TextChunk @@ -338,3 +347,25 @@ func (r *Repository) GetChunksByUIDs(ctx context.Context, chunkUIDs []uuid.UUID) } return chunks, nil } + +// HardDeleteChunksByKbUID deletes all the chunks associated with a certain kbUID. +func (r *Repository) HardDeleteChunksByKbUID(ctx context.Context, kbUID uuid.UUID) error { + where := fmt.Sprintf("%s = ?", TextChunkColumn.KbUID) + return r.db.WithContext(ctx).Where(where, kbUID).Unscoped().Delete(&TextChunk{}).Error +} + +// ListChunksByKbFileUID returns the list of chunks by kbFileUID +func (r *Repository) ListChunksByKbFileUID(ctx context.Context, kbFileUID uuid.UUID) ([]TextChunk, error) { + var chunks []TextChunk + where := fmt.Sprintf("%s = ?", TextChunkColumn.KbFileUID) + if err := r.db.WithContext(ctx).Where(where, kbFileUID).Find(&chunks).Error; err != nil { + return nil, err + } + return chunks, nil +} + +// HardDeleteChunksByKbFileUID deletes all the chunks associated with a certain kbFileUID. +func (r *Repository) HardDeleteChunksByKbFileUID(ctx context.Context, kbFileUID uuid.UUID) error { + where := fmt.Sprintf("%s = ?", TextChunkColumn.KbFileUID) + return r.db.WithContext(ctx).Where(where, kbFileUID).Unscoped().Delete(&TextChunk{}).Error +} diff --git a/pkg/repository/convertedfile.go b/pkg/repository/convertedfile.go index 7befb70..6ee3fac 100644 --- a/pkg/repository/convertedfile.go +++ b/pkg/repository/convertedfile.go @@ -14,6 +14,8 @@ type ConvertedFileI interface { ConvertedFileTableName() string CreateConvertedFile(ctx context.Context, cf ConvertedFile, callExternalService func(convertedFileUID uuid.UUID) (map[string]any, error)) (*ConvertedFile, error) DeleteConvertedFile(ctx context.Context, uid uuid.UUID) error + DeleteAllConvertedFilesinKb(ctx context.Context, kbUID uuid.UUID) error + HardDeleteConvertedFileByFileUID(ctx context.Context, fileUID uuid.UUID) error GetConvertedFileByFileUID(ctx context.Context, fileUID uuid.UUID) (*ConvertedFile, error) } @@ -137,6 +139,22 @@ func (r *Repository) DeleteConvertedFile(ctx context.Context, uid uuid.UUID) err return nil } +// DeleteAllConvertedFilesinKb deletes all the records in the knowledge base +func (r *Repository) DeleteAllConvertedFilesinKb(ctx context.Context, kbUID uuid.UUID) error { + err := r.db.Transaction(func(tx *gorm.DB) error { + // Specify the condition to find the record by its UID + where := fmt.Sprintf("%s = ?", ConvertedFileColumn.KbUID) + if err := tx.Where(where, kbUID).Delete(&ConvertedFile{}).Error; err != nil { + return err + } + return nil + }) + if err != nil { + return err + } + return nil +} + // UpdateConvertedFile updates the record by UID using update map. func (r *Repository) UpdateConvertedFile(ctx context.Context, uid uuid.UUID, update map[string]any) error { // Specify the condition to find the record by its UID @@ -146,3 +164,13 @@ func (r *Repository) UpdateConvertedFile(ctx context.Context, uid uuid.UUID, upd } return nil } + +// HardDeleteConvertedFileByFileUID deletes the record by file UID +func (r *Repository) HardDeleteConvertedFileByFileUID(ctx context.Context, fileUID uuid.UUID) error { + // Specify the condition to find the record by its UID + where := fmt.Sprintf("%s = ?", ConvertedFileColumn.FileUID) + if err := r.db.WithContext(ctx).Where(where, fileUID).Unscoped().Delete(&ConvertedFile{}).Error; err != nil { + return err + } + return nil +} diff --git a/pkg/repository/embedding.go b/pkg/repository/embedding.go index bc0afa7..4a3a975 100644 --- a/pkg/repository/embedding.go +++ b/pkg/repository/embedding.go @@ -18,8 +18,11 @@ type EmbeddingI interface { UpsertEmbeddings(ctx context.Context, embeddings []Embedding, externalServiceCall func(embUIDs []string) error) ([]Embedding, error) DeleteEmbeddingsBySource(ctx context.Context, sourceTable string, sourceUID uuid.UUID) error DeleteEmbeddingsByUIDs(ctx context.Context, embUIDs []uuid.UUID) error + HardDeleteEmbeddingsByKbUID(ctx context.Context, kbUID uuid.UUID) error + HardDeleteEmbeddingsByKbFileUID(ctx context.Context, kbFileUID uuid.UUID) error // GetEmbeddingByUIDs fetches embeddings by their UIDs. GetEmbeddingByUIDs(ctx context.Context, embUIDs []uuid.UUID) ([]Embedding, error) + ListEmbeddingsByKbFileUID(ctx context.Context, kbFileUID uuid.UUID) ([]Embedding, error) } type Embedding struct { UID uuid.UUID `gorm:"column:uid;type:uuid;default:gen_random_uuid();primaryKey" json:"uid"` @@ -92,6 +95,8 @@ type EmbeddingColumns struct { Collection string CreateTime string UpdateTime string + KbUID string + KbFileUID string } var EmbeddingColumn = EmbeddingColumns{ @@ -102,6 +107,8 @@ var EmbeddingColumn = EmbeddingColumns{ Collection: "collection", CreateTime: "create_time", UpdateTime: "update_time", + KbUID: "kb_uid", + KbFileUID: "kb_file_uid", } // TableName returns the table name of the Embedding @@ -173,3 +180,25 @@ func (r *Repository) GetEmbeddingByUIDs(ctx context.Context, embUIDs []uuid.UUID } return embeddings, nil } + +// HardDeleteEmbeddingsByKbUID deletes all the embeddings associated with a certain kbUID. +func (r *Repository) HardDeleteEmbeddingsByKbUID(ctx context.Context, kbUID uuid.UUID) error { + where := fmt.Sprintf("%s = ?", EmbeddingColumn.KbUID) + return r.db.WithContext(ctx).Where(where, kbUID).Unscoped().Delete(&Embedding{}).Error +} + +// HardDeleteEmbeddingsByKbFileUID deletes all the embeddings associated with a certain kbFileUID. +func (r *Repository) HardDeleteEmbeddingsByKbFileUID(ctx context.Context, kbFileUID uuid.UUID) error { + where := fmt.Sprintf("%s = ?", EmbeddingColumn.KbFileUID) + return r.db.WithContext(ctx).Where(where, kbFileUID).Unscoped().Delete(&Embedding{}).Error +} + +// ListEmbeddingsByKbFileUID fetches embeddings by their kbFileUID. +func (r *Repository) ListEmbeddingsByKbFileUID(ctx context.Context, kbFileUID uuid.UUID) ([]Embedding, error) { + var embeddings []Embedding + where := fmt.Sprintf("%s = ?", EmbeddingColumn.KbFileUID) + if err := r.db.WithContext(ctx).Where(where, kbFileUID).Find(&embeddings).Error; err != nil { + return nil, err + } + return embeddings, nil +} diff --git a/pkg/repository/knowledgebasefile.go b/pkg/repository/knowledgebasefile.go index adfe2f2..e24f5e0 100644 --- a/pkg/repository/knowledgebasefile.go +++ b/pkg/repository/knowledgebasefile.go @@ -23,6 +23,8 @@ type KnowledgeBaseFileI interface { ListKnowledgeBaseFiles(ctx context.Context, uid string, ownerUID string, kbUID string, pageSize int32, nextPageToken string, filesUID []string) ([]KnowledgeBaseFile, int, string, error) // DeleteKnowledgeBaseFile deletes the knowledge base file by file UID DeleteKnowledgeBaseFile(ctx context.Context, fileUID string) error + // DeleteAllKnowledgeBaseFiles deletes all files in the knowledge base + DeleteAllKnowledgeBaseFiles(ctx context.Context, kbUID string) error // ProcessKnowledgeBaseFiles updates the process status of the files ProcessKnowledgeBaseFiles(ctx context.Context, fileUids []string) ([]KnowledgeBaseFile, error) // GetNeedProcessFiles returns the files that are not yet processed @@ -263,6 +265,17 @@ func (r *Repository) DeleteKnowledgeBaseFile(ctx context.Context, fileUID string return nil } +// hard delete all files in the knowledge base +func (r *Repository) DeleteAllKnowledgeBaseFiles(ctx context.Context, kbUID string) error { + whereClause := fmt.Sprintf("%v = ?", KnowledgeBaseFileColumn.KnowledgeBaseUID) + if err := r.db.WithContext(ctx).Model(&KnowledgeBaseFile{}). + Where(whereClause, kbUID). + Delete(&KnowledgeBaseFile{}).Error; err != nil { + return err + } + return nil +} + // ProcessKnowledgeBaseFiles updates the process status of the files func (r *Repository) ProcessKnowledgeBaseFiles(ctx context.Context, fileUIDs []string) ([]KnowledgeBaseFile, error) { // Update the process status of the files diff --git a/pkg/service/pipeline.go b/pkg/service/pipeline.go index 4444ca3..0e5ab4e 100644 --- a/pkg/service/pipeline.go +++ b/pkg/service/pipeline.go @@ -51,7 +51,7 @@ func (s *Service) ConvertPDFToMD(ctx context.Context, caller uuid.UUID, pdfBase6 result, err := getConvertResult(resp) if err != nil { logger.Error("failed to get convert result", zap.Error(err)) - return "", err + return "", fmt.Errorf("failed to get convert result: %w", err) } return result, nil } @@ -162,7 +162,7 @@ func (s *Service) SplitText(ctx context.Context, caller uuid.UUID, text string) } result, err := GetChunksFromResponse(res) if err != nil { - return nil, err + return nil, fmt.Errorf("failed to get chunks from response: %w", err) } return result, nil } @@ -202,7 +202,7 @@ func (s *Service) VectorizeText(ctx context.Context, caller uuid.UUID, texts []s } result, err := GetVectorFromResponse(res) if err != nil { - return nil, err + return nil, fmt.Errorf("failed to get vector from response: %w", err) } allResults = append(allResults, result...) } diff --git a/pkg/worker/worker.go b/pkg/worker/worker.go index c11d8d9..3f33086 100644 --- a/pkg/worker/worker.go +++ b/pkg/worker/worker.go @@ -280,14 +280,14 @@ func (wp *fileToEmbWorkerPool) processFile(ctx context.Context, file repository. case artifactpb.FileProcessStatus_FILE_PROCESS_STATUS_WAITING: updatedFile, nextStatus, err := wp.processWaitingFile(ctx, file) if err != nil { - return err + return fmt.Errorf("error processing waiting file: %w", err) } status = nextStatus file = *updatedFile case artifactpb.FileProcessStatus_FILE_PROCESS_STATUS_CONVERTING: updatedFile, nextStatus, err := wp.processConvertingFile(ctx, file) if err != nil { - return err + return fmt.Errorf("error processing converting file: %w", err) } status = nextStatus file = *updatedFile @@ -295,7 +295,7 @@ func (wp *fileToEmbWorkerPool) processFile(ctx context.Context, file repository. case artifactpb.FileProcessStatus_FILE_PROCESS_STATUS_CHUNKING: updatedFile, nextStatus, err := wp.processChunkingFile(ctx, file) if err != nil { - return err + return fmt.Errorf("error processing chunking file: %w", err) } status = nextStatus file = *updatedFile @@ -303,7 +303,7 @@ func (wp *fileToEmbWorkerPool) processFile(ctx context.Context, file repository. case artifactpb.FileProcessStatus_FILE_PROCESS_STATUS_EMBEDDING: updatedFile, nextStatus, err := wp.processEmbeddingFile(ctx, file) if err != nil { - return err + return fmt.Errorf("error processing embedding file: %w", err) } status = nextStatus file = *updatedFile