diff --git a/cmd/main/main.go b/cmd/main/main.go index 3cf41ba..b9c3eb0 100644 --- a/cmd/main/main.go +++ b/cmd/main/main.go @@ -83,6 +83,10 @@ func grpcHandlerFunc(grpcServer *grpc.Server, gwHandler http.Handler) http.Handl } func main() { + // gorm's autoUpdate will use local timezone by default, so we need to set it to UTC + time.Local = time.UTC + + // Initialize config if err := config.Init(); err != nil { log.Fatal(err.Error()) } diff --git a/config/config.yaml b/config/config.yaml index 0ec7d75..321615f 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -22,7 +22,7 @@ database: host: pg-sql port: 5432 name: artifact - version: 14 + version: 15 timezone: Etc/UTC pool: idleconnections: 5 diff --git a/go.mod b/go.mod index 065c310..e460893 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 github.com/influxdata/influxdb-client-go/v2 v2.12.3 - github.com/instill-ai/protogen-go v0.3.3-alpha.0.20240808093014-75008c807ea7 + github.com/instill-ai/protogen-go v0.3.3-alpha.0.20240816101745-44cbb332d242 github.com/instill-ai/usage-client v0.3.0-alpha.0.20240319060111-4a3a39f2fd61 github.com/instill-ai/x v0.3.0-alpha.0.20231219052200-6230a89e386c github.com/knadh/koanf v1.5.0 diff --git a/go.sum b/go.sum index 8e4affb..e7c4650 100644 --- a/go.sum +++ b/go.sum @@ -342,8 +342,8 @@ github.com/influxdata/influxdb-client-go/v2 v2.12.3 h1:28nRlNMRIV4QbtIUvxhWqaxn0 github.com/influxdata/influxdb-client-go/v2 v2.12.3/go.mod h1:IrrLUbCjjfkmRuaCiGQg4m2GbkaeJDcuWoxiWdQEbA0= github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839 h1:W9WBk7wlPfJLvMCdtV4zPulc4uCPrlywQOmbFOhgQNU= github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= -github.com/instill-ai/protogen-go v0.3.3-alpha.0.20240808093014-75008c807ea7 h1:2uF3AxjNM8EgRIVViitAoX6qr/aTaO2wrr8pk9CCp+I= -github.com/instill-ai/protogen-go v0.3.3-alpha.0.20240808093014-75008c807ea7/go.mod h1:2blmpUwiTwxIDnrjIqT6FhR5ewshZZF554wzjXFvKpQ= +github.com/instill-ai/protogen-go v0.3.3-alpha.0.20240816101745-44cbb332d242 h1:4mP3CToV4oO5MkzAVVbcGqoMNS49AiaT0biNNv805Vs= +github.com/instill-ai/protogen-go v0.3.3-alpha.0.20240816101745-44cbb332d242/go.mod h1:2blmpUwiTwxIDnrjIqT6FhR5ewshZZF554wzjXFvKpQ= github.com/instill-ai/usage-client v0.3.0-alpha.0.20240319060111-4a3a39f2fd61 h1:smPTvmXDhn/QC7y/TPXyMTqbbRd0gvzmFgWBChwTfhE= github.com/instill-ai/usage-client v0.3.0-alpha.0.20240319060111-4a3a39f2fd61/go.mod h1:/TAHs4ybuylk5icuy+MQtHRc4XUnIyXzeNKxX9qDFhw= github.com/instill-ai/x v0.3.0-alpha.0.20231219052200-6230a89e386c h1:a2RVkpIV2QcrGnSHAou+t/L+vBsaIfFvk5inVg5Uh4s= diff --git a/pkg/acl/acl.go b/pkg/acl/acl.go index b0b4826..a80629d 100644 --- a/pkg/acl/acl.go +++ b/pkg/acl/acl.go @@ -40,6 +40,8 @@ type Relation struct { Relation string } +const CatalogObject = "knowledgebase" + func NewACLClient(wc openfga.OpenFGAServiceClient, rc openfga.OpenFGAServiceClient, redisClient *redis.Client) ACLClient { if rc == nil { rc = wc diff --git a/pkg/db/migration/000015_create_conversation_and_message_table.down.sql b/pkg/db/migration/000015_create_conversation_and_message_table.down.sql new file mode 100644 index 0000000..bf238e8 --- /dev/null +++ b/pkg/db/migration/000015_create_conversation_and_message_table.down.sql @@ -0,0 +1,9 @@ +BEGIN; + +-- Drop the message table +DROP TABLE IF EXISTS message; + +-- Drop the conversation table +DROP TABLE IF EXISTS conversation; + +COMMIT; diff --git a/pkg/db/migration/000015_create_conversation_and_message_table.up.sql b/pkg/db/migration/000015_create_conversation_and_message_table.up.sql new file mode 100644 index 0000000..32a1ee9 --- /dev/null +++ b/pkg/db/migration/000015_create_conversation_and_message_table.up.sql @@ -0,0 +1,53 @@ +BEGIN; +-- Create the conversation table +CREATE TABLE conversation ( + uid UUID PRIMARY KEY DEFAULT gen_random_uuid(), + namespace_uid UUID NOT NULL, + catalog_uid UUID NOT NULL, + id VARCHAR(255) NOT NULL, + create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + delete_time TIMESTAMP +); +-- Create unique index on namespace_uid, catalog_uid, and id +CREATE UNIQUE INDEX idx_unique_namespace_catalog_id ON conversation (namespace_uid, catalog_uid, id) +WHERE delete_time IS NULL; +-- Create the message table +CREATE TABLE message ( + uid UUID PRIMARY KEY DEFAULT gen_random_uuid(), + namespace_uid UUID NOT NULL, + catalog_uid UUID NOT NULL, + conversation_uid UUID NOT NULL, + content TEXT, + role VARCHAR(50) NOT NULL, + type VARCHAR(50) NOT NULL, + create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + delete_time TIMESTAMP +); +-- Add foreign key constraint with CASCADE DELETE +ALTER TABLE message +ADD CONSTRAINT fk_message_conversation FOREIGN KEY (conversation_uid) REFERENCES conversation(uid) ON DELETE CASCADE; +-- Add index for efficient message retrieval +CREATE INDEX idx_message_catalog_conversation ON message (namespace_uid, catalog_uid, conversation_uid); +-- Add comments +COMMENT ON TABLE conversation IS 'Table to store conversations'; +COMMENT ON COLUMN conversation.uid IS 'Unique identifier(uuid) for the conversation'; +COMMENT ON COLUMN conversation.namespace_uid IS 'Namespace identifier(uuid) for the conversation'; +COMMENT ON COLUMN conversation.catalog_uid IS 'Catalog identifier(uuid) for the conversation'; +COMMENT ON COLUMN conversation.id IS 'User-defined identifier for the conversation'; +COMMENT ON COLUMN conversation.create_time IS 'Timestamp when the conversation was created'; +COMMENT ON COLUMN conversation.update_time IS 'Timestamp when the conversation was last updated'; +COMMENT ON COLUMN conversation.delete_time IS 'Timestamp when the conversation was deleted (soft delete)'; +COMMENT ON TABLE message IS 'Table to store messages within conversations'; +COMMENT ON COLUMN message.uid IS 'Unique identifier(uuid) for the message'; +COMMENT ON COLUMN message.namespace_uid IS 'Namespace identifier(uuid) for the message'; +COMMENT ON COLUMN message.catalog_uid IS 'Catalog identifier(uuid) for the message'; +COMMENT ON COLUMN message.conversation_uid IS 'Reference to the conversation this message belongs to'; +COMMENT ON COLUMN message.content IS 'Content of the message'; +COMMENT ON COLUMN message.role IS 'Role of the message sender (e.g., user, assistant)'; +COMMENT ON COLUMN message.type IS 'Type of the message'; +COMMENT ON COLUMN message.create_time IS 'Timestamp when the message was created'; +COMMENT ON COLUMN message.update_time IS 'Timestamp when the message was last updated'; +COMMENT ON COLUMN message.delete_time IS 'Timestamp when the message was deleted (soft delete)'; +COMMIT; diff --git a/pkg/handler/catalog.go b/pkg/handler/catalog.go index 17cc3b2..36be9dd 100644 --- a/pkg/handler/catalog.go +++ b/pkg/handler/catalog.go @@ -36,7 +36,7 @@ func (ph *PublicHandler) GetFileCatalog(ctx context.Context, req *artifactpb.Get log.Error("failed to get namespace by ns id", zap.Error(err)) return nil, fmt.Errorf("failed to get namespace by ns id. err: %w", err) } - kb, err := ph.service.Repository.GetKnowledgeBaseByOwnerAndKbID(ctx, ns.NsUID.String(), req.CatalogId) + kb, err := ph.service.Repository.GetKnowledgeBaseByOwnerAndKbID(ctx, ns.NsUID, req.CatalogId) if err != nil { log.Error("failed to get knowledge base by owner and kb id", zap.Error(err)) return nil, fmt.Errorf("failed to get catalog by namepsace and catalog id. err: %w", err) diff --git a/pkg/handler/conversation.go b/pkg/handler/conversation.go new file mode 100644 index 0000000..a12dcba --- /dev/null +++ b/pkg/handler/conversation.go @@ -0,0 +1,188 @@ +package handler + +import ( + "context" + "fmt" + + "go.uber.org/zap" + "google.golang.org/protobuf/types/known/timestamppb" + + "github.com/instill-ai/artifact-backend/pkg/customerror" + "github.com/instill-ai/artifact-backend/pkg/logger" + "github.com/instill-ai/artifact-backend/pkg/repository" + artifactpb "github.com/instill-ai/protogen-go/artifact/artifact/v1alpha" +) + +// CreateConversation creates a new conversation +func (ph *PublicHandler) CreateConversation(ctx context.Context, req *artifactpb.CreateConversationRequest) (*artifactpb.CreateConversationResponse, error) { + log, _ := logger.GetZapLogger(ctx) + + // Get user ID from context + authUID, err := getUserUIDFromContext(ctx) + if err != nil { + return nil, fmt.Errorf("failed to get user id from header: %v", err) + } + + nameOk := isValidName(req.GetConversationId()) + if !nameOk { + msg := "the conversation id should be lowercase without any space or special character besides the hyphen, " + + "it can not start with number or hyphen, and should be less than 32 characters. name: %v. err: %w" + return nil, fmt.Errorf(msg, req.GetConversationId(), customerror.ErrInvalidArgument) + } + + // ACL - check user's permission to create conversation in the namespace + ns, catalog, err := ph.service.CheckCatalogUserPermission(ctx, req.GetNamespaceId(), req.GetCatalogId(), authUID) + if err != nil { + log.Error( + "failed to check user permission", + zap.Error(err), + zap.String("namespace_id", req.GetNamespaceId()), + zap.String("auth_uid", authUID), + ) + return nil, fmt.Errorf("failed to check user permission: %w", err) + } + + // Create conversation + conversation, err := ph.service.Repository.CreateConversation(ctx, repository.Conversation{ + NamespaceUID: ns.NsUID, + CatalogUID: catalog.UID, + ID: req.GetConversationId(), + }) + if err != nil { + log.Error("failed to create conversation", zap.Error(err)) + return nil, fmt.Errorf("failed to create conversation: %w", err) + } + + return &artifactpb.CreateConversationResponse{ + Conversation: convertToProtoConversation(conversation, req.GetNamespaceId(), req.GetCatalogId()), + }, nil +} + +// ListConversations lists conversations for a given catalog +func (ph *PublicHandler) ListConversations(ctx context.Context, req *artifactpb.ListConversationsRequest) (*artifactpb.ListConversationsResponse, error) { + log, _ := logger.GetZapLogger(ctx) + + // Get user ID from context + authUID, err := getUserUIDFromContext(ctx) + if err != nil { + return nil, fmt.Errorf("failed to get user id from header: %v", err) + } + + // ACL - check user's permission to list conversations in the catalog + ns, catalog, err := ph.service.CheckCatalogUserPermission(ctx, req.GetNamespaceId(), req.GetCatalogId(), authUID) + if err != nil { + log.Error( + "failed to check user permission", + zap.Error(err), + zap.String("namespace_id", req.GetNamespaceId()), + zap.String("auth_uid", authUID), + ) + return nil, fmt.Errorf("failed to check user permission: %w", err) + } + + // Get conversations + conversations, totalCount, nextPageToken, err := ph.service.Repository.ListConversations(ctx, ns.NsUID, catalog.UID, req.GetPageSize(), req.GetPageToken()) + if err != nil { + log.Error("failed to list conversations", zap.Error(err)) + return nil, fmt.Errorf("failed to list conversations: %w", err) + } + + // Convert to proto conversations + protoConversations := make([]*artifactpb.Conversation, len(conversations)) + for i, conv := range conversations { + protoConversations[i] = convertToProtoConversation(conv, req.GetNamespaceId(), req.GetCatalogId()) + } + + return &artifactpb.ListConversationsResponse{ + Conversations: protoConversations, + NextPageToken: nextPageToken, + TotalSize: int32(totalCount), + }, nil +} + +// UpdateConversation updates an existing conversation +func (ph *PublicHandler) UpdateConversation(ctx context.Context, req *artifactpb.UpdateConversationRequest) (*artifactpb.UpdateConversationResponse, error) { + log, _ := logger.GetZapLogger(ctx) + + // Get user ID from context + authUID, err := getUserUIDFromContext(ctx) + if err != nil { + return nil, fmt.Errorf("failed to get user id from header: %v", err) + } + + // ACL - check user's permission to update conversation in the catalog + ns, catalog, err := ph.service.CheckCatalogUserPermission(ctx, req.GetNamespaceId(), req.GetCatalogId(), authUID) + if err != nil { + log.Error( + "failed to check user permission", + zap.Error(err), + zap.String("namespace_id", req.GetNamespaceId()), + zap.String("auth_uid", authUID), + ) + return nil, fmt.Errorf("failed to check user permission: %w", err) + } + + // Get the existing conversation + existingConv, err := ph.service.Repository.GetConversationByID(ctx, ns.NsUID, catalog.UID, req.GetConversationId()) + if err != nil { + log.Error("failed to get existing conversation", zap.Error(err)) + return nil, fmt.Errorf("failed to get existing conversation: %w", err) + } + + // Update conversation + updatedConv, err := ph.service.Repository.UpdateConversationByUpdateMap(ctx, existingConv.UID, map[string]interface{}{ + repository.ConversationColumn.ID: req.GetNewConversationId(), + }) + if err != nil { + log.Error("failed to update conversation", zap.Error(err)) + return nil, fmt.Errorf("failed to update conversation: %w", err) + } + + return &artifactpb.UpdateConversationResponse{ + Conversation: convertToProtoConversation(updatedConv, req.GetNamespaceId(), req.GetCatalogId()), + }, nil +} + +// DeleteConversation deletes an existing conversation +func (ph *PublicHandler) DeleteConversation(ctx context.Context, req *artifactpb.DeleteConversationRequest) (*artifactpb.DeleteConversationResponse, error) { + log, _ := logger.GetZapLogger(ctx) + + // Get user ID from context + authUID, err := getUserUIDFromContext(ctx) + if err != nil { + return nil, fmt.Errorf("failed to get user id from header: %v", err) + } + + // ACL - check user's permission to delete conversation in the namespace + ns, catalog, err := ph.service.CheckCatalogUserPermission(ctx, req.GetNamespaceId(), req.GetCatalogId(), authUID) + if err != nil { + log.Error( + "failed to check user permission", + zap.Error(err), + zap.String("namespace_id", req.GetNamespaceId()), + zap.String("auth_uid", authUID), + ) + return nil, fmt.Errorf("failed to check user permission: %w", err) + } + // Delete conversation + err = ph.service.Repository.SoftDeleteConversation(ctx, ns.NsUID, catalog.UID, req.GetConversationId()) + if err != nil { + log.Error("failed to delete conversation", zap.Error(err)) + return nil, fmt.Errorf("failed to delete conversation: %w", err) + } + + return &artifactpb.DeleteConversationResponse{}, nil +} + +// Helper function to convert repository.Conversation to artifactpb.Conversation +func convertToProtoConversation(conv *repository.Conversation, nsID, catalogID string) *artifactpb.Conversation { + + return &artifactpb.Conversation{ + Uid: conv.UID.String(), + NamespaceId: nsID, + CatalogId: catalogID, + Id: conv.ID, + CreateTime: timestamppb.New(conv.CreateTime), + UpdateTime: timestamppb.New(conv.UpdateTime), + } +} diff --git a/pkg/handler/knowledgebase.go b/pkg/handler/knowledgebase.go index 8180e96..b3452dd 100644 --- a/pkg/handler/knowledgebase.go +++ b/pkg/handler/knowledgebase.go @@ -87,16 +87,6 @@ func (ph *PublicHandler) CreateCatalog(ctx context.Context, req *artifactpb.Crea return nil, fmt.Errorf(msg, req.Name, customerror.ErrInvalidArgument) } - // // get the owner uid from the mgmt service - // var ownerUUID string - // { - // // get the owner uid from the mgmt service - // ownerUUID, err = ph.getOwnerUID(ctx, req.OwnerId) - // if err != nil { - // log.Error("failed to get owner uid", zap.Error(err)) - // return nil, err - // } - // } creatorUUID, err := uuid.FromString(authUID) if err != nil { @@ -262,7 +252,7 @@ func (ph *PublicHandler) UpdateCatalog(ctx context.Context, req *artifactpb.Upda return nil, fmt.Errorf("failed to get namespace. err: %w", err) } // ACL - check user's permission to update catalog - kb, err := ph.service.Repository.GetKnowledgeBaseByOwnerAndKbID(ctx, ns.NsUID.String(), req.CatalogId) + kb, err := ph.service.Repository.GetKnowledgeBaseByOwnerAndKbID(ctx, ns.NsUID, req.CatalogId) if err != nil { log.Error("failed to get catalog", zap.Error(err)) return nil, fmt.Errorf(ErrorListKnowledgeBasesMsg, err) @@ -343,7 +333,7 @@ func (ph *PublicHandler) DeleteCatalog(ctx context.Context, req *artifactpb.Dele return nil, fmt.Errorf("failed to get namespace. err: %w", err) } // ACL - check user's permission to write catalog - kb, err := ph.service.Repository.GetKnowledgeBaseByOwnerAndKbID(ctx, ns.NsUID.String(), req.CatalogId) + kb, err := ph.service.Repository.GetKnowledgeBaseByOwnerAndKbID(ctx, ns.NsUID, req.CatalogId) if err != nil { log.Error("failed to get catalog", zap.Error(err)) return nil, fmt.Errorf(ErrorListKnowledgeBasesMsg, err) diff --git a/pkg/handler/knowledgebasefiles.go b/pkg/handler/knowledgebasefiles.go index 9ea1f8b..8cdb5c7 100644 --- a/pkg/handler/knowledgebasefiles.go +++ b/pkg/handler/knowledgebasefiles.go @@ -48,7 +48,7 @@ func (ph *PublicHandler) UploadCatalogFile(ctx context.Context, req *artifactpb. return nil, fmt.Errorf("failed to get namespace. err: %w", err) } // ACL - check user's permission to write catalog - kb, err := ph.service.Repository.GetKnowledgeBaseByOwnerAndKbID(ctx, ns.NsUID.String(), req.CatalogId) + kb, err := ph.service.Repository.GetKnowledgeBaseByOwnerAndKbID(ctx, ns.NsUID, req.CatalogId) if err != nil { log.Error("failed to get catalog", zap.Error(err)) return nil, fmt.Errorf(ErrorListKnowledgeBasesMsg, err) @@ -228,7 +228,7 @@ func (ph *PublicHandler) ListCatalogFiles(ctx context.Context, req *artifactpb.L return nil, fmt.Errorf("failed to get namespace. err: %w", err) } // ACL - check user's permission to write catalog - kb, err := ph.service.Repository.GetKnowledgeBaseByOwnerAndKbID(ctx, ns.NsUID.String(), req.CatalogId) + kb, err := ph.service.Repository.GetKnowledgeBaseByOwnerAndKbID(ctx, ns.NsUID, req.CatalogId) if err != nil { log.Error("failed to get catalog", zap.Error(err)) return nil, fmt.Errorf(ErrorListKnowledgeBasesMsg, err) diff --git a/pkg/handler/message.go b/pkg/handler/message.go new file mode 100644 index 0000000..608ac8f --- /dev/null +++ b/pkg/handler/message.go @@ -0,0 +1,226 @@ +package handler + +import ( + "context" + "fmt" + + "go.uber.org/zap" + "google.golang.org/protobuf/types/known/timestamppb" + + "github.com/gofrs/uuid" + "github.com/instill-ai/artifact-backend/pkg/logger" + "github.com/instill-ai/artifact-backend/pkg/repository" + artifactpb "github.com/instill-ai/protogen-go/artifact/artifact/v1alpha" +) + +// CreateMessage creates a new message in a conversation +func (ph *PublicHandler) CreateMessage(ctx context.Context, req *artifactpb.CreateMessageRequest) (*artifactpb.CreateMessageResponse, error) { + log, _ := logger.GetZapLogger(ctx) + + // Get user ID from context + authUID, err := getUserUIDFromContext(ctx) + if err != nil { + return nil, fmt.Errorf("failed to get user id from header: %v", err) + } + + // ACL - check user's permission to create message in the catalog + ns, catalog, err := ph.service.CheckCatalogUserPermission(ctx, req.GetNamespaceId(), req.GetCatalogId(), authUID) + if err != nil { + log.Error( + "failed to check user permission", + zap.Error(err), + zap.String("namespace_id", req.GetNamespaceId()), + zap.String("auth_uid", authUID), + ) + return nil, fmt.Errorf("failed to check user permission: %w", err) + } + + // Get the existing conversation + existingConv, err := ph.service.Repository.GetConversationByID(ctx, ns.NsUID, catalog.UID, req.GetConversationId()) + if err != nil { + log.Error("failed to get existing conversation", zap.Error(err)) + return nil, fmt.Errorf("failed to get existing conversation: %w", err) + } + + // Create message + message, err := ph.service.Repository.CreateMessage(ctx, repository.Message{ + NamespaceUID: ns.NsUID, + CatalogUID: catalog.UID, + ConversationUID: existingConv.UID, + Content: req.GetContent(), + Role: req.GetRole(), + Type: req.GetType().String(), + }) + if err != nil { + log.Error("failed to create message", zap.Error(err)) + return nil, fmt.Errorf("failed to create message: %w", err) + } + + return &artifactpb.CreateMessageResponse{ + Message: convertToProtoMessage(message), + }, nil +} + +// ListMessages lists messages in a conversation +func (ph *PublicHandler) ListMessages(ctx context.Context, req *artifactpb.ListMessagesRequest) (*artifactpb.ListMessagesResponse, error) { + log, _ := logger.GetZapLogger(ctx) + + // Get user ID from context + authUID, err := getUserUIDFromContext(ctx) + if err != nil { + return nil, fmt.Errorf("failed to get user id from header: %v", err) + } + + // ACL - check user's permission to list messages in the catalog + ns, catalog, err := ph.service.CheckCatalogUserPermission(ctx, req.GetNamespaceId(), req.GetCatalogId(), authUID) + if err != nil { + log.Error( + "failed to check user permission", + zap.Error(err), + zap.String("namespace_id", req.GetNamespaceId()), + zap.String("auth_uid", authUID), + ) + return nil, fmt.Errorf("failed to check user permission: %w", err) + } + // Get the existing conversation + existingConv, err := ph.service.Repository.GetConversationByID(ctx, ns.NsUID, catalog.UID, req.GetConversationId()) + if err != nil { + log.Error("failed to get existing conversation", zap.Error(err)) + return nil, fmt.Errorf("failed to get existing conversation: %w", err) + } + + // Get messages + messages, nextPageToken, totalCount, err := ph.service.Repository.ListMessages( + ctx, ns.NsUID, catalog.UID, existingConv.UID, req.GetLatestK(), + req.GetPageSize(), req.GetPageToken(), req.GetIncludeSystemMessages()) + if err != nil { + log.Error("failed to list messages", zap.Error(err)) + return nil, fmt.Errorf("failed to list messages: %w", err) + } + + // Convert to proto messages + protoMessages := make([]*artifactpb.Message, len(messages)) + for i, msg := range messages { + protoMessages[i] = convertToProtoMessage(msg) + } + + return &artifactpb.ListMessagesResponse{ + Messages: protoMessages, + NextPageToken: nextPageToken, + TotalSize: int32(totalCount), + }, nil +} + +// UpdateMessage updates an existing message +func (ph *PublicHandler) UpdateMessage(ctx context.Context, req *artifactpb.UpdateMessageRequest) (*artifactpb.UpdateMessageResponse, error) { + log, _ := logger.GetZapLogger(ctx) + + // Get user ID from context + authUID, err := getUserUIDFromContext(ctx) + if err != nil { + return nil, fmt.Errorf("failed to get user id from header: %v", err) + } + + // ACL - check user's permission to update message in the catalog + ns, catalog, err := ph.service.CheckCatalogUserPermission(ctx, req.GetNamespaceId(), req.GetCatalogId(), authUID) + if err != nil { + log.Error( + "failed to check user permission", + zap.Error(err), + zap.String("namespace_id", req.GetNamespaceId()), + zap.String("auth_uid", authUID), + ) + return nil, fmt.Errorf("failed to check user permission: %w", err) + } + // turn message uid to uuid + messageUUID, err := uuid.FromString(req.GetMessageUid()) + if err != nil { + log.Error("failed to convert message uid to uuid", zap.Error(err)) + return nil, fmt.Errorf("failed to convert message uid to uuid: %w", err) + } + // Get the existing message + existingMsg, err := ph.service.Repository.GetMessageByUID(ctx, messageUUID) + if err != nil { + log.Error("failed to get existing message", zap.Error(err)) + return nil, fmt.Errorf("failed to get existing message: %w", err) + } + + if existingMsg.NamespaceUID != ns.NsUID || existingMsg.CatalogUID != catalog.UID { + log.Error("message does not belong to the namespace or catalog.", zap.String("namespace id", ns.NsID), zap.String("catalog id", req.CatalogId)) + return nil, fmt.Errorf("message does not belong to the catalog") + } + + // Update message + updatedMsg, err := ph.service.Repository.UpdateMessageByUpdateMap(ctx, messageUUID, map[string]interface{}{ + repository.MessageColumn.Content: req.GetContent()}) + + if err != nil { + log.Error("failed to update message", zap.Error(err)) + return nil, fmt.Errorf("failed to update message: %w", err) + } + + return &artifactpb.UpdateMessageResponse{ + Message: convertToProtoMessage(updatedMsg), + }, nil +} + +// DeleteMessage deletes an existing message +func (ph *PublicHandler) DeleteMessage(ctx context.Context, req *artifactpb.DeleteMessageRequest) (*artifactpb.DeleteMessageResponse, error) { + log, _ := logger.GetZapLogger(ctx) + + // Get user ID from context + authUID, err := getUserUIDFromContext(ctx) + if err != nil { + return nil, fmt.Errorf("failed to get user id from header: %v", err) + } + + // ACL - check user's permission to delete message in the catalog + ns, catalog, err := ph.service.CheckCatalogUserPermission(ctx, req.GetNamespaceId(), req.GetCatalogId(), authUID) + if err != nil { + log.Error( + "failed to check user permission", + zap.Error(err), + zap.String("namespace_id", req.GetNamespaceId()), + zap.String("auth_uid", authUID), + ) + return nil, fmt.Errorf("failed to check user permission: %w", err) + } + // turn message uid to uuid + messageUUID, err := uuid.FromString(req.GetMessageUid()) + if err != nil { + log.Error("failed to convert message uid to uuid", zap.Error(err)) + return nil, fmt.Errorf("failed to convert message uid to uuid: %w", err) + } + // Get the existing message + existingMsg, err := ph.service.Repository.GetMessageByUID(ctx, messageUUID) + if err != nil { + log.Error("failed to get existing message", zap.Error(err)) + return nil, fmt.Errorf("failed to get existing message: %w", err) + } + if existingMsg.NamespaceUID != ns.NsUID || existingMsg.CatalogUID != catalog.UID { + log.Error("message does not belong to the namespace or catalog.", zap.String("namespace id", ns.NsID), zap.String("catalog id", req.CatalogId)) + return nil, fmt.Errorf("message does not belong to the catalog") + } + // Delete message + err = ph.service.Repository.DeleteMessage(ctx, messageUUID) + if err != nil { + log.Error("failed to delete message", zap.Error(err)) + return nil, fmt.Errorf("failed to delete message: %w", err) + } + + return &artifactpb.DeleteMessageResponse{}, nil +} + +// Helper function to convert repository.Message to artifactpb.Message +func convertToProtoMessage(msg *repository.Message) *artifactpb.Message { + return &artifactpb.Message{ + Uid: msg.UID.String(), + CatalogUid: msg.CatalogUID.String(), + ConversationUid: msg.ConversationUID.String(), + Content: msg.Content, + Role: msg.Role, + Type: artifactpb.Message_MessageType(artifactpb.Message_MessageType_value[msg.Type]), + CreateTime: timestamppb.New(msg.CreateTime), + UpdateTime: timestamppb.New(msg.UpdateTime), + } +} diff --git a/pkg/handler/qa.go b/pkg/handler/qa.go index 18a05cc..cfa9b19 100644 --- a/pkg/handler/qa.go +++ b/pkg/handler/qa.go @@ -45,7 +45,7 @@ func (ph *PublicHandler) QuestionAnswering( log.Info("get namespace by ns id", zap.Duration("duration", time.Since(t))) t = time.Now() ownerUID := ns.NsUID - kb, err := ph.service.Repository.GetKnowledgeBaseByOwnerAndKbID(ctx, ownerUID.String(), req.CatalogId) + kb, err := ph.service.Repository.GetKnowledgeBaseByOwnerAndKbID(ctx, ownerUID, req.CatalogId) if err != nil { log.Error("failed to get catalog by namespace and catalog id", zap.Error(err)) return nil, fmt.Errorf("failed to get catalog by namespace and catalog id. err: %w", err) @@ -88,7 +88,7 @@ func (ph *PublicHandler) QuestionAnswering( return nil, fmt.Errorf("failed to parse requester uid: %v. err: %w", err, customerror.ErrUnauthenticated) } } - simChunksScroes, err := ph.service.SimilarityChunksSearch(ctx, authUserUUID, requesterUUID, ownerUID.String(), scReq) + simChunksScroes, err := ph.service.SimilarityChunksSearch(ctx, authUserUUID, requesterUUID, ownerUID, scReq) if err != nil { log.Error("failed to get similarity chunks", zap.Error(err)) return nil, fmt.Errorf("failed to get similarity chunks. err: %w", err) diff --git a/pkg/handler/retrieval.go b/pkg/handler/retrieval.go index 1927fbf..9f66d74 100644 --- a/pkg/handler/retrieval.go +++ b/pkg/handler/retrieval.go @@ -12,13 +12,13 @@ import ( "github.com/instill-ai/artifact-backend/pkg/repository" "github.com/instill-ai/artifact-backend/pkg/resource" "github.com/instill-ai/artifact-backend/pkg/service" - artifactv1alpha "github.com/instill-ai/protogen-go/artifact/artifact/v1alpha" + artifactPb "github.com/instill-ai/protogen-go/artifact/artifact/v1alpha" "go.uber.org/zap" ) func (ph *PublicHandler) SimilarityChunksSearch( - ctx context.Context, req *artifactv1alpha.SimilarityChunksSearchRequest) ( - *artifactv1alpha.SimilarityChunksSearchResponse, + ctx context.Context, req *artifactPb.SimilarityChunksSearchRequest) ( + *artifactPb.SimilarityChunksSearchResponse, error) { log, _ := logger.GetZapLogger(ctx) @@ -43,7 +43,7 @@ func (ph *PublicHandler) SimilarityChunksSearch( log.Info("get namespace by ns id", zap.Duration("duration", time.Since(t))) t = time.Now() ownerUID := ns.NsUID - kb, err := ph.service.Repository.GetKnowledgeBaseByOwnerAndKbID(ctx, ownerUID.String(), req.CatalogId) + kb, err := ph.service.Repository.GetKnowledgeBaseByOwnerAndKbID(ctx, ownerUID, req.CatalogId) if err != nil { log.Error("failed to get catalog by owner and kb id", zap.Error(err)) return nil, fmt.Errorf("failed to get catalog by owner and kb id. err: %w", err) @@ -71,13 +71,13 @@ func (ph *PublicHandler) SimilarityChunksSearch( reqUIDString := resource.GetRequestSingleHeader(ctx, constant.HeaderRequesterUIDKey) requesterUID := uuid.FromStringOrNil(reqUIDString) // retrieve the chunks based on the similarity - simChunksScroes, err := ph.service.SimilarityChunksSearch(ctx, uidUUID, requesterUID, ownerUID.String(), req) + simChunksScores, err := ph.service.SimilarityChunksSearch(ctx, uidUUID, requesterUID, ownerUID, req) if err != nil { log.Error("failed to get similarity chunks", zap.Error(err)) return nil, fmt.Errorf("failed to get similarity chunks. err: %w", err) } var chunkUIDs []uuid.UUID - for _, simChunk := range simChunksScroes { + for _, simChunk := range simChunksScores { chunkUIDs = append(chunkUIDs, simChunk.ChunkUID) } log.Info("get similarity chunks", zap.Duration("duration", time.Since(t))) @@ -125,17 +125,17 @@ func (ph *PublicHandler) SimilarityChunksSearch( log.Info("get catalog files by file uids", zap.Duration("duration", time.Since(t))) // prepare the response - simChunks := make([]*artifactv1alpha.SimilarityChunk, 0, len(chunks)) + simChunks := make([]*artifactPb.SimilarityChunk, 0, len(chunks)) for i, chunk := range chunks { if !chunk.Retrievable { continue } - simChunks = append(simChunks, &artifactv1alpha.SimilarityChunk{ + simChunks = append(simChunks, &artifactPb.SimilarityChunk{ ChunkUid: chunk.UID.String(), - SimilarityScore: float32(simChunksScroes[i].Score), + SimilarityScore: float32(simChunksScores[i].Score), TextContent: string(chunkContents[i].Content), SourceFile: fileUIDMapName[chunk.KbFileUID], }) } - return &artifactv1alpha.SimilarityChunksSearchResponse{SimilarChunks: simChunks}, nil + return &artifactPb.SimilarityChunksSearchResponse{SimilarChunks: simChunks}, nil } diff --git a/pkg/mock/repository_i_mock.gen.go b/pkg/mock/repository_i_mock.gen.go index 5cbab83..38b5db7 100644 --- a/pkg/mock/repository_i_mock.gen.go +++ b/pkg/mock/repository_i_mock.gen.go @@ -20,12 +20,24 @@ type RepositoryIMock struct { t minimock.Tester finishOnce sync.Once + funcConversationTableName func() (s1 string) + inspectFuncConversationTableName func() + afterConversationTableNameCounter uint64 + beforeConversationTableNameCounter uint64 + ConversationTableNameMock mRepositoryIMockConversationTableName + funcConvertedFileTableName func() (s1 string) inspectFuncConvertedFileTableName func() afterConvertedFileTableNameCounter uint64 beforeConvertedFileTableNameCounter uint64 ConvertedFileTableNameMock mRepositoryIMockConvertedFileTableName + funcCreateConversation func(ctx context.Context, conv mm_repository.Conversation) (cp1 *mm_repository.Conversation, err error) + inspectFuncCreateConversation func(ctx context.Context, conv mm_repository.Conversation) + afterCreateConversationCounter uint64 + beforeCreateConversationCounter uint64 + CreateConversationMock mRepositoryIMockCreateConversation + funcCreateConvertedFile func(ctx context.Context, cf mm_repository.ConvertedFile, callExternalService func(convertedFileUID uuid.UUID) (map[string]any, error)) (cp1 *mm_repository.ConvertedFile, err error) inspectFuncCreateConvertedFile func(ctx context.Context, cf mm_repository.ConvertedFile, callExternalService func(convertedFileUID uuid.UUID) (map[string]any, error)) afterCreateConvertedFileCounter uint64 @@ -44,6 +56,12 @@ type RepositoryIMock struct { beforeCreateKnowledgeBaseFileCounter uint64 CreateKnowledgeBaseFileMock mRepositoryIMockCreateKnowledgeBaseFile + funcCreateMessage func(ctx context.Context, msg mm_repository.Message) (mp1 *mm_repository.Message, err error) + inspectFuncCreateMessage func(ctx context.Context, msg mm_repository.Message) + afterCreateMessageCounter uint64 + beforeCreateMessageCounter uint64 + CreateMessageMock mRepositoryIMockCreateMessage + funcDeleteAllConvertedFilesinKb func(ctx context.Context, kbUID uuid.UUID) (err error) inspectFuncDeleteAllConvertedFilesinKb func(ctx context.Context, kbUID uuid.UUID) afterDeleteAllConvertedFilesinKbCounter uint64 @@ -104,6 +122,12 @@ type RepositoryIMock struct { beforeDeleteKnowledgeBaseFileCounter uint64 DeleteKnowledgeBaseFileMock mRepositoryIMockDeleteKnowledgeBaseFile + funcDeleteMessage func(ctx context.Context, messageUID uuid.UUID) (err error) + inspectFuncDeleteMessage func(ctx context.Context, messageUID uuid.UUID) + afterDeleteMessageCounter uint64 + beforeDeleteMessageCounter uint64 + DeleteMessageMock mRepositoryIMockDeleteMessage + funcDeleteRepositoryTag func(ctx context.Context, s1 string) (err error) inspectFuncDeleteRepositoryTag func(ctx context.Context, s1 string) afterDeleteRepositoryTagCounter uint64 @@ -116,6 +140,18 @@ type RepositoryIMock struct { beforeGetChunksByUIDsCounter uint64 GetChunksByUIDsMock mRepositoryIMockGetChunksByUIDs + funcGetConversationByID func(ctx context.Context, namespaceUID uuid.UUID, catalogUID uuid.UUID, conversationID string) (cp1 *mm_repository.Conversation, err error) + inspectFuncGetConversationByID func(ctx context.Context, namespaceUID uuid.UUID, catalogUID uuid.UUID, conversationID string) + afterGetConversationByIDCounter uint64 + beforeGetConversationByIDCounter uint64 + GetConversationByIDMock mRepositoryIMockGetConversationByID + + funcGetConversationByUID func(ctx context.Context, convUID uuid.UUID) (cp1 *mm_repository.Conversation, err error) + inspectFuncGetConversationByUID func(ctx context.Context, convUID uuid.UUID) + afterGetConversationByUIDCounter uint64 + beforeGetConversationByUIDCounter uint64 + GetConversationByUIDMock mRepositoryIMockGetConversationByUID + funcGetConvertedFileByFileUID func(ctx context.Context, fileUID uuid.UUID) (cp1 *mm_repository.ConvertedFile, err error) inspectFuncGetConvertedFileByFileUID func(ctx context.Context, fileUID uuid.UUID) afterGetConvertedFileByFileUIDCounter uint64 @@ -146,8 +182,8 @@ type RepositoryIMock struct { beforeGetFilesTotalTokensCounter uint64 GetFilesTotalTokensMock mRepositoryIMockGetFilesTotalTokens - funcGetKnowledgeBaseByOwnerAndKbID func(ctx context.Context, ownerUID string, kbID string) (kp1 *mm_repository.KnowledgeBase, err error) - inspectFuncGetKnowledgeBaseByOwnerAndKbID func(ctx context.Context, ownerUID string, kbID string) + funcGetKnowledgeBaseByOwnerAndKbID func(ctx context.Context, ownerUID uuid.UUID, kbID string) (kp1 *mm_repository.KnowledgeBase, err error) + inspectFuncGetKnowledgeBaseByOwnerAndKbID func(ctx context.Context, ownerUID uuid.UUID, kbID string) afterGetKnowledgeBaseByOwnerAndKbIDCounter uint64 beforeGetKnowledgeBaseByOwnerAndKbIDCounter uint64 GetKnowledgeBaseByOwnerAndKbIDMock mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID @@ -170,6 +206,12 @@ type RepositoryIMock struct { beforeGetKnowledgebaseFileByKbUIDAndFileIDCounter uint64 GetKnowledgebaseFileByKbUIDAndFileIDMock mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID + funcGetMessageByUID func(ctx context.Context, messageUID uuid.UUID) (mp1 *mm_repository.Message, err error) + inspectFuncGetMessageByUID func(ctx context.Context, messageUID uuid.UUID) + afterGetMessageByUIDCounter uint64 + beforeGetMessageByUIDCounter uint64 + GetMessageByUIDMock mRepositoryIMockGetMessageByUID + funcGetNeedProcessFiles func(ctx context.Context) (ka1 []mm_repository.KnowledgeBaseFile) inspectFuncGetNeedProcessFiles func(ctx context.Context) afterGetNeedProcessFilesCounter uint64 @@ -269,6 +311,12 @@ type RepositoryIMock struct { beforeListChunksByKbFileUIDCounter uint64 ListChunksByKbFileUIDMock mRepositoryIMockListChunksByKbFileUID + funcListConversations func(ctx context.Context, namespaceUID uuid.UUID, catalogUID uuid.UUID, pageSize int32, nextPageToken string) (cpa1 []*mm_repository.Conversation, i1 int, s1 string, err error) + inspectFuncListConversations func(ctx context.Context, namespaceUID uuid.UUID, catalogUID uuid.UUID, pageSize int32, nextPageToken string) + afterListConversationsCounter uint64 + beforeListConversationsCounter uint64 + ListConversationsMock mRepositoryIMockListConversations + funcListEmbeddingsByKbFileUID func(ctx context.Context, kbFileUID uuid.UUID) (ea1 []mm_repository.Embedding, err error) inspectFuncListEmbeddingsByKbFileUID func(ctx context.Context, kbFileUID uuid.UUID) afterListEmbeddingsByKbFileUIDCounter uint64 @@ -287,12 +335,30 @@ type RepositoryIMock struct { beforeListKnowledgeBasesCounter uint64 ListKnowledgeBasesMock mRepositoryIMockListKnowledgeBases + funcListMessages func(ctx context.Context, namespaceUID uuid.UUID, catalogUID uuid.UUID, conversationUID uuid.UUID, latestK int32, pageSize int32, pageToken string, includeSystemMessages bool) (mpa1 []*mm_repository.Message, s1 string, i1 int64, err error) + inspectFuncListMessages func(ctx context.Context, namespaceUID uuid.UUID, catalogUID uuid.UUID, conversationUID uuid.UUID, latestK int32, pageSize int32, pageToken string, includeSystemMessages bool) + afterListMessagesCounter uint64 + beforeListMessagesCounter uint64 + ListMessagesMock mRepositoryIMockListMessages + + funcMessageTableName func() (s1 string) + inspectFuncMessageTableName func() + afterMessageTableNameCounter uint64 + beforeMessageTableNameCounter uint64 + MessageTableNameMock mRepositoryIMockMessageTableName + funcProcessKnowledgeBaseFiles func(ctx context.Context, fileUIDs []string, requester uuid.UUID) (ka1 []mm_repository.KnowledgeBaseFile, err error) inspectFuncProcessKnowledgeBaseFiles func(ctx context.Context, fileUIDs []string, requester uuid.UUID) afterProcessKnowledgeBaseFilesCounter uint64 beforeProcessKnowledgeBaseFilesCounter uint64 ProcessKnowledgeBaseFilesMock mRepositoryIMockProcessKnowledgeBaseFiles + funcSoftDeleteConversation func(ctx context.Context, namespaceUID uuid.UUID, catalogUID uuid.UUID, conversationID string) (err error) + inspectFuncSoftDeleteConversation func(ctx context.Context, namespaceUID uuid.UUID, catalogUID uuid.UUID, conversationID string) + afterSoftDeleteConversationCounter uint64 + beforeSoftDeleteConversationCounter uint64 + SoftDeleteConversationMock mRepositoryIMockSoftDeleteConversation + funcTextChunkTableName func() (s1 string) inspectFuncTextChunkTableName func() afterTextChunkTableNameCounter uint64 @@ -305,6 +371,12 @@ type RepositoryIMock struct { beforeUpdateChunkCounter uint64 UpdateChunkMock mRepositoryIMockUpdateChunk + funcUpdateConversationByUpdateMap func(ctx context.Context, convUID uuid.UUID, updateMap map[string]interface{}) (cp1 *mm_repository.Conversation, err error) + inspectFuncUpdateConversationByUpdateMap func(ctx context.Context, convUID uuid.UUID, updateMap map[string]interface{}) + afterUpdateConversationByUpdateMapCounter uint64 + beforeUpdateConversationByUpdateMapCounter uint64 + UpdateConversationByUpdateMapMock mRepositoryIMockUpdateConversationByUpdateMap + funcUpdateExtraMetaData func(ctx context.Context, fileUID uuid.UUID, failureReason string, convertingPipe string, chunkingPipe string, embeddingPipe string) (err error) inspectFuncUpdateExtraMetaData func(ctx context.Context, fileUID uuid.UUID, failureReason string, convertingPipe string, chunkingPipe string, embeddingPipe string) afterUpdateExtraMetaDataCounter uint64 @@ -323,6 +395,18 @@ type RepositoryIMock struct { beforeUpdateKnowledgeBaseFileCounter uint64 UpdateKnowledgeBaseFileMock mRepositoryIMockUpdateKnowledgeBaseFile + funcUpdateMessage func(ctx context.Context, msg mm_repository.Message) (mp1 *mm_repository.Message, err error) + inspectFuncUpdateMessage func(ctx context.Context, msg mm_repository.Message) + afterUpdateMessageCounter uint64 + beforeUpdateMessageCounter uint64 + UpdateMessageMock mRepositoryIMockUpdateMessage + + funcUpdateMessageByUpdateMap func(ctx context.Context, messageUID uuid.UUID, updateMap map[string]interface{}) (mp1 *mm_repository.Message, err error) + inspectFuncUpdateMessageByUpdateMap func(ctx context.Context, messageUID uuid.UUID, updateMap map[string]interface{}) + afterUpdateMessageByUpdateMapCounter uint64 + beforeUpdateMessageByUpdateMapCounter uint64 + UpdateMessageByUpdateMapMock mRepositoryIMockUpdateMessageByUpdateMap + funcUpsertEmbeddings func(ctx context.Context, embeddings []mm_repository.Embedding, externalServiceCall func(embUIDs []string) error) (ea1 []mm_repository.Embedding, err error) inspectFuncUpsertEmbeddings func(ctx context.Context, embeddings []mm_repository.Embedding, externalServiceCall func(embUIDs []string) error) afterUpsertEmbeddingsCounter uint64 @@ -344,8 +428,13 @@ func NewRepositoryIMock(t minimock.Tester) *RepositoryIMock { controller.RegisterMocker(m) } + m.ConversationTableNameMock = mRepositoryIMockConversationTableName{mock: m} + m.ConvertedFileTableNameMock = mRepositoryIMockConvertedFileTableName{mock: m} + m.CreateConversationMock = mRepositoryIMockCreateConversation{mock: m} + m.CreateConversationMock.callArgs = []*RepositoryIMockCreateConversationParams{} + m.CreateConvertedFileMock = mRepositoryIMockCreateConvertedFile{mock: m} m.CreateConvertedFileMock.callArgs = []*RepositoryIMockCreateConvertedFileParams{} @@ -355,6 +444,9 @@ func NewRepositoryIMock(t minimock.Tester) *RepositoryIMock { m.CreateKnowledgeBaseFileMock = mRepositoryIMockCreateKnowledgeBaseFile{mock: m} m.CreateKnowledgeBaseFileMock.callArgs = []*RepositoryIMockCreateKnowledgeBaseFileParams{} + m.CreateMessageMock = mRepositoryIMockCreateMessage{mock: m} + m.CreateMessageMock.callArgs = []*RepositoryIMockCreateMessageParams{} + m.DeleteAllConvertedFilesinKbMock = mRepositoryIMockDeleteAllConvertedFilesinKb{mock: m} m.DeleteAllConvertedFilesinKbMock.callArgs = []*RepositoryIMockDeleteAllConvertedFilesinKbParams{} @@ -385,12 +477,21 @@ func NewRepositoryIMock(t minimock.Tester) *RepositoryIMock { m.DeleteKnowledgeBaseFileMock = mRepositoryIMockDeleteKnowledgeBaseFile{mock: m} m.DeleteKnowledgeBaseFileMock.callArgs = []*RepositoryIMockDeleteKnowledgeBaseFileParams{} + m.DeleteMessageMock = mRepositoryIMockDeleteMessage{mock: m} + m.DeleteMessageMock.callArgs = []*RepositoryIMockDeleteMessageParams{} + m.DeleteRepositoryTagMock = mRepositoryIMockDeleteRepositoryTag{mock: m} m.DeleteRepositoryTagMock.callArgs = []*RepositoryIMockDeleteRepositoryTagParams{} m.GetChunksByUIDsMock = mRepositoryIMockGetChunksByUIDs{mock: m} m.GetChunksByUIDsMock.callArgs = []*RepositoryIMockGetChunksByUIDsParams{} + m.GetConversationByIDMock = mRepositoryIMockGetConversationByID{mock: m} + m.GetConversationByIDMock.callArgs = []*RepositoryIMockGetConversationByIDParams{} + + m.GetConversationByUIDMock = mRepositoryIMockGetConversationByUID{mock: m} + m.GetConversationByUIDMock.callArgs = []*RepositoryIMockGetConversationByUIDParams{} + m.GetConvertedFileByFileUIDMock = mRepositoryIMockGetConvertedFileByFileUID{mock: m} m.GetConvertedFileByFileUIDMock.callArgs = []*RepositoryIMockGetConvertedFileByFileUIDParams{} @@ -415,6 +516,9 @@ func NewRepositoryIMock(t minimock.Tester) *RepositoryIMock { m.GetKnowledgebaseFileByKbUIDAndFileIDMock = mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID{mock: m} m.GetKnowledgebaseFileByKbUIDAndFileIDMock.callArgs = []*RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDParams{} + m.GetMessageByUIDMock = mRepositoryIMockGetMessageByUID{mock: m} + m.GetMessageByUIDMock.callArgs = []*RepositoryIMockGetMessageByUIDParams{} + m.GetNeedProcessFilesMock = mRepositoryIMockGetNeedProcessFiles{mock: m} m.GetNeedProcessFilesMock.callArgs = []*RepositoryIMockGetNeedProcessFilesParams{} @@ -459,6 +563,9 @@ func NewRepositoryIMock(t minimock.Tester) *RepositoryIMock { m.ListChunksByKbFileUIDMock = mRepositoryIMockListChunksByKbFileUID{mock: m} m.ListChunksByKbFileUIDMock.callArgs = []*RepositoryIMockListChunksByKbFileUIDParams{} + m.ListConversationsMock = mRepositoryIMockListConversations{mock: m} + m.ListConversationsMock.callArgs = []*RepositoryIMockListConversationsParams{} + m.ListEmbeddingsByKbFileUIDMock = mRepositoryIMockListEmbeddingsByKbFileUID{mock: m} m.ListEmbeddingsByKbFileUIDMock.callArgs = []*RepositoryIMockListEmbeddingsByKbFileUIDParams{} @@ -468,14 +575,25 @@ func NewRepositoryIMock(t minimock.Tester) *RepositoryIMock { m.ListKnowledgeBasesMock = mRepositoryIMockListKnowledgeBases{mock: m} m.ListKnowledgeBasesMock.callArgs = []*RepositoryIMockListKnowledgeBasesParams{} + m.ListMessagesMock = mRepositoryIMockListMessages{mock: m} + m.ListMessagesMock.callArgs = []*RepositoryIMockListMessagesParams{} + + m.MessageTableNameMock = mRepositoryIMockMessageTableName{mock: m} + m.ProcessKnowledgeBaseFilesMock = mRepositoryIMockProcessKnowledgeBaseFiles{mock: m} m.ProcessKnowledgeBaseFilesMock.callArgs = []*RepositoryIMockProcessKnowledgeBaseFilesParams{} + m.SoftDeleteConversationMock = mRepositoryIMockSoftDeleteConversation{mock: m} + m.SoftDeleteConversationMock.callArgs = []*RepositoryIMockSoftDeleteConversationParams{} + m.TextChunkTableNameMock = mRepositoryIMockTextChunkTableName{mock: m} m.UpdateChunkMock = mRepositoryIMockUpdateChunk{mock: m} m.UpdateChunkMock.callArgs = []*RepositoryIMockUpdateChunkParams{} + m.UpdateConversationByUpdateMapMock = mRepositoryIMockUpdateConversationByUpdateMap{mock: m} + m.UpdateConversationByUpdateMapMock.callArgs = []*RepositoryIMockUpdateConversationByUpdateMapParams{} + m.UpdateExtraMetaDataMock = mRepositoryIMockUpdateExtraMetaData{mock: m} m.UpdateExtraMetaDataMock.callArgs = []*RepositoryIMockUpdateExtraMetaDataParams{} @@ -485,6 +603,12 @@ func NewRepositoryIMock(t minimock.Tester) *RepositoryIMock { m.UpdateKnowledgeBaseFileMock = mRepositoryIMockUpdateKnowledgeBaseFile{mock: m} m.UpdateKnowledgeBaseFileMock.callArgs = []*RepositoryIMockUpdateKnowledgeBaseFileParams{} + m.UpdateMessageMock = mRepositoryIMockUpdateMessage{mock: m} + m.UpdateMessageMock.callArgs = []*RepositoryIMockUpdateMessageParams{} + + m.UpdateMessageByUpdateMapMock = mRepositoryIMockUpdateMessageByUpdateMap{mock: m} + m.UpdateMessageByUpdateMapMock.callArgs = []*RepositoryIMockUpdateMessageByUpdateMapParams{} + m.UpsertEmbeddingsMock = mRepositoryIMockUpsertEmbeddings{mock: m} m.UpsertEmbeddingsMock.callArgs = []*RepositoryIMockUpsertEmbeddingsParams{} @@ -496,6 +620,169 @@ func NewRepositoryIMock(t minimock.Tester) *RepositoryIMock { return m } +type mRepositoryIMockConversationTableName struct { + mock *RepositoryIMock + defaultExpectation *RepositoryIMockConversationTableNameExpectation + expectations []*RepositoryIMockConversationTableNameExpectation + + expectedInvocations uint64 +} + +// RepositoryIMockConversationTableNameExpectation specifies expectation struct of the RepositoryI.ConversationTableName +type RepositoryIMockConversationTableNameExpectation struct { + mock *RepositoryIMock + + results *RepositoryIMockConversationTableNameResults + Counter uint64 +} + +// RepositoryIMockConversationTableNameResults contains results of the RepositoryI.ConversationTableName +type RepositoryIMockConversationTableNameResults struct { + s1 string +} + +// Expect sets up expected params for RepositoryI.ConversationTableName +func (mmConversationTableName *mRepositoryIMockConversationTableName) Expect() *mRepositoryIMockConversationTableName { + if mmConversationTableName.mock.funcConversationTableName != nil { + mmConversationTableName.mock.t.Fatalf("RepositoryIMock.ConversationTableName mock is already set by Set") + } + + if mmConversationTableName.defaultExpectation == nil { + mmConversationTableName.defaultExpectation = &RepositoryIMockConversationTableNameExpectation{} + } + + return mmConversationTableName +} + +// Inspect accepts an inspector function that has same arguments as the RepositoryI.ConversationTableName +func (mmConversationTableName *mRepositoryIMockConversationTableName) Inspect(f func()) *mRepositoryIMockConversationTableName { + if mmConversationTableName.mock.inspectFuncConversationTableName != nil { + mmConversationTableName.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.ConversationTableName") + } + + mmConversationTableName.mock.inspectFuncConversationTableName = f + + return mmConversationTableName +} + +// Return sets up results that will be returned by RepositoryI.ConversationTableName +func (mmConversationTableName *mRepositoryIMockConversationTableName) Return(s1 string) *RepositoryIMock { + if mmConversationTableName.mock.funcConversationTableName != nil { + mmConversationTableName.mock.t.Fatalf("RepositoryIMock.ConversationTableName mock is already set by Set") + } + + if mmConversationTableName.defaultExpectation == nil { + mmConversationTableName.defaultExpectation = &RepositoryIMockConversationTableNameExpectation{mock: mmConversationTableName.mock} + } + mmConversationTableName.defaultExpectation.results = &RepositoryIMockConversationTableNameResults{s1} + return mmConversationTableName.mock +} + +// Set uses given function f to mock the RepositoryI.ConversationTableName method +func (mmConversationTableName *mRepositoryIMockConversationTableName) Set(f func() (s1 string)) *RepositoryIMock { + if mmConversationTableName.defaultExpectation != nil { + mmConversationTableName.mock.t.Fatalf("Default expectation is already set for the RepositoryI.ConversationTableName method") + } + + if len(mmConversationTableName.expectations) > 0 { + mmConversationTableName.mock.t.Fatalf("Some expectations are already set for the RepositoryI.ConversationTableName method") + } + + mmConversationTableName.mock.funcConversationTableName = f + return mmConversationTableName.mock +} + +// Times sets number of times RepositoryI.ConversationTableName should be invoked +func (mmConversationTableName *mRepositoryIMockConversationTableName) Times(n uint64) *mRepositoryIMockConversationTableName { + if n == 0 { + mmConversationTableName.mock.t.Fatalf("Times of RepositoryIMock.ConversationTableName mock can not be zero") + } + mm_atomic.StoreUint64(&mmConversationTableName.expectedInvocations, n) + return mmConversationTableName +} + +func (mmConversationTableName *mRepositoryIMockConversationTableName) invocationsDone() bool { + if len(mmConversationTableName.expectations) == 0 && mmConversationTableName.defaultExpectation == nil && mmConversationTableName.mock.funcConversationTableName == nil { + return true + } + + totalInvocations := mm_atomic.LoadUint64(&mmConversationTableName.mock.afterConversationTableNameCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmConversationTableName.expectedInvocations) + + return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) +} + +// ConversationTableName implements repository.RepositoryI +func (mmConversationTableName *RepositoryIMock) ConversationTableName() (s1 string) { + mm_atomic.AddUint64(&mmConversationTableName.beforeConversationTableNameCounter, 1) + defer mm_atomic.AddUint64(&mmConversationTableName.afterConversationTableNameCounter, 1) + + if mmConversationTableName.inspectFuncConversationTableName != nil { + mmConversationTableName.inspectFuncConversationTableName() + } + + if mmConversationTableName.ConversationTableNameMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmConversationTableName.ConversationTableNameMock.defaultExpectation.Counter, 1) + + mm_results := mmConversationTableName.ConversationTableNameMock.defaultExpectation.results + if mm_results == nil { + mmConversationTableName.t.Fatal("No results are set for the RepositoryIMock.ConversationTableName") + } + return (*mm_results).s1 + } + if mmConversationTableName.funcConversationTableName != nil { + return mmConversationTableName.funcConversationTableName() + } + mmConversationTableName.t.Fatalf("Unexpected call to RepositoryIMock.ConversationTableName.") + return +} + +// ConversationTableNameAfterCounter returns a count of finished RepositoryIMock.ConversationTableName invocations +func (mmConversationTableName *RepositoryIMock) ConversationTableNameAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmConversationTableName.afterConversationTableNameCounter) +} + +// ConversationTableNameBeforeCounter returns a count of RepositoryIMock.ConversationTableName invocations +func (mmConversationTableName *RepositoryIMock) ConversationTableNameBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmConversationTableName.beforeConversationTableNameCounter) +} + +// MinimockConversationTableNameDone returns true if the count of the ConversationTableName invocations corresponds +// the number of defined expectations +func (m *RepositoryIMock) MinimockConversationTableNameDone() bool { + for _, e := range m.ConversationTableNameMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + return false + } + } + + return m.ConversationTableNameMock.invocationsDone() +} + +// MinimockConversationTableNameInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockConversationTableNameInspect() { + for _, e := range m.ConversationTableNameMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + m.t.Error("Expected call to RepositoryIMock.ConversationTableName") + } + } + + afterConversationTableNameCounter := mm_atomic.LoadUint64(&m.afterConversationTableNameCounter) + // if default expectation was set then invocations count should be greater than zero + if m.ConversationTableNameMock.defaultExpectation != nil && afterConversationTableNameCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.ConversationTableName") + } + // if func was set then invocations count should be greater than zero + if m.funcConversationTableName != nil && afterConversationTableNameCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.ConversationTableName") + } + + if !m.ConversationTableNameMock.invocationsDone() && afterConversationTableNameCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.ConversationTableName but found %d calls", + mm_atomic.LoadUint64(&m.ConversationTableNameMock.expectedInvocations), afterConversationTableNameCounter) + } +} + type mRepositoryIMockConvertedFileTableName struct { mock *RepositoryIMock defaultExpectation *RepositoryIMockConvertedFileTableNameExpectation @@ -659,14830 +946,19075 @@ func (m *RepositoryIMock) MinimockConvertedFileTableNameInspect() { } } -type mRepositoryIMockCreateConvertedFile struct { +type mRepositoryIMockCreateConversation struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockCreateConvertedFileExpectation - expectations []*RepositoryIMockCreateConvertedFileExpectation + defaultExpectation *RepositoryIMockCreateConversationExpectation + expectations []*RepositoryIMockCreateConversationExpectation - callArgs []*RepositoryIMockCreateConvertedFileParams + callArgs []*RepositoryIMockCreateConversationParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockCreateConvertedFileExpectation specifies expectation struct of the RepositoryI.CreateConvertedFile -type RepositoryIMockCreateConvertedFileExpectation struct { +// RepositoryIMockCreateConversationExpectation specifies expectation struct of the RepositoryI.CreateConversation +type RepositoryIMockCreateConversationExpectation struct { mock *RepositoryIMock - params *RepositoryIMockCreateConvertedFileParams - paramPtrs *RepositoryIMockCreateConvertedFileParamPtrs - results *RepositoryIMockCreateConvertedFileResults + params *RepositoryIMockCreateConversationParams + paramPtrs *RepositoryIMockCreateConversationParamPtrs + results *RepositoryIMockCreateConversationResults Counter uint64 } -// RepositoryIMockCreateConvertedFileParams contains parameters of the RepositoryI.CreateConvertedFile -type RepositoryIMockCreateConvertedFileParams struct { - ctx context.Context - cf mm_repository.ConvertedFile - callExternalService func(convertedFileUID uuid.UUID) (map[string]any, error) +// RepositoryIMockCreateConversationParams contains parameters of the RepositoryI.CreateConversation +type RepositoryIMockCreateConversationParams struct { + ctx context.Context + conv mm_repository.Conversation } -// RepositoryIMockCreateConvertedFileParamPtrs contains pointers to parameters of the RepositoryI.CreateConvertedFile -type RepositoryIMockCreateConvertedFileParamPtrs struct { - ctx *context.Context - cf *mm_repository.ConvertedFile - callExternalService *func(convertedFileUID uuid.UUID) (map[string]any, error) +// RepositoryIMockCreateConversationParamPtrs contains pointers to parameters of the RepositoryI.CreateConversation +type RepositoryIMockCreateConversationParamPtrs struct { + ctx *context.Context + conv *mm_repository.Conversation } -// RepositoryIMockCreateConvertedFileResults contains results of the RepositoryI.CreateConvertedFile -type RepositoryIMockCreateConvertedFileResults struct { - cp1 *mm_repository.ConvertedFile +// RepositoryIMockCreateConversationResults contains results of the RepositoryI.CreateConversation +type RepositoryIMockCreateConversationResults struct { + cp1 *mm_repository.Conversation err error } -// Expect sets up expected params for RepositoryI.CreateConvertedFile -func (mmCreateConvertedFile *mRepositoryIMockCreateConvertedFile) Expect(ctx context.Context, cf mm_repository.ConvertedFile, callExternalService func(convertedFileUID uuid.UUID) (map[string]any, error)) *mRepositoryIMockCreateConvertedFile { - if mmCreateConvertedFile.mock.funcCreateConvertedFile != nil { - mmCreateConvertedFile.mock.t.Fatalf("RepositoryIMock.CreateConvertedFile mock is already set by Set") +// Expect sets up expected params for RepositoryI.CreateConversation +func (mmCreateConversation *mRepositoryIMockCreateConversation) Expect(ctx context.Context, conv mm_repository.Conversation) *mRepositoryIMockCreateConversation { + if mmCreateConversation.mock.funcCreateConversation != nil { + mmCreateConversation.mock.t.Fatalf("RepositoryIMock.CreateConversation mock is already set by Set") } - if mmCreateConvertedFile.defaultExpectation == nil { - mmCreateConvertedFile.defaultExpectation = &RepositoryIMockCreateConvertedFileExpectation{} + if mmCreateConversation.defaultExpectation == nil { + mmCreateConversation.defaultExpectation = &RepositoryIMockCreateConversationExpectation{} } - if mmCreateConvertedFile.defaultExpectation.paramPtrs != nil { - mmCreateConvertedFile.mock.t.Fatalf("RepositoryIMock.CreateConvertedFile mock is already set by ExpectParams functions") + if mmCreateConversation.defaultExpectation.paramPtrs != nil { + mmCreateConversation.mock.t.Fatalf("RepositoryIMock.CreateConversation mock is already set by ExpectParams functions") } - mmCreateConvertedFile.defaultExpectation.params = &RepositoryIMockCreateConvertedFileParams{ctx, cf, callExternalService} - for _, e := range mmCreateConvertedFile.expectations { - if minimock.Equal(e.params, mmCreateConvertedFile.defaultExpectation.params) { - mmCreateConvertedFile.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmCreateConvertedFile.defaultExpectation.params) + mmCreateConversation.defaultExpectation.params = &RepositoryIMockCreateConversationParams{ctx, conv} + for _, e := range mmCreateConversation.expectations { + if minimock.Equal(e.params, mmCreateConversation.defaultExpectation.params) { + mmCreateConversation.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmCreateConversation.defaultExpectation.params) } } - return mmCreateConvertedFile -} - -// ExpectCtxParam1 sets up expected param ctx for RepositoryI.CreateConvertedFile -func (mmCreateConvertedFile *mRepositoryIMockCreateConvertedFile) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockCreateConvertedFile { - if mmCreateConvertedFile.mock.funcCreateConvertedFile != nil { - mmCreateConvertedFile.mock.t.Fatalf("RepositoryIMock.CreateConvertedFile mock is already set by Set") - } - - if mmCreateConvertedFile.defaultExpectation == nil { - mmCreateConvertedFile.defaultExpectation = &RepositoryIMockCreateConvertedFileExpectation{} - } - - if mmCreateConvertedFile.defaultExpectation.params != nil { - mmCreateConvertedFile.mock.t.Fatalf("RepositoryIMock.CreateConvertedFile mock is already set by Expect") - } - - if mmCreateConvertedFile.defaultExpectation.paramPtrs == nil { - mmCreateConvertedFile.defaultExpectation.paramPtrs = &RepositoryIMockCreateConvertedFileParamPtrs{} - } - mmCreateConvertedFile.defaultExpectation.paramPtrs.ctx = &ctx - - return mmCreateConvertedFile + return mmCreateConversation } -// ExpectCfParam2 sets up expected param cf for RepositoryI.CreateConvertedFile -func (mmCreateConvertedFile *mRepositoryIMockCreateConvertedFile) ExpectCfParam2(cf mm_repository.ConvertedFile) *mRepositoryIMockCreateConvertedFile { - if mmCreateConvertedFile.mock.funcCreateConvertedFile != nil { - mmCreateConvertedFile.mock.t.Fatalf("RepositoryIMock.CreateConvertedFile mock is already set by Set") +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.CreateConversation +func (mmCreateConversation *mRepositoryIMockCreateConversation) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockCreateConversation { + if mmCreateConversation.mock.funcCreateConversation != nil { + mmCreateConversation.mock.t.Fatalf("RepositoryIMock.CreateConversation mock is already set by Set") } - if mmCreateConvertedFile.defaultExpectation == nil { - mmCreateConvertedFile.defaultExpectation = &RepositoryIMockCreateConvertedFileExpectation{} + if mmCreateConversation.defaultExpectation == nil { + mmCreateConversation.defaultExpectation = &RepositoryIMockCreateConversationExpectation{} } - if mmCreateConvertedFile.defaultExpectation.params != nil { - mmCreateConvertedFile.mock.t.Fatalf("RepositoryIMock.CreateConvertedFile mock is already set by Expect") + if mmCreateConversation.defaultExpectation.params != nil { + mmCreateConversation.mock.t.Fatalf("RepositoryIMock.CreateConversation mock is already set by Expect") } - if mmCreateConvertedFile.defaultExpectation.paramPtrs == nil { - mmCreateConvertedFile.defaultExpectation.paramPtrs = &RepositoryIMockCreateConvertedFileParamPtrs{} + if mmCreateConversation.defaultExpectation.paramPtrs == nil { + mmCreateConversation.defaultExpectation.paramPtrs = &RepositoryIMockCreateConversationParamPtrs{} } - mmCreateConvertedFile.defaultExpectation.paramPtrs.cf = &cf + mmCreateConversation.defaultExpectation.paramPtrs.ctx = &ctx - return mmCreateConvertedFile + return mmCreateConversation } -// ExpectCallExternalServiceParam3 sets up expected param callExternalService for RepositoryI.CreateConvertedFile -func (mmCreateConvertedFile *mRepositoryIMockCreateConvertedFile) ExpectCallExternalServiceParam3(callExternalService func(convertedFileUID uuid.UUID) (map[string]any, error)) *mRepositoryIMockCreateConvertedFile { - if mmCreateConvertedFile.mock.funcCreateConvertedFile != nil { - mmCreateConvertedFile.mock.t.Fatalf("RepositoryIMock.CreateConvertedFile mock is already set by Set") +// ExpectConvParam2 sets up expected param conv for RepositoryI.CreateConversation +func (mmCreateConversation *mRepositoryIMockCreateConversation) ExpectConvParam2(conv mm_repository.Conversation) *mRepositoryIMockCreateConversation { + if mmCreateConversation.mock.funcCreateConversation != nil { + mmCreateConversation.mock.t.Fatalf("RepositoryIMock.CreateConversation mock is already set by Set") } - if mmCreateConvertedFile.defaultExpectation == nil { - mmCreateConvertedFile.defaultExpectation = &RepositoryIMockCreateConvertedFileExpectation{} + if mmCreateConversation.defaultExpectation == nil { + mmCreateConversation.defaultExpectation = &RepositoryIMockCreateConversationExpectation{} } - if mmCreateConvertedFile.defaultExpectation.params != nil { - mmCreateConvertedFile.mock.t.Fatalf("RepositoryIMock.CreateConvertedFile mock is already set by Expect") + if mmCreateConversation.defaultExpectation.params != nil { + mmCreateConversation.mock.t.Fatalf("RepositoryIMock.CreateConversation mock is already set by Expect") } - if mmCreateConvertedFile.defaultExpectation.paramPtrs == nil { - mmCreateConvertedFile.defaultExpectation.paramPtrs = &RepositoryIMockCreateConvertedFileParamPtrs{} + if mmCreateConversation.defaultExpectation.paramPtrs == nil { + mmCreateConversation.defaultExpectation.paramPtrs = &RepositoryIMockCreateConversationParamPtrs{} } - mmCreateConvertedFile.defaultExpectation.paramPtrs.callExternalService = &callExternalService + mmCreateConversation.defaultExpectation.paramPtrs.conv = &conv - return mmCreateConvertedFile + return mmCreateConversation } -// Inspect accepts an inspector function that has same arguments as the RepositoryI.CreateConvertedFile -func (mmCreateConvertedFile *mRepositoryIMockCreateConvertedFile) Inspect(f func(ctx context.Context, cf mm_repository.ConvertedFile, callExternalService func(convertedFileUID uuid.UUID) (map[string]any, error))) *mRepositoryIMockCreateConvertedFile { - if mmCreateConvertedFile.mock.inspectFuncCreateConvertedFile != nil { - mmCreateConvertedFile.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.CreateConvertedFile") +// Inspect accepts an inspector function that has same arguments as the RepositoryI.CreateConversation +func (mmCreateConversation *mRepositoryIMockCreateConversation) Inspect(f func(ctx context.Context, conv mm_repository.Conversation)) *mRepositoryIMockCreateConversation { + if mmCreateConversation.mock.inspectFuncCreateConversation != nil { + mmCreateConversation.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.CreateConversation") } - mmCreateConvertedFile.mock.inspectFuncCreateConvertedFile = f + mmCreateConversation.mock.inspectFuncCreateConversation = f - return mmCreateConvertedFile + return mmCreateConversation } -// Return sets up results that will be returned by RepositoryI.CreateConvertedFile -func (mmCreateConvertedFile *mRepositoryIMockCreateConvertedFile) Return(cp1 *mm_repository.ConvertedFile, err error) *RepositoryIMock { - if mmCreateConvertedFile.mock.funcCreateConvertedFile != nil { - mmCreateConvertedFile.mock.t.Fatalf("RepositoryIMock.CreateConvertedFile mock is already set by Set") +// Return sets up results that will be returned by RepositoryI.CreateConversation +func (mmCreateConversation *mRepositoryIMockCreateConversation) Return(cp1 *mm_repository.Conversation, err error) *RepositoryIMock { + if mmCreateConversation.mock.funcCreateConversation != nil { + mmCreateConversation.mock.t.Fatalf("RepositoryIMock.CreateConversation mock is already set by Set") } - if mmCreateConvertedFile.defaultExpectation == nil { - mmCreateConvertedFile.defaultExpectation = &RepositoryIMockCreateConvertedFileExpectation{mock: mmCreateConvertedFile.mock} + if mmCreateConversation.defaultExpectation == nil { + mmCreateConversation.defaultExpectation = &RepositoryIMockCreateConversationExpectation{mock: mmCreateConversation.mock} } - mmCreateConvertedFile.defaultExpectation.results = &RepositoryIMockCreateConvertedFileResults{cp1, err} - return mmCreateConvertedFile.mock + mmCreateConversation.defaultExpectation.results = &RepositoryIMockCreateConversationResults{cp1, err} + return mmCreateConversation.mock } -// Set uses given function f to mock the RepositoryI.CreateConvertedFile method -func (mmCreateConvertedFile *mRepositoryIMockCreateConvertedFile) Set(f func(ctx context.Context, cf mm_repository.ConvertedFile, callExternalService func(convertedFileUID uuid.UUID) (map[string]any, error)) (cp1 *mm_repository.ConvertedFile, err error)) *RepositoryIMock { - if mmCreateConvertedFile.defaultExpectation != nil { - mmCreateConvertedFile.mock.t.Fatalf("Default expectation is already set for the RepositoryI.CreateConvertedFile method") +// Set uses given function f to mock the RepositoryI.CreateConversation method +func (mmCreateConversation *mRepositoryIMockCreateConversation) Set(f func(ctx context.Context, conv mm_repository.Conversation) (cp1 *mm_repository.Conversation, err error)) *RepositoryIMock { + if mmCreateConversation.defaultExpectation != nil { + mmCreateConversation.mock.t.Fatalf("Default expectation is already set for the RepositoryI.CreateConversation method") } - if len(mmCreateConvertedFile.expectations) > 0 { - mmCreateConvertedFile.mock.t.Fatalf("Some expectations are already set for the RepositoryI.CreateConvertedFile method") + if len(mmCreateConversation.expectations) > 0 { + mmCreateConversation.mock.t.Fatalf("Some expectations are already set for the RepositoryI.CreateConversation method") } - mmCreateConvertedFile.mock.funcCreateConvertedFile = f - return mmCreateConvertedFile.mock + mmCreateConversation.mock.funcCreateConversation = f + return mmCreateConversation.mock } -// When sets expectation for the RepositoryI.CreateConvertedFile which will trigger the result defined by the following +// When sets expectation for the RepositoryI.CreateConversation which will trigger the result defined by the following // Then helper -func (mmCreateConvertedFile *mRepositoryIMockCreateConvertedFile) When(ctx context.Context, cf mm_repository.ConvertedFile, callExternalService func(convertedFileUID uuid.UUID) (map[string]any, error)) *RepositoryIMockCreateConvertedFileExpectation { - if mmCreateConvertedFile.mock.funcCreateConvertedFile != nil { - mmCreateConvertedFile.mock.t.Fatalf("RepositoryIMock.CreateConvertedFile mock is already set by Set") +func (mmCreateConversation *mRepositoryIMockCreateConversation) When(ctx context.Context, conv mm_repository.Conversation) *RepositoryIMockCreateConversationExpectation { + if mmCreateConversation.mock.funcCreateConversation != nil { + mmCreateConversation.mock.t.Fatalf("RepositoryIMock.CreateConversation mock is already set by Set") } - expectation := &RepositoryIMockCreateConvertedFileExpectation{ - mock: mmCreateConvertedFile.mock, - params: &RepositoryIMockCreateConvertedFileParams{ctx, cf, callExternalService}, + expectation := &RepositoryIMockCreateConversationExpectation{ + mock: mmCreateConversation.mock, + params: &RepositoryIMockCreateConversationParams{ctx, conv}, } - mmCreateConvertedFile.expectations = append(mmCreateConvertedFile.expectations, expectation) + mmCreateConversation.expectations = append(mmCreateConversation.expectations, expectation) return expectation } -// Then sets up RepositoryI.CreateConvertedFile return parameters for the expectation previously defined by the When method -func (e *RepositoryIMockCreateConvertedFileExpectation) Then(cp1 *mm_repository.ConvertedFile, err error) *RepositoryIMock { - e.results = &RepositoryIMockCreateConvertedFileResults{cp1, err} +// Then sets up RepositoryI.CreateConversation return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockCreateConversationExpectation) Then(cp1 *mm_repository.Conversation, err error) *RepositoryIMock { + e.results = &RepositoryIMockCreateConversationResults{cp1, err} return e.mock } -// Times sets number of times RepositoryI.CreateConvertedFile should be invoked -func (mmCreateConvertedFile *mRepositoryIMockCreateConvertedFile) Times(n uint64) *mRepositoryIMockCreateConvertedFile { +// Times sets number of times RepositoryI.CreateConversation should be invoked +func (mmCreateConversation *mRepositoryIMockCreateConversation) Times(n uint64) *mRepositoryIMockCreateConversation { if n == 0 { - mmCreateConvertedFile.mock.t.Fatalf("Times of RepositoryIMock.CreateConvertedFile mock can not be zero") + mmCreateConversation.mock.t.Fatalf("Times of RepositoryIMock.CreateConversation mock can not be zero") } - mm_atomic.StoreUint64(&mmCreateConvertedFile.expectedInvocations, n) - return mmCreateConvertedFile + mm_atomic.StoreUint64(&mmCreateConversation.expectedInvocations, n) + return mmCreateConversation } -func (mmCreateConvertedFile *mRepositoryIMockCreateConvertedFile) invocationsDone() bool { - if len(mmCreateConvertedFile.expectations) == 0 && mmCreateConvertedFile.defaultExpectation == nil && mmCreateConvertedFile.mock.funcCreateConvertedFile == nil { +func (mmCreateConversation *mRepositoryIMockCreateConversation) invocationsDone() bool { + if len(mmCreateConversation.expectations) == 0 && mmCreateConversation.defaultExpectation == nil && mmCreateConversation.mock.funcCreateConversation == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmCreateConvertedFile.mock.afterCreateConvertedFileCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmCreateConvertedFile.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmCreateConversation.mock.afterCreateConversationCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmCreateConversation.expectedInvocations) return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) } -// CreateConvertedFile implements repository.RepositoryI -func (mmCreateConvertedFile *RepositoryIMock) CreateConvertedFile(ctx context.Context, cf mm_repository.ConvertedFile, callExternalService func(convertedFileUID uuid.UUID) (map[string]any, error)) (cp1 *mm_repository.ConvertedFile, err error) { - mm_atomic.AddUint64(&mmCreateConvertedFile.beforeCreateConvertedFileCounter, 1) - defer mm_atomic.AddUint64(&mmCreateConvertedFile.afterCreateConvertedFileCounter, 1) +// CreateConversation implements repository.RepositoryI +func (mmCreateConversation *RepositoryIMock) CreateConversation(ctx context.Context, conv mm_repository.Conversation) (cp1 *mm_repository.Conversation, err error) { + mm_atomic.AddUint64(&mmCreateConversation.beforeCreateConversationCounter, 1) + defer mm_atomic.AddUint64(&mmCreateConversation.afterCreateConversationCounter, 1) - if mmCreateConvertedFile.inspectFuncCreateConvertedFile != nil { - mmCreateConvertedFile.inspectFuncCreateConvertedFile(ctx, cf, callExternalService) + if mmCreateConversation.inspectFuncCreateConversation != nil { + mmCreateConversation.inspectFuncCreateConversation(ctx, conv) } - mm_params := RepositoryIMockCreateConvertedFileParams{ctx, cf, callExternalService} + mm_params := RepositoryIMockCreateConversationParams{ctx, conv} // Record call args - mmCreateConvertedFile.CreateConvertedFileMock.mutex.Lock() - mmCreateConvertedFile.CreateConvertedFileMock.callArgs = append(mmCreateConvertedFile.CreateConvertedFileMock.callArgs, &mm_params) - mmCreateConvertedFile.CreateConvertedFileMock.mutex.Unlock() + mmCreateConversation.CreateConversationMock.mutex.Lock() + mmCreateConversation.CreateConversationMock.callArgs = append(mmCreateConversation.CreateConversationMock.callArgs, &mm_params) + mmCreateConversation.CreateConversationMock.mutex.Unlock() - for _, e := range mmCreateConvertedFile.CreateConvertedFileMock.expectations { + for _, e := range mmCreateConversation.CreateConversationMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) return e.results.cp1, e.results.err } } - if mmCreateConvertedFile.CreateConvertedFileMock.defaultExpectation != nil { - mm_atomic.AddUint64(&mmCreateConvertedFile.CreateConvertedFileMock.defaultExpectation.Counter, 1) - mm_want := mmCreateConvertedFile.CreateConvertedFileMock.defaultExpectation.params - mm_want_ptrs := mmCreateConvertedFile.CreateConvertedFileMock.defaultExpectation.paramPtrs + if mmCreateConversation.CreateConversationMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmCreateConversation.CreateConversationMock.defaultExpectation.Counter, 1) + mm_want := mmCreateConversation.CreateConversationMock.defaultExpectation.params + mm_want_ptrs := mmCreateConversation.CreateConversationMock.defaultExpectation.paramPtrs - mm_got := RepositoryIMockCreateConvertedFileParams{ctx, cf, callExternalService} + mm_got := RepositoryIMockCreateConversationParams{ctx, conv} if mm_want_ptrs != nil { if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { - mmCreateConvertedFile.t.Errorf("RepositoryIMock.CreateConvertedFile 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.cf != nil && !minimock.Equal(*mm_want_ptrs.cf, mm_got.cf) { - mmCreateConvertedFile.t.Errorf("RepositoryIMock.CreateConvertedFile got unexpected parameter cf, want: %#v, got: %#v%s\n", *mm_want_ptrs.cf, mm_got.cf, minimock.Diff(*mm_want_ptrs.cf, mm_got.cf)) + mmCreateConversation.t.Errorf("RepositoryIMock.CreateConversation 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.callExternalService != nil && !minimock.Equal(*mm_want_ptrs.callExternalService, mm_got.callExternalService) { - mmCreateConvertedFile.t.Errorf("RepositoryIMock.CreateConvertedFile got unexpected parameter callExternalService, want: %#v, got: %#v%s\n", *mm_want_ptrs.callExternalService, mm_got.callExternalService, minimock.Diff(*mm_want_ptrs.callExternalService, mm_got.callExternalService)) + if mm_want_ptrs.conv != nil && !minimock.Equal(*mm_want_ptrs.conv, mm_got.conv) { + mmCreateConversation.t.Errorf("RepositoryIMock.CreateConversation got unexpected parameter conv, want: %#v, got: %#v%s\n", *mm_want_ptrs.conv, mm_got.conv, minimock.Diff(*mm_want_ptrs.conv, mm_got.conv)) } } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { - mmCreateConvertedFile.t.Errorf("RepositoryIMock.CreateConvertedFile got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + mmCreateConversation.t.Errorf("RepositoryIMock.CreateConversation got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) } - mm_results := mmCreateConvertedFile.CreateConvertedFileMock.defaultExpectation.results + mm_results := mmCreateConversation.CreateConversationMock.defaultExpectation.results if mm_results == nil { - mmCreateConvertedFile.t.Fatal("No results are set for the RepositoryIMock.CreateConvertedFile") + mmCreateConversation.t.Fatal("No results are set for the RepositoryIMock.CreateConversation") } return (*mm_results).cp1, (*mm_results).err } - if mmCreateConvertedFile.funcCreateConvertedFile != nil { - return mmCreateConvertedFile.funcCreateConvertedFile(ctx, cf, callExternalService) + if mmCreateConversation.funcCreateConversation != nil { + return mmCreateConversation.funcCreateConversation(ctx, conv) } - mmCreateConvertedFile.t.Fatalf("Unexpected call to RepositoryIMock.CreateConvertedFile. %v %v %v", ctx, cf, callExternalService) + mmCreateConversation.t.Fatalf("Unexpected call to RepositoryIMock.CreateConversation. %v %v", ctx, conv) return } -// CreateConvertedFileAfterCounter returns a count of finished RepositoryIMock.CreateConvertedFile invocations -func (mmCreateConvertedFile *RepositoryIMock) CreateConvertedFileAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmCreateConvertedFile.afterCreateConvertedFileCounter) +// CreateConversationAfterCounter returns a count of finished RepositoryIMock.CreateConversation invocations +func (mmCreateConversation *RepositoryIMock) CreateConversationAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmCreateConversation.afterCreateConversationCounter) } -// CreateConvertedFileBeforeCounter returns a count of RepositoryIMock.CreateConvertedFile invocations -func (mmCreateConvertedFile *RepositoryIMock) CreateConvertedFileBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmCreateConvertedFile.beforeCreateConvertedFileCounter) +// CreateConversationBeforeCounter returns a count of RepositoryIMock.CreateConversation invocations +func (mmCreateConversation *RepositoryIMock) CreateConversationBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmCreateConversation.beforeCreateConversationCounter) } -// Calls returns a list of arguments used in each call to RepositoryIMock.CreateConvertedFile. +// Calls returns a list of arguments used in each call to RepositoryIMock.CreateConversation. // The list is in the same order as the calls were made (i.e. recent calls have a higher index) -func (mmCreateConvertedFile *mRepositoryIMockCreateConvertedFile) Calls() []*RepositoryIMockCreateConvertedFileParams { - mmCreateConvertedFile.mutex.RLock() +func (mmCreateConversation *mRepositoryIMockCreateConversation) Calls() []*RepositoryIMockCreateConversationParams { + mmCreateConversation.mutex.RLock() - argCopy := make([]*RepositoryIMockCreateConvertedFileParams, len(mmCreateConvertedFile.callArgs)) - copy(argCopy, mmCreateConvertedFile.callArgs) + argCopy := make([]*RepositoryIMockCreateConversationParams, len(mmCreateConversation.callArgs)) + copy(argCopy, mmCreateConversation.callArgs) - mmCreateConvertedFile.mutex.RUnlock() + mmCreateConversation.mutex.RUnlock() return argCopy } -// MinimockCreateConvertedFileDone returns true if the count of the CreateConvertedFile invocations corresponds +// MinimockCreateConversationDone returns true if the count of the CreateConversation invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockCreateConvertedFileDone() bool { - for _, e := range m.CreateConvertedFileMock.expectations { +func (m *RepositoryIMock) MinimockCreateConversationDone() bool { + for _, e := range m.CreateConversationMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.CreateConvertedFileMock.invocationsDone() + return m.CreateConversationMock.invocationsDone() } -// MinimockCreateConvertedFileInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockCreateConvertedFileInspect() { - for _, e := range m.CreateConvertedFileMock.expectations { +// MinimockCreateConversationInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockCreateConversationInspect() { + for _, e := range m.CreateConversationMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { - m.t.Errorf("Expected call to RepositoryIMock.CreateConvertedFile with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.CreateConversation with params: %#v", *e.params) } } - afterCreateConvertedFileCounter := mm_atomic.LoadUint64(&m.afterCreateConvertedFileCounter) + afterCreateConversationCounter := mm_atomic.LoadUint64(&m.afterCreateConversationCounter) // if default expectation was set then invocations count should be greater than zero - if m.CreateConvertedFileMock.defaultExpectation != nil && afterCreateConvertedFileCounter < 1 { - if m.CreateConvertedFileMock.defaultExpectation.params == nil { - m.t.Error("Expected call to RepositoryIMock.CreateConvertedFile") + if m.CreateConversationMock.defaultExpectation != nil && afterCreateConversationCounter < 1 { + if m.CreateConversationMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.CreateConversation") } else { - m.t.Errorf("Expected call to RepositoryIMock.CreateConvertedFile with params: %#v", *m.CreateConvertedFileMock.defaultExpectation.params) + m.t.Errorf("Expected call to RepositoryIMock.CreateConversation with params: %#v", *m.CreateConversationMock.defaultExpectation.params) } } // if func was set then invocations count should be greater than zero - if m.funcCreateConvertedFile != nil && afterCreateConvertedFileCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.CreateConvertedFile") + if m.funcCreateConversation != nil && afterCreateConversationCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.CreateConversation") } - if !m.CreateConvertedFileMock.invocationsDone() && afterCreateConvertedFileCounter > 0 { - m.t.Errorf("Expected %d calls to RepositoryIMock.CreateConvertedFile but found %d calls", - mm_atomic.LoadUint64(&m.CreateConvertedFileMock.expectedInvocations), afterCreateConvertedFileCounter) + if !m.CreateConversationMock.invocationsDone() && afterCreateConversationCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.CreateConversation but found %d calls", + mm_atomic.LoadUint64(&m.CreateConversationMock.expectedInvocations), afterCreateConversationCounter) } } -type mRepositoryIMockCreateKnowledgeBase struct { +type mRepositoryIMockCreateConvertedFile struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockCreateKnowledgeBaseExpectation - expectations []*RepositoryIMockCreateKnowledgeBaseExpectation + defaultExpectation *RepositoryIMockCreateConvertedFileExpectation + expectations []*RepositoryIMockCreateConvertedFileExpectation - callArgs []*RepositoryIMockCreateKnowledgeBaseParams + callArgs []*RepositoryIMockCreateConvertedFileParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockCreateKnowledgeBaseExpectation specifies expectation struct of the RepositoryI.CreateKnowledgeBase -type RepositoryIMockCreateKnowledgeBaseExpectation struct { +// RepositoryIMockCreateConvertedFileExpectation specifies expectation struct of the RepositoryI.CreateConvertedFile +type RepositoryIMockCreateConvertedFileExpectation struct { mock *RepositoryIMock - params *RepositoryIMockCreateKnowledgeBaseParams - paramPtrs *RepositoryIMockCreateKnowledgeBaseParamPtrs - results *RepositoryIMockCreateKnowledgeBaseResults + params *RepositoryIMockCreateConvertedFileParams + paramPtrs *RepositoryIMockCreateConvertedFileParamPtrs + results *RepositoryIMockCreateConvertedFileResults Counter uint64 } -// RepositoryIMockCreateKnowledgeBaseParams contains parameters of the RepositoryI.CreateKnowledgeBase -type RepositoryIMockCreateKnowledgeBaseParams struct { - ctx context.Context - kb mm_repository.KnowledgeBase - externalService func(kbUID string) error +// RepositoryIMockCreateConvertedFileParams contains parameters of the RepositoryI.CreateConvertedFile +type RepositoryIMockCreateConvertedFileParams struct { + ctx context.Context + cf mm_repository.ConvertedFile + callExternalService func(convertedFileUID uuid.UUID) (map[string]any, error) } -// RepositoryIMockCreateKnowledgeBaseParamPtrs contains pointers to parameters of the RepositoryI.CreateKnowledgeBase -type RepositoryIMockCreateKnowledgeBaseParamPtrs struct { - ctx *context.Context - kb *mm_repository.KnowledgeBase - externalService *func(kbUID string) error +// RepositoryIMockCreateConvertedFileParamPtrs contains pointers to parameters of the RepositoryI.CreateConvertedFile +type RepositoryIMockCreateConvertedFileParamPtrs struct { + ctx *context.Context + cf *mm_repository.ConvertedFile + callExternalService *func(convertedFileUID uuid.UUID) (map[string]any, error) } -// RepositoryIMockCreateKnowledgeBaseResults contains results of the RepositoryI.CreateKnowledgeBase -type RepositoryIMockCreateKnowledgeBaseResults struct { - kp1 *mm_repository.KnowledgeBase +// RepositoryIMockCreateConvertedFileResults contains results of the RepositoryI.CreateConvertedFile +type RepositoryIMockCreateConvertedFileResults struct { + cp1 *mm_repository.ConvertedFile err error } -// Expect sets up expected params for RepositoryI.CreateKnowledgeBase -func (mmCreateKnowledgeBase *mRepositoryIMockCreateKnowledgeBase) Expect(ctx context.Context, kb mm_repository.KnowledgeBase, externalService func(kbUID string) error) *mRepositoryIMockCreateKnowledgeBase { - if mmCreateKnowledgeBase.mock.funcCreateKnowledgeBase != nil { - mmCreateKnowledgeBase.mock.t.Fatalf("RepositoryIMock.CreateKnowledgeBase mock is already set by Set") +// Expect sets up expected params for RepositoryI.CreateConvertedFile +func (mmCreateConvertedFile *mRepositoryIMockCreateConvertedFile) Expect(ctx context.Context, cf mm_repository.ConvertedFile, callExternalService func(convertedFileUID uuid.UUID) (map[string]any, error)) *mRepositoryIMockCreateConvertedFile { + if mmCreateConvertedFile.mock.funcCreateConvertedFile != nil { + mmCreateConvertedFile.mock.t.Fatalf("RepositoryIMock.CreateConvertedFile mock is already set by Set") } - if mmCreateKnowledgeBase.defaultExpectation == nil { - mmCreateKnowledgeBase.defaultExpectation = &RepositoryIMockCreateKnowledgeBaseExpectation{} + if mmCreateConvertedFile.defaultExpectation == nil { + mmCreateConvertedFile.defaultExpectation = &RepositoryIMockCreateConvertedFileExpectation{} } - if mmCreateKnowledgeBase.defaultExpectation.paramPtrs != nil { - mmCreateKnowledgeBase.mock.t.Fatalf("RepositoryIMock.CreateKnowledgeBase mock is already set by ExpectParams functions") + if mmCreateConvertedFile.defaultExpectation.paramPtrs != nil { + mmCreateConvertedFile.mock.t.Fatalf("RepositoryIMock.CreateConvertedFile mock is already set by ExpectParams functions") } - mmCreateKnowledgeBase.defaultExpectation.params = &RepositoryIMockCreateKnowledgeBaseParams{ctx, kb, externalService} - for _, e := range mmCreateKnowledgeBase.expectations { - if minimock.Equal(e.params, mmCreateKnowledgeBase.defaultExpectation.params) { - mmCreateKnowledgeBase.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmCreateKnowledgeBase.defaultExpectation.params) + mmCreateConvertedFile.defaultExpectation.params = &RepositoryIMockCreateConvertedFileParams{ctx, cf, callExternalService} + for _, e := range mmCreateConvertedFile.expectations { + if minimock.Equal(e.params, mmCreateConvertedFile.defaultExpectation.params) { + mmCreateConvertedFile.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmCreateConvertedFile.defaultExpectation.params) } } - return mmCreateKnowledgeBase + return mmCreateConvertedFile } -// ExpectCtxParam1 sets up expected param ctx for RepositoryI.CreateKnowledgeBase -func (mmCreateKnowledgeBase *mRepositoryIMockCreateKnowledgeBase) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockCreateKnowledgeBase { - if mmCreateKnowledgeBase.mock.funcCreateKnowledgeBase != nil { - mmCreateKnowledgeBase.mock.t.Fatalf("RepositoryIMock.CreateKnowledgeBase mock is already set by Set") +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.CreateConvertedFile +func (mmCreateConvertedFile *mRepositoryIMockCreateConvertedFile) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockCreateConvertedFile { + if mmCreateConvertedFile.mock.funcCreateConvertedFile != nil { + mmCreateConvertedFile.mock.t.Fatalf("RepositoryIMock.CreateConvertedFile mock is already set by Set") } - if mmCreateKnowledgeBase.defaultExpectation == nil { - mmCreateKnowledgeBase.defaultExpectation = &RepositoryIMockCreateKnowledgeBaseExpectation{} + if mmCreateConvertedFile.defaultExpectation == nil { + mmCreateConvertedFile.defaultExpectation = &RepositoryIMockCreateConvertedFileExpectation{} } - if mmCreateKnowledgeBase.defaultExpectation.params != nil { - mmCreateKnowledgeBase.mock.t.Fatalf("RepositoryIMock.CreateKnowledgeBase mock is already set by Expect") + if mmCreateConvertedFile.defaultExpectation.params != nil { + mmCreateConvertedFile.mock.t.Fatalf("RepositoryIMock.CreateConvertedFile mock is already set by Expect") } - if mmCreateKnowledgeBase.defaultExpectation.paramPtrs == nil { - mmCreateKnowledgeBase.defaultExpectation.paramPtrs = &RepositoryIMockCreateKnowledgeBaseParamPtrs{} + if mmCreateConvertedFile.defaultExpectation.paramPtrs == nil { + mmCreateConvertedFile.defaultExpectation.paramPtrs = &RepositoryIMockCreateConvertedFileParamPtrs{} } - mmCreateKnowledgeBase.defaultExpectation.paramPtrs.ctx = &ctx + mmCreateConvertedFile.defaultExpectation.paramPtrs.ctx = &ctx - return mmCreateKnowledgeBase + return mmCreateConvertedFile } -// ExpectKbParam2 sets up expected param kb for RepositoryI.CreateKnowledgeBase -func (mmCreateKnowledgeBase *mRepositoryIMockCreateKnowledgeBase) ExpectKbParam2(kb mm_repository.KnowledgeBase) *mRepositoryIMockCreateKnowledgeBase { - if mmCreateKnowledgeBase.mock.funcCreateKnowledgeBase != nil { - mmCreateKnowledgeBase.mock.t.Fatalf("RepositoryIMock.CreateKnowledgeBase mock is already set by Set") +// ExpectCfParam2 sets up expected param cf for RepositoryI.CreateConvertedFile +func (mmCreateConvertedFile *mRepositoryIMockCreateConvertedFile) ExpectCfParam2(cf mm_repository.ConvertedFile) *mRepositoryIMockCreateConvertedFile { + if mmCreateConvertedFile.mock.funcCreateConvertedFile != nil { + mmCreateConvertedFile.mock.t.Fatalf("RepositoryIMock.CreateConvertedFile mock is already set by Set") } - if mmCreateKnowledgeBase.defaultExpectation == nil { - mmCreateKnowledgeBase.defaultExpectation = &RepositoryIMockCreateKnowledgeBaseExpectation{} + if mmCreateConvertedFile.defaultExpectation == nil { + mmCreateConvertedFile.defaultExpectation = &RepositoryIMockCreateConvertedFileExpectation{} } - if mmCreateKnowledgeBase.defaultExpectation.params != nil { - mmCreateKnowledgeBase.mock.t.Fatalf("RepositoryIMock.CreateKnowledgeBase mock is already set by Expect") + if mmCreateConvertedFile.defaultExpectation.params != nil { + mmCreateConvertedFile.mock.t.Fatalf("RepositoryIMock.CreateConvertedFile mock is already set by Expect") } - if mmCreateKnowledgeBase.defaultExpectation.paramPtrs == nil { - mmCreateKnowledgeBase.defaultExpectation.paramPtrs = &RepositoryIMockCreateKnowledgeBaseParamPtrs{} + if mmCreateConvertedFile.defaultExpectation.paramPtrs == nil { + mmCreateConvertedFile.defaultExpectation.paramPtrs = &RepositoryIMockCreateConvertedFileParamPtrs{} } - mmCreateKnowledgeBase.defaultExpectation.paramPtrs.kb = &kb + mmCreateConvertedFile.defaultExpectation.paramPtrs.cf = &cf - return mmCreateKnowledgeBase + return mmCreateConvertedFile } -// ExpectExternalServiceParam3 sets up expected param externalService for RepositoryI.CreateKnowledgeBase -func (mmCreateKnowledgeBase *mRepositoryIMockCreateKnowledgeBase) ExpectExternalServiceParam3(externalService func(kbUID string) error) *mRepositoryIMockCreateKnowledgeBase { - if mmCreateKnowledgeBase.mock.funcCreateKnowledgeBase != nil { - mmCreateKnowledgeBase.mock.t.Fatalf("RepositoryIMock.CreateKnowledgeBase mock is already set by Set") +// ExpectCallExternalServiceParam3 sets up expected param callExternalService for RepositoryI.CreateConvertedFile +func (mmCreateConvertedFile *mRepositoryIMockCreateConvertedFile) ExpectCallExternalServiceParam3(callExternalService func(convertedFileUID uuid.UUID) (map[string]any, error)) *mRepositoryIMockCreateConvertedFile { + if mmCreateConvertedFile.mock.funcCreateConvertedFile != nil { + mmCreateConvertedFile.mock.t.Fatalf("RepositoryIMock.CreateConvertedFile mock is already set by Set") } - if mmCreateKnowledgeBase.defaultExpectation == nil { - mmCreateKnowledgeBase.defaultExpectation = &RepositoryIMockCreateKnowledgeBaseExpectation{} + if mmCreateConvertedFile.defaultExpectation == nil { + mmCreateConvertedFile.defaultExpectation = &RepositoryIMockCreateConvertedFileExpectation{} } - if mmCreateKnowledgeBase.defaultExpectation.params != nil { - mmCreateKnowledgeBase.mock.t.Fatalf("RepositoryIMock.CreateKnowledgeBase mock is already set by Expect") + if mmCreateConvertedFile.defaultExpectation.params != nil { + mmCreateConvertedFile.mock.t.Fatalf("RepositoryIMock.CreateConvertedFile mock is already set by Expect") } - if mmCreateKnowledgeBase.defaultExpectation.paramPtrs == nil { - mmCreateKnowledgeBase.defaultExpectation.paramPtrs = &RepositoryIMockCreateKnowledgeBaseParamPtrs{} + if mmCreateConvertedFile.defaultExpectation.paramPtrs == nil { + mmCreateConvertedFile.defaultExpectation.paramPtrs = &RepositoryIMockCreateConvertedFileParamPtrs{} } - mmCreateKnowledgeBase.defaultExpectation.paramPtrs.externalService = &externalService + mmCreateConvertedFile.defaultExpectation.paramPtrs.callExternalService = &callExternalService - return mmCreateKnowledgeBase + return mmCreateConvertedFile } -// Inspect accepts an inspector function that has same arguments as the RepositoryI.CreateKnowledgeBase -func (mmCreateKnowledgeBase *mRepositoryIMockCreateKnowledgeBase) Inspect(f func(ctx context.Context, kb mm_repository.KnowledgeBase, externalService func(kbUID string) error)) *mRepositoryIMockCreateKnowledgeBase { - if mmCreateKnowledgeBase.mock.inspectFuncCreateKnowledgeBase != nil { - mmCreateKnowledgeBase.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.CreateKnowledgeBase") +// Inspect accepts an inspector function that has same arguments as the RepositoryI.CreateConvertedFile +func (mmCreateConvertedFile *mRepositoryIMockCreateConvertedFile) Inspect(f func(ctx context.Context, cf mm_repository.ConvertedFile, callExternalService func(convertedFileUID uuid.UUID) (map[string]any, error))) *mRepositoryIMockCreateConvertedFile { + if mmCreateConvertedFile.mock.inspectFuncCreateConvertedFile != nil { + mmCreateConvertedFile.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.CreateConvertedFile") } - mmCreateKnowledgeBase.mock.inspectFuncCreateKnowledgeBase = f + mmCreateConvertedFile.mock.inspectFuncCreateConvertedFile = f - return mmCreateKnowledgeBase + return mmCreateConvertedFile } -// Return sets up results that will be returned by RepositoryI.CreateKnowledgeBase -func (mmCreateKnowledgeBase *mRepositoryIMockCreateKnowledgeBase) Return(kp1 *mm_repository.KnowledgeBase, err error) *RepositoryIMock { - if mmCreateKnowledgeBase.mock.funcCreateKnowledgeBase != nil { - mmCreateKnowledgeBase.mock.t.Fatalf("RepositoryIMock.CreateKnowledgeBase mock is already set by Set") +// Return sets up results that will be returned by RepositoryI.CreateConvertedFile +func (mmCreateConvertedFile *mRepositoryIMockCreateConvertedFile) Return(cp1 *mm_repository.ConvertedFile, err error) *RepositoryIMock { + if mmCreateConvertedFile.mock.funcCreateConvertedFile != nil { + mmCreateConvertedFile.mock.t.Fatalf("RepositoryIMock.CreateConvertedFile mock is already set by Set") } - if mmCreateKnowledgeBase.defaultExpectation == nil { - mmCreateKnowledgeBase.defaultExpectation = &RepositoryIMockCreateKnowledgeBaseExpectation{mock: mmCreateKnowledgeBase.mock} + if mmCreateConvertedFile.defaultExpectation == nil { + mmCreateConvertedFile.defaultExpectation = &RepositoryIMockCreateConvertedFileExpectation{mock: mmCreateConvertedFile.mock} } - mmCreateKnowledgeBase.defaultExpectation.results = &RepositoryIMockCreateKnowledgeBaseResults{kp1, err} - return mmCreateKnowledgeBase.mock + mmCreateConvertedFile.defaultExpectation.results = &RepositoryIMockCreateConvertedFileResults{cp1, err} + return mmCreateConvertedFile.mock } -// Set uses given function f to mock the RepositoryI.CreateKnowledgeBase method -func (mmCreateKnowledgeBase *mRepositoryIMockCreateKnowledgeBase) Set(f func(ctx context.Context, kb mm_repository.KnowledgeBase, externalService func(kbUID string) error) (kp1 *mm_repository.KnowledgeBase, err error)) *RepositoryIMock { - if mmCreateKnowledgeBase.defaultExpectation != nil { - mmCreateKnowledgeBase.mock.t.Fatalf("Default expectation is already set for the RepositoryI.CreateKnowledgeBase method") +// Set uses given function f to mock the RepositoryI.CreateConvertedFile method +func (mmCreateConvertedFile *mRepositoryIMockCreateConvertedFile) Set(f func(ctx context.Context, cf mm_repository.ConvertedFile, callExternalService func(convertedFileUID uuid.UUID) (map[string]any, error)) (cp1 *mm_repository.ConvertedFile, err error)) *RepositoryIMock { + if mmCreateConvertedFile.defaultExpectation != nil { + mmCreateConvertedFile.mock.t.Fatalf("Default expectation is already set for the RepositoryI.CreateConvertedFile method") } - if len(mmCreateKnowledgeBase.expectations) > 0 { - mmCreateKnowledgeBase.mock.t.Fatalf("Some expectations are already set for the RepositoryI.CreateKnowledgeBase method") + if len(mmCreateConvertedFile.expectations) > 0 { + mmCreateConvertedFile.mock.t.Fatalf("Some expectations are already set for the RepositoryI.CreateConvertedFile method") } - mmCreateKnowledgeBase.mock.funcCreateKnowledgeBase = f - return mmCreateKnowledgeBase.mock + mmCreateConvertedFile.mock.funcCreateConvertedFile = f + return mmCreateConvertedFile.mock } -// When sets expectation for the RepositoryI.CreateKnowledgeBase which will trigger the result defined by the following +// When sets expectation for the RepositoryI.CreateConvertedFile which will trigger the result defined by the following // Then helper -func (mmCreateKnowledgeBase *mRepositoryIMockCreateKnowledgeBase) When(ctx context.Context, kb mm_repository.KnowledgeBase, externalService func(kbUID string) error) *RepositoryIMockCreateKnowledgeBaseExpectation { - if mmCreateKnowledgeBase.mock.funcCreateKnowledgeBase != nil { - mmCreateKnowledgeBase.mock.t.Fatalf("RepositoryIMock.CreateKnowledgeBase mock is already set by Set") +func (mmCreateConvertedFile *mRepositoryIMockCreateConvertedFile) When(ctx context.Context, cf mm_repository.ConvertedFile, callExternalService func(convertedFileUID uuid.UUID) (map[string]any, error)) *RepositoryIMockCreateConvertedFileExpectation { + if mmCreateConvertedFile.mock.funcCreateConvertedFile != nil { + mmCreateConvertedFile.mock.t.Fatalf("RepositoryIMock.CreateConvertedFile mock is already set by Set") } - expectation := &RepositoryIMockCreateKnowledgeBaseExpectation{ - mock: mmCreateKnowledgeBase.mock, - params: &RepositoryIMockCreateKnowledgeBaseParams{ctx, kb, externalService}, + expectation := &RepositoryIMockCreateConvertedFileExpectation{ + mock: mmCreateConvertedFile.mock, + params: &RepositoryIMockCreateConvertedFileParams{ctx, cf, callExternalService}, } - mmCreateKnowledgeBase.expectations = append(mmCreateKnowledgeBase.expectations, expectation) + mmCreateConvertedFile.expectations = append(mmCreateConvertedFile.expectations, expectation) return expectation } -// Then sets up RepositoryI.CreateKnowledgeBase return parameters for the expectation previously defined by the When method -func (e *RepositoryIMockCreateKnowledgeBaseExpectation) Then(kp1 *mm_repository.KnowledgeBase, err error) *RepositoryIMock { - e.results = &RepositoryIMockCreateKnowledgeBaseResults{kp1, err} +// Then sets up RepositoryI.CreateConvertedFile return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockCreateConvertedFileExpectation) Then(cp1 *mm_repository.ConvertedFile, err error) *RepositoryIMock { + e.results = &RepositoryIMockCreateConvertedFileResults{cp1, err} return e.mock } -// Times sets number of times RepositoryI.CreateKnowledgeBase should be invoked -func (mmCreateKnowledgeBase *mRepositoryIMockCreateKnowledgeBase) Times(n uint64) *mRepositoryIMockCreateKnowledgeBase { +// Times sets number of times RepositoryI.CreateConvertedFile should be invoked +func (mmCreateConvertedFile *mRepositoryIMockCreateConvertedFile) Times(n uint64) *mRepositoryIMockCreateConvertedFile { if n == 0 { - mmCreateKnowledgeBase.mock.t.Fatalf("Times of RepositoryIMock.CreateKnowledgeBase mock can not be zero") + mmCreateConvertedFile.mock.t.Fatalf("Times of RepositoryIMock.CreateConvertedFile mock can not be zero") } - mm_atomic.StoreUint64(&mmCreateKnowledgeBase.expectedInvocations, n) - return mmCreateKnowledgeBase + mm_atomic.StoreUint64(&mmCreateConvertedFile.expectedInvocations, n) + return mmCreateConvertedFile } -func (mmCreateKnowledgeBase *mRepositoryIMockCreateKnowledgeBase) invocationsDone() bool { - if len(mmCreateKnowledgeBase.expectations) == 0 && mmCreateKnowledgeBase.defaultExpectation == nil && mmCreateKnowledgeBase.mock.funcCreateKnowledgeBase == nil { +func (mmCreateConvertedFile *mRepositoryIMockCreateConvertedFile) invocationsDone() bool { + if len(mmCreateConvertedFile.expectations) == 0 && mmCreateConvertedFile.defaultExpectation == nil && mmCreateConvertedFile.mock.funcCreateConvertedFile == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmCreateKnowledgeBase.mock.afterCreateKnowledgeBaseCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmCreateKnowledgeBase.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmCreateConvertedFile.mock.afterCreateConvertedFileCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmCreateConvertedFile.expectedInvocations) return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) } -// CreateKnowledgeBase implements repository.RepositoryI -func (mmCreateKnowledgeBase *RepositoryIMock) CreateKnowledgeBase(ctx context.Context, kb mm_repository.KnowledgeBase, externalService func(kbUID string) error) (kp1 *mm_repository.KnowledgeBase, err error) { - mm_atomic.AddUint64(&mmCreateKnowledgeBase.beforeCreateKnowledgeBaseCounter, 1) - defer mm_atomic.AddUint64(&mmCreateKnowledgeBase.afterCreateKnowledgeBaseCounter, 1) +// CreateConvertedFile implements repository.RepositoryI +func (mmCreateConvertedFile *RepositoryIMock) CreateConvertedFile(ctx context.Context, cf mm_repository.ConvertedFile, callExternalService func(convertedFileUID uuid.UUID) (map[string]any, error)) (cp1 *mm_repository.ConvertedFile, err error) { + mm_atomic.AddUint64(&mmCreateConvertedFile.beforeCreateConvertedFileCounter, 1) + defer mm_atomic.AddUint64(&mmCreateConvertedFile.afterCreateConvertedFileCounter, 1) - if mmCreateKnowledgeBase.inspectFuncCreateKnowledgeBase != nil { - mmCreateKnowledgeBase.inspectFuncCreateKnowledgeBase(ctx, kb, externalService) + if mmCreateConvertedFile.inspectFuncCreateConvertedFile != nil { + mmCreateConvertedFile.inspectFuncCreateConvertedFile(ctx, cf, callExternalService) } - mm_params := RepositoryIMockCreateKnowledgeBaseParams{ctx, kb, externalService} + mm_params := RepositoryIMockCreateConvertedFileParams{ctx, cf, callExternalService} // Record call args - mmCreateKnowledgeBase.CreateKnowledgeBaseMock.mutex.Lock() - mmCreateKnowledgeBase.CreateKnowledgeBaseMock.callArgs = append(mmCreateKnowledgeBase.CreateKnowledgeBaseMock.callArgs, &mm_params) - mmCreateKnowledgeBase.CreateKnowledgeBaseMock.mutex.Unlock() + mmCreateConvertedFile.CreateConvertedFileMock.mutex.Lock() + mmCreateConvertedFile.CreateConvertedFileMock.callArgs = append(mmCreateConvertedFile.CreateConvertedFileMock.callArgs, &mm_params) + mmCreateConvertedFile.CreateConvertedFileMock.mutex.Unlock() - for _, e := range mmCreateKnowledgeBase.CreateKnowledgeBaseMock.expectations { + for _, e := range mmCreateConvertedFile.CreateConvertedFileMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.kp1, e.results.err + return e.results.cp1, e.results.err } } - if mmCreateKnowledgeBase.CreateKnowledgeBaseMock.defaultExpectation != nil { - mm_atomic.AddUint64(&mmCreateKnowledgeBase.CreateKnowledgeBaseMock.defaultExpectation.Counter, 1) - mm_want := mmCreateKnowledgeBase.CreateKnowledgeBaseMock.defaultExpectation.params - mm_want_ptrs := mmCreateKnowledgeBase.CreateKnowledgeBaseMock.defaultExpectation.paramPtrs + if mmCreateConvertedFile.CreateConvertedFileMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmCreateConvertedFile.CreateConvertedFileMock.defaultExpectation.Counter, 1) + mm_want := mmCreateConvertedFile.CreateConvertedFileMock.defaultExpectation.params + mm_want_ptrs := mmCreateConvertedFile.CreateConvertedFileMock.defaultExpectation.paramPtrs - mm_got := RepositoryIMockCreateKnowledgeBaseParams{ctx, kb, externalService} + mm_got := RepositoryIMockCreateConvertedFileParams{ctx, cf, callExternalService} if mm_want_ptrs != nil { if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { - mmCreateKnowledgeBase.t.Errorf("RepositoryIMock.CreateKnowledgeBase 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)) + mmCreateConvertedFile.t.Errorf("RepositoryIMock.CreateConvertedFile 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.kb != nil && !minimock.Equal(*mm_want_ptrs.kb, mm_got.kb) { - mmCreateKnowledgeBase.t.Errorf("RepositoryIMock.CreateKnowledgeBase got unexpected parameter kb, want: %#v, got: %#v%s\n", *mm_want_ptrs.kb, mm_got.kb, minimock.Diff(*mm_want_ptrs.kb, mm_got.kb)) + if mm_want_ptrs.cf != nil && !minimock.Equal(*mm_want_ptrs.cf, mm_got.cf) { + mmCreateConvertedFile.t.Errorf("RepositoryIMock.CreateConvertedFile got unexpected parameter cf, want: %#v, got: %#v%s\n", *mm_want_ptrs.cf, mm_got.cf, minimock.Diff(*mm_want_ptrs.cf, mm_got.cf)) } - if mm_want_ptrs.externalService != nil && !minimock.Equal(*mm_want_ptrs.externalService, mm_got.externalService) { - mmCreateKnowledgeBase.t.Errorf("RepositoryIMock.CreateKnowledgeBase got unexpected parameter externalService, want: %#v, got: %#v%s\n", *mm_want_ptrs.externalService, mm_got.externalService, minimock.Diff(*mm_want_ptrs.externalService, mm_got.externalService)) + if mm_want_ptrs.callExternalService != nil && !minimock.Equal(*mm_want_ptrs.callExternalService, mm_got.callExternalService) { + mmCreateConvertedFile.t.Errorf("RepositoryIMock.CreateConvertedFile got unexpected parameter callExternalService, want: %#v, got: %#v%s\n", *mm_want_ptrs.callExternalService, mm_got.callExternalService, minimock.Diff(*mm_want_ptrs.callExternalService, mm_got.callExternalService)) } } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { - mmCreateKnowledgeBase.t.Errorf("RepositoryIMock.CreateKnowledgeBase got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + mmCreateConvertedFile.t.Errorf("RepositoryIMock.CreateConvertedFile got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) } - mm_results := mmCreateKnowledgeBase.CreateKnowledgeBaseMock.defaultExpectation.results + mm_results := mmCreateConvertedFile.CreateConvertedFileMock.defaultExpectation.results if mm_results == nil { - mmCreateKnowledgeBase.t.Fatal("No results are set for the RepositoryIMock.CreateKnowledgeBase") + mmCreateConvertedFile.t.Fatal("No results are set for the RepositoryIMock.CreateConvertedFile") } - return (*mm_results).kp1, (*mm_results).err + return (*mm_results).cp1, (*mm_results).err } - if mmCreateKnowledgeBase.funcCreateKnowledgeBase != nil { - return mmCreateKnowledgeBase.funcCreateKnowledgeBase(ctx, kb, externalService) + if mmCreateConvertedFile.funcCreateConvertedFile != nil { + return mmCreateConvertedFile.funcCreateConvertedFile(ctx, cf, callExternalService) } - mmCreateKnowledgeBase.t.Fatalf("Unexpected call to RepositoryIMock.CreateKnowledgeBase. %v %v %v", ctx, kb, externalService) + mmCreateConvertedFile.t.Fatalf("Unexpected call to RepositoryIMock.CreateConvertedFile. %v %v %v", ctx, cf, callExternalService) return } -// CreateKnowledgeBaseAfterCounter returns a count of finished RepositoryIMock.CreateKnowledgeBase invocations -func (mmCreateKnowledgeBase *RepositoryIMock) CreateKnowledgeBaseAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmCreateKnowledgeBase.afterCreateKnowledgeBaseCounter) +// CreateConvertedFileAfterCounter returns a count of finished RepositoryIMock.CreateConvertedFile invocations +func (mmCreateConvertedFile *RepositoryIMock) CreateConvertedFileAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmCreateConvertedFile.afterCreateConvertedFileCounter) } -// CreateKnowledgeBaseBeforeCounter returns a count of RepositoryIMock.CreateKnowledgeBase invocations -func (mmCreateKnowledgeBase *RepositoryIMock) CreateKnowledgeBaseBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmCreateKnowledgeBase.beforeCreateKnowledgeBaseCounter) +// CreateConvertedFileBeforeCounter returns a count of RepositoryIMock.CreateConvertedFile invocations +func (mmCreateConvertedFile *RepositoryIMock) CreateConvertedFileBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmCreateConvertedFile.beforeCreateConvertedFileCounter) } -// Calls returns a list of arguments used in each call to RepositoryIMock.CreateKnowledgeBase. +// Calls returns a list of arguments used in each call to RepositoryIMock.CreateConvertedFile. // The list is in the same order as the calls were made (i.e. recent calls have a higher index) -func (mmCreateKnowledgeBase *mRepositoryIMockCreateKnowledgeBase) Calls() []*RepositoryIMockCreateKnowledgeBaseParams { - mmCreateKnowledgeBase.mutex.RLock() +func (mmCreateConvertedFile *mRepositoryIMockCreateConvertedFile) Calls() []*RepositoryIMockCreateConvertedFileParams { + mmCreateConvertedFile.mutex.RLock() - argCopy := make([]*RepositoryIMockCreateKnowledgeBaseParams, len(mmCreateKnowledgeBase.callArgs)) - copy(argCopy, mmCreateKnowledgeBase.callArgs) + argCopy := make([]*RepositoryIMockCreateConvertedFileParams, len(mmCreateConvertedFile.callArgs)) + copy(argCopy, mmCreateConvertedFile.callArgs) - mmCreateKnowledgeBase.mutex.RUnlock() + mmCreateConvertedFile.mutex.RUnlock() return argCopy } -// MinimockCreateKnowledgeBaseDone returns true if the count of the CreateKnowledgeBase invocations corresponds +// MinimockCreateConvertedFileDone returns true if the count of the CreateConvertedFile invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockCreateKnowledgeBaseDone() bool { - for _, e := range m.CreateKnowledgeBaseMock.expectations { +func (m *RepositoryIMock) MinimockCreateConvertedFileDone() bool { + for _, e := range m.CreateConvertedFileMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.CreateKnowledgeBaseMock.invocationsDone() + return m.CreateConvertedFileMock.invocationsDone() } -// MinimockCreateKnowledgeBaseInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockCreateKnowledgeBaseInspect() { - for _, e := range m.CreateKnowledgeBaseMock.expectations { +// MinimockCreateConvertedFileInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockCreateConvertedFileInspect() { + for _, e := range m.CreateConvertedFileMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { - m.t.Errorf("Expected call to RepositoryIMock.CreateKnowledgeBase with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.CreateConvertedFile with params: %#v", *e.params) } } - afterCreateKnowledgeBaseCounter := mm_atomic.LoadUint64(&m.afterCreateKnowledgeBaseCounter) + afterCreateConvertedFileCounter := mm_atomic.LoadUint64(&m.afterCreateConvertedFileCounter) // if default expectation was set then invocations count should be greater than zero - if m.CreateKnowledgeBaseMock.defaultExpectation != nil && afterCreateKnowledgeBaseCounter < 1 { - if m.CreateKnowledgeBaseMock.defaultExpectation.params == nil { - m.t.Error("Expected call to RepositoryIMock.CreateKnowledgeBase") + if m.CreateConvertedFileMock.defaultExpectation != nil && afterCreateConvertedFileCounter < 1 { + if m.CreateConvertedFileMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.CreateConvertedFile") } else { - m.t.Errorf("Expected call to RepositoryIMock.CreateKnowledgeBase with params: %#v", *m.CreateKnowledgeBaseMock.defaultExpectation.params) + m.t.Errorf("Expected call to RepositoryIMock.CreateConvertedFile with params: %#v", *m.CreateConvertedFileMock.defaultExpectation.params) } } // if func was set then invocations count should be greater than zero - if m.funcCreateKnowledgeBase != nil && afterCreateKnowledgeBaseCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.CreateKnowledgeBase") + if m.funcCreateConvertedFile != nil && afterCreateConvertedFileCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.CreateConvertedFile") } - if !m.CreateKnowledgeBaseMock.invocationsDone() && afterCreateKnowledgeBaseCounter > 0 { - m.t.Errorf("Expected %d calls to RepositoryIMock.CreateKnowledgeBase but found %d calls", - mm_atomic.LoadUint64(&m.CreateKnowledgeBaseMock.expectedInvocations), afterCreateKnowledgeBaseCounter) + if !m.CreateConvertedFileMock.invocationsDone() && afterCreateConvertedFileCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.CreateConvertedFile but found %d calls", + mm_atomic.LoadUint64(&m.CreateConvertedFileMock.expectedInvocations), afterCreateConvertedFileCounter) } } -type mRepositoryIMockCreateKnowledgeBaseFile struct { +type mRepositoryIMockCreateKnowledgeBase struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockCreateKnowledgeBaseFileExpectation - expectations []*RepositoryIMockCreateKnowledgeBaseFileExpectation + defaultExpectation *RepositoryIMockCreateKnowledgeBaseExpectation + expectations []*RepositoryIMockCreateKnowledgeBaseExpectation - callArgs []*RepositoryIMockCreateKnowledgeBaseFileParams + callArgs []*RepositoryIMockCreateKnowledgeBaseParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockCreateKnowledgeBaseFileExpectation specifies expectation struct of the RepositoryI.CreateKnowledgeBaseFile -type RepositoryIMockCreateKnowledgeBaseFileExpectation struct { +// RepositoryIMockCreateKnowledgeBaseExpectation specifies expectation struct of the RepositoryI.CreateKnowledgeBase +type RepositoryIMockCreateKnowledgeBaseExpectation struct { mock *RepositoryIMock - params *RepositoryIMockCreateKnowledgeBaseFileParams - paramPtrs *RepositoryIMockCreateKnowledgeBaseFileParamPtrs - results *RepositoryIMockCreateKnowledgeBaseFileResults + params *RepositoryIMockCreateKnowledgeBaseParams + paramPtrs *RepositoryIMockCreateKnowledgeBaseParamPtrs + results *RepositoryIMockCreateKnowledgeBaseResults Counter uint64 } -// RepositoryIMockCreateKnowledgeBaseFileParams contains parameters of the RepositoryI.CreateKnowledgeBaseFile -type RepositoryIMockCreateKnowledgeBaseFileParams struct { - ctx context.Context - kb mm_repository.KnowledgeBaseFile - externalServiceCall func(FileUID string) error +// RepositoryIMockCreateKnowledgeBaseParams contains parameters of the RepositoryI.CreateKnowledgeBase +type RepositoryIMockCreateKnowledgeBaseParams struct { + ctx context.Context + kb mm_repository.KnowledgeBase + externalService func(kbUID string) error } -// RepositoryIMockCreateKnowledgeBaseFileParamPtrs contains pointers to parameters of the RepositoryI.CreateKnowledgeBaseFile -type RepositoryIMockCreateKnowledgeBaseFileParamPtrs struct { - ctx *context.Context - kb *mm_repository.KnowledgeBaseFile - externalServiceCall *func(FileUID string) error +// RepositoryIMockCreateKnowledgeBaseParamPtrs contains pointers to parameters of the RepositoryI.CreateKnowledgeBase +type RepositoryIMockCreateKnowledgeBaseParamPtrs struct { + ctx *context.Context + kb *mm_repository.KnowledgeBase + externalService *func(kbUID string) error } -// RepositoryIMockCreateKnowledgeBaseFileResults contains results of the RepositoryI.CreateKnowledgeBaseFile -type RepositoryIMockCreateKnowledgeBaseFileResults struct { - kp1 *mm_repository.KnowledgeBaseFile +// RepositoryIMockCreateKnowledgeBaseResults contains results of the RepositoryI.CreateKnowledgeBase +type RepositoryIMockCreateKnowledgeBaseResults struct { + kp1 *mm_repository.KnowledgeBase err error } -// Expect sets up expected params for RepositoryI.CreateKnowledgeBaseFile -func (mmCreateKnowledgeBaseFile *mRepositoryIMockCreateKnowledgeBaseFile) Expect(ctx context.Context, kb mm_repository.KnowledgeBaseFile, externalServiceCall func(FileUID string) error) *mRepositoryIMockCreateKnowledgeBaseFile { - if mmCreateKnowledgeBaseFile.mock.funcCreateKnowledgeBaseFile != nil { - mmCreateKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.CreateKnowledgeBaseFile mock is already set by Set") +// Expect sets up expected params for RepositoryI.CreateKnowledgeBase +func (mmCreateKnowledgeBase *mRepositoryIMockCreateKnowledgeBase) Expect(ctx context.Context, kb mm_repository.KnowledgeBase, externalService func(kbUID string) error) *mRepositoryIMockCreateKnowledgeBase { + if mmCreateKnowledgeBase.mock.funcCreateKnowledgeBase != nil { + mmCreateKnowledgeBase.mock.t.Fatalf("RepositoryIMock.CreateKnowledgeBase mock is already set by Set") } - if mmCreateKnowledgeBaseFile.defaultExpectation == nil { - mmCreateKnowledgeBaseFile.defaultExpectation = &RepositoryIMockCreateKnowledgeBaseFileExpectation{} + if mmCreateKnowledgeBase.defaultExpectation == nil { + mmCreateKnowledgeBase.defaultExpectation = &RepositoryIMockCreateKnowledgeBaseExpectation{} } - if mmCreateKnowledgeBaseFile.defaultExpectation.paramPtrs != nil { - mmCreateKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.CreateKnowledgeBaseFile mock is already set by ExpectParams functions") + if mmCreateKnowledgeBase.defaultExpectation.paramPtrs != nil { + mmCreateKnowledgeBase.mock.t.Fatalf("RepositoryIMock.CreateKnowledgeBase mock is already set by ExpectParams functions") } - mmCreateKnowledgeBaseFile.defaultExpectation.params = &RepositoryIMockCreateKnowledgeBaseFileParams{ctx, kb, externalServiceCall} - for _, e := range mmCreateKnowledgeBaseFile.expectations { - if minimock.Equal(e.params, mmCreateKnowledgeBaseFile.defaultExpectation.params) { - mmCreateKnowledgeBaseFile.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmCreateKnowledgeBaseFile.defaultExpectation.params) + mmCreateKnowledgeBase.defaultExpectation.params = &RepositoryIMockCreateKnowledgeBaseParams{ctx, kb, externalService} + for _, e := range mmCreateKnowledgeBase.expectations { + if minimock.Equal(e.params, mmCreateKnowledgeBase.defaultExpectation.params) { + mmCreateKnowledgeBase.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmCreateKnowledgeBase.defaultExpectation.params) } } - return mmCreateKnowledgeBaseFile + return mmCreateKnowledgeBase } -// ExpectCtxParam1 sets up expected param ctx for RepositoryI.CreateKnowledgeBaseFile -func (mmCreateKnowledgeBaseFile *mRepositoryIMockCreateKnowledgeBaseFile) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockCreateKnowledgeBaseFile { - if mmCreateKnowledgeBaseFile.mock.funcCreateKnowledgeBaseFile != nil { - mmCreateKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.CreateKnowledgeBaseFile mock is already set by Set") +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.CreateKnowledgeBase +func (mmCreateKnowledgeBase *mRepositoryIMockCreateKnowledgeBase) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockCreateKnowledgeBase { + if mmCreateKnowledgeBase.mock.funcCreateKnowledgeBase != nil { + mmCreateKnowledgeBase.mock.t.Fatalf("RepositoryIMock.CreateKnowledgeBase mock is already set by Set") } - if mmCreateKnowledgeBaseFile.defaultExpectation == nil { - mmCreateKnowledgeBaseFile.defaultExpectation = &RepositoryIMockCreateKnowledgeBaseFileExpectation{} + if mmCreateKnowledgeBase.defaultExpectation == nil { + mmCreateKnowledgeBase.defaultExpectation = &RepositoryIMockCreateKnowledgeBaseExpectation{} } - if mmCreateKnowledgeBaseFile.defaultExpectation.params != nil { - mmCreateKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.CreateKnowledgeBaseFile mock is already set by Expect") + if mmCreateKnowledgeBase.defaultExpectation.params != nil { + mmCreateKnowledgeBase.mock.t.Fatalf("RepositoryIMock.CreateKnowledgeBase mock is already set by Expect") } - if mmCreateKnowledgeBaseFile.defaultExpectation.paramPtrs == nil { - mmCreateKnowledgeBaseFile.defaultExpectation.paramPtrs = &RepositoryIMockCreateKnowledgeBaseFileParamPtrs{} + if mmCreateKnowledgeBase.defaultExpectation.paramPtrs == nil { + mmCreateKnowledgeBase.defaultExpectation.paramPtrs = &RepositoryIMockCreateKnowledgeBaseParamPtrs{} } - mmCreateKnowledgeBaseFile.defaultExpectation.paramPtrs.ctx = &ctx + mmCreateKnowledgeBase.defaultExpectation.paramPtrs.ctx = &ctx - return mmCreateKnowledgeBaseFile + return mmCreateKnowledgeBase } -// ExpectKbParam2 sets up expected param kb for RepositoryI.CreateKnowledgeBaseFile -func (mmCreateKnowledgeBaseFile *mRepositoryIMockCreateKnowledgeBaseFile) ExpectKbParam2(kb mm_repository.KnowledgeBaseFile) *mRepositoryIMockCreateKnowledgeBaseFile { - if mmCreateKnowledgeBaseFile.mock.funcCreateKnowledgeBaseFile != nil { - mmCreateKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.CreateKnowledgeBaseFile mock is already set by Set") +// ExpectKbParam2 sets up expected param kb for RepositoryI.CreateKnowledgeBase +func (mmCreateKnowledgeBase *mRepositoryIMockCreateKnowledgeBase) ExpectKbParam2(kb mm_repository.KnowledgeBase) *mRepositoryIMockCreateKnowledgeBase { + if mmCreateKnowledgeBase.mock.funcCreateKnowledgeBase != nil { + mmCreateKnowledgeBase.mock.t.Fatalf("RepositoryIMock.CreateKnowledgeBase mock is already set by Set") } - if mmCreateKnowledgeBaseFile.defaultExpectation == nil { - mmCreateKnowledgeBaseFile.defaultExpectation = &RepositoryIMockCreateKnowledgeBaseFileExpectation{} + if mmCreateKnowledgeBase.defaultExpectation == nil { + mmCreateKnowledgeBase.defaultExpectation = &RepositoryIMockCreateKnowledgeBaseExpectation{} } - if mmCreateKnowledgeBaseFile.defaultExpectation.params != nil { - mmCreateKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.CreateKnowledgeBaseFile mock is already set by Expect") + if mmCreateKnowledgeBase.defaultExpectation.params != nil { + mmCreateKnowledgeBase.mock.t.Fatalf("RepositoryIMock.CreateKnowledgeBase mock is already set by Expect") } - if mmCreateKnowledgeBaseFile.defaultExpectation.paramPtrs == nil { - mmCreateKnowledgeBaseFile.defaultExpectation.paramPtrs = &RepositoryIMockCreateKnowledgeBaseFileParamPtrs{} + if mmCreateKnowledgeBase.defaultExpectation.paramPtrs == nil { + mmCreateKnowledgeBase.defaultExpectation.paramPtrs = &RepositoryIMockCreateKnowledgeBaseParamPtrs{} } - mmCreateKnowledgeBaseFile.defaultExpectation.paramPtrs.kb = &kb + mmCreateKnowledgeBase.defaultExpectation.paramPtrs.kb = &kb - return mmCreateKnowledgeBaseFile + return mmCreateKnowledgeBase } -// ExpectExternalServiceCallParam3 sets up expected param externalServiceCall for RepositoryI.CreateKnowledgeBaseFile -func (mmCreateKnowledgeBaseFile *mRepositoryIMockCreateKnowledgeBaseFile) ExpectExternalServiceCallParam3(externalServiceCall func(FileUID string) error) *mRepositoryIMockCreateKnowledgeBaseFile { - if mmCreateKnowledgeBaseFile.mock.funcCreateKnowledgeBaseFile != nil { - mmCreateKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.CreateKnowledgeBaseFile mock is already set by Set") +// ExpectExternalServiceParam3 sets up expected param externalService for RepositoryI.CreateKnowledgeBase +func (mmCreateKnowledgeBase *mRepositoryIMockCreateKnowledgeBase) ExpectExternalServiceParam3(externalService func(kbUID string) error) *mRepositoryIMockCreateKnowledgeBase { + if mmCreateKnowledgeBase.mock.funcCreateKnowledgeBase != nil { + mmCreateKnowledgeBase.mock.t.Fatalf("RepositoryIMock.CreateKnowledgeBase mock is already set by Set") } - if mmCreateKnowledgeBaseFile.defaultExpectation == nil { - mmCreateKnowledgeBaseFile.defaultExpectation = &RepositoryIMockCreateKnowledgeBaseFileExpectation{} + if mmCreateKnowledgeBase.defaultExpectation == nil { + mmCreateKnowledgeBase.defaultExpectation = &RepositoryIMockCreateKnowledgeBaseExpectation{} } - if mmCreateKnowledgeBaseFile.defaultExpectation.params != nil { - mmCreateKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.CreateKnowledgeBaseFile mock is already set by Expect") + if mmCreateKnowledgeBase.defaultExpectation.params != nil { + mmCreateKnowledgeBase.mock.t.Fatalf("RepositoryIMock.CreateKnowledgeBase mock is already set by Expect") } - if mmCreateKnowledgeBaseFile.defaultExpectation.paramPtrs == nil { - mmCreateKnowledgeBaseFile.defaultExpectation.paramPtrs = &RepositoryIMockCreateKnowledgeBaseFileParamPtrs{} + if mmCreateKnowledgeBase.defaultExpectation.paramPtrs == nil { + mmCreateKnowledgeBase.defaultExpectation.paramPtrs = &RepositoryIMockCreateKnowledgeBaseParamPtrs{} } - mmCreateKnowledgeBaseFile.defaultExpectation.paramPtrs.externalServiceCall = &externalServiceCall + mmCreateKnowledgeBase.defaultExpectation.paramPtrs.externalService = &externalService - return mmCreateKnowledgeBaseFile + return mmCreateKnowledgeBase } -// Inspect accepts an inspector function that has same arguments as the RepositoryI.CreateKnowledgeBaseFile -func (mmCreateKnowledgeBaseFile *mRepositoryIMockCreateKnowledgeBaseFile) Inspect(f func(ctx context.Context, kb mm_repository.KnowledgeBaseFile, externalServiceCall func(FileUID string) error)) *mRepositoryIMockCreateKnowledgeBaseFile { - if mmCreateKnowledgeBaseFile.mock.inspectFuncCreateKnowledgeBaseFile != nil { - mmCreateKnowledgeBaseFile.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.CreateKnowledgeBaseFile") +// Inspect accepts an inspector function that has same arguments as the RepositoryI.CreateKnowledgeBase +func (mmCreateKnowledgeBase *mRepositoryIMockCreateKnowledgeBase) Inspect(f func(ctx context.Context, kb mm_repository.KnowledgeBase, externalService func(kbUID string) error)) *mRepositoryIMockCreateKnowledgeBase { + if mmCreateKnowledgeBase.mock.inspectFuncCreateKnowledgeBase != nil { + mmCreateKnowledgeBase.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.CreateKnowledgeBase") } - mmCreateKnowledgeBaseFile.mock.inspectFuncCreateKnowledgeBaseFile = f + mmCreateKnowledgeBase.mock.inspectFuncCreateKnowledgeBase = f - return mmCreateKnowledgeBaseFile + return mmCreateKnowledgeBase } -// Return sets up results that will be returned by RepositoryI.CreateKnowledgeBaseFile -func (mmCreateKnowledgeBaseFile *mRepositoryIMockCreateKnowledgeBaseFile) Return(kp1 *mm_repository.KnowledgeBaseFile, err error) *RepositoryIMock { - if mmCreateKnowledgeBaseFile.mock.funcCreateKnowledgeBaseFile != nil { - mmCreateKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.CreateKnowledgeBaseFile mock is already set by Set") +// Return sets up results that will be returned by RepositoryI.CreateKnowledgeBase +func (mmCreateKnowledgeBase *mRepositoryIMockCreateKnowledgeBase) Return(kp1 *mm_repository.KnowledgeBase, err error) *RepositoryIMock { + if mmCreateKnowledgeBase.mock.funcCreateKnowledgeBase != nil { + mmCreateKnowledgeBase.mock.t.Fatalf("RepositoryIMock.CreateKnowledgeBase mock is already set by Set") } - if mmCreateKnowledgeBaseFile.defaultExpectation == nil { - mmCreateKnowledgeBaseFile.defaultExpectation = &RepositoryIMockCreateKnowledgeBaseFileExpectation{mock: mmCreateKnowledgeBaseFile.mock} + if mmCreateKnowledgeBase.defaultExpectation == nil { + mmCreateKnowledgeBase.defaultExpectation = &RepositoryIMockCreateKnowledgeBaseExpectation{mock: mmCreateKnowledgeBase.mock} } - mmCreateKnowledgeBaseFile.defaultExpectation.results = &RepositoryIMockCreateKnowledgeBaseFileResults{kp1, err} - return mmCreateKnowledgeBaseFile.mock + mmCreateKnowledgeBase.defaultExpectation.results = &RepositoryIMockCreateKnowledgeBaseResults{kp1, err} + return mmCreateKnowledgeBase.mock } -// Set uses given function f to mock the RepositoryI.CreateKnowledgeBaseFile method -func (mmCreateKnowledgeBaseFile *mRepositoryIMockCreateKnowledgeBaseFile) Set(f func(ctx context.Context, kb mm_repository.KnowledgeBaseFile, externalServiceCall func(FileUID string) error) (kp1 *mm_repository.KnowledgeBaseFile, err error)) *RepositoryIMock { - if mmCreateKnowledgeBaseFile.defaultExpectation != nil { - mmCreateKnowledgeBaseFile.mock.t.Fatalf("Default expectation is already set for the RepositoryI.CreateKnowledgeBaseFile method") +// Set uses given function f to mock the RepositoryI.CreateKnowledgeBase method +func (mmCreateKnowledgeBase *mRepositoryIMockCreateKnowledgeBase) Set(f func(ctx context.Context, kb mm_repository.KnowledgeBase, externalService func(kbUID string) error) (kp1 *mm_repository.KnowledgeBase, err error)) *RepositoryIMock { + if mmCreateKnowledgeBase.defaultExpectation != nil { + mmCreateKnowledgeBase.mock.t.Fatalf("Default expectation is already set for the RepositoryI.CreateKnowledgeBase method") } - if len(mmCreateKnowledgeBaseFile.expectations) > 0 { - mmCreateKnowledgeBaseFile.mock.t.Fatalf("Some expectations are already set for the RepositoryI.CreateKnowledgeBaseFile method") + if len(mmCreateKnowledgeBase.expectations) > 0 { + mmCreateKnowledgeBase.mock.t.Fatalf("Some expectations are already set for the RepositoryI.CreateKnowledgeBase method") } - mmCreateKnowledgeBaseFile.mock.funcCreateKnowledgeBaseFile = f - return mmCreateKnowledgeBaseFile.mock + mmCreateKnowledgeBase.mock.funcCreateKnowledgeBase = f + return mmCreateKnowledgeBase.mock } -// When sets expectation for the RepositoryI.CreateKnowledgeBaseFile which will trigger the result defined by the following +// When sets expectation for the RepositoryI.CreateKnowledgeBase which will trigger the result defined by the following // Then helper -func (mmCreateKnowledgeBaseFile *mRepositoryIMockCreateKnowledgeBaseFile) When(ctx context.Context, kb mm_repository.KnowledgeBaseFile, externalServiceCall func(FileUID string) error) *RepositoryIMockCreateKnowledgeBaseFileExpectation { - if mmCreateKnowledgeBaseFile.mock.funcCreateKnowledgeBaseFile != nil { - mmCreateKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.CreateKnowledgeBaseFile mock is already set by Set") +func (mmCreateKnowledgeBase *mRepositoryIMockCreateKnowledgeBase) When(ctx context.Context, kb mm_repository.KnowledgeBase, externalService func(kbUID string) error) *RepositoryIMockCreateKnowledgeBaseExpectation { + if mmCreateKnowledgeBase.mock.funcCreateKnowledgeBase != nil { + mmCreateKnowledgeBase.mock.t.Fatalf("RepositoryIMock.CreateKnowledgeBase mock is already set by Set") } - expectation := &RepositoryIMockCreateKnowledgeBaseFileExpectation{ - mock: mmCreateKnowledgeBaseFile.mock, - params: &RepositoryIMockCreateKnowledgeBaseFileParams{ctx, kb, externalServiceCall}, + expectation := &RepositoryIMockCreateKnowledgeBaseExpectation{ + mock: mmCreateKnowledgeBase.mock, + params: &RepositoryIMockCreateKnowledgeBaseParams{ctx, kb, externalService}, } - mmCreateKnowledgeBaseFile.expectations = append(mmCreateKnowledgeBaseFile.expectations, expectation) + mmCreateKnowledgeBase.expectations = append(mmCreateKnowledgeBase.expectations, expectation) return expectation } -// Then sets up RepositoryI.CreateKnowledgeBaseFile return parameters for the expectation previously defined by the When method -func (e *RepositoryIMockCreateKnowledgeBaseFileExpectation) Then(kp1 *mm_repository.KnowledgeBaseFile, err error) *RepositoryIMock { - e.results = &RepositoryIMockCreateKnowledgeBaseFileResults{kp1, err} +// Then sets up RepositoryI.CreateKnowledgeBase return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockCreateKnowledgeBaseExpectation) Then(kp1 *mm_repository.KnowledgeBase, err error) *RepositoryIMock { + e.results = &RepositoryIMockCreateKnowledgeBaseResults{kp1, err} return e.mock } -// Times sets number of times RepositoryI.CreateKnowledgeBaseFile should be invoked -func (mmCreateKnowledgeBaseFile *mRepositoryIMockCreateKnowledgeBaseFile) Times(n uint64) *mRepositoryIMockCreateKnowledgeBaseFile { +// Times sets number of times RepositoryI.CreateKnowledgeBase should be invoked +func (mmCreateKnowledgeBase *mRepositoryIMockCreateKnowledgeBase) Times(n uint64) *mRepositoryIMockCreateKnowledgeBase { if n == 0 { - mmCreateKnowledgeBaseFile.mock.t.Fatalf("Times of RepositoryIMock.CreateKnowledgeBaseFile mock can not be zero") + mmCreateKnowledgeBase.mock.t.Fatalf("Times of RepositoryIMock.CreateKnowledgeBase mock can not be zero") } - mm_atomic.StoreUint64(&mmCreateKnowledgeBaseFile.expectedInvocations, n) - return mmCreateKnowledgeBaseFile + mm_atomic.StoreUint64(&mmCreateKnowledgeBase.expectedInvocations, n) + return mmCreateKnowledgeBase } -func (mmCreateKnowledgeBaseFile *mRepositoryIMockCreateKnowledgeBaseFile) invocationsDone() bool { - if len(mmCreateKnowledgeBaseFile.expectations) == 0 && mmCreateKnowledgeBaseFile.defaultExpectation == nil && mmCreateKnowledgeBaseFile.mock.funcCreateKnowledgeBaseFile == nil { +func (mmCreateKnowledgeBase *mRepositoryIMockCreateKnowledgeBase) invocationsDone() bool { + if len(mmCreateKnowledgeBase.expectations) == 0 && mmCreateKnowledgeBase.defaultExpectation == nil && mmCreateKnowledgeBase.mock.funcCreateKnowledgeBase == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmCreateKnowledgeBaseFile.mock.afterCreateKnowledgeBaseFileCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmCreateKnowledgeBaseFile.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmCreateKnowledgeBase.mock.afterCreateKnowledgeBaseCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmCreateKnowledgeBase.expectedInvocations) return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) } -// CreateKnowledgeBaseFile implements repository.RepositoryI -func (mmCreateKnowledgeBaseFile *RepositoryIMock) CreateKnowledgeBaseFile(ctx context.Context, kb mm_repository.KnowledgeBaseFile, externalServiceCall func(FileUID string) error) (kp1 *mm_repository.KnowledgeBaseFile, err error) { - mm_atomic.AddUint64(&mmCreateKnowledgeBaseFile.beforeCreateKnowledgeBaseFileCounter, 1) - defer mm_atomic.AddUint64(&mmCreateKnowledgeBaseFile.afterCreateKnowledgeBaseFileCounter, 1) +// CreateKnowledgeBase implements repository.RepositoryI +func (mmCreateKnowledgeBase *RepositoryIMock) CreateKnowledgeBase(ctx context.Context, kb mm_repository.KnowledgeBase, externalService func(kbUID string) error) (kp1 *mm_repository.KnowledgeBase, err error) { + mm_atomic.AddUint64(&mmCreateKnowledgeBase.beforeCreateKnowledgeBaseCounter, 1) + defer mm_atomic.AddUint64(&mmCreateKnowledgeBase.afterCreateKnowledgeBaseCounter, 1) - if mmCreateKnowledgeBaseFile.inspectFuncCreateKnowledgeBaseFile != nil { - mmCreateKnowledgeBaseFile.inspectFuncCreateKnowledgeBaseFile(ctx, kb, externalServiceCall) + if mmCreateKnowledgeBase.inspectFuncCreateKnowledgeBase != nil { + mmCreateKnowledgeBase.inspectFuncCreateKnowledgeBase(ctx, kb, externalService) } - mm_params := RepositoryIMockCreateKnowledgeBaseFileParams{ctx, kb, externalServiceCall} + mm_params := RepositoryIMockCreateKnowledgeBaseParams{ctx, kb, externalService} // Record call args - mmCreateKnowledgeBaseFile.CreateKnowledgeBaseFileMock.mutex.Lock() - mmCreateKnowledgeBaseFile.CreateKnowledgeBaseFileMock.callArgs = append(mmCreateKnowledgeBaseFile.CreateKnowledgeBaseFileMock.callArgs, &mm_params) - mmCreateKnowledgeBaseFile.CreateKnowledgeBaseFileMock.mutex.Unlock() + mmCreateKnowledgeBase.CreateKnowledgeBaseMock.mutex.Lock() + mmCreateKnowledgeBase.CreateKnowledgeBaseMock.callArgs = append(mmCreateKnowledgeBase.CreateKnowledgeBaseMock.callArgs, &mm_params) + mmCreateKnowledgeBase.CreateKnowledgeBaseMock.mutex.Unlock() - for _, e := range mmCreateKnowledgeBaseFile.CreateKnowledgeBaseFileMock.expectations { + for _, e := range mmCreateKnowledgeBase.CreateKnowledgeBaseMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) return e.results.kp1, e.results.err } } - if mmCreateKnowledgeBaseFile.CreateKnowledgeBaseFileMock.defaultExpectation != nil { - mm_atomic.AddUint64(&mmCreateKnowledgeBaseFile.CreateKnowledgeBaseFileMock.defaultExpectation.Counter, 1) - mm_want := mmCreateKnowledgeBaseFile.CreateKnowledgeBaseFileMock.defaultExpectation.params - mm_want_ptrs := mmCreateKnowledgeBaseFile.CreateKnowledgeBaseFileMock.defaultExpectation.paramPtrs + if mmCreateKnowledgeBase.CreateKnowledgeBaseMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmCreateKnowledgeBase.CreateKnowledgeBaseMock.defaultExpectation.Counter, 1) + mm_want := mmCreateKnowledgeBase.CreateKnowledgeBaseMock.defaultExpectation.params + mm_want_ptrs := mmCreateKnowledgeBase.CreateKnowledgeBaseMock.defaultExpectation.paramPtrs - mm_got := RepositoryIMockCreateKnowledgeBaseFileParams{ctx, kb, externalServiceCall} + mm_got := RepositoryIMockCreateKnowledgeBaseParams{ctx, kb, externalService} if mm_want_ptrs != nil { if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { - mmCreateKnowledgeBaseFile.t.Errorf("RepositoryIMock.CreateKnowledgeBaseFile 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)) + mmCreateKnowledgeBase.t.Errorf("RepositoryIMock.CreateKnowledgeBase 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.kb != nil && !minimock.Equal(*mm_want_ptrs.kb, mm_got.kb) { - mmCreateKnowledgeBaseFile.t.Errorf("RepositoryIMock.CreateKnowledgeBaseFile got unexpected parameter kb, want: %#v, got: %#v%s\n", *mm_want_ptrs.kb, mm_got.kb, minimock.Diff(*mm_want_ptrs.kb, mm_got.kb)) + mmCreateKnowledgeBase.t.Errorf("RepositoryIMock.CreateKnowledgeBase got unexpected parameter kb, want: %#v, got: %#v%s\n", *mm_want_ptrs.kb, mm_got.kb, minimock.Diff(*mm_want_ptrs.kb, mm_got.kb)) } - if mm_want_ptrs.externalServiceCall != nil && !minimock.Equal(*mm_want_ptrs.externalServiceCall, mm_got.externalServiceCall) { - mmCreateKnowledgeBaseFile.t.Errorf("RepositoryIMock.CreateKnowledgeBaseFile 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.externalService != nil && !minimock.Equal(*mm_want_ptrs.externalService, mm_got.externalService) { + mmCreateKnowledgeBase.t.Errorf("RepositoryIMock.CreateKnowledgeBase got unexpected parameter externalService, want: %#v, got: %#v%s\n", *mm_want_ptrs.externalService, mm_got.externalService, minimock.Diff(*mm_want_ptrs.externalService, mm_got.externalService)) } } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { - mmCreateKnowledgeBaseFile.t.Errorf("RepositoryIMock.CreateKnowledgeBaseFile got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + mmCreateKnowledgeBase.t.Errorf("RepositoryIMock.CreateKnowledgeBase got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) } - mm_results := mmCreateKnowledgeBaseFile.CreateKnowledgeBaseFileMock.defaultExpectation.results + mm_results := mmCreateKnowledgeBase.CreateKnowledgeBaseMock.defaultExpectation.results if mm_results == nil { - mmCreateKnowledgeBaseFile.t.Fatal("No results are set for the RepositoryIMock.CreateKnowledgeBaseFile") + mmCreateKnowledgeBase.t.Fatal("No results are set for the RepositoryIMock.CreateKnowledgeBase") } return (*mm_results).kp1, (*mm_results).err } - if mmCreateKnowledgeBaseFile.funcCreateKnowledgeBaseFile != nil { - return mmCreateKnowledgeBaseFile.funcCreateKnowledgeBaseFile(ctx, kb, externalServiceCall) + if mmCreateKnowledgeBase.funcCreateKnowledgeBase != nil { + return mmCreateKnowledgeBase.funcCreateKnowledgeBase(ctx, kb, externalService) } - mmCreateKnowledgeBaseFile.t.Fatalf("Unexpected call to RepositoryIMock.CreateKnowledgeBaseFile. %v %v %v", ctx, kb, externalServiceCall) + mmCreateKnowledgeBase.t.Fatalf("Unexpected call to RepositoryIMock.CreateKnowledgeBase. %v %v %v", ctx, kb, externalService) return } -// CreateKnowledgeBaseFileAfterCounter returns a count of finished RepositoryIMock.CreateKnowledgeBaseFile invocations -func (mmCreateKnowledgeBaseFile *RepositoryIMock) CreateKnowledgeBaseFileAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmCreateKnowledgeBaseFile.afterCreateKnowledgeBaseFileCounter) +// CreateKnowledgeBaseAfterCounter returns a count of finished RepositoryIMock.CreateKnowledgeBase invocations +func (mmCreateKnowledgeBase *RepositoryIMock) CreateKnowledgeBaseAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmCreateKnowledgeBase.afterCreateKnowledgeBaseCounter) } -// CreateKnowledgeBaseFileBeforeCounter returns a count of RepositoryIMock.CreateKnowledgeBaseFile invocations -func (mmCreateKnowledgeBaseFile *RepositoryIMock) CreateKnowledgeBaseFileBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmCreateKnowledgeBaseFile.beforeCreateKnowledgeBaseFileCounter) +// CreateKnowledgeBaseBeforeCounter returns a count of RepositoryIMock.CreateKnowledgeBase invocations +func (mmCreateKnowledgeBase *RepositoryIMock) CreateKnowledgeBaseBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmCreateKnowledgeBase.beforeCreateKnowledgeBaseCounter) } -// Calls returns a list of arguments used in each call to RepositoryIMock.CreateKnowledgeBaseFile. +// Calls returns a list of arguments used in each call to RepositoryIMock.CreateKnowledgeBase. // The list is in the same order as the calls were made (i.e. recent calls have a higher index) -func (mmCreateKnowledgeBaseFile *mRepositoryIMockCreateKnowledgeBaseFile) Calls() []*RepositoryIMockCreateKnowledgeBaseFileParams { - mmCreateKnowledgeBaseFile.mutex.RLock() +func (mmCreateKnowledgeBase *mRepositoryIMockCreateKnowledgeBase) Calls() []*RepositoryIMockCreateKnowledgeBaseParams { + mmCreateKnowledgeBase.mutex.RLock() - argCopy := make([]*RepositoryIMockCreateKnowledgeBaseFileParams, len(mmCreateKnowledgeBaseFile.callArgs)) - copy(argCopy, mmCreateKnowledgeBaseFile.callArgs) + argCopy := make([]*RepositoryIMockCreateKnowledgeBaseParams, len(mmCreateKnowledgeBase.callArgs)) + copy(argCopy, mmCreateKnowledgeBase.callArgs) - mmCreateKnowledgeBaseFile.mutex.RUnlock() + mmCreateKnowledgeBase.mutex.RUnlock() return argCopy } -// MinimockCreateKnowledgeBaseFileDone returns true if the count of the CreateKnowledgeBaseFile invocations corresponds +// MinimockCreateKnowledgeBaseDone returns true if the count of the CreateKnowledgeBase invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockCreateKnowledgeBaseFileDone() bool { - for _, e := range m.CreateKnowledgeBaseFileMock.expectations { +func (m *RepositoryIMock) MinimockCreateKnowledgeBaseDone() bool { + for _, e := range m.CreateKnowledgeBaseMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.CreateKnowledgeBaseFileMock.invocationsDone() + return m.CreateKnowledgeBaseMock.invocationsDone() } -// MinimockCreateKnowledgeBaseFileInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockCreateKnowledgeBaseFileInspect() { - for _, e := range m.CreateKnowledgeBaseFileMock.expectations { +// MinimockCreateKnowledgeBaseInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockCreateKnowledgeBaseInspect() { + for _, e := range m.CreateKnowledgeBaseMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { - m.t.Errorf("Expected call to RepositoryIMock.CreateKnowledgeBaseFile with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.CreateKnowledgeBase with params: %#v", *e.params) } } - afterCreateKnowledgeBaseFileCounter := mm_atomic.LoadUint64(&m.afterCreateKnowledgeBaseFileCounter) + afterCreateKnowledgeBaseCounter := mm_atomic.LoadUint64(&m.afterCreateKnowledgeBaseCounter) // if default expectation was set then invocations count should be greater than zero - if m.CreateKnowledgeBaseFileMock.defaultExpectation != nil && afterCreateKnowledgeBaseFileCounter < 1 { - if m.CreateKnowledgeBaseFileMock.defaultExpectation.params == nil { - m.t.Error("Expected call to RepositoryIMock.CreateKnowledgeBaseFile") + if m.CreateKnowledgeBaseMock.defaultExpectation != nil && afterCreateKnowledgeBaseCounter < 1 { + if m.CreateKnowledgeBaseMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.CreateKnowledgeBase") } else { - m.t.Errorf("Expected call to RepositoryIMock.CreateKnowledgeBaseFile with params: %#v", *m.CreateKnowledgeBaseFileMock.defaultExpectation.params) + m.t.Errorf("Expected call to RepositoryIMock.CreateKnowledgeBase with params: %#v", *m.CreateKnowledgeBaseMock.defaultExpectation.params) } } // if func was set then invocations count should be greater than zero - if m.funcCreateKnowledgeBaseFile != nil && afterCreateKnowledgeBaseFileCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.CreateKnowledgeBaseFile") + if m.funcCreateKnowledgeBase != nil && afterCreateKnowledgeBaseCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.CreateKnowledgeBase") } - if !m.CreateKnowledgeBaseFileMock.invocationsDone() && afterCreateKnowledgeBaseFileCounter > 0 { - m.t.Errorf("Expected %d calls to RepositoryIMock.CreateKnowledgeBaseFile but found %d calls", - mm_atomic.LoadUint64(&m.CreateKnowledgeBaseFileMock.expectedInvocations), afterCreateKnowledgeBaseFileCounter) + if !m.CreateKnowledgeBaseMock.invocationsDone() && afterCreateKnowledgeBaseCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.CreateKnowledgeBase but found %d calls", + mm_atomic.LoadUint64(&m.CreateKnowledgeBaseMock.expectedInvocations), afterCreateKnowledgeBaseCounter) } } -type mRepositoryIMockDeleteAllConvertedFilesinKb struct { +type mRepositoryIMockCreateKnowledgeBaseFile struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockDeleteAllConvertedFilesinKbExpectation - expectations []*RepositoryIMockDeleteAllConvertedFilesinKbExpectation + defaultExpectation *RepositoryIMockCreateKnowledgeBaseFileExpectation + expectations []*RepositoryIMockCreateKnowledgeBaseFileExpectation - callArgs []*RepositoryIMockDeleteAllConvertedFilesinKbParams + callArgs []*RepositoryIMockCreateKnowledgeBaseFileParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockDeleteAllConvertedFilesinKbExpectation specifies expectation struct of the RepositoryI.DeleteAllConvertedFilesinKb -type RepositoryIMockDeleteAllConvertedFilesinKbExpectation struct { +// RepositoryIMockCreateKnowledgeBaseFileExpectation specifies expectation struct of the RepositoryI.CreateKnowledgeBaseFile +type RepositoryIMockCreateKnowledgeBaseFileExpectation struct { mock *RepositoryIMock - params *RepositoryIMockDeleteAllConvertedFilesinKbParams - paramPtrs *RepositoryIMockDeleteAllConvertedFilesinKbParamPtrs - results *RepositoryIMockDeleteAllConvertedFilesinKbResults + params *RepositoryIMockCreateKnowledgeBaseFileParams + paramPtrs *RepositoryIMockCreateKnowledgeBaseFileParamPtrs + results *RepositoryIMockCreateKnowledgeBaseFileResults Counter uint64 } -// RepositoryIMockDeleteAllConvertedFilesinKbParams contains parameters of the RepositoryI.DeleteAllConvertedFilesinKb -type RepositoryIMockDeleteAllConvertedFilesinKbParams struct { - ctx context.Context - kbUID uuid.UUID +// RepositoryIMockCreateKnowledgeBaseFileParams contains parameters of the RepositoryI.CreateKnowledgeBaseFile +type RepositoryIMockCreateKnowledgeBaseFileParams struct { + ctx context.Context + kb mm_repository.KnowledgeBaseFile + externalServiceCall func(FileUID string) error } -// RepositoryIMockDeleteAllConvertedFilesinKbParamPtrs contains pointers to parameters of the RepositoryI.DeleteAllConvertedFilesinKb -type RepositoryIMockDeleteAllConvertedFilesinKbParamPtrs struct { - ctx *context.Context - kbUID *uuid.UUID +// RepositoryIMockCreateKnowledgeBaseFileParamPtrs contains pointers to parameters of the RepositoryI.CreateKnowledgeBaseFile +type RepositoryIMockCreateKnowledgeBaseFileParamPtrs struct { + ctx *context.Context + kb *mm_repository.KnowledgeBaseFile + externalServiceCall *func(FileUID string) error } -// RepositoryIMockDeleteAllConvertedFilesinKbResults contains results of the RepositoryI.DeleteAllConvertedFilesinKb -type RepositoryIMockDeleteAllConvertedFilesinKbResults struct { +// RepositoryIMockCreateKnowledgeBaseFileResults contains results of the RepositoryI.CreateKnowledgeBaseFile +type RepositoryIMockCreateKnowledgeBaseFileResults struct { + kp1 *mm_repository.KnowledgeBaseFile err error } -// 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") +// Expect sets up expected params for RepositoryI.CreateKnowledgeBaseFile +func (mmCreateKnowledgeBaseFile *mRepositoryIMockCreateKnowledgeBaseFile) Expect(ctx context.Context, kb mm_repository.KnowledgeBaseFile, externalServiceCall func(FileUID string) error) *mRepositoryIMockCreateKnowledgeBaseFile { + if mmCreateKnowledgeBaseFile.mock.funcCreateKnowledgeBaseFile != nil { + mmCreateKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.CreateKnowledgeBaseFile mock is already set by Set") } - if mmDeleteAllConvertedFilesinKb.defaultExpectation == nil { - mmDeleteAllConvertedFilesinKb.defaultExpectation = &RepositoryIMockDeleteAllConvertedFilesinKbExpectation{} + if mmCreateKnowledgeBaseFile.defaultExpectation == nil { + mmCreateKnowledgeBaseFile.defaultExpectation = &RepositoryIMockCreateKnowledgeBaseFileExpectation{} } - if mmDeleteAllConvertedFilesinKb.defaultExpectation.paramPtrs != nil { - mmDeleteAllConvertedFilesinKb.mock.t.Fatalf("RepositoryIMock.DeleteAllConvertedFilesinKb mock is already set by ExpectParams functions") + if mmCreateKnowledgeBaseFile.defaultExpectation.paramPtrs != nil { + mmCreateKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.CreateKnowledgeBaseFile mock is already set by ExpectParams functions") } - 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) + mmCreateKnowledgeBaseFile.defaultExpectation.params = &RepositoryIMockCreateKnowledgeBaseFileParams{ctx, kb, externalServiceCall} + for _, e := range mmCreateKnowledgeBaseFile.expectations { + if minimock.Equal(e.params, mmCreateKnowledgeBaseFile.defaultExpectation.params) { + mmCreateKnowledgeBaseFile.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmCreateKnowledgeBaseFile.defaultExpectation.params) } } - return mmDeleteAllConvertedFilesinKb + return mmCreateKnowledgeBaseFile } -// 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") +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.CreateKnowledgeBaseFile +func (mmCreateKnowledgeBaseFile *mRepositoryIMockCreateKnowledgeBaseFile) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockCreateKnowledgeBaseFile { + if mmCreateKnowledgeBaseFile.mock.funcCreateKnowledgeBaseFile != nil { + mmCreateKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.CreateKnowledgeBaseFile mock is already set by Set") } - if mmDeleteAllConvertedFilesinKb.defaultExpectation == nil { - mmDeleteAllConvertedFilesinKb.defaultExpectation = &RepositoryIMockDeleteAllConvertedFilesinKbExpectation{} + if mmCreateKnowledgeBaseFile.defaultExpectation == nil { + mmCreateKnowledgeBaseFile.defaultExpectation = &RepositoryIMockCreateKnowledgeBaseFileExpectation{} } - if mmDeleteAllConvertedFilesinKb.defaultExpectation.params != nil { - mmDeleteAllConvertedFilesinKb.mock.t.Fatalf("RepositoryIMock.DeleteAllConvertedFilesinKb mock is already set by Expect") + if mmCreateKnowledgeBaseFile.defaultExpectation.params != nil { + mmCreateKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.CreateKnowledgeBaseFile mock is already set by Expect") } - if mmDeleteAllConvertedFilesinKb.defaultExpectation.paramPtrs == nil { - mmDeleteAllConvertedFilesinKb.defaultExpectation.paramPtrs = &RepositoryIMockDeleteAllConvertedFilesinKbParamPtrs{} + if mmCreateKnowledgeBaseFile.defaultExpectation.paramPtrs == nil { + mmCreateKnowledgeBaseFile.defaultExpectation.paramPtrs = &RepositoryIMockCreateKnowledgeBaseFileParamPtrs{} } - mmDeleteAllConvertedFilesinKb.defaultExpectation.paramPtrs.ctx = &ctx + mmCreateKnowledgeBaseFile.defaultExpectation.paramPtrs.ctx = &ctx - return mmDeleteAllConvertedFilesinKb + return mmCreateKnowledgeBaseFile } -// 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") +// ExpectKbParam2 sets up expected param kb for RepositoryI.CreateKnowledgeBaseFile +func (mmCreateKnowledgeBaseFile *mRepositoryIMockCreateKnowledgeBaseFile) ExpectKbParam2(kb mm_repository.KnowledgeBaseFile) *mRepositoryIMockCreateKnowledgeBaseFile { + if mmCreateKnowledgeBaseFile.mock.funcCreateKnowledgeBaseFile != nil { + mmCreateKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.CreateKnowledgeBaseFile mock is already set by Set") } - if mmDeleteAllConvertedFilesinKb.defaultExpectation == nil { - mmDeleteAllConvertedFilesinKb.defaultExpectation = &RepositoryIMockDeleteAllConvertedFilesinKbExpectation{} + if mmCreateKnowledgeBaseFile.defaultExpectation == nil { + mmCreateKnowledgeBaseFile.defaultExpectation = &RepositoryIMockCreateKnowledgeBaseFileExpectation{} } - if mmDeleteAllConvertedFilesinKb.defaultExpectation.params != nil { - mmDeleteAllConvertedFilesinKb.mock.t.Fatalf("RepositoryIMock.DeleteAllConvertedFilesinKb mock is already set by Expect") + if mmCreateKnowledgeBaseFile.defaultExpectation.params != nil { + mmCreateKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.CreateKnowledgeBaseFile mock is already set by Expect") } - if mmDeleteAllConvertedFilesinKb.defaultExpectation.paramPtrs == nil { - mmDeleteAllConvertedFilesinKb.defaultExpectation.paramPtrs = &RepositoryIMockDeleteAllConvertedFilesinKbParamPtrs{} + if mmCreateKnowledgeBaseFile.defaultExpectation.paramPtrs == nil { + mmCreateKnowledgeBaseFile.defaultExpectation.paramPtrs = &RepositoryIMockCreateKnowledgeBaseFileParamPtrs{} } - mmDeleteAllConvertedFilesinKb.defaultExpectation.paramPtrs.kbUID = &kbUID + mmCreateKnowledgeBaseFile.defaultExpectation.paramPtrs.kb = &kb - return mmDeleteAllConvertedFilesinKb + return mmCreateKnowledgeBaseFile } -// 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") +// ExpectExternalServiceCallParam3 sets up expected param externalServiceCall for RepositoryI.CreateKnowledgeBaseFile +func (mmCreateKnowledgeBaseFile *mRepositoryIMockCreateKnowledgeBaseFile) ExpectExternalServiceCallParam3(externalServiceCall func(FileUID string) error) *mRepositoryIMockCreateKnowledgeBaseFile { + if mmCreateKnowledgeBaseFile.mock.funcCreateKnowledgeBaseFile != nil { + mmCreateKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.CreateKnowledgeBaseFile mock is already set by Set") } - mmDeleteAllConvertedFilesinKb.mock.inspectFuncDeleteAllConvertedFilesinKb = f + if mmCreateKnowledgeBaseFile.defaultExpectation == nil { + mmCreateKnowledgeBaseFile.defaultExpectation = &RepositoryIMockCreateKnowledgeBaseFileExpectation{} + } - return mmDeleteAllConvertedFilesinKb + if mmCreateKnowledgeBaseFile.defaultExpectation.params != nil { + mmCreateKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.CreateKnowledgeBaseFile mock is already set by Expect") + } + + if mmCreateKnowledgeBaseFile.defaultExpectation.paramPtrs == nil { + mmCreateKnowledgeBaseFile.defaultExpectation.paramPtrs = &RepositoryIMockCreateKnowledgeBaseFileParamPtrs{} + } + mmCreateKnowledgeBaseFile.defaultExpectation.paramPtrs.externalServiceCall = &externalServiceCall + + return mmCreateKnowledgeBaseFile } -// 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") +// Inspect accepts an inspector function that has same arguments as the RepositoryI.CreateKnowledgeBaseFile +func (mmCreateKnowledgeBaseFile *mRepositoryIMockCreateKnowledgeBaseFile) Inspect(f func(ctx context.Context, kb mm_repository.KnowledgeBaseFile, externalServiceCall func(FileUID string) error)) *mRepositoryIMockCreateKnowledgeBaseFile { + if mmCreateKnowledgeBaseFile.mock.inspectFuncCreateKnowledgeBaseFile != nil { + mmCreateKnowledgeBaseFile.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.CreateKnowledgeBaseFile") } - if mmDeleteAllConvertedFilesinKb.defaultExpectation == nil { - mmDeleteAllConvertedFilesinKb.defaultExpectation = &RepositoryIMockDeleteAllConvertedFilesinKbExpectation{mock: mmDeleteAllConvertedFilesinKb.mock} + mmCreateKnowledgeBaseFile.mock.inspectFuncCreateKnowledgeBaseFile = f + + return mmCreateKnowledgeBaseFile +} + +// Return sets up results that will be returned by RepositoryI.CreateKnowledgeBaseFile +func (mmCreateKnowledgeBaseFile *mRepositoryIMockCreateKnowledgeBaseFile) Return(kp1 *mm_repository.KnowledgeBaseFile, err error) *RepositoryIMock { + if mmCreateKnowledgeBaseFile.mock.funcCreateKnowledgeBaseFile != nil { + mmCreateKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.CreateKnowledgeBaseFile mock is already set by Set") } - mmDeleteAllConvertedFilesinKb.defaultExpectation.results = &RepositoryIMockDeleteAllConvertedFilesinKbResults{err} - return mmDeleteAllConvertedFilesinKb.mock + + if mmCreateKnowledgeBaseFile.defaultExpectation == nil { + mmCreateKnowledgeBaseFile.defaultExpectation = &RepositoryIMockCreateKnowledgeBaseFileExpectation{mock: mmCreateKnowledgeBaseFile.mock} + } + mmCreateKnowledgeBaseFile.defaultExpectation.results = &RepositoryIMockCreateKnowledgeBaseFileResults{kp1, err} + return mmCreateKnowledgeBaseFile.mock } -// 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") +// Set uses given function f to mock the RepositoryI.CreateKnowledgeBaseFile method +func (mmCreateKnowledgeBaseFile *mRepositoryIMockCreateKnowledgeBaseFile) Set(f func(ctx context.Context, kb mm_repository.KnowledgeBaseFile, externalServiceCall func(FileUID string) error) (kp1 *mm_repository.KnowledgeBaseFile, err error)) *RepositoryIMock { + if mmCreateKnowledgeBaseFile.defaultExpectation != nil { + mmCreateKnowledgeBaseFile.mock.t.Fatalf("Default expectation is already set for the RepositoryI.CreateKnowledgeBaseFile method") } - if len(mmDeleteAllConvertedFilesinKb.expectations) > 0 { - mmDeleteAllConvertedFilesinKb.mock.t.Fatalf("Some expectations are already set for the RepositoryI.DeleteAllConvertedFilesinKb method") + if len(mmCreateKnowledgeBaseFile.expectations) > 0 { + mmCreateKnowledgeBaseFile.mock.t.Fatalf("Some expectations are already set for the RepositoryI.CreateKnowledgeBaseFile method") } - mmDeleteAllConvertedFilesinKb.mock.funcDeleteAllConvertedFilesinKb = f - return mmDeleteAllConvertedFilesinKb.mock + mmCreateKnowledgeBaseFile.mock.funcCreateKnowledgeBaseFile = f + return mmCreateKnowledgeBaseFile.mock } -// When sets expectation for the RepositoryI.DeleteAllConvertedFilesinKb which will trigger the result defined by the following +// When sets expectation for the RepositoryI.CreateKnowledgeBaseFile which will trigger the result defined by the following // Then helper -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") +func (mmCreateKnowledgeBaseFile *mRepositoryIMockCreateKnowledgeBaseFile) When(ctx context.Context, kb mm_repository.KnowledgeBaseFile, externalServiceCall func(FileUID string) error) *RepositoryIMockCreateKnowledgeBaseFileExpectation { + if mmCreateKnowledgeBaseFile.mock.funcCreateKnowledgeBaseFile != nil { + mmCreateKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.CreateKnowledgeBaseFile mock is already set by Set") } - expectation := &RepositoryIMockDeleteAllConvertedFilesinKbExpectation{ - mock: mmDeleteAllConvertedFilesinKb.mock, - params: &RepositoryIMockDeleteAllConvertedFilesinKbParams{ctx, kbUID}, + expectation := &RepositoryIMockCreateKnowledgeBaseFileExpectation{ + mock: mmCreateKnowledgeBaseFile.mock, + params: &RepositoryIMockCreateKnowledgeBaseFileParams{ctx, kb, externalServiceCall}, } - mmDeleteAllConvertedFilesinKb.expectations = append(mmDeleteAllConvertedFilesinKb.expectations, expectation) + mmCreateKnowledgeBaseFile.expectations = append(mmCreateKnowledgeBaseFile.expectations, expectation) return expectation } -// 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} +// Then sets up RepositoryI.CreateKnowledgeBaseFile return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockCreateKnowledgeBaseFileExpectation) Then(kp1 *mm_repository.KnowledgeBaseFile, err error) *RepositoryIMock { + e.results = &RepositoryIMockCreateKnowledgeBaseFileResults{kp1, err} return e.mock } -// Times sets number of times RepositoryI.DeleteAllConvertedFilesinKb should be invoked -func (mmDeleteAllConvertedFilesinKb *mRepositoryIMockDeleteAllConvertedFilesinKb) Times(n uint64) *mRepositoryIMockDeleteAllConvertedFilesinKb { +// Times sets number of times RepositoryI.CreateKnowledgeBaseFile should be invoked +func (mmCreateKnowledgeBaseFile *mRepositoryIMockCreateKnowledgeBaseFile) Times(n uint64) *mRepositoryIMockCreateKnowledgeBaseFile { if n == 0 { - mmDeleteAllConvertedFilesinKb.mock.t.Fatalf("Times of RepositoryIMock.DeleteAllConvertedFilesinKb mock can not be zero") + mmCreateKnowledgeBaseFile.mock.t.Fatalf("Times of RepositoryIMock.CreateKnowledgeBaseFile mock can not be zero") } - mm_atomic.StoreUint64(&mmDeleteAllConvertedFilesinKb.expectedInvocations, n) - return mmDeleteAllConvertedFilesinKb + mm_atomic.StoreUint64(&mmCreateKnowledgeBaseFile.expectedInvocations, n) + return mmCreateKnowledgeBaseFile } -func (mmDeleteAllConvertedFilesinKb *mRepositoryIMockDeleteAllConvertedFilesinKb) invocationsDone() bool { - if len(mmDeleteAllConvertedFilesinKb.expectations) == 0 && mmDeleteAllConvertedFilesinKb.defaultExpectation == nil && mmDeleteAllConvertedFilesinKb.mock.funcDeleteAllConvertedFilesinKb == nil { +func (mmCreateKnowledgeBaseFile *mRepositoryIMockCreateKnowledgeBaseFile) invocationsDone() bool { + if len(mmCreateKnowledgeBaseFile.expectations) == 0 && mmCreateKnowledgeBaseFile.defaultExpectation == nil && mmCreateKnowledgeBaseFile.mock.funcCreateKnowledgeBaseFile == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmDeleteAllConvertedFilesinKb.mock.afterDeleteAllConvertedFilesinKbCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmDeleteAllConvertedFilesinKb.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmCreateKnowledgeBaseFile.mock.afterCreateKnowledgeBaseFileCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmCreateKnowledgeBaseFile.expectedInvocations) return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) } -// 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) +// CreateKnowledgeBaseFile implements repository.RepositoryI +func (mmCreateKnowledgeBaseFile *RepositoryIMock) CreateKnowledgeBaseFile(ctx context.Context, kb mm_repository.KnowledgeBaseFile, externalServiceCall func(FileUID string) error) (kp1 *mm_repository.KnowledgeBaseFile, err error) { + mm_atomic.AddUint64(&mmCreateKnowledgeBaseFile.beforeCreateKnowledgeBaseFileCounter, 1) + defer mm_atomic.AddUint64(&mmCreateKnowledgeBaseFile.afterCreateKnowledgeBaseFileCounter, 1) - if mmDeleteAllConvertedFilesinKb.inspectFuncDeleteAllConvertedFilesinKb != nil { - mmDeleteAllConvertedFilesinKb.inspectFuncDeleteAllConvertedFilesinKb(ctx, kbUID) + if mmCreateKnowledgeBaseFile.inspectFuncCreateKnowledgeBaseFile != nil { + mmCreateKnowledgeBaseFile.inspectFuncCreateKnowledgeBaseFile(ctx, kb, externalServiceCall) } - mm_params := RepositoryIMockDeleteAllConvertedFilesinKbParams{ctx, kbUID} + mm_params := RepositoryIMockCreateKnowledgeBaseFileParams{ctx, kb, externalServiceCall} // Record call args - mmDeleteAllConvertedFilesinKb.DeleteAllConvertedFilesinKbMock.mutex.Lock() - mmDeleteAllConvertedFilesinKb.DeleteAllConvertedFilesinKbMock.callArgs = append(mmDeleteAllConvertedFilesinKb.DeleteAllConvertedFilesinKbMock.callArgs, &mm_params) - mmDeleteAllConvertedFilesinKb.DeleteAllConvertedFilesinKbMock.mutex.Unlock() + mmCreateKnowledgeBaseFile.CreateKnowledgeBaseFileMock.mutex.Lock() + mmCreateKnowledgeBaseFile.CreateKnowledgeBaseFileMock.callArgs = append(mmCreateKnowledgeBaseFile.CreateKnowledgeBaseFileMock.callArgs, &mm_params) + mmCreateKnowledgeBaseFile.CreateKnowledgeBaseFileMock.mutex.Unlock() - for _, e := range mmDeleteAllConvertedFilesinKb.DeleteAllConvertedFilesinKbMock.expectations { + for _, e := range mmCreateKnowledgeBaseFile.CreateKnowledgeBaseFileMock.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 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 + if mmCreateKnowledgeBaseFile.CreateKnowledgeBaseFileMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmCreateKnowledgeBaseFile.CreateKnowledgeBaseFileMock.defaultExpectation.Counter, 1) + mm_want := mmCreateKnowledgeBaseFile.CreateKnowledgeBaseFileMock.defaultExpectation.params + mm_want_ptrs := mmCreateKnowledgeBaseFile.CreateKnowledgeBaseFileMock.defaultExpectation.paramPtrs - mm_got := RepositoryIMockDeleteAllConvertedFilesinKbParams{ctx, kbUID} + mm_got := RepositoryIMockCreateKnowledgeBaseFileParams{ctx, kb, externalServiceCall} if mm_want_ptrs != nil { if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { - 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)) + mmCreateKnowledgeBaseFile.t.Errorf("RepositoryIMock.CreateKnowledgeBaseFile 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) { - 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)) + if mm_want_ptrs.kb != nil && !minimock.Equal(*mm_want_ptrs.kb, mm_got.kb) { + mmCreateKnowledgeBaseFile.t.Errorf("RepositoryIMock.CreateKnowledgeBaseFile got unexpected parameter kb, want: %#v, got: %#v%s\n", *mm_want_ptrs.kb, mm_got.kb, minimock.Diff(*mm_want_ptrs.kb, mm_got.kb)) + } + + if mm_want_ptrs.externalServiceCall != nil && !minimock.Equal(*mm_want_ptrs.externalServiceCall, mm_got.externalServiceCall) { + mmCreateKnowledgeBaseFile.t.Errorf("RepositoryIMock.CreateKnowledgeBaseFile 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) { - mmDeleteAllConvertedFilesinKb.t.Errorf("RepositoryIMock.DeleteAllConvertedFilesinKb got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + mmCreateKnowledgeBaseFile.t.Errorf("RepositoryIMock.CreateKnowledgeBaseFile got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) } - mm_results := mmDeleteAllConvertedFilesinKb.DeleteAllConvertedFilesinKbMock.defaultExpectation.results + mm_results := mmCreateKnowledgeBaseFile.CreateKnowledgeBaseFileMock.defaultExpectation.results if mm_results == nil { - mmDeleteAllConvertedFilesinKb.t.Fatal("No results are set for the RepositoryIMock.DeleteAllConvertedFilesinKb") + mmCreateKnowledgeBaseFile.t.Fatal("No results are set for the RepositoryIMock.CreateKnowledgeBaseFile") } - return (*mm_results).err + return (*mm_results).kp1, (*mm_results).err } - if mmDeleteAllConvertedFilesinKb.funcDeleteAllConvertedFilesinKb != nil { - return mmDeleteAllConvertedFilesinKb.funcDeleteAllConvertedFilesinKb(ctx, kbUID) + if mmCreateKnowledgeBaseFile.funcCreateKnowledgeBaseFile != nil { + return mmCreateKnowledgeBaseFile.funcCreateKnowledgeBaseFile(ctx, kb, externalServiceCall) } - mmDeleteAllConvertedFilesinKb.t.Fatalf("Unexpected call to RepositoryIMock.DeleteAllConvertedFilesinKb. %v %v", ctx, kbUID) + mmCreateKnowledgeBaseFile.t.Fatalf("Unexpected call to RepositoryIMock.CreateKnowledgeBaseFile. %v %v %v", ctx, kb, externalServiceCall) return } -// DeleteAllConvertedFilesinKbAfterCounter returns a count of finished RepositoryIMock.DeleteAllConvertedFilesinKb invocations -func (mmDeleteAllConvertedFilesinKb *RepositoryIMock) DeleteAllConvertedFilesinKbAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmDeleteAllConvertedFilesinKb.afterDeleteAllConvertedFilesinKbCounter) +// CreateKnowledgeBaseFileAfterCounter returns a count of finished RepositoryIMock.CreateKnowledgeBaseFile invocations +func (mmCreateKnowledgeBaseFile *RepositoryIMock) CreateKnowledgeBaseFileAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmCreateKnowledgeBaseFile.afterCreateKnowledgeBaseFileCounter) } -// DeleteAllConvertedFilesinKbBeforeCounter returns a count of RepositoryIMock.DeleteAllConvertedFilesinKb invocations -func (mmDeleteAllConvertedFilesinKb *RepositoryIMock) DeleteAllConvertedFilesinKbBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmDeleteAllConvertedFilesinKb.beforeDeleteAllConvertedFilesinKbCounter) +// CreateKnowledgeBaseFileBeforeCounter returns a count of RepositoryIMock.CreateKnowledgeBaseFile invocations +func (mmCreateKnowledgeBaseFile *RepositoryIMock) CreateKnowledgeBaseFileBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmCreateKnowledgeBaseFile.beforeCreateKnowledgeBaseFileCounter) } -// Calls returns a list of arguments used in each call to RepositoryIMock.DeleteAllConvertedFilesinKb. +// Calls returns a list of arguments used in each call to RepositoryIMock.CreateKnowledgeBaseFile. // The list is in the same order as the calls were made (i.e. recent calls have a higher index) -func (mmDeleteAllConvertedFilesinKb *mRepositoryIMockDeleteAllConvertedFilesinKb) Calls() []*RepositoryIMockDeleteAllConvertedFilesinKbParams { - mmDeleteAllConvertedFilesinKb.mutex.RLock() +func (mmCreateKnowledgeBaseFile *mRepositoryIMockCreateKnowledgeBaseFile) Calls() []*RepositoryIMockCreateKnowledgeBaseFileParams { + mmCreateKnowledgeBaseFile.mutex.RLock() - argCopy := make([]*RepositoryIMockDeleteAllConvertedFilesinKbParams, len(mmDeleteAllConvertedFilesinKb.callArgs)) - copy(argCopy, mmDeleteAllConvertedFilesinKb.callArgs) + argCopy := make([]*RepositoryIMockCreateKnowledgeBaseFileParams, len(mmCreateKnowledgeBaseFile.callArgs)) + copy(argCopy, mmCreateKnowledgeBaseFile.callArgs) - mmDeleteAllConvertedFilesinKb.mutex.RUnlock() + mmCreateKnowledgeBaseFile.mutex.RUnlock() return argCopy } -// MinimockDeleteAllConvertedFilesinKbDone returns true if the count of the DeleteAllConvertedFilesinKb invocations corresponds +// MinimockCreateKnowledgeBaseFileDone returns true if the count of the CreateKnowledgeBaseFile invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockDeleteAllConvertedFilesinKbDone() bool { - for _, e := range m.DeleteAllConvertedFilesinKbMock.expectations { +func (m *RepositoryIMock) MinimockCreateKnowledgeBaseFileDone() bool { + for _, e := range m.CreateKnowledgeBaseFileMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.DeleteAllConvertedFilesinKbMock.invocationsDone() + return m.CreateKnowledgeBaseFileMock.invocationsDone() } -// MinimockDeleteAllConvertedFilesinKbInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockDeleteAllConvertedFilesinKbInspect() { - for _, e := range m.DeleteAllConvertedFilesinKbMock.expectations { +// MinimockCreateKnowledgeBaseFileInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockCreateKnowledgeBaseFileInspect() { + for _, e := range m.CreateKnowledgeBaseFileMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { - m.t.Errorf("Expected call to RepositoryIMock.DeleteAllConvertedFilesinKb with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.CreateKnowledgeBaseFile with params: %#v", *e.params) } } - afterDeleteAllConvertedFilesinKbCounter := mm_atomic.LoadUint64(&m.afterDeleteAllConvertedFilesinKbCounter) + afterCreateKnowledgeBaseFileCounter := mm_atomic.LoadUint64(&m.afterCreateKnowledgeBaseFileCounter) // if default expectation was set then invocations count should be greater than zero - if m.DeleteAllConvertedFilesinKbMock.defaultExpectation != nil && afterDeleteAllConvertedFilesinKbCounter < 1 { - if m.DeleteAllConvertedFilesinKbMock.defaultExpectation.params == nil { - m.t.Error("Expected call to RepositoryIMock.DeleteAllConvertedFilesinKb") + if m.CreateKnowledgeBaseFileMock.defaultExpectation != nil && afterCreateKnowledgeBaseFileCounter < 1 { + if m.CreateKnowledgeBaseFileMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.CreateKnowledgeBaseFile") } else { - m.t.Errorf("Expected call to RepositoryIMock.DeleteAllConvertedFilesinKb with params: %#v", *m.DeleteAllConvertedFilesinKbMock.defaultExpectation.params) + m.t.Errorf("Expected call to RepositoryIMock.CreateKnowledgeBaseFile with params: %#v", *m.CreateKnowledgeBaseFileMock.defaultExpectation.params) } } // if func was set then invocations count should be greater than zero - if m.funcDeleteAllConvertedFilesinKb != nil && afterDeleteAllConvertedFilesinKbCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.DeleteAllConvertedFilesinKb") + if m.funcCreateKnowledgeBaseFile != nil && afterCreateKnowledgeBaseFileCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.CreateKnowledgeBaseFile") } - 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) + if !m.CreateKnowledgeBaseFileMock.invocationsDone() && afterCreateKnowledgeBaseFileCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.CreateKnowledgeBaseFile but found %d calls", + mm_atomic.LoadUint64(&m.CreateKnowledgeBaseFileMock.expectedInvocations), afterCreateKnowledgeBaseFileCounter) } } -type mRepositoryIMockDeleteAllKnowledgeBaseFiles struct { +type mRepositoryIMockCreateMessage struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockDeleteAllKnowledgeBaseFilesExpectation - expectations []*RepositoryIMockDeleteAllKnowledgeBaseFilesExpectation + defaultExpectation *RepositoryIMockCreateMessageExpectation + expectations []*RepositoryIMockCreateMessageExpectation - callArgs []*RepositoryIMockDeleteAllKnowledgeBaseFilesParams + callArgs []*RepositoryIMockCreateMessageParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockDeleteAllKnowledgeBaseFilesExpectation specifies expectation struct of the RepositoryI.DeleteAllKnowledgeBaseFiles -type RepositoryIMockDeleteAllKnowledgeBaseFilesExpectation struct { +// RepositoryIMockCreateMessageExpectation specifies expectation struct of the RepositoryI.CreateMessage +type RepositoryIMockCreateMessageExpectation struct { mock *RepositoryIMock - params *RepositoryIMockDeleteAllKnowledgeBaseFilesParams - paramPtrs *RepositoryIMockDeleteAllKnowledgeBaseFilesParamPtrs - results *RepositoryIMockDeleteAllKnowledgeBaseFilesResults + params *RepositoryIMockCreateMessageParams + paramPtrs *RepositoryIMockCreateMessageParamPtrs + results *RepositoryIMockCreateMessageResults Counter uint64 } -// RepositoryIMockDeleteAllKnowledgeBaseFilesParams contains parameters of the RepositoryI.DeleteAllKnowledgeBaseFiles -type RepositoryIMockDeleteAllKnowledgeBaseFilesParams struct { - ctx context.Context - kbUID string +// RepositoryIMockCreateMessageParams contains parameters of the RepositoryI.CreateMessage +type RepositoryIMockCreateMessageParams struct { + ctx context.Context + msg mm_repository.Message } -// RepositoryIMockDeleteAllKnowledgeBaseFilesParamPtrs contains pointers to parameters of the RepositoryI.DeleteAllKnowledgeBaseFiles -type RepositoryIMockDeleteAllKnowledgeBaseFilesParamPtrs struct { - ctx *context.Context - kbUID *string +// RepositoryIMockCreateMessageParamPtrs contains pointers to parameters of the RepositoryI.CreateMessage +type RepositoryIMockCreateMessageParamPtrs struct { + ctx *context.Context + msg *mm_repository.Message } -// RepositoryIMockDeleteAllKnowledgeBaseFilesResults contains results of the RepositoryI.DeleteAllKnowledgeBaseFiles -type RepositoryIMockDeleteAllKnowledgeBaseFilesResults struct { +// RepositoryIMockCreateMessageResults contains results of the RepositoryI.CreateMessage +type RepositoryIMockCreateMessageResults struct { + mp1 *mm_repository.Message err error } -// 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") +// Expect sets up expected params for RepositoryI.CreateMessage +func (mmCreateMessage *mRepositoryIMockCreateMessage) Expect(ctx context.Context, msg mm_repository.Message) *mRepositoryIMockCreateMessage { + if mmCreateMessage.mock.funcCreateMessage != nil { + mmCreateMessage.mock.t.Fatalf("RepositoryIMock.CreateMessage mock is already set by Set") } - if mmDeleteAllKnowledgeBaseFiles.defaultExpectation == nil { - mmDeleteAllKnowledgeBaseFiles.defaultExpectation = &RepositoryIMockDeleteAllKnowledgeBaseFilesExpectation{} + if mmCreateMessage.defaultExpectation == nil { + mmCreateMessage.defaultExpectation = &RepositoryIMockCreateMessageExpectation{} } - if mmDeleteAllKnowledgeBaseFiles.defaultExpectation.paramPtrs != nil { - mmDeleteAllKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.DeleteAllKnowledgeBaseFiles mock is already set by ExpectParams functions") + if mmCreateMessage.defaultExpectation.paramPtrs != nil { + mmCreateMessage.mock.t.Fatalf("RepositoryIMock.CreateMessage mock is already set by ExpectParams functions") } - 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) + mmCreateMessage.defaultExpectation.params = &RepositoryIMockCreateMessageParams{ctx, msg} + for _, e := range mmCreateMessage.expectations { + if minimock.Equal(e.params, mmCreateMessage.defaultExpectation.params) { + mmCreateMessage.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmCreateMessage.defaultExpectation.params) } } - return mmDeleteAllKnowledgeBaseFiles + return mmCreateMessage } -// 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") +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.CreateMessage +func (mmCreateMessage *mRepositoryIMockCreateMessage) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockCreateMessage { + if mmCreateMessage.mock.funcCreateMessage != nil { + mmCreateMessage.mock.t.Fatalf("RepositoryIMock.CreateMessage mock is already set by Set") } - if mmDeleteAllKnowledgeBaseFiles.defaultExpectation == nil { - mmDeleteAllKnowledgeBaseFiles.defaultExpectation = &RepositoryIMockDeleteAllKnowledgeBaseFilesExpectation{} + if mmCreateMessage.defaultExpectation == nil { + mmCreateMessage.defaultExpectation = &RepositoryIMockCreateMessageExpectation{} } - if mmDeleteAllKnowledgeBaseFiles.defaultExpectation.params != nil { - mmDeleteAllKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.DeleteAllKnowledgeBaseFiles mock is already set by Expect") + if mmCreateMessage.defaultExpectation.params != nil { + mmCreateMessage.mock.t.Fatalf("RepositoryIMock.CreateMessage mock is already set by Expect") } - if mmDeleteAllKnowledgeBaseFiles.defaultExpectation.paramPtrs == nil { - mmDeleteAllKnowledgeBaseFiles.defaultExpectation.paramPtrs = &RepositoryIMockDeleteAllKnowledgeBaseFilesParamPtrs{} + if mmCreateMessage.defaultExpectation.paramPtrs == nil { + mmCreateMessage.defaultExpectation.paramPtrs = &RepositoryIMockCreateMessageParamPtrs{} } - mmDeleteAllKnowledgeBaseFiles.defaultExpectation.paramPtrs.ctx = &ctx + mmCreateMessage.defaultExpectation.paramPtrs.ctx = &ctx - return mmDeleteAllKnowledgeBaseFiles + return mmCreateMessage } -// 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") +// ExpectMsgParam2 sets up expected param msg for RepositoryI.CreateMessage +func (mmCreateMessage *mRepositoryIMockCreateMessage) ExpectMsgParam2(msg mm_repository.Message) *mRepositoryIMockCreateMessage { + if mmCreateMessage.mock.funcCreateMessage != nil { + mmCreateMessage.mock.t.Fatalf("RepositoryIMock.CreateMessage mock is already set by Set") } - if mmDeleteAllKnowledgeBaseFiles.defaultExpectation == nil { - mmDeleteAllKnowledgeBaseFiles.defaultExpectation = &RepositoryIMockDeleteAllKnowledgeBaseFilesExpectation{} + if mmCreateMessage.defaultExpectation == nil { + mmCreateMessage.defaultExpectation = &RepositoryIMockCreateMessageExpectation{} } - if mmDeleteAllKnowledgeBaseFiles.defaultExpectation.params != nil { - mmDeleteAllKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.DeleteAllKnowledgeBaseFiles mock is already set by Expect") + if mmCreateMessage.defaultExpectation.params != nil { + mmCreateMessage.mock.t.Fatalf("RepositoryIMock.CreateMessage mock is already set by Expect") } - if mmDeleteAllKnowledgeBaseFiles.defaultExpectation.paramPtrs == nil { - mmDeleteAllKnowledgeBaseFiles.defaultExpectation.paramPtrs = &RepositoryIMockDeleteAllKnowledgeBaseFilesParamPtrs{} + if mmCreateMessage.defaultExpectation.paramPtrs == nil { + mmCreateMessage.defaultExpectation.paramPtrs = &RepositoryIMockCreateMessageParamPtrs{} } - mmDeleteAllKnowledgeBaseFiles.defaultExpectation.paramPtrs.kbUID = &kbUID + mmCreateMessage.defaultExpectation.paramPtrs.msg = &msg - return mmDeleteAllKnowledgeBaseFiles + return mmCreateMessage } -// 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") +// Inspect accepts an inspector function that has same arguments as the RepositoryI.CreateMessage +func (mmCreateMessage *mRepositoryIMockCreateMessage) Inspect(f func(ctx context.Context, msg mm_repository.Message)) *mRepositoryIMockCreateMessage { + if mmCreateMessage.mock.inspectFuncCreateMessage != nil { + mmCreateMessage.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.CreateMessage") } - mmDeleteAllKnowledgeBaseFiles.mock.inspectFuncDeleteAllKnowledgeBaseFiles = f + mmCreateMessage.mock.inspectFuncCreateMessage = f - return mmDeleteAllKnowledgeBaseFiles + return mmCreateMessage } -// 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") +// Return sets up results that will be returned by RepositoryI.CreateMessage +func (mmCreateMessage *mRepositoryIMockCreateMessage) Return(mp1 *mm_repository.Message, err error) *RepositoryIMock { + if mmCreateMessage.mock.funcCreateMessage != nil { + mmCreateMessage.mock.t.Fatalf("RepositoryIMock.CreateMessage mock is already set by Set") } - if mmDeleteAllKnowledgeBaseFiles.defaultExpectation == nil { - mmDeleteAllKnowledgeBaseFiles.defaultExpectation = &RepositoryIMockDeleteAllKnowledgeBaseFilesExpectation{mock: mmDeleteAllKnowledgeBaseFiles.mock} + if mmCreateMessage.defaultExpectation == nil { + mmCreateMessage.defaultExpectation = &RepositoryIMockCreateMessageExpectation{mock: mmCreateMessage.mock} } - mmDeleteAllKnowledgeBaseFiles.defaultExpectation.results = &RepositoryIMockDeleteAllKnowledgeBaseFilesResults{err} - return mmDeleteAllKnowledgeBaseFiles.mock + mmCreateMessage.defaultExpectation.results = &RepositoryIMockCreateMessageResults{mp1, err} + return mmCreateMessage.mock } -// 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") +// Set uses given function f to mock the RepositoryI.CreateMessage method +func (mmCreateMessage *mRepositoryIMockCreateMessage) Set(f func(ctx context.Context, msg mm_repository.Message) (mp1 *mm_repository.Message, err error)) *RepositoryIMock { + if mmCreateMessage.defaultExpectation != nil { + mmCreateMessage.mock.t.Fatalf("Default expectation is already set for the RepositoryI.CreateMessage method") } - if len(mmDeleteAllKnowledgeBaseFiles.expectations) > 0 { - mmDeleteAllKnowledgeBaseFiles.mock.t.Fatalf("Some expectations are already set for the RepositoryI.DeleteAllKnowledgeBaseFiles method") + if len(mmCreateMessage.expectations) > 0 { + mmCreateMessage.mock.t.Fatalf("Some expectations are already set for the RepositoryI.CreateMessage method") } - mmDeleteAllKnowledgeBaseFiles.mock.funcDeleteAllKnowledgeBaseFiles = f - return mmDeleteAllKnowledgeBaseFiles.mock + mmCreateMessage.mock.funcCreateMessage = f + return mmCreateMessage.mock } -// When sets expectation for the RepositoryI.DeleteAllKnowledgeBaseFiles which will trigger the result defined by the following +// When sets expectation for the RepositoryI.CreateMessage which will trigger the result defined by the following // Then helper -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") +func (mmCreateMessage *mRepositoryIMockCreateMessage) When(ctx context.Context, msg mm_repository.Message) *RepositoryIMockCreateMessageExpectation { + if mmCreateMessage.mock.funcCreateMessage != nil { + mmCreateMessage.mock.t.Fatalf("RepositoryIMock.CreateMessage mock is already set by Set") } - expectation := &RepositoryIMockDeleteAllKnowledgeBaseFilesExpectation{ - mock: mmDeleteAllKnowledgeBaseFiles.mock, - params: &RepositoryIMockDeleteAllKnowledgeBaseFilesParams{ctx, kbUID}, + expectation := &RepositoryIMockCreateMessageExpectation{ + mock: mmCreateMessage.mock, + params: &RepositoryIMockCreateMessageParams{ctx, msg}, } - mmDeleteAllKnowledgeBaseFiles.expectations = append(mmDeleteAllKnowledgeBaseFiles.expectations, expectation) + mmCreateMessage.expectations = append(mmCreateMessage.expectations, expectation) return expectation } -// 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} +// Then sets up RepositoryI.CreateMessage return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockCreateMessageExpectation) Then(mp1 *mm_repository.Message, err error) *RepositoryIMock { + e.results = &RepositoryIMockCreateMessageResults{mp1, err} return e.mock } -// Times sets number of times RepositoryI.DeleteAllKnowledgeBaseFiles should be invoked -func (mmDeleteAllKnowledgeBaseFiles *mRepositoryIMockDeleteAllKnowledgeBaseFiles) Times(n uint64) *mRepositoryIMockDeleteAllKnowledgeBaseFiles { +// Times sets number of times RepositoryI.CreateMessage should be invoked +func (mmCreateMessage *mRepositoryIMockCreateMessage) Times(n uint64) *mRepositoryIMockCreateMessage { if n == 0 { - mmDeleteAllKnowledgeBaseFiles.mock.t.Fatalf("Times of RepositoryIMock.DeleteAllKnowledgeBaseFiles mock can not be zero") + mmCreateMessage.mock.t.Fatalf("Times of RepositoryIMock.CreateMessage mock can not be zero") } - mm_atomic.StoreUint64(&mmDeleteAllKnowledgeBaseFiles.expectedInvocations, n) - return mmDeleteAllKnowledgeBaseFiles + mm_atomic.StoreUint64(&mmCreateMessage.expectedInvocations, n) + return mmCreateMessage } -func (mmDeleteAllKnowledgeBaseFiles *mRepositoryIMockDeleteAllKnowledgeBaseFiles) invocationsDone() bool { - if len(mmDeleteAllKnowledgeBaseFiles.expectations) == 0 && mmDeleteAllKnowledgeBaseFiles.defaultExpectation == nil && mmDeleteAllKnowledgeBaseFiles.mock.funcDeleteAllKnowledgeBaseFiles == nil { +func (mmCreateMessage *mRepositoryIMockCreateMessage) invocationsDone() bool { + if len(mmCreateMessage.expectations) == 0 && mmCreateMessage.defaultExpectation == nil && mmCreateMessage.mock.funcCreateMessage == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmDeleteAllKnowledgeBaseFiles.mock.afterDeleteAllKnowledgeBaseFilesCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmDeleteAllKnowledgeBaseFiles.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmCreateMessage.mock.afterCreateMessageCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmCreateMessage.expectedInvocations) return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) } -// 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) +// CreateMessage implements repository.RepositoryI +func (mmCreateMessage *RepositoryIMock) CreateMessage(ctx context.Context, msg mm_repository.Message) (mp1 *mm_repository.Message, err error) { + mm_atomic.AddUint64(&mmCreateMessage.beforeCreateMessageCounter, 1) + defer mm_atomic.AddUint64(&mmCreateMessage.afterCreateMessageCounter, 1) - if mmDeleteAllKnowledgeBaseFiles.inspectFuncDeleteAllKnowledgeBaseFiles != nil { - mmDeleteAllKnowledgeBaseFiles.inspectFuncDeleteAllKnowledgeBaseFiles(ctx, kbUID) + if mmCreateMessage.inspectFuncCreateMessage != nil { + mmCreateMessage.inspectFuncCreateMessage(ctx, msg) } - mm_params := RepositoryIMockDeleteAllKnowledgeBaseFilesParams{ctx, kbUID} + mm_params := RepositoryIMockCreateMessageParams{ctx, msg} // Record call args - mmDeleteAllKnowledgeBaseFiles.DeleteAllKnowledgeBaseFilesMock.mutex.Lock() - mmDeleteAllKnowledgeBaseFiles.DeleteAllKnowledgeBaseFilesMock.callArgs = append(mmDeleteAllKnowledgeBaseFiles.DeleteAllKnowledgeBaseFilesMock.callArgs, &mm_params) - mmDeleteAllKnowledgeBaseFiles.DeleteAllKnowledgeBaseFilesMock.mutex.Unlock() + mmCreateMessage.CreateMessageMock.mutex.Lock() + mmCreateMessage.CreateMessageMock.callArgs = append(mmCreateMessage.CreateMessageMock.callArgs, &mm_params) + mmCreateMessage.CreateMessageMock.mutex.Unlock() - for _, e := range mmDeleteAllKnowledgeBaseFiles.DeleteAllKnowledgeBaseFilesMock.expectations { + for _, e := range mmCreateMessage.CreateMessageMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.err + return e.results.mp1, e.results.err } } - 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 + if mmCreateMessage.CreateMessageMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmCreateMessage.CreateMessageMock.defaultExpectation.Counter, 1) + mm_want := mmCreateMessage.CreateMessageMock.defaultExpectation.params + mm_want_ptrs := mmCreateMessage.CreateMessageMock.defaultExpectation.paramPtrs - mm_got := RepositoryIMockDeleteAllKnowledgeBaseFilesParams{ctx, kbUID} + mm_got := RepositoryIMockCreateMessageParams{ctx, msg} if mm_want_ptrs != nil { if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { - 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)) + mmCreateMessage.t.Errorf("RepositoryIMock.CreateMessage 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) { - 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)) + if mm_want_ptrs.msg != nil && !minimock.Equal(*mm_want_ptrs.msg, mm_got.msg) { + mmCreateMessage.t.Errorf("RepositoryIMock.CreateMessage got unexpected parameter msg, want: %#v, got: %#v%s\n", *mm_want_ptrs.msg, mm_got.msg, minimock.Diff(*mm_want_ptrs.msg, mm_got.msg)) } } else if mm_want != nil && !minimock.Equal(*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)) + mmCreateMessage.t.Errorf("RepositoryIMock.CreateMessage got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) } - mm_results := mmDeleteAllKnowledgeBaseFiles.DeleteAllKnowledgeBaseFilesMock.defaultExpectation.results + mm_results := mmCreateMessage.CreateMessageMock.defaultExpectation.results if mm_results == nil { - mmDeleteAllKnowledgeBaseFiles.t.Fatal("No results are set for the RepositoryIMock.DeleteAllKnowledgeBaseFiles") + mmCreateMessage.t.Fatal("No results are set for the RepositoryIMock.CreateMessage") } - return (*mm_results).err + return (*mm_results).mp1, (*mm_results).err } - if mmDeleteAllKnowledgeBaseFiles.funcDeleteAllKnowledgeBaseFiles != nil { - return mmDeleteAllKnowledgeBaseFiles.funcDeleteAllKnowledgeBaseFiles(ctx, kbUID) + if mmCreateMessage.funcCreateMessage != nil { + return mmCreateMessage.funcCreateMessage(ctx, msg) } - mmDeleteAllKnowledgeBaseFiles.t.Fatalf("Unexpected call to RepositoryIMock.DeleteAllKnowledgeBaseFiles. %v %v", ctx, kbUID) + mmCreateMessage.t.Fatalf("Unexpected call to RepositoryIMock.CreateMessage. %v %v", ctx, msg) return } -// DeleteAllKnowledgeBaseFilesAfterCounter returns a count of finished RepositoryIMock.DeleteAllKnowledgeBaseFiles invocations -func (mmDeleteAllKnowledgeBaseFiles *RepositoryIMock) DeleteAllKnowledgeBaseFilesAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmDeleteAllKnowledgeBaseFiles.afterDeleteAllKnowledgeBaseFilesCounter) +// CreateMessageAfterCounter returns a count of finished RepositoryIMock.CreateMessage invocations +func (mmCreateMessage *RepositoryIMock) CreateMessageAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmCreateMessage.afterCreateMessageCounter) } -// DeleteAllKnowledgeBaseFilesBeforeCounter returns a count of RepositoryIMock.DeleteAllKnowledgeBaseFiles invocations -func (mmDeleteAllKnowledgeBaseFiles *RepositoryIMock) DeleteAllKnowledgeBaseFilesBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmDeleteAllKnowledgeBaseFiles.beforeDeleteAllKnowledgeBaseFilesCounter) +// CreateMessageBeforeCounter returns a count of RepositoryIMock.CreateMessage invocations +func (mmCreateMessage *RepositoryIMock) CreateMessageBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmCreateMessage.beforeCreateMessageCounter) } -// Calls returns a list of arguments used in each call to RepositoryIMock.DeleteAllKnowledgeBaseFiles. +// Calls returns a list of arguments used in each call to RepositoryIMock.CreateMessage. // The list is in the same order as the calls were made (i.e. recent calls have a higher index) -func (mmDeleteAllKnowledgeBaseFiles *mRepositoryIMockDeleteAllKnowledgeBaseFiles) Calls() []*RepositoryIMockDeleteAllKnowledgeBaseFilesParams { - mmDeleteAllKnowledgeBaseFiles.mutex.RLock() +func (mmCreateMessage *mRepositoryIMockCreateMessage) Calls() []*RepositoryIMockCreateMessageParams { + mmCreateMessage.mutex.RLock() - argCopy := make([]*RepositoryIMockDeleteAllKnowledgeBaseFilesParams, len(mmDeleteAllKnowledgeBaseFiles.callArgs)) - copy(argCopy, mmDeleteAllKnowledgeBaseFiles.callArgs) + argCopy := make([]*RepositoryIMockCreateMessageParams, len(mmCreateMessage.callArgs)) + copy(argCopy, mmCreateMessage.callArgs) - mmDeleteAllKnowledgeBaseFiles.mutex.RUnlock() + mmCreateMessage.mutex.RUnlock() return argCopy } -// MinimockDeleteAllKnowledgeBaseFilesDone returns true if the count of the DeleteAllKnowledgeBaseFiles invocations corresponds +// MinimockCreateMessageDone returns true if the count of the CreateMessage invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockDeleteAllKnowledgeBaseFilesDone() bool { - for _, e := range m.DeleteAllKnowledgeBaseFilesMock.expectations { +func (m *RepositoryIMock) MinimockCreateMessageDone() bool { + for _, e := range m.CreateMessageMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.DeleteAllKnowledgeBaseFilesMock.invocationsDone() + return m.CreateMessageMock.invocationsDone() } -// MinimockDeleteAllKnowledgeBaseFilesInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockDeleteAllKnowledgeBaseFilesInspect() { - for _, e := range m.DeleteAllKnowledgeBaseFilesMock.expectations { +// MinimockCreateMessageInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockCreateMessageInspect() { + for _, e := range m.CreateMessageMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { - m.t.Errorf("Expected call to RepositoryIMock.DeleteAllKnowledgeBaseFiles with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.CreateMessage with params: %#v", *e.params) } } - afterDeleteAllKnowledgeBaseFilesCounter := mm_atomic.LoadUint64(&m.afterDeleteAllKnowledgeBaseFilesCounter) + afterCreateMessageCounter := mm_atomic.LoadUint64(&m.afterCreateMessageCounter) // if default expectation was set then invocations count should be greater than zero - if m.DeleteAllKnowledgeBaseFilesMock.defaultExpectation != nil && afterDeleteAllKnowledgeBaseFilesCounter < 1 { - if m.DeleteAllKnowledgeBaseFilesMock.defaultExpectation.params == nil { - m.t.Error("Expected call to RepositoryIMock.DeleteAllKnowledgeBaseFiles") + if m.CreateMessageMock.defaultExpectation != nil && afterCreateMessageCounter < 1 { + if m.CreateMessageMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.CreateMessage") } else { - m.t.Errorf("Expected call to RepositoryIMock.DeleteAllKnowledgeBaseFiles with params: %#v", *m.DeleteAllKnowledgeBaseFilesMock.defaultExpectation.params) + m.t.Errorf("Expected call to RepositoryIMock.CreateMessage with params: %#v", *m.CreateMessageMock.defaultExpectation.params) } } // if func was set then invocations count should be greater than zero - if m.funcDeleteAllKnowledgeBaseFiles != nil && afterDeleteAllKnowledgeBaseFilesCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.DeleteAllKnowledgeBaseFiles") + if m.funcCreateMessage != nil && afterCreateMessageCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.CreateMessage") } - 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) + if !m.CreateMessageMock.invocationsDone() && afterCreateMessageCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.CreateMessage but found %d calls", + mm_atomic.LoadUint64(&m.CreateMessageMock.expectedInvocations), afterCreateMessageCounter) } } -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)) + 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.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.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)) } - 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)) - } + } else if mm_want != nil && !minimock.Equal(*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)) + } - 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 + 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 + return mmDeleteAllKnowledgeBaseFiles } -// 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") +// 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.ctx = &ctx + mmDeleteAllKnowledgeBaseFiles.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") +// 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.sourceTable = &sourceTable + mmDeleteAllKnowledgeBaseFiles.defaultExpectation.paramPtrs.kbUID = &kbUID - 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") +// 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") } - if mmDeleteChunksBySource.defaultExpectation == nil { - mmDeleteChunksBySource.defaultExpectation = &RepositoryIMockDeleteChunksBySourceExpectation{} - } + mmDeleteAllKnowledgeBaseFiles.mock.inspectFuncDeleteAllKnowledgeBaseFiles = f - if mmDeleteChunksBySource.defaultExpectation.params != nil { - mmDeleteChunksBySource.mock.t.Fatalf("RepositoryIMock.DeleteChunksBySource mock is already set by Expect") - } + return mmDeleteAllKnowledgeBaseFiles +} - if mmDeleteChunksBySource.defaultExpectation.paramPtrs == nil { - mmDeleteChunksBySource.defaultExpectation.paramPtrs = &RepositoryIMockDeleteChunksBySourceParamPtrs{} +// 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") } - mmDeleteChunksBySource.defaultExpectation.paramPtrs.sourceUID = &sourceUID - return mmDeleteChunksBySource + if mmDeleteAllKnowledgeBaseFiles.defaultExpectation == nil { + mmDeleteAllKnowledgeBaseFiles.defaultExpectation = &RepositoryIMockDeleteAllKnowledgeBaseFilesExpectation{mock: mmDeleteAllKnowledgeBaseFiles.mock} + } + mmDeleteAllKnowledgeBaseFiles.defaultExpectation.results = &RepositoryIMockDeleteAllKnowledgeBaseFilesResults{err} + return mmDeleteAllKnowledgeBaseFiles.mock } -// 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") +// 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") } - mmDeleteChunksBySource.mock.inspectFuncDeleteChunksBySource = f + if len(mmDeleteAllKnowledgeBaseFiles.expectations) > 0 { + mmDeleteAllKnowledgeBaseFiles.mock.t.Fatalf("Some expectations are already set for the RepositoryI.DeleteAllKnowledgeBaseFiles method") + } - return mmDeleteChunksBySource + mmDeleteAllKnowledgeBaseFiles.mock.funcDeleteAllKnowledgeBaseFiles = f + return mmDeleteAllKnowledgeBaseFiles.mock } -// 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") +// When sets expectation for the RepositoryI.DeleteAllKnowledgeBaseFiles which will trigger the result defined by the following +// Then helper +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") } - if mmDeleteChunksBySource.defaultExpectation == nil { - mmDeleteChunksBySource.defaultExpectation = &RepositoryIMockDeleteChunksBySourceExpectation{mock: mmDeleteChunksBySource.mock} + expectation := &RepositoryIMockDeleteAllKnowledgeBaseFilesExpectation{ + mock: mmDeleteAllKnowledgeBaseFiles.mock, + params: &RepositoryIMockDeleteAllKnowledgeBaseFilesParams{ctx, kbUID}, } - mmDeleteChunksBySource.defaultExpectation.results = &RepositoryIMockDeleteChunksBySourceResults{err} - return mmDeleteChunksBySource.mock + mmDeleteAllKnowledgeBaseFiles.expectations = append(mmDeleteAllKnowledgeBaseFiles.expectations, expectation) + return expectation } -// 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.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)) + } + + 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)) + } + + 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) { - mmDeleteChunksByUIDs.t.Errorf("RepositoryIMock.DeleteChunksByUIDs got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*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 := mmDeleteChunksByUIDs.DeleteChunksByUIDsMock.defaultExpectation.results + mm_results := mmDeleteAndCreateChunks.DeleteAndCreateChunksMock.defaultExpectation.results if mm_results == nil { - mmDeleteChunksByUIDs.t.Fatal("No results are set for the RepositoryIMock.DeleteChunksByUIDs") + mmDeleteAndCreateChunks.t.Fatal("No results are set for the RepositoryIMock.DeleteAndCreateChunks") } - return (*mm_results).err + 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 + if mmDeleteChunksBySource.defaultExpectation == nil { + mmDeleteChunksBySource.defaultExpectation = &RepositoryIMockDeleteChunksBySourceExpectation{} + } - return mmDeleteConvertedFile + 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.sourceUID = &sourceUID + + return mmDeleteChunksBySource } -// 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") +// 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 mmDeleteConvertedFile.defaultExpectation == nil { - mmDeleteConvertedFile.defaultExpectation = &RepositoryIMockDeleteConvertedFileExpectation{mock: mmDeleteConvertedFile.mock} + mmDeleteChunksBySource.mock.inspectFuncDeleteChunksBySource = f + + return mmDeleteChunksBySource +} + +// 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") } - mmDeleteConvertedFile.defaultExpectation.results = &RepositoryIMockDeleteConvertedFileResults{err} - return mmDeleteConvertedFile.mock + + if mmDeleteChunksBySource.defaultExpectation == nil { + mmDeleteChunksBySource.defaultExpectation = &RepositoryIMockDeleteChunksBySourceExpectation{mock: mmDeleteChunksBySource.mock} + } + mmDeleteChunksBySource.defaultExpectation.results = &RepositoryIMockDeleteChunksBySourceResults{err} + return mmDeleteChunksBySource.mock } -// 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") +// 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(mmDeleteConvertedFile.expectations) > 0 { - mmDeleteConvertedFile.mock.t.Fatalf("Some expectations are already set for the RepositoryI.DeleteConvertedFile method") + if len(mmDeleteChunksBySource.expectations) > 0 { + mmDeleteChunksBySource.mock.t.Fatalf("Some expectations are already set for the RepositoryI.DeleteChunksBySource method") } - mmDeleteConvertedFile.mock.funcDeleteConvertedFile = f - return mmDeleteConvertedFile.mock + mmDeleteChunksBySource.mock.funcDeleteChunksBySource = f + return mmDeleteChunksBySource.mock } -// When sets expectation for the RepositoryI.DeleteConvertedFile which will trigger the result defined by the following +// When sets expectation for the RepositoryI.DeleteChunksBySource 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") +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 := &RepositoryIMockDeleteConvertedFileExpectation{ - mock: mmDeleteConvertedFile.mock, - params: &RepositoryIMockDeleteConvertedFileParams{ctx, uid}, + expectation := &RepositoryIMockDeleteChunksBySourceExpectation{ + mock: mmDeleteChunksBySource.mock, + params: &RepositoryIMockDeleteChunksBySourceParams{ctx, sourceTable, sourceUID}, } - mmDeleteConvertedFile.expectations = append(mmDeleteConvertedFile.expectations, expectation) + 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 + mmDeleteChunksByUIDs.defaultExpectation.paramPtrs.ctx = &ctx - return mmDeleteEmbeddingsBySource + return mmDeleteChunksByUIDs } -// 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") +// 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.sourceTable = &sourceTable + mmDeleteChunksByUIDs.defaultExpectation.paramPtrs.chunkUIDs = &chunkUIDs - 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") +// 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") } - if mmDeleteEmbeddingsBySource.defaultExpectation == nil { - mmDeleteEmbeddingsBySource.defaultExpectation = &RepositoryIMockDeleteEmbeddingsBySourceExpectation{} - } + mmDeleteChunksByUIDs.mock.inspectFuncDeleteChunksByUIDs = f - 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.sourceUID = &sourceUID - - return mmDeleteEmbeddingsBySource -} - -// 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") - } - - mmDeleteEmbeddingsBySource.mock.inspectFuncDeleteEmbeddingsBySource = 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}, - } - mmDeleteKnowledgeBaseFile.expectations = append(mmDeleteKnowledgeBaseFile.expectations, expectation) + expectation := &RepositoryIMockDeleteEmbeddingsByUIDsExpectation{ + mock: mmDeleteEmbeddingsByUIDs.mock, + params: &RepositoryIMockDeleteEmbeddingsByUIDsParams{ctx, embUIDs}, + } + 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 mRepositoryIMockDeleteMessage struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockGetConvertedFileByFileUIDExpectation - expectations []*RepositoryIMockGetConvertedFileByFileUIDExpectation + defaultExpectation *RepositoryIMockDeleteMessageExpectation + expectations []*RepositoryIMockDeleteMessageExpectation - callArgs []*RepositoryIMockGetConvertedFileByFileUIDParams + callArgs []*RepositoryIMockDeleteMessageParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockGetConvertedFileByFileUIDExpectation specifies expectation struct of the RepositoryI.GetConvertedFileByFileUID -type RepositoryIMockGetConvertedFileByFileUIDExpectation struct { +// RepositoryIMockDeleteMessageExpectation specifies expectation struct of the RepositoryI.DeleteMessage +type RepositoryIMockDeleteMessageExpectation struct { mock *RepositoryIMock - params *RepositoryIMockGetConvertedFileByFileUIDParams - paramPtrs *RepositoryIMockGetConvertedFileByFileUIDParamPtrs - results *RepositoryIMockGetConvertedFileByFileUIDResults + params *RepositoryIMockDeleteMessageParams + paramPtrs *RepositoryIMockDeleteMessageParamPtrs + results *RepositoryIMockDeleteMessageResults Counter uint64 } -// RepositoryIMockGetConvertedFileByFileUIDParams contains parameters of the RepositoryI.GetConvertedFileByFileUID -type RepositoryIMockGetConvertedFileByFileUIDParams struct { - ctx context.Context - fileUID uuid.UUID +// RepositoryIMockDeleteMessageParams contains parameters of the RepositoryI.DeleteMessage +type RepositoryIMockDeleteMessageParams struct { + ctx context.Context + messageUID uuid.UUID } -// RepositoryIMockGetConvertedFileByFileUIDParamPtrs contains pointers to parameters of the RepositoryI.GetConvertedFileByFileUID -type RepositoryIMockGetConvertedFileByFileUIDParamPtrs struct { - ctx *context.Context - fileUID *uuid.UUID +// RepositoryIMockDeleteMessageParamPtrs contains pointers to parameters of the RepositoryI.DeleteMessage +type RepositoryIMockDeleteMessageParamPtrs struct { + ctx *context.Context + messageUID *uuid.UUID } -// RepositoryIMockGetConvertedFileByFileUIDResults contains results of the RepositoryI.GetConvertedFileByFileUID -type RepositoryIMockGetConvertedFileByFileUIDResults struct { - cp1 *mm_repository.ConvertedFile +// RepositoryIMockDeleteMessageResults contains results of the RepositoryI.DeleteMessage +type RepositoryIMockDeleteMessageResults 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.DeleteMessage +func (mmDeleteMessage *mRepositoryIMockDeleteMessage) Expect(ctx context.Context, messageUID uuid.UUID) *mRepositoryIMockDeleteMessage { + if mmDeleteMessage.mock.funcDeleteMessage != nil { + mmDeleteMessage.mock.t.Fatalf("RepositoryIMock.DeleteMessage mock is already set by Set") } - if mmGetConvertedFileByFileUID.defaultExpectation == nil { - mmGetConvertedFileByFileUID.defaultExpectation = &RepositoryIMockGetConvertedFileByFileUIDExpectation{} + if mmDeleteMessage.defaultExpectation == nil { + mmDeleteMessage.defaultExpectation = &RepositoryIMockDeleteMessageExpectation{} } - if mmGetConvertedFileByFileUID.defaultExpectation.paramPtrs != nil { - mmGetConvertedFileByFileUID.mock.t.Fatalf("RepositoryIMock.GetConvertedFileByFileUID mock is already set by ExpectParams functions") + if mmDeleteMessage.defaultExpectation.paramPtrs != nil { + mmDeleteMessage.mock.t.Fatalf("RepositoryIMock.DeleteMessage 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) + mmDeleteMessage.defaultExpectation.params = &RepositoryIMockDeleteMessageParams{ctx, messageUID} + for _, e := range mmDeleteMessage.expectations { + if minimock.Equal(e.params, mmDeleteMessage.defaultExpectation.params) { + mmDeleteMessage.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmDeleteMessage.defaultExpectation.params) } } - return mmGetConvertedFileByFileUID + return mmDeleteMessage } -// 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.DeleteMessage +func (mmDeleteMessage *mRepositoryIMockDeleteMessage) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockDeleteMessage { + if mmDeleteMessage.mock.funcDeleteMessage != nil { + mmDeleteMessage.mock.t.Fatalf("RepositoryIMock.DeleteMessage mock is already set by Set") } - if mmGetConvertedFileByFileUID.defaultExpectation == nil { - mmGetConvertedFileByFileUID.defaultExpectation = &RepositoryIMockGetConvertedFileByFileUIDExpectation{} + if mmDeleteMessage.defaultExpectation == nil { + mmDeleteMessage.defaultExpectation = &RepositoryIMockDeleteMessageExpectation{} } - if mmGetConvertedFileByFileUID.defaultExpectation.params != nil { - mmGetConvertedFileByFileUID.mock.t.Fatalf("RepositoryIMock.GetConvertedFileByFileUID mock is already set by Expect") + if mmDeleteMessage.defaultExpectation.params != nil { + mmDeleteMessage.mock.t.Fatalf("RepositoryIMock.DeleteMessage mock is already set by Expect") } - if mmGetConvertedFileByFileUID.defaultExpectation.paramPtrs == nil { - mmGetConvertedFileByFileUID.defaultExpectation.paramPtrs = &RepositoryIMockGetConvertedFileByFileUIDParamPtrs{} + if mmDeleteMessage.defaultExpectation.paramPtrs == nil { + mmDeleteMessage.defaultExpectation.paramPtrs = &RepositoryIMockDeleteMessageParamPtrs{} } - mmGetConvertedFileByFileUID.defaultExpectation.paramPtrs.ctx = &ctx + mmDeleteMessage.defaultExpectation.paramPtrs.ctx = &ctx - return mmGetConvertedFileByFileUID + return mmDeleteMessage } -// 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") +// ExpectMessageUIDParam2 sets up expected param messageUID for RepositoryI.DeleteMessage +func (mmDeleteMessage *mRepositoryIMockDeleteMessage) ExpectMessageUIDParam2(messageUID uuid.UUID) *mRepositoryIMockDeleteMessage { + if mmDeleteMessage.mock.funcDeleteMessage != nil { + mmDeleteMessage.mock.t.Fatalf("RepositoryIMock.DeleteMessage mock is already set by Set") } - if mmGetConvertedFileByFileUID.defaultExpectation == nil { - mmGetConvertedFileByFileUID.defaultExpectation = &RepositoryIMockGetConvertedFileByFileUIDExpectation{} + if mmDeleteMessage.defaultExpectation == nil { + mmDeleteMessage.defaultExpectation = &RepositoryIMockDeleteMessageExpectation{} } - if mmGetConvertedFileByFileUID.defaultExpectation.params != nil { - mmGetConvertedFileByFileUID.mock.t.Fatalf("RepositoryIMock.GetConvertedFileByFileUID mock is already set by Expect") + if mmDeleteMessage.defaultExpectation.params != nil { + mmDeleteMessage.mock.t.Fatalf("RepositoryIMock.DeleteMessage mock is already set by Expect") } - if mmGetConvertedFileByFileUID.defaultExpectation.paramPtrs == nil { - mmGetConvertedFileByFileUID.defaultExpectation.paramPtrs = &RepositoryIMockGetConvertedFileByFileUIDParamPtrs{} + if mmDeleteMessage.defaultExpectation.paramPtrs == nil { + mmDeleteMessage.defaultExpectation.paramPtrs = &RepositoryIMockDeleteMessageParamPtrs{} } - mmGetConvertedFileByFileUID.defaultExpectation.paramPtrs.fileUID = &fileUID + mmDeleteMessage.defaultExpectation.paramPtrs.messageUID = &messageUID - return mmGetConvertedFileByFileUID + return mmDeleteMessage } -// 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.DeleteMessage +func (mmDeleteMessage *mRepositoryIMockDeleteMessage) Inspect(f func(ctx context.Context, messageUID uuid.UUID)) *mRepositoryIMockDeleteMessage { + if mmDeleteMessage.mock.inspectFuncDeleteMessage != nil { + mmDeleteMessage.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.DeleteMessage") } - mmGetConvertedFileByFileUID.mock.inspectFuncGetConvertedFileByFileUID = f + mmDeleteMessage.mock.inspectFuncDeleteMessage = f - return mmGetConvertedFileByFileUID + return mmDeleteMessage } -// 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.DeleteMessage +func (mmDeleteMessage *mRepositoryIMockDeleteMessage) Return(err error) *RepositoryIMock { + if mmDeleteMessage.mock.funcDeleteMessage != nil { + mmDeleteMessage.mock.t.Fatalf("RepositoryIMock.DeleteMessage mock is already set by Set") } - if mmGetConvertedFileByFileUID.defaultExpectation == nil { - mmGetConvertedFileByFileUID.defaultExpectation = &RepositoryIMockGetConvertedFileByFileUIDExpectation{mock: mmGetConvertedFileByFileUID.mock} + if mmDeleteMessage.defaultExpectation == nil { + mmDeleteMessage.defaultExpectation = &RepositoryIMockDeleteMessageExpectation{mock: mmDeleteMessage.mock} } - mmGetConvertedFileByFileUID.defaultExpectation.results = &RepositoryIMockGetConvertedFileByFileUIDResults{cp1, err} - return mmGetConvertedFileByFileUID.mock + mmDeleteMessage.defaultExpectation.results = &RepositoryIMockDeleteMessageResults{err} + return mmDeleteMessage.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.DeleteMessage method +func (mmDeleteMessage *mRepositoryIMockDeleteMessage) Set(f func(ctx context.Context, messageUID uuid.UUID) (err error)) *RepositoryIMock { + if mmDeleteMessage.defaultExpectation != nil { + mmDeleteMessage.mock.t.Fatalf("Default expectation is already set for the RepositoryI.DeleteMessage method") } - if len(mmGetConvertedFileByFileUID.expectations) > 0 { - mmGetConvertedFileByFileUID.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetConvertedFileByFileUID method") + if len(mmDeleteMessage.expectations) > 0 { + mmDeleteMessage.mock.t.Fatalf("Some expectations are already set for the RepositoryI.DeleteMessage method") } - mmGetConvertedFileByFileUID.mock.funcGetConvertedFileByFileUID = f - return mmGetConvertedFileByFileUID.mock + mmDeleteMessage.mock.funcDeleteMessage = f + return mmDeleteMessage.mock } -// When sets expectation for the RepositoryI.GetConvertedFileByFileUID which will trigger the result defined by the following +// When sets expectation for the RepositoryI.DeleteMessage 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 (mmDeleteMessage *mRepositoryIMockDeleteMessage) When(ctx context.Context, messageUID uuid.UUID) *RepositoryIMockDeleteMessageExpectation { + if mmDeleteMessage.mock.funcDeleteMessage != nil { + mmDeleteMessage.mock.t.Fatalf("RepositoryIMock.DeleteMessage mock is already set by Set") } - expectation := &RepositoryIMockGetConvertedFileByFileUIDExpectation{ - mock: mmGetConvertedFileByFileUID.mock, - params: &RepositoryIMockGetConvertedFileByFileUIDParams{ctx, fileUID}, + expectation := &RepositoryIMockDeleteMessageExpectation{ + mock: mmDeleteMessage.mock, + params: &RepositoryIMockDeleteMessageParams{ctx, messageUID}, } - mmGetConvertedFileByFileUID.expectations = append(mmGetConvertedFileByFileUID.expectations, expectation) + mmDeleteMessage.expectations = append(mmDeleteMessage.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.DeleteMessage return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockDeleteMessageExpectation) Then(err error) *RepositoryIMock { + e.results = &RepositoryIMockDeleteMessageResults{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.DeleteMessage should be invoked +func (mmDeleteMessage *mRepositoryIMockDeleteMessage) Times(n uint64) *mRepositoryIMockDeleteMessage { if n == 0 { - mmGetConvertedFileByFileUID.mock.t.Fatalf("Times of RepositoryIMock.GetConvertedFileByFileUID mock can not be zero") + mmDeleteMessage.mock.t.Fatalf("Times of RepositoryIMock.DeleteMessage mock can not be zero") } - mm_atomic.StoreUint64(&mmGetConvertedFileByFileUID.expectedInvocations, n) - return mmGetConvertedFileByFileUID + mm_atomic.StoreUint64(&mmDeleteMessage.expectedInvocations, n) + return mmDeleteMessage } -func (mmGetConvertedFileByFileUID *mRepositoryIMockGetConvertedFileByFileUID) invocationsDone() bool { - if len(mmGetConvertedFileByFileUID.expectations) == 0 && mmGetConvertedFileByFileUID.defaultExpectation == nil && mmGetConvertedFileByFileUID.mock.funcGetConvertedFileByFileUID == nil { +func (mmDeleteMessage *mRepositoryIMockDeleteMessage) invocationsDone() bool { + if len(mmDeleteMessage.expectations) == 0 && mmDeleteMessage.defaultExpectation == nil && mmDeleteMessage.mock.funcDeleteMessage == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmGetConvertedFileByFileUID.mock.afterGetConvertedFileByFileUIDCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmGetConvertedFileByFileUID.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmDeleteMessage.mock.afterDeleteMessageCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmDeleteMessage.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) +// DeleteMessage implements repository.RepositoryI +func (mmDeleteMessage *RepositoryIMock) DeleteMessage(ctx context.Context, messageUID uuid.UUID) (err error) { + mm_atomic.AddUint64(&mmDeleteMessage.beforeDeleteMessageCounter, 1) + defer mm_atomic.AddUint64(&mmDeleteMessage.afterDeleteMessageCounter, 1) - if mmGetConvertedFileByFileUID.inspectFuncGetConvertedFileByFileUID != nil { - mmGetConvertedFileByFileUID.inspectFuncGetConvertedFileByFileUID(ctx, fileUID) + if mmDeleteMessage.inspectFuncDeleteMessage != nil { + mmDeleteMessage.inspectFuncDeleteMessage(ctx, messageUID) } - mm_params := RepositoryIMockGetConvertedFileByFileUIDParams{ctx, fileUID} + mm_params := RepositoryIMockDeleteMessageParams{ctx, messageUID} // Record call args - mmGetConvertedFileByFileUID.GetConvertedFileByFileUIDMock.mutex.Lock() - mmGetConvertedFileByFileUID.GetConvertedFileByFileUIDMock.callArgs = append(mmGetConvertedFileByFileUID.GetConvertedFileByFileUIDMock.callArgs, &mm_params) - mmGetConvertedFileByFileUID.GetConvertedFileByFileUIDMock.mutex.Unlock() + mmDeleteMessage.DeleteMessageMock.mutex.Lock() + mmDeleteMessage.DeleteMessageMock.callArgs = append(mmDeleteMessage.DeleteMessageMock.callArgs, &mm_params) + mmDeleteMessage.DeleteMessageMock.mutex.Unlock() - for _, e := range mmGetConvertedFileByFileUID.GetConvertedFileByFileUIDMock.expectations { + for _, e := range mmDeleteMessage.DeleteMessageMock.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 mmDeleteMessage.DeleteMessageMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmDeleteMessage.DeleteMessageMock.defaultExpectation.Counter, 1) + mm_want := mmDeleteMessage.DeleteMessageMock.defaultExpectation.params + mm_want_ptrs := mmDeleteMessage.DeleteMessageMock.defaultExpectation.paramPtrs - mm_got := RepositoryIMockGetConvertedFileByFileUIDParams{ctx, fileUID} + mm_got := RepositoryIMockDeleteMessageParams{ctx, messageUID} 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)) + mmDeleteMessage.t.Errorf("RepositoryIMock.DeleteMessage 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.messageUID != nil && !minimock.Equal(*mm_want_ptrs.messageUID, mm_got.messageUID) { + mmDeleteMessage.t.Errorf("RepositoryIMock.DeleteMessage got unexpected parameter messageUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.messageUID, mm_got.messageUID, minimock.Diff(*mm_want_ptrs.messageUID, mm_got.messageUID)) } } 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)) + mmDeleteMessage.t.Errorf("RepositoryIMock.DeleteMessage 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 := mmDeleteMessage.DeleteMessageMock.defaultExpectation.results if mm_results == nil { - mmGetConvertedFileByFileUID.t.Fatal("No results are set for the RepositoryIMock.GetConvertedFileByFileUID") + mmDeleteMessage.t.Fatal("No results are set for the RepositoryIMock.DeleteMessage") } - return (*mm_results).cp1, (*mm_results).err + return (*mm_results).err } - if mmGetConvertedFileByFileUID.funcGetConvertedFileByFileUID != nil { - return mmGetConvertedFileByFileUID.funcGetConvertedFileByFileUID(ctx, fileUID) + if mmDeleteMessage.funcDeleteMessage != nil { + return mmDeleteMessage.funcDeleteMessage(ctx, messageUID) } - mmGetConvertedFileByFileUID.t.Fatalf("Unexpected call to RepositoryIMock.GetConvertedFileByFileUID. %v %v", ctx, fileUID) + mmDeleteMessage.t.Fatalf("Unexpected call to RepositoryIMock.DeleteMessage. %v %v", ctx, messageUID) return } -// GetConvertedFileByFileUIDAfterCounter returns a count of finished RepositoryIMock.GetConvertedFileByFileUID invocations -func (mmGetConvertedFileByFileUID *RepositoryIMock) GetConvertedFileByFileUIDAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetConvertedFileByFileUID.afterGetConvertedFileByFileUIDCounter) +// DeleteMessageAfterCounter returns a count of finished RepositoryIMock.DeleteMessage invocations +func (mmDeleteMessage *RepositoryIMock) DeleteMessageAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmDeleteMessage.afterDeleteMessageCounter) } -// GetConvertedFileByFileUIDBeforeCounter returns a count of RepositoryIMock.GetConvertedFileByFileUID invocations -func (mmGetConvertedFileByFileUID *RepositoryIMock) GetConvertedFileByFileUIDBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetConvertedFileByFileUID.beforeGetConvertedFileByFileUIDCounter) +// DeleteMessageBeforeCounter returns a count of RepositoryIMock.DeleteMessage invocations +func (mmDeleteMessage *RepositoryIMock) DeleteMessageBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmDeleteMessage.beforeDeleteMessageCounter) } -// 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.DeleteMessage. // 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 (mmDeleteMessage *mRepositoryIMockDeleteMessage) Calls() []*RepositoryIMockDeleteMessageParams { + mmDeleteMessage.mutex.RLock() - argCopy := make([]*RepositoryIMockGetConvertedFileByFileUIDParams, len(mmGetConvertedFileByFileUID.callArgs)) - copy(argCopy, mmGetConvertedFileByFileUID.callArgs) + argCopy := make([]*RepositoryIMockDeleteMessageParams, len(mmDeleteMessage.callArgs)) + copy(argCopy, mmDeleteMessage.callArgs) - mmGetConvertedFileByFileUID.mutex.RUnlock() + mmDeleteMessage.mutex.RUnlock() return argCopy } -// MinimockGetConvertedFileByFileUIDDone returns true if the count of the GetConvertedFileByFileUID invocations corresponds +// MinimockDeleteMessageDone returns true if the count of the DeleteMessage invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockGetConvertedFileByFileUIDDone() bool { - for _, e := range m.GetConvertedFileByFileUIDMock.expectations { +func (m *RepositoryIMock) MinimockDeleteMessageDone() bool { + for _, e := range m.DeleteMessageMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.GetConvertedFileByFileUIDMock.invocationsDone() + return m.DeleteMessageMock.invocationsDone() } -// MinimockGetConvertedFileByFileUIDInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockGetConvertedFileByFileUIDInspect() { - for _, e := range m.GetConvertedFileByFileUIDMock.expectations { +// MinimockDeleteMessageInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockDeleteMessageInspect() { + for _, e := range m.DeleteMessageMock.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.DeleteMessage with params: %#v", *e.params) } } - afterGetConvertedFileByFileUIDCounter := mm_atomic.LoadUint64(&m.afterGetConvertedFileByFileUIDCounter) + afterDeleteMessageCounter := mm_atomic.LoadUint64(&m.afterDeleteMessageCounter) // 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.DeleteMessageMock.defaultExpectation != nil && afterDeleteMessageCounter < 1 { + if m.DeleteMessageMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.DeleteMessage") } else { - m.t.Errorf("Expected call to RepositoryIMock.GetConvertedFileByFileUID with params: %#v", *m.GetConvertedFileByFileUIDMock.defaultExpectation.params) + m.t.Errorf("Expected call to RepositoryIMock.DeleteMessage with params: %#v", *m.DeleteMessageMock.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.funcDeleteMessage != nil && afterDeleteMessageCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.DeleteMessage") } - 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.DeleteMessageMock.invocationsDone() && afterDeleteMessageCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.DeleteMessage but found %d calls", + mm_atomic.LoadUint64(&m.DeleteMessageMock.expectedInvocations), afterDeleteMessageCounter) } } -type mRepositoryIMockGetCountFilesByListKnowledgeBaseUID struct { +type mRepositoryIMockDeleteRepositoryTag struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockGetCountFilesByListKnowledgeBaseUIDExpectation - expectations []*RepositoryIMockGetCountFilesByListKnowledgeBaseUIDExpectation + defaultExpectation *RepositoryIMockDeleteRepositoryTagExpectation + expectations []*RepositoryIMockDeleteRepositoryTagExpectation - callArgs []*RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParams + callArgs []*RepositoryIMockDeleteRepositoryTagParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockGetCountFilesByListKnowledgeBaseUIDExpectation specifies expectation struct of the RepositoryI.GetCountFilesByListKnowledgeBaseUID -type RepositoryIMockGetCountFilesByListKnowledgeBaseUIDExpectation struct { +// RepositoryIMockDeleteRepositoryTagExpectation specifies expectation struct of the RepositoryI.DeleteRepositoryTag +type RepositoryIMockDeleteRepositoryTagExpectation struct { mock *RepositoryIMock - params *RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParams - paramPtrs *RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParamPtrs - results *RepositoryIMockGetCountFilesByListKnowledgeBaseUIDResults + params *RepositoryIMockDeleteRepositoryTagParams + paramPtrs *RepositoryIMockDeleteRepositoryTagParamPtrs + results *RepositoryIMockDeleteRepositoryTagResults Counter uint64 } -// RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParams contains parameters of the RepositoryI.GetCountFilesByListKnowledgeBaseUID -type RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParams struct { - ctx context.Context - kbUIDs []mm_repository.KbUID +// RepositoryIMockDeleteRepositoryTagParams contains parameters of the RepositoryI.DeleteRepositoryTag +type RepositoryIMockDeleteRepositoryTagParams struct { + ctx context.Context + s1 string } -// RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParamPtrs contains pointers to parameters of the RepositoryI.GetCountFilesByListKnowledgeBaseUID -type RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParamPtrs struct { - ctx *context.Context - kbUIDs *[]mm_repository.KbUID +// RepositoryIMockDeleteRepositoryTagParamPtrs contains pointers to parameters of the RepositoryI.DeleteRepositoryTag +type RepositoryIMockDeleteRepositoryTagParamPtrs struct { + ctx *context.Context + s1 *string } -// RepositoryIMockGetCountFilesByListKnowledgeBaseUIDResults contains results of the RepositoryI.GetCountFilesByListKnowledgeBaseUID -type RepositoryIMockGetCountFilesByListKnowledgeBaseUIDResults struct { - m1 map[mm_repository.KbUID]int64 +// RepositoryIMockDeleteRepositoryTagResults contains results of the RepositoryI.DeleteRepositoryTag +type RepositoryIMockDeleteRepositoryTagResults struct { 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.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 mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation == nil { - mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation = &RepositoryIMockGetCountFilesByListKnowledgeBaseUIDExpectation{} + if mmDeleteRepositoryTag.defaultExpectation == nil { + mmDeleteRepositoryTag.defaultExpectation = &RepositoryIMockDeleteRepositoryTagExpectation{} } - if mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.paramPtrs != nil { - mmGetCountFilesByListKnowledgeBaseUID.mock.t.Fatalf("RepositoryIMock.GetCountFilesByListKnowledgeBaseUID 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") } - 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) + 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 mmGetCountFilesByListKnowledgeBaseUID + return mmDeleteRepositoryTag } -// 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.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 mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation == nil { - mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation = &RepositoryIMockGetCountFilesByListKnowledgeBaseUIDExpectation{} + if mmDeleteRepositoryTag.defaultExpectation == nil { + mmDeleteRepositoryTag.defaultExpectation = &RepositoryIMockDeleteRepositoryTagExpectation{} } - if mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.params != nil { - mmGetCountFilesByListKnowledgeBaseUID.mock.t.Fatalf("RepositoryIMock.GetCountFilesByListKnowledgeBaseUID mock is already set by Expect") + if mmDeleteRepositoryTag.defaultExpectation.params != nil { + mmDeleteRepositoryTag.mock.t.Fatalf("RepositoryIMock.DeleteRepositoryTag mock is already set by Expect") } - if mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.paramPtrs == nil { - mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.paramPtrs = &RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParamPtrs{} + if mmDeleteRepositoryTag.defaultExpectation.paramPtrs == nil { + mmDeleteRepositoryTag.defaultExpectation.paramPtrs = &RepositoryIMockDeleteRepositoryTagParamPtrs{} } - mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.paramPtrs.ctx = &ctx + mmDeleteRepositoryTag.defaultExpectation.paramPtrs.ctx = &ctx - return mmGetCountFilesByListKnowledgeBaseUID + return mmDeleteRepositoryTag } -// 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") +// 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 mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation == nil { - mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation = &RepositoryIMockGetCountFilesByListKnowledgeBaseUIDExpectation{} + if mmDeleteRepositoryTag.defaultExpectation == nil { + mmDeleteRepositoryTag.defaultExpectation = &RepositoryIMockDeleteRepositoryTagExpectation{} } - if mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.params != nil { - mmGetCountFilesByListKnowledgeBaseUID.mock.t.Fatalf("RepositoryIMock.GetCountFilesByListKnowledgeBaseUID mock is already set by Expect") + if mmDeleteRepositoryTag.defaultExpectation.params != nil { + mmDeleteRepositoryTag.mock.t.Fatalf("RepositoryIMock.DeleteRepositoryTag mock is already set by Expect") } - if mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.paramPtrs == nil { - mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.paramPtrs = &RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParamPtrs{} + if mmDeleteRepositoryTag.defaultExpectation.paramPtrs == nil { + mmDeleteRepositoryTag.defaultExpectation.paramPtrs = &RepositoryIMockDeleteRepositoryTagParamPtrs{} } - mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.paramPtrs.kbUIDs = &kbUIDs + mmDeleteRepositoryTag.defaultExpectation.paramPtrs.s1 = &s1 - return mmGetCountFilesByListKnowledgeBaseUID + return mmDeleteRepositoryTag } -// 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.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") } - mmGetCountFilesByListKnowledgeBaseUID.mock.inspectFuncGetCountFilesByListKnowledgeBaseUID = f + mmDeleteRepositoryTag.mock.inspectFuncDeleteRepositoryTag = f - return mmGetCountFilesByListKnowledgeBaseUID + return mmDeleteRepositoryTag } -// 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.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 mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation == nil { - mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation = &RepositoryIMockGetCountFilesByListKnowledgeBaseUIDExpectation{mock: mmGetCountFilesByListKnowledgeBaseUID.mock} + if mmDeleteRepositoryTag.defaultExpectation == nil { + mmDeleteRepositoryTag.defaultExpectation = &RepositoryIMockDeleteRepositoryTagExpectation{mock: mmDeleteRepositoryTag.mock} } - mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.results = &RepositoryIMockGetCountFilesByListKnowledgeBaseUIDResults{m1, err} - return mmGetCountFilesByListKnowledgeBaseUID.mock + mmDeleteRepositoryTag.defaultExpectation.results = &RepositoryIMockDeleteRepositoryTagResults{err} + return mmDeleteRepositoryTag.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.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(mmGetCountFilesByListKnowledgeBaseUID.expectations) > 0 { - mmGetCountFilesByListKnowledgeBaseUID.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetCountFilesByListKnowledgeBaseUID method") + if len(mmDeleteRepositoryTag.expectations) > 0 { + mmDeleteRepositoryTag.mock.t.Fatalf("Some expectations are already set for the RepositoryI.DeleteRepositoryTag method") } - mmGetCountFilesByListKnowledgeBaseUID.mock.funcGetCountFilesByListKnowledgeBaseUID = f - return mmGetCountFilesByListKnowledgeBaseUID.mock + mmDeleteRepositoryTag.mock.funcDeleteRepositoryTag = f + return mmDeleteRepositoryTag.mock } -// When sets expectation for the RepositoryI.GetCountFilesByListKnowledgeBaseUID 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 (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 (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 := &RepositoryIMockGetCountFilesByListKnowledgeBaseUIDExpectation{ - mock: mmGetCountFilesByListKnowledgeBaseUID.mock, - params: &RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParams{ctx, kbUIDs}, + expectation := &RepositoryIMockDeleteRepositoryTagExpectation{ + mock: mmDeleteRepositoryTag.mock, + params: &RepositoryIMockDeleteRepositoryTagParams{ctx, s1}, } - mmGetCountFilesByListKnowledgeBaseUID.expectations = append(mmGetCountFilesByListKnowledgeBaseUID.expectations, expectation) + mmDeleteRepositoryTag.expectations = append(mmDeleteRepositoryTag.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.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.GetCountFilesByListKnowledgeBaseUID should be invoked -func (mmGetCountFilesByListKnowledgeBaseUID *mRepositoryIMockGetCountFilesByListKnowledgeBaseUID) Times(n uint64) *mRepositoryIMockGetCountFilesByListKnowledgeBaseUID { +// Times sets number of times RepositoryI.DeleteRepositoryTag should be invoked +func (mmDeleteRepositoryTag *mRepositoryIMockDeleteRepositoryTag) Times(n uint64) *mRepositoryIMockDeleteRepositoryTag { if n == 0 { - mmGetCountFilesByListKnowledgeBaseUID.mock.t.Fatalf("Times of RepositoryIMock.GetCountFilesByListKnowledgeBaseUID mock can not be zero") + mmDeleteRepositoryTag.mock.t.Fatalf("Times of RepositoryIMock.DeleteRepositoryTag mock can not be zero") } - mm_atomic.StoreUint64(&mmGetCountFilesByListKnowledgeBaseUID.expectedInvocations, n) - return mmGetCountFilesByListKnowledgeBaseUID + mm_atomic.StoreUint64(&mmDeleteRepositoryTag.expectedInvocations, n) + return mmDeleteRepositoryTag } -func (mmGetCountFilesByListKnowledgeBaseUID *mRepositoryIMockGetCountFilesByListKnowledgeBaseUID) invocationsDone() bool { - if len(mmGetCountFilesByListKnowledgeBaseUID.expectations) == 0 && mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation == nil && mmGetCountFilesByListKnowledgeBaseUID.mock.funcGetCountFilesByListKnowledgeBaseUID == nil { +func (mmDeleteRepositoryTag *mRepositoryIMockDeleteRepositoryTag) invocationsDone() bool { + if len(mmDeleteRepositoryTag.expectations) == 0 && mmDeleteRepositoryTag.defaultExpectation == nil && mmDeleteRepositoryTag.mock.funcDeleteRepositoryTag == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmGetCountFilesByListKnowledgeBaseUID.mock.afterGetCountFilesByListKnowledgeBaseUIDCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmGetCountFilesByListKnowledgeBaseUID.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmDeleteRepositoryTag.mock.afterDeleteRepositoryTagCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmDeleteRepositoryTag.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) +// 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 mmGetCountFilesByListKnowledgeBaseUID.inspectFuncGetCountFilesByListKnowledgeBaseUID != nil { - mmGetCountFilesByListKnowledgeBaseUID.inspectFuncGetCountFilesByListKnowledgeBaseUID(ctx, kbUIDs) + if mmDeleteRepositoryTag.inspectFuncDeleteRepositoryTag != nil { + mmDeleteRepositoryTag.inspectFuncDeleteRepositoryTag(ctx, s1) } - mm_params := RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParams{ctx, kbUIDs} + mm_params := RepositoryIMockDeleteRepositoryTagParams{ctx, s1} // Record call args - mmGetCountFilesByListKnowledgeBaseUID.GetCountFilesByListKnowledgeBaseUIDMock.mutex.Lock() - mmGetCountFilesByListKnowledgeBaseUID.GetCountFilesByListKnowledgeBaseUIDMock.callArgs = append(mmGetCountFilesByListKnowledgeBaseUID.GetCountFilesByListKnowledgeBaseUIDMock.callArgs, &mm_params) - mmGetCountFilesByListKnowledgeBaseUID.GetCountFilesByListKnowledgeBaseUIDMock.mutex.Unlock() + mmDeleteRepositoryTag.DeleteRepositoryTagMock.mutex.Lock() + mmDeleteRepositoryTag.DeleteRepositoryTagMock.callArgs = append(mmDeleteRepositoryTag.DeleteRepositoryTagMock.callArgs, &mm_params) + mmDeleteRepositoryTag.DeleteRepositoryTagMock.mutex.Unlock() - for _, e := range mmGetCountFilesByListKnowledgeBaseUID.GetCountFilesByListKnowledgeBaseUIDMock.expectations { + for _, e := range mmDeleteRepositoryTag.DeleteRepositoryTagMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.m1, e.results.err + return 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 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 := RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParams{ctx, kbUIDs} + 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) { - 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)) + 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.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.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) { - mmGetCountFilesByListKnowledgeBaseUID.t.Errorf("RepositoryIMock.GetCountFilesByListKnowledgeBaseUID 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 := mmGetCountFilesByListKnowledgeBaseUID.GetCountFilesByListKnowledgeBaseUIDMock.defaultExpectation.results + mm_results := mmDeleteRepositoryTag.DeleteRepositoryTagMock.defaultExpectation.results if mm_results == nil { - mmGetCountFilesByListKnowledgeBaseUID.t.Fatal("No results are set for the RepositoryIMock.GetCountFilesByListKnowledgeBaseUID") + mmDeleteRepositoryTag.t.Fatal("No results are set for the RepositoryIMock.DeleteRepositoryTag") } - return (*mm_results).m1, (*mm_results).err + return (*mm_results).err } - if mmGetCountFilesByListKnowledgeBaseUID.funcGetCountFilesByListKnowledgeBaseUID != nil { - return mmGetCountFilesByListKnowledgeBaseUID.funcGetCountFilesByListKnowledgeBaseUID(ctx, kbUIDs) + if mmDeleteRepositoryTag.funcDeleteRepositoryTag != nil { + return mmDeleteRepositoryTag.funcDeleteRepositoryTag(ctx, s1) } - mmGetCountFilesByListKnowledgeBaseUID.t.Fatalf("Unexpected call to RepositoryIMock.GetCountFilesByListKnowledgeBaseUID. %v %v", ctx, kbUIDs) + mmDeleteRepositoryTag.t.Fatalf("Unexpected call to RepositoryIMock.DeleteRepositoryTag. %v %v", ctx, s1) return } -// GetCountFilesByListKnowledgeBaseUIDAfterCounter returns a count of finished RepositoryIMock.GetCountFilesByListKnowledgeBaseUID invocations -func (mmGetCountFilesByListKnowledgeBaseUID *RepositoryIMock) GetCountFilesByListKnowledgeBaseUIDAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetCountFilesByListKnowledgeBaseUID.afterGetCountFilesByListKnowledgeBaseUIDCounter) +// DeleteRepositoryTagAfterCounter returns a count of finished RepositoryIMock.DeleteRepositoryTag invocations +func (mmDeleteRepositoryTag *RepositoryIMock) DeleteRepositoryTagAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmDeleteRepositoryTag.afterDeleteRepositoryTagCounter) } -// GetCountFilesByListKnowledgeBaseUIDBeforeCounter returns a count of RepositoryIMock.GetCountFilesByListKnowledgeBaseUID invocations -func (mmGetCountFilesByListKnowledgeBaseUID *RepositoryIMock) GetCountFilesByListKnowledgeBaseUIDBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetCountFilesByListKnowledgeBaseUID.beforeGetCountFilesByListKnowledgeBaseUIDCounter) +// 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.GetCountFilesByListKnowledgeBaseUID. +// 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 (mmGetCountFilesByListKnowledgeBaseUID *mRepositoryIMockGetCountFilesByListKnowledgeBaseUID) Calls() []*RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParams { - mmGetCountFilesByListKnowledgeBaseUID.mutex.RLock() +func (mmDeleteRepositoryTag *mRepositoryIMockDeleteRepositoryTag) Calls() []*RepositoryIMockDeleteRepositoryTagParams { + mmDeleteRepositoryTag.mutex.RLock() - argCopy := make([]*RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParams, len(mmGetCountFilesByListKnowledgeBaseUID.callArgs)) - copy(argCopy, mmGetCountFilesByListKnowledgeBaseUID.callArgs) + argCopy := make([]*RepositoryIMockDeleteRepositoryTagParams, len(mmDeleteRepositoryTag.callArgs)) + copy(argCopy, mmDeleteRepositoryTag.callArgs) - mmGetCountFilesByListKnowledgeBaseUID.mutex.RUnlock() + mmDeleteRepositoryTag.mutex.RUnlock() return argCopy } -// MinimockGetCountFilesByListKnowledgeBaseUIDDone returns true if the count of the GetCountFilesByListKnowledgeBaseUID invocations corresponds +// MinimockDeleteRepositoryTagDone returns true if the count of the DeleteRepositoryTag invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockGetCountFilesByListKnowledgeBaseUIDDone() bool { - for _, e := range m.GetCountFilesByListKnowledgeBaseUIDMock.expectations { +func (m *RepositoryIMock) MinimockDeleteRepositoryTagDone() bool { + for _, e := range m.DeleteRepositoryTagMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.GetCountFilesByListKnowledgeBaseUIDMock.invocationsDone() + return m.DeleteRepositoryTagMock.invocationsDone() } -// MinimockGetCountFilesByListKnowledgeBaseUIDInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockGetCountFilesByListKnowledgeBaseUIDInspect() { - for _, e := range m.GetCountFilesByListKnowledgeBaseUIDMock.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.GetCountFilesByListKnowledgeBaseUID with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.DeleteRepositoryTag with params: %#v", *e.params) } } - afterGetCountFilesByListKnowledgeBaseUIDCounter := mm_atomic.LoadUint64(&m.afterGetCountFilesByListKnowledgeBaseUIDCounter) + afterDeleteRepositoryTagCounter := mm_atomic.LoadUint64(&m.afterDeleteRepositoryTagCounter) // 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.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.GetCountFilesByListKnowledgeBaseUID with params: %#v", *m.GetCountFilesByListKnowledgeBaseUIDMock.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.funcGetCountFilesByListKnowledgeBaseUID != nil && afterGetCountFilesByListKnowledgeBaseUIDCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.GetCountFilesByListKnowledgeBaseUID") + if m.funcDeleteRepositoryTag != nil && afterDeleteRepositoryTagCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.DeleteRepositoryTag") } - 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.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 mRepositoryIMockGetEmbeddingByUIDs struct { +type mRepositoryIMockGetChunksByUIDs struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockGetEmbeddingByUIDsExpectation - expectations []*RepositoryIMockGetEmbeddingByUIDsExpectation + defaultExpectation *RepositoryIMockGetChunksByUIDsExpectation + expectations []*RepositoryIMockGetChunksByUIDsExpectation - callArgs []*RepositoryIMockGetEmbeddingByUIDsParams + callArgs []*RepositoryIMockGetChunksByUIDsParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockGetEmbeddingByUIDsExpectation specifies expectation struct of the RepositoryI.GetEmbeddingByUIDs -type RepositoryIMockGetEmbeddingByUIDsExpectation struct { +// RepositoryIMockGetChunksByUIDsExpectation specifies expectation struct of the RepositoryI.GetChunksByUIDs +type RepositoryIMockGetChunksByUIDsExpectation struct { mock *RepositoryIMock - params *RepositoryIMockGetEmbeddingByUIDsParams - paramPtrs *RepositoryIMockGetEmbeddingByUIDsParamPtrs - results *RepositoryIMockGetEmbeddingByUIDsResults + params *RepositoryIMockGetChunksByUIDsParams + paramPtrs *RepositoryIMockGetChunksByUIDsParamPtrs + results *RepositoryIMockGetChunksByUIDsResults Counter uint64 } -// RepositoryIMockGetEmbeddingByUIDsParams contains parameters of the RepositoryI.GetEmbeddingByUIDs -type RepositoryIMockGetEmbeddingByUIDsParams struct { - ctx context.Context - embUIDs []uuid.UUID +// RepositoryIMockGetChunksByUIDsParams contains parameters of the RepositoryI.GetChunksByUIDs +type RepositoryIMockGetChunksByUIDsParams struct { + ctx context.Context + chunkUIDs []uuid.UUID } -// RepositoryIMockGetEmbeddingByUIDsParamPtrs contains pointers to parameters of the RepositoryI.GetEmbeddingByUIDs -type RepositoryIMockGetEmbeddingByUIDsParamPtrs struct { - ctx *context.Context - embUIDs *[]uuid.UUID +// RepositoryIMockGetChunksByUIDsParamPtrs contains pointers to parameters of the RepositoryI.GetChunksByUIDs +type RepositoryIMockGetChunksByUIDsParamPtrs struct { + ctx *context.Context + chunkUIDs *[]uuid.UUID } -// RepositoryIMockGetEmbeddingByUIDsResults contains results of the RepositoryI.GetEmbeddingByUIDs -type RepositoryIMockGetEmbeddingByUIDsResults struct { - ea1 []mm_repository.Embedding +// RepositoryIMockGetChunksByUIDsResults contains results of the RepositoryI.GetChunksByUIDs +type RepositoryIMockGetChunksByUIDsResults struct { + ta1 []mm_repository.TextChunk 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.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 mmGetEmbeddingByUIDs.defaultExpectation == nil { - mmGetEmbeddingByUIDs.defaultExpectation = &RepositoryIMockGetEmbeddingByUIDsExpectation{} + if mmGetChunksByUIDs.defaultExpectation == nil { + mmGetChunksByUIDs.defaultExpectation = &RepositoryIMockGetChunksByUIDsExpectation{} } - if mmGetEmbeddingByUIDs.defaultExpectation.paramPtrs != nil { - mmGetEmbeddingByUIDs.mock.t.Fatalf("RepositoryIMock.GetEmbeddingByUIDs 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") } - 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) + 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 mmGetEmbeddingByUIDs + return mmGetChunksByUIDs } -// 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.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 mmGetEmbeddingByUIDs.defaultExpectation == nil { - mmGetEmbeddingByUIDs.defaultExpectation = &RepositoryIMockGetEmbeddingByUIDsExpectation{} + if mmGetChunksByUIDs.defaultExpectation == nil { + mmGetChunksByUIDs.defaultExpectation = &RepositoryIMockGetChunksByUIDsExpectation{} } - if mmGetEmbeddingByUIDs.defaultExpectation.params != nil { - mmGetEmbeddingByUIDs.mock.t.Fatalf("RepositoryIMock.GetEmbeddingByUIDs mock is already set by Expect") + if mmGetChunksByUIDs.defaultExpectation.params != nil { + mmGetChunksByUIDs.mock.t.Fatalf("RepositoryIMock.GetChunksByUIDs mock is already set by Expect") } - if mmGetEmbeddingByUIDs.defaultExpectation.paramPtrs == nil { - mmGetEmbeddingByUIDs.defaultExpectation.paramPtrs = &RepositoryIMockGetEmbeddingByUIDsParamPtrs{} + if mmGetChunksByUIDs.defaultExpectation.paramPtrs == nil { + mmGetChunksByUIDs.defaultExpectation.paramPtrs = &RepositoryIMockGetChunksByUIDsParamPtrs{} } - mmGetEmbeddingByUIDs.defaultExpectation.paramPtrs.ctx = &ctx + mmGetChunksByUIDs.defaultExpectation.paramPtrs.ctx = &ctx - return mmGetEmbeddingByUIDs + return mmGetChunksByUIDs } -// 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") +// 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 mmGetEmbeddingByUIDs.defaultExpectation == nil { - mmGetEmbeddingByUIDs.defaultExpectation = &RepositoryIMockGetEmbeddingByUIDsExpectation{} + if mmGetChunksByUIDs.defaultExpectation == nil { + mmGetChunksByUIDs.defaultExpectation = &RepositoryIMockGetChunksByUIDsExpectation{} } - if mmGetEmbeddingByUIDs.defaultExpectation.params != nil { - mmGetEmbeddingByUIDs.mock.t.Fatalf("RepositoryIMock.GetEmbeddingByUIDs mock is already set by Expect") + if mmGetChunksByUIDs.defaultExpectation.params != nil { + mmGetChunksByUIDs.mock.t.Fatalf("RepositoryIMock.GetChunksByUIDs mock is already set by Expect") } - if mmGetEmbeddingByUIDs.defaultExpectation.paramPtrs == nil { - mmGetEmbeddingByUIDs.defaultExpectation.paramPtrs = &RepositoryIMockGetEmbeddingByUIDsParamPtrs{} + if mmGetChunksByUIDs.defaultExpectation.paramPtrs == nil { + mmGetChunksByUIDs.defaultExpectation.paramPtrs = &RepositoryIMockGetChunksByUIDsParamPtrs{} } - mmGetEmbeddingByUIDs.defaultExpectation.paramPtrs.embUIDs = &embUIDs + mmGetChunksByUIDs.defaultExpectation.paramPtrs.chunkUIDs = &chunkUIDs - return mmGetEmbeddingByUIDs + return mmGetChunksByUIDs } -// 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.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") } - mmGetEmbeddingByUIDs.mock.inspectFuncGetEmbeddingByUIDs = f + mmGetChunksByUIDs.mock.inspectFuncGetChunksByUIDs = f - return mmGetEmbeddingByUIDs + return mmGetChunksByUIDs } -// 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.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 mmGetEmbeddingByUIDs.defaultExpectation == nil { - mmGetEmbeddingByUIDs.defaultExpectation = &RepositoryIMockGetEmbeddingByUIDsExpectation{mock: mmGetEmbeddingByUIDs.mock} + if mmGetChunksByUIDs.defaultExpectation == nil { + mmGetChunksByUIDs.defaultExpectation = &RepositoryIMockGetChunksByUIDsExpectation{mock: mmGetChunksByUIDs.mock} } - mmGetEmbeddingByUIDs.defaultExpectation.results = &RepositoryIMockGetEmbeddingByUIDsResults{ea1, err} - return mmGetEmbeddingByUIDs.mock + mmGetChunksByUIDs.defaultExpectation.results = &RepositoryIMockGetChunksByUIDsResults{ta1, err} + return mmGetChunksByUIDs.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.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(mmGetEmbeddingByUIDs.expectations) > 0 { - mmGetEmbeddingByUIDs.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetEmbeddingByUIDs method") + if len(mmGetChunksByUIDs.expectations) > 0 { + mmGetChunksByUIDs.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetChunksByUIDs method") } - mmGetEmbeddingByUIDs.mock.funcGetEmbeddingByUIDs = f - return mmGetEmbeddingByUIDs.mock + mmGetChunksByUIDs.mock.funcGetChunksByUIDs = f + return mmGetChunksByUIDs.mock } -// When sets expectation for the RepositoryI.GetEmbeddingByUIDs 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 (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 (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 := &RepositoryIMockGetEmbeddingByUIDsExpectation{ - mock: mmGetEmbeddingByUIDs.mock, - params: &RepositoryIMockGetEmbeddingByUIDsParams{ctx, embUIDs}, + expectation := &RepositoryIMockGetChunksByUIDsExpectation{ + mock: mmGetChunksByUIDs.mock, + params: &RepositoryIMockGetChunksByUIDsParams{ctx, chunkUIDs}, } - mmGetEmbeddingByUIDs.expectations = append(mmGetEmbeddingByUIDs.expectations, expectation) + mmGetChunksByUIDs.expectations = append(mmGetChunksByUIDs.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.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.GetEmbeddingByUIDs should be invoked -func (mmGetEmbeddingByUIDs *mRepositoryIMockGetEmbeddingByUIDs) Times(n uint64) *mRepositoryIMockGetEmbeddingByUIDs { +// Times sets number of times RepositoryI.GetChunksByUIDs should be invoked +func (mmGetChunksByUIDs *mRepositoryIMockGetChunksByUIDs) Times(n uint64) *mRepositoryIMockGetChunksByUIDs { if n == 0 { - mmGetEmbeddingByUIDs.mock.t.Fatalf("Times of RepositoryIMock.GetEmbeddingByUIDs mock can not be zero") + mmGetChunksByUIDs.mock.t.Fatalf("Times of RepositoryIMock.GetChunksByUIDs mock can not be zero") } - mm_atomic.StoreUint64(&mmGetEmbeddingByUIDs.expectedInvocations, n) - return mmGetEmbeddingByUIDs + mm_atomic.StoreUint64(&mmGetChunksByUIDs.expectedInvocations, n) + return mmGetChunksByUIDs } -func (mmGetEmbeddingByUIDs *mRepositoryIMockGetEmbeddingByUIDs) invocationsDone() bool { - if len(mmGetEmbeddingByUIDs.expectations) == 0 && mmGetEmbeddingByUIDs.defaultExpectation == nil && mmGetEmbeddingByUIDs.mock.funcGetEmbeddingByUIDs == nil { +func (mmGetChunksByUIDs *mRepositoryIMockGetChunksByUIDs) invocationsDone() bool { + if len(mmGetChunksByUIDs.expectations) == 0 && mmGetChunksByUIDs.defaultExpectation == nil && mmGetChunksByUIDs.mock.funcGetChunksByUIDs == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmGetEmbeddingByUIDs.mock.afterGetEmbeddingByUIDsCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmGetEmbeddingByUIDs.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmGetChunksByUIDs.mock.afterGetChunksByUIDsCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmGetChunksByUIDs.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) +// 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 mmGetEmbeddingByUIDs.inspectFuncGetEmbeddingByUIDs != nil { - mmGetEmbeddingByUIDs.inspectFuncGetEmbeddingByUIDs(ctx, embUIDs) + if mmGetChunksByUIDs.inspectFuncGetChunksByUIDs != nil { + mmGetChunksByUIDs.inspectFuncGetChunksByUIDs(ctx, chunkUIDs) } - mm_params := RepositoryIMockGetEmbeddingByUIDsParams{ctx, embUIDs} + mm_params := RepositoryIMockGetChunksByUIDsParams{ctx, chunkUIDs} // Record call args - mmGetEmbeddingByUIDs.GetEmbeddingByUIDsMock.mutex.Lock() - mmGetEmbeddingByUIDs.GetEmbeddingByUIDsMock.callArgs = append(mmGetEmbeddingByUIDs.GetEmbeddingByUIDsMock.callArgs, &mm_params) - mmGetEmbeddingByUIDs.GetEmbeddingByUIDsMock.mutex.Unlock() + mmGetChunksByUIDs.GetChunksByUIDsMock.mutex.Lock() + mmGetChunksByUIDs.GetChunksByUIDsMock.callArgs = append(mmGetChunksByUIDs.GetChunksByUIDsMock.callArgs, &mm_params) + mmGetChunksByUIDs.GetChunksByUIDsMock.mutex.Unlock() - for _, e := range mmGetEmbeddingByUIDs.GetEmbeddingByUIDsMock.expectations { + for _, e := range mmGetChunksByUIDs.GetChunksByUIDsMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.ea1, e.results.err + return e.results.ta1, 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 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 := RepositoryIMockGetEmbeddingByUIDsParams{ctx, embUIDs} + 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) { - 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)) + 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.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.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) { - mmGetEmbeddingByUIDs.t.Errorf("RepositoryIMock.GetEmbeddingByUIDs 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 := mmGetEmbeddingByUIDs.GetEmbeddingByUIDsMock.defaultExpectation.results + mm_results := mmGetChunksByUIDs.GetChunksByUIDsMock.defaultExpectation.results if mm_results == nil { - mmGetEmbeddingByUIDs.t.Fatal("No results are set for the RepositoryIMock.GetEmbeddingByUIDs") + mmGetChunksByUIDs.t.Fatal("No results are set for the RepositoryIMock.GetChunksByUIDs") } - return (*mm_results).ea1, (*mm_results).err + return (*mm_results).ta1, (*mm_results).err } - if mmGetEmbeddingByUIDs.funcGetEmbeddingByUIDs != nil { - return mmGetEmbeddingByUIDs.funcGetEmbeddingByUIDs(ctx, embUIDs) + if mmGetChunksByUIDs.funcGetChunksByUIDs != nil { + return mmGetChunksByUIDs.funcGetChunksByUIDs(ctx, chunkUIDs) } - mmGetEmbeddingByUIDs.t.Fatalf("Unexpected call to RepositoryIMock.GetEmbeddingByUIDs. %v %v", ctx, embUIDs) + mmGetChunksByUIDs.t.Fatalf("Unexpected call to RepositoryIMock.GetChunksByUIDs. %v %v", ctx, chunkUIDs) return } -// GetEmbeddingByUIDsAfterCounter returns a count of finished RepositoryIMock.GetEmbeddingByUIDs invocations -func (mmGetEmbeddingByUIDs *RepositoryIMock) GetEmbeddingByUIDsAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetEmbeddingByUIDs.afterGetEmbeddingByUIDsCounter) +// GetChunksByUIDsAfterCounter returns a count of finished RepositoryIMock.GetChunksByUIDs invocations +func (mmGetChunksByUIDs *RepositoryIMock) GetChunksByUIDsAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetChunksByUIDs.afterGetChunksByUIDsCounter) } -// GetEmbeddingByUIDsBeforeCounter returns a count of RepositoryIMock.GetEmbeddingByUIDs invocations -func (mmGetEmbeddingByUIDs *RepositoryIMock) GetEmbeddingByUIDsBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetEmbeddingByUIDs.beforeGetEmbeddingByUIDsCounter) +// 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.GetEmbeddingByUIDs. +// 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 (mmGetEmbeddingByUIDs *mRepositoryIMockGetEmbeddingByUIDs) Calls() []*RepositoryIMockGetEmbeddingByUIDsParams { - mmGetEmbeddingByUIDs.mutex.RLock() +func (mmGetChunksByUIDs *mRepositoryIMockGetChunksByUIDs) Calls() []*RepositoryIMockGetChunksByUIDsParams { + mmGetChunksByUIDs.mutex.RLock() - argCopy := make([]*RepositoryIMockGetEmbeddingByUIDsParams, len(mmGetEmbeddingByUIDs.callArgs)) - copy(argCopy, mmGetEmbeddingByUIDs.callArgs) + argCopy := make([]*RepositoryIMockGetChunksByUIDsParams, len(mmGetChunksByUIDs.callArgs)) + copy(argCopy, mmGetChunksByUIDs.callArgs) - mmGetEmbeddingByUIDs.mutex.RUnlock() + mmGetChunksByUIDs.mutex.RUnlock() return argCopy } -// MinimockGetEmbeddingByUIDsDone returns true if the count of the GetEmbeddingByUIDs invocations corresponds +// MinimockGetChunksByUIDsDone returns true if the count of the GetChunksByUIDs invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockGetEmbeddingByUIDsDone() bool { - for _, e := range m.GetEmbeddingByUIDsMock.expectations { +func (m *RepositoryIMock) MinimockGetChunksByUIDsDone() bool { + for _, e := range m.GetChunksByUIDsMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.GetEmbeddingByUIDsMock.invocationsDone() + return m.GetChunksByUIDsMock.invocationsDone() } -// MinimockGetEmbeddingByUIDsInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockGetEmbeddingByUIDsInspect() { - for _, e := range m.GetEmbeddingByUIDsMock.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.GetEmbeddingByUIDs with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.GetChunksByUIDs with params: %#v", *e.params) } } - afterGetEmbeddingByUIDsCounter := mm_atomic.LoadUint64(&m.afterGetEmbeddingByUIDsCounter) + afterGetChunksByUIDsCounter := mm_atomic.LoadUint64(&m.afterGetChunksByUIDsCounter) // 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.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.GetEmbeddingByUIDs with params: %#v", *m.GetEmbeddingByUIDsMock.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.funcGetEmbeddingByUIDs != nil && afterGetEmbeddingByUIDsCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.GetEmbeddingByUIDs") + if m.funcGetChunksByUIDs != nil && afterGetChunksByUIDsCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.GetChunksByUIDs") } - 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.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 mRepositoryIMockGetFilesTotalTokens struct { +type mRepositoryIMockGetConversationByID struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockGetFilesTotalTokensExpectation - expectations []*RepositoryIMockGetFilesTotalTokensExpectation + defaultExpectation *RepositoryIMockGetConversationByIDExpectation + expectations []*RepositoryIMockGetConversationByIDExpectation - callArgs []*RepositoryIMockGetFilesTotalTokensParams + callArgs []*RepositoryIMockGetConversationByIDParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockGetFilesTotalTokensExpectation specifies expectation struct of the RepositoryI.GetFilesTotalTokens -type RepositoryIMockGetFilesTotalTokensExpectation struct { +// RepositoryIMockGetConversationByIDExpectation specifies expectation struct of the RepositoryI.GetConversationByID +type RepositoryIMockGetConversationByIDExpectation struct { mock *RepositoryIMock - params *RepositoryIMockGetFilesTotalTokensParams - paramPtrs *RepositoryIMockGetFilesTotalTokensParamPtrs - results *RepositoryIMockGetFilesTotalTokensResults + params *RepositoryIMockGetConversationByIDParams + paramPtrs *RepositoryIMockGetConversationByIDParamPtrs + results *RepositoryIMockGetConversationByIDResults 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 - } +// RepositoryIMockGetConversationByIDParams contains parameters of the RepositoryI.GetConversationByID +type RepositoryIMockGetConversationByIDParams struct { + ctx context.Context + namespaceUID uuid.UUID + catalogUID uuid.UUID + conversationID 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 - } +// RepositoryIMockGetConversationByIDParamPtrs contains pointers to parameters of the RepositoryI.GetConversationByID +type RepositoryIMockGetConversationByIDParamPtrs struct { + ctx *context.Context + namespaceUID *uuid.UUID + catalogUID *uuid.UUID + conversationID *string } -// RepositoryIMockGetFilesTotalTokensResults contains results of the RepositoryI.GetFilesTotalTokens -type RepositoryIMockGetFilesTotalTokensResults struct { - m1 map[mm_repository.FileUID]int +// RepositoryIMockGetConversationByIDResults contains results of the RepositoryI.GetConversationByID +type RepositoryIMockGetConversationByIDResults struct { + cp1 *mm_repository.Conversation 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.GetConversationByID +func (mmGetConversationByID *mRepositoryIMockGetConversationByID) Expect(ctx context.Context, namespaceUID uuid.UUID, catalogUID uuid.UUID, conversationID string) *mRepositoryIMockGetConversationByID { + if mmGetConversationByID.mock.funcGetConversationByID != nil { + mmGetConversationByID.mock.t.Fatalf("RepositoryIMock.GetConversationByID mock is already set by Set") } - if mmGetFilesTotalTokens.defaultExpectation == nil { - mmGetFilesTotalTokens.defaultExpectation = &RepositoryIMockGetFilesTotalTokensExpectation{} + if mmGetConversationByID.defaultExpectation == nil { + mmGetConversationByID.defaultExpectation = &RepositoryIMockGetConversationByIDExpectation{} } - if mmGetFilesTotalTokens.defaultExpectation.paramPtrs != nil { - mmGetFilesTotalTokens.mock.t.Fatalf("RepositoryIMock.GetFilesTotalTokens mock is already set by ExpectParams functions") + if mmGetConversationByID.defaultExpectation.paramPtrs != nil { + mmGetConversationByID.mock.t.Fatalf("RepositoryIMock.GetConversationByID 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) + mmGetConversationByID.defaultExpectation.params = &RepositoryIMockGetConversationByIDParams{ctx, namespaceUID, catalogUID, conversationID} + for _, e := range mmGetConversationByID.expectations { + if minimock.Equal(e.params, mmGetConversationByID.defaultExpectation.params) { + mmGetConversationByID.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetConversationByID.defaultExpectation.params) } } - return mmGetFilesTotalTokens + return mmGetConversationByID } -// 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.GetConversationByID +func (mmGetConversationByID *mRepositoryIMockGetConversationByID) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockGetConversationByID { + if mmGetConversationByID.mock.funcGetConversationByID != nil { + mmGetConversationByID.mock.t.Fatalf("RepositoryIMock.GetConversationByID mock is already set by Set") } - if mmGetFilesTotalTokens.defaultExpectation == nil { - mmGetFilesTotalTokens.defaultExpectation = &RepositoryIMockGetFilesTotalTokensExpectation{} + if mmGetConversationByID.defaultExpectation == nil { + mmGetConversationByID.defaultExpectation = &RepositoryIMockGetConversationByIDExpectation{} } - if mmGetFilesTotalTokens.defaultExpectation.params != nil { - mmGetFilesTotalTokens.mock.t.Fatalf("RepositoryIMock.GetFilesTotalTokens mock is already set by Expect") + if mmGetConversationByID.defaultExpectation.params != nil { + mmGetConversationByID.mock.t.Fatalf("RepositoryIMock.GetConversationByID mock is already set by Expect") } - if mmGetFilesTotalTokens.defaultExpectation.paramPtrs == nil { - mmGetFilesTotalTokens.defaultExpectation.paramPtrs = &RepositoryIMockGetFilesTotalTokensParamPtrs{} + if mmGetConversationByID.defaultExpectation.paramPtrs == nil { + mmGetConversationByID.defaultExpectation.paramPtrs = &RepositoryIMockGetConversationByIDParamPtrs{} } - mmGetFilesTotalTokens.defaultExpectation.paramPtrs.ctx = &ctx + mmGetConversationByID.defaultExpectation.paramPtrs.ctx = &ctx - return mmGetFilesTotalTokens + return mmGetConversationByID } -// 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") +// ExpectNamespaceUIDParam2 sets up expected param namespaceUID for RepositoryI.GetConversationByID +func (mmGetConversationByID *mRepositoryIMockGetConversationByID) ExpectNamespaceUIDParam2(namespaceUID uuid.UUID) *mRepositoryIMockGetConversationByID { + if mmGetConversationByID.mock.funcGetConversationByID != nil { + mmGetConversationByID.mock.t.Fatalf("RepositoryIMock.GetConversationByID mock is already set by Set") } - if mmGetFilesTotalTokens.defaultExpectation == nil { - mmGetFilesTotalTokens.defaultExpectation = &RepositoryIMockGetFilesTotalTokensExpectation{} + if mmGetConversationByID.defaultExpectation == nil { + mmGetConversationByID.defaultExpectation = &RepositoryIMockGetConversationByIDExpectation{} } - if mmGetFilesTotalTokens.defaultExpectation.params != nil { - mmGetFilesTotalTokens.mock.t.Fatalf("RepositoryIMock.GetFilesTotalTokens mock is already set by Expect") + if mmGetConversationByID.defaultExpectation.params != nil { + mmGetConversationByID.mock.t.Fatalf("RepositoryIMock.GetConversationByID mock is already set by Expect") } - if mmGetFilesTotalTokens.defaultExpectation.paramPtrs == nil { - mmGetFilesTotalTokens.defaultExpectation.paramPtrs = &RepositoryIMockGetFilesTotalTokensParamPtrs{} + if mmGetConversationByID.defaultExpectation.paramPtrs == nil { + mmGetConversationByID.defaultExpectation.paramPtrs = &RepositoryIMockGetConversationByIDParamPtrs{} } - mmGetFilesTotalTokens.defaultExpectation.paramPtrs.sources = &sources + mmGetConversationByID.defaultExpectation.paramPtrs.namespaceUID = &namespaceUID - return mmGetFilesTotalTokens + return mmGetConversationByID } -// 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") +// ExpectCatalogUIDParam3 sets up expected param catalogUID for RepositoryI.GetConversationByID +func (mmGetConversationByID *mRepositoryIMockGetConversationByID) ExpectCatalogUIDParam3(catalogUID uuid.UUID) *mRepositoryIMockGetConversationByID { + if mmGetConversationByID.mock.funcGetConversationByID != nil { + mmGetConversationByID.mock.t.Fatalf("RepositoryIMock.GetConversationByID mock is already set by Set") } - mmGetFilesTotalTokens.mock.inspectFuncGetFilesTotalTokens = f + if mmGetConversationByID.defaultExpectation == nil { + mmGetConversationByID.defaultExpectation = &RepositoryIMockGetConversationByIDExpectation{} + } - return mmGetFilesTotalTokens + if mmGetConversationByID.defaultExpectation.params != nil { + mmGetConversationByID.mock.t.Fatalf("RepositoryIMock.GetConversationByID mock is already set by Expect") + } + + if mmGetConversationByID.defaultExpectation.paramPtrs == nil { + mmGetConversationByID.defaultExpectation.paramPtrs = &RepositoryIMockGetConversationByIDParamPtrs{} + } + mmGetConversationByID.defaultExpectation.paramPtrs.catalogUID = &catalogUID + + return mmGetConversationByID } -// 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") +// ExpectConversationIDParam4 sets up expected param conversationID for RepositoryI.GetConversationByID +func (mmGetConversationByID *mRepositoryIMockGetConversationByID) ExpectConversationIDParam4(conversationID string) *mRepositoryIMockGetConversationByID { + if mmGetConversationByID.mock.funcGetConversationByID != nil { + mmGetConversationByID.mock.t.Fatalf("RepositoryIMock.GetConversationByID mock is already set by Set") } - if mmGetFilesTotalTokens.defaultExpectation == nil { - mmGetFilesTotalTokens.defaultExpectation = &RepositoryIMockGetFilesTotalTokensExpectation{mock: mmGetFilesTotalTokens.mock} + if mmGetConversationByID.defaultExpectation == nil { + mmGetConversationByID.defaultExpectation = &RepositoryIMockGetConversationByIDExpectation{} } - mmGetFilesTotalTokens.defaultExpectation.results = &RepositoryIMockGetFilesTotalTokensResults{m1, err} - return mmGetFilesTotalTokens.mock + + if mmGetConversationByID.defaultExpectation.params != nil { + mmGetConversationByID.mock.t.Fatalf("RepositoryIMock.GetConversationByID mock is already set by Expect") + } + + if mmGetConversationByID.defaultExpectation.paramPtrs == nil { + mmGetConversationByID.defaultExpectation.paramPtrs = &RepositoryIMockGetConversationByIDParamPtrs{} + } + mmGetConversationByID.defaultExpectation.paramPtrs.conversationID = &conversationID + + return mmGetConversationByID } -// 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") +// Inspect accepts an inspector function that has same arguments as the RepositoryI.GetConversationByID +func (mmGetConversationByID *mRepositoryIMockGetConversationByID) Inspect(f func(ctx context.Context, namespaceUID uuid.UUID, catalogUID uuid.UUID, conversationID string)) *mRepositoryIMockGetConversationByID { + if mmGetConversationByID.mock.inspectFuncGetConversationByID != nil { + mmGetConversationByID.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.GetConversationByID") } - if len(mmGetFilesTotalTokens.expectations) > 0 { - mmGetFilesTotalTokens.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetFilesTotalTokens method") + mmGetConversationByID.mock.inspectFuncGetConversationByID = f + + return mmGetConversationByID +} + +// Return sets up results that will be returned by RepositoryI.GetConversationByID +func (mmGetConversationByID *mRepositoryIMockGetConversationByID) Return(cp1 *mm_repository.Conversation, err error) *RepositoryIMock { + if mmGetConversationByID.mock.funcGetConversationByID != nil { + mmGetConversationByID.mock.t.Fatalf("RepositoryIMock.GetConversationByID mock is already set by Set") } - mmGetFilesTotalTokens.mock.funcGetFilesTotalTokens = f - return mmGetFilesTotalTokens.mock + if mmGetConversationByID.defaultExpectation == nil { + mmGetConversationByID.defaultExpectation = &RepositoryIMockGetConversationByIDExpectation{mock: mmGetConversationByID.mock} + } + mmGetConversationByID.defaultExpectation.results = &RepositoryIMockGetConversationByIDResults{cp1, err} + return mmGetConversationByID.mock } -// When sets expectation for the RepositoryI.GetFilesTotalTokens which will trigger the result defined by the following +// Set uses given function f to mock the RepositoryI.GetConversationByID method +func (mmGetConversationByID *mRepositoryIMockGetConversationByID) Set(f func(ctx context.Context, namespaceUID uuid.UUID, catalogUID uuid.UUID, conversationID string) (cp1 *mm_repository.Conversation, err error)) *RepositoryIMock { + if mmGetConversationByID.defaultExpectation != nil { + mmGetConversationByID.mock.t.Fatalf("Default expectation is already set for the RepositoryI.GetConversationByID method") + } + + if len(mmGetConversationByID.expectations) > 0 { + mmGetConversationByID.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetConversationByID method") + } + + mmGetConversationByID.mock.funcGetConversationByID = f + return mmGetConversationByID.mock +} + +// When sets expectation for the RepositoryI.GetConversationByID 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 (mmGetConversationByID *mRepositoryIMockGetConversationByID) When(ctx context.Context, namespaceUID uuid.UUID, catalogUID uuid.UUID, conversationID string) *RepositoryIMockGetConversationByIDExpectation { + if mmGetConversationByID.mock.funcGetConversationByID != nil { + mmGetConversationByID.mock.t.Fatalf("RepositoryIMock.GetConversationByID mock is already set by Set") } - expectation := &RepositoryIMockGetFilesTotalTokensExpectation{ - mock: mmGetFilesTotalTokens.mock, - params: &RepositoryIMockGetFilesTotalTokensParams{ctx, sources}, + expectation := &RepositoryIMockGetConversationByIDExpectation{ + mock: mmGetConversationByID.mock, + params: &RepositoryIMockGetConversationByIDParams{ctx, namespaceUID, catalogUID, conversationID}, } - mmGetFilesTotalTokens.expectations = append(mmGetFilesTotalTokens.expectations, expectation) + mmGetConversationByID.expectations = append(mmGetConversationByID.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.GetConversationByID return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockGetConversationByIDExpectation) Then(cp1 *mm_repository.Conversation, err error) *RepositoryIMock { + e.results = &RepositoryIMockGetConversationByIDResults{cp1, 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.GetConversationByID should be invoked +func (mmGetConversationByID *mRepositoryIMockGetConversationByID) Times(n uint64) *mRepositoryIMockGetConversationByID { if n == 0 { - mmGetFilesTotalTokens.mock.t.Fatalf("Times of RepositoryIMock.GetFilesTotalTokens mock can not be zero") + mmGetConversationByID.mock.t.Fatalf("Times of RepositoryIMock.GetConversationByID mock can not be zero") } - mm_atomic.StoreUint64(&mmGetFilesTotalTokens.expectedInvocations, n) - return mmGetFilesTotalTokens + mm_atomic.StoreUint64(&mmGetConversationByID.expectedInvocations, n) + return mmGetConversationByID } -func (mmGetFilesTotalTokens *mRepositoryIMockGetFilesTotalTokens) invocationsDone() bool { - if len(mmGetFilesTotalTokens.expectations) == 0 && mmGetFilesTotalTokens.defaultExpectation == nil && mmGetFilesTotalTokens.mock.funcGetFilesTotalTokens == nil { +func (mmGetConversationByID *mRepositoryIMockGetConversationByID) invocationsDone() bool { + if len(mmGetConversationByID.expectations) == 0 && mmGetConversationByID.defaultExpectation == nil && mmGetConversationByID.mock.funcGetConversationByID == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmGetFilesTotalTokens.mock.afterGetFilesTotalTokensCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmGetFilesTotalTokens.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmGetConversationByID.mock.afterGetConversationByIDCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmGetConversationByID.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) +// GetConversationByID implements repository.RepositoryI +func (mmGetConversationByID *RepositoryIMock) GetConversationByID(ctx context.Context, namespaceUID uuid.UUID, catalogUID uuid.UUID, conversationID string) (cp1 *mm_repository.Conversation, err error) { + mm_atomic.AddUint64(&mmGetConversationByID.beforeGetConversationByIDCounter, 1) + defer mm_atomic.AddUint64(&mmGetConversationByID.afterGetConversationByIDCounter, 1) - if mmGetFilesTotalTokens.inspectFuncGetFilesTotalTokens != nil { - mmGetFilesTotalTokens.inspectFuncGetFilesTotalTokens(ctx, sources) + if mmGetConversationByID.inspectFuncGetConversationByID != nil { + mmGetConversationByID.inspectFuncGetConversationByID(ctx, namespaceUID, catalogUID, conversationID) } - mm_params := RepositoryIMockGetFilesTotalTokensParams{ctx, sources} + mm_params := RepositoryIMockGetConversationByIDParams{ctx, namespaceUID, catalogUID, conversationID} // Record call args - mmGetFilesTotalTokens.GetFilesTotalTokensMock.mutex.Lock() - mmGetFilesTotalTokens.GetFilesTotalTokensMock.callArgs = append(mmGetFilesTotalTokens.GetFilesTotalTokensMock.callArgs, &mm_params) - mmGetFilesTotalTokens.GetFilesTotalTokensMock.mutex.Unlock() + mmGetConversationByID.GetConversationByIDMock.mutex.Lock() + mmGetConversationByID.GetConversationByIDMock.callArgs = append(mmGetConversationByID.GetConversationByIDMock.callArgs, &mm_params) + mmGetConversationByID.GetConversationByIDMock.mutex.Unlock() - for _, e := range mmGetFilesTotalTokens.GetFilesTotalTokensMock.expectations { + for _, e := range mmGetConversationByID.GetConversationByIDMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.m1, e.results.err + return e.results.cp1, 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 mmGetConversationByID.GetConversationByIDMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmGetConversationByID.GetConversationByIDMock.defaultExpectation.Counter, 1) + mm_want := mmGetConversationByID.GetConversationByIDMock.defaultExpectation.params + mm_want_ptrs := mmGetConversationByID.GetConversationByIDMock.defaultExpectation.paramPtrs - mm_got := RepositoryIMockGetFilesTotalTokensParams{ctx, sources} + mm_got := RepositoryIMockGetConversationByIDParams{ctx, namespaceUID, catalogUID, conversationID} 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)) + mmGetConversationByID.t.Errorf("RepositoryIMock.GetConversationByID 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.namespaceUID != nil && !minimock.Equal(*mm_want_ptrs.namespaceUID, mm_got.namespaceUID) { + mmGetConversationByID.t.Errorf("RepositoryIMock.GetConversationByID got unexpected parameter namespaceUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.namespaceUID, mm_got.namespaceUID, minimock.Diff(*mm_want_ptrs.namespaceUID, mm_got.namespaceUID)) + } + + if mm_want_ptrs.catalogUID != nil && !minimock.Equal(*mm_want_ptrs.catalogUID, mm_got.catalogUID) { + mmGetConversationByID.t.Errorf("RepositoryIMock.GetConversationByID got unexpected parameter catalogUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.catalogUID, mm_got.catalogUID, minimock.Diff(*mm_want_ptrs.catalogUID, mm_got.catalogUID)) + } + + if mm_want_ptrs.conversationID != nil && !minimock.Equal(*mm_want_ptrs.conversationID, mm_got.conversationID) { + mmGetConversationByID.t.Errorf("RepositoryIMock.GetConversationByID got unexpected parameter conversationID, want: %#v, got: %#v%s\n", *mm_want_ptrs.conversationID, mm_got.conversationID, minimock.Diff(*mm_want_ptrs.conversationID, mm_got.conversationID)) } } 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)) + mmGetConversationByID.t.Errorf("RepositoryIMock.GetConversationByID 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 := mmGetConversationByID.GetConversationByIDMock.defaultExpectation.results if mm_results == nil { - mmGetFilesTotalTokens.t.Fatal("No results are set for the RepositoryIMock.GetFilesTotalTokens") + mmGetConversationByID.t.Fatal("No results are set for the RepositoryIMock.GetConversationByID") } - return (*mm_results).m1, (*mm_results).err + return (*mm_results).cp1, (*mm_results).err } - if mmGetFilesTotalTokens.funcGetFilesTotalTokens != nil { - return mmGetFilesTotalTokens.funcGetFilesTotalTokens(ctx, sources) + if mmGetConversationByID.funcGetConversationByID != nil { + return mmGetConversationByID.funcGetConversationByID(ctx, namespaceUID, catalogUID, conversationID) } - mmGetFilesTotalTokens.t.Fatalf("Unexpected call to RepositoryIMock.GetFilesTotalTokens. %v %v", ctx, sources) + mmGetConversationByID.t.Fatalf("Unexpected call to RepositoryIMock.GetConversationByID. %v %v %v %v", ctx, namespaceUID, catalogUID, conversationID) return } -// GetFilesTotalTokensAfterCounter returns a count of finished RepositoryIMock.GetFilesTotalTokens invocations -func (mmGetFilesTotalTokens *RepositoryIMock) GetFilesTotalTokensAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetFilesTotalTokens.afterGetFilesTotalTokensCounter) +// GetConversationByIDAfterCounter returns a count of finished RepositoryIMock.GetConversationByID invocations +func (mmGetConversationByID *RepositoryIMock) GetConversationByIDAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetConversationByID.afterGetConversationByIDCounter) } -// GetFilesTotalTokensBeforeCounter returns a count of RepositoryIMock.GetFilesTotalTokens invocations -func (mmGetFilesTotalTokens *RepositoryIMock) GetFilesTotalTokensBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetFilesTotalTokens.beforeGetFilesTotalTokensCounter) +// GetConversationByIDBeforeCounter returns a count of RepositoryIMock.GetConversationByID invocations +func (mmGetConversationByID *RepositoryIMock) GetConversationByIDBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetConversationByID.beforeGetConversationByIDCounter) } -// 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.GetConversationByID. // 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 (mmGetConversationByID *mRepositoryIMockGetConversationByID) Calls() []*RepositoryIMockGetConversationByIDParams { + mmGetConversationByID.mutex.RLock() - argCopy := make([]*RepositoryIMockGetFilesTotalTokensParams, len(mmGetFilesTotalTokens.callArgs)) - copy(argCopy, mmGetFilesTotalTokens.callArgs) + argCopy := make([]*RepositoryIMockGetConversationByIDParams, len(mmGetConversationByID.callArgs)) + copy(argCopy, mmGetConversationByID.callArgs) - mmGetFilesTotalTokens.mutex.RUnlock() + mmGetConversationByID.mutex.RUnlock() return argCopy } -// MinimockGetFilesTotalTokensDone returns true if the count of the GetFilesTotalTokens invocations corresponds +// MinimockGetConversationByIDDone returns true if the count of the GetConversationByID invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockGetFilesTotalTokensDone() bool { - for _, e := range m.GetFilesTotalTokensMock.expectations { +func (m *RepositoryIMock) MinimockGetConversationByIDDone() bool { + for _, e := range m.GetConversationByIDMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.GetFilesTotalTokensMock.invocationsDone() + return m.GetConversationByIDMock.invocationsDone() } -// MinimockGetFilesTotalTokensInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockGetFilesTotalTokensInspect() { - for _, e := range m.GetFilesTotalTokensMock.expectations { +// MinimockGetConversationByIDInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockGetConversationByIDInspect() { + for _, e := range m.GetConversationByIDMock.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.GetConversationByID with params: %#v", *e.params) } } - afterGetFilesTotalTokensCounter := mm_atomic.LoadUint64(&m.afterGetFilesTotalTokensCounter) + afterGetConversationByIDCounter := mm_atomic.LoadUint64(&m.afterGetConversationByIDCounter) // 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.GetConversationByIDMock.defaultExpectation != nil && afterGetConversationByIDCounter < 1 { + if m.GetConversationByIDMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.GetConversationByID") } else { - m.t.Errorf("Expected call to RepositoryIMock.GetFilesTotalTokens with params: %#v", *m.GetFilesTotalTokensMock.defaultExpectation.params) + m.t.Errorf("Expected call to RepositoryIMock.GetConversationByID with params: %#v", *m.GetConversationByIDMock.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.funcGetConversationByID != nil && afterGetConversationByIDCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.GetConversationByID") } - 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.GetConversationByIDMock.invocationsDone() && afterGetConversationByIDCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.GetConversationByID but found %d calls", + mm_atomic.LoadUint64(&m.GetConversationByIDMock.expectedInvocations), afterGetConversationByIDCounter) } } -type mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID struct { +type mRepositoryIMockGetConversationByUID struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation - expectations []*RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation + defaultExpectation *RepositoryIMockGetConversationByUIDExpectation + expectations []*RepositoryIMockGetConversationByUIDExpectation - callArgs []*RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParams + callArgs []*RepositoryIMockGetConversationByUIDParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation specifies expectation struct of the RepositoryI.GetKnowledgeBaseByOwnerAndKbID -type RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation struct { +// RepositoryIMockGetConversationByUIDExpectation specifies expectation struct of the RepositoryI.GetConversationByUID +type RepositoryIMockGetConversationByUIDExpectation struct { mock *RepositoryIMock - params *RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParams - paramPtrs *RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParamPtrs - results *RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDResults + params *RepositoryIMockGetConversationByUIDParams + paramPtrs *RepositoryIMockGetConversationByUIDParamPtrs + results *RepositoryIMockGetConversationByUIDResults Counter uint64 } -// RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParams contains parameters of the RepositoryI.GetKnowledgeBaseByOwnerAndKbID -type RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParams struct { - ctx context.Context - ownerUID string - kbID string +// RepositoryIMockGetConversationByUIDParams contains parameters of the RepositoryI.GetConversationByUID +type RepositoryIMockGetConversationByUIDParams struct { + ctx context.Context + convUID uuid.UUID } -// RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParamPtrs contains pointers to parameters of the RepositoryI.GetKnowledgeBaseByOwnerAndKbID -type RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParamPtrs struct { - ctx *context.Context - ownerUID *string - kbID *string +// RepositoryIMockGetConversationByUIDParamPtrs contains pointers to parameters of the RepositoryI.GetConversationByUID +type RepositoryIMockGetConversationByUIDParamPtrs struct { + ctx *context.Context + convUID *uuid.UUID } -// RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDResults contains results of the RepositoryI.GetKnowledgeBaseByOwnerAndKbID -type RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDResults struct { - kp1 *mm_repository.KnowledgeBase +// RepositoryIMockGetConversationByUIDResults contains results of the RepositoryI.GetConversationByUID +type RepositoryIMockGetConversationByUIDResults struct { + cp1 *mm_repository.Conversation 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.GetConversationByUID +func (mmGetConversationByUID *mRepositoryIMockGetConversationByUID) Expect(ctx context.Context, convUID uuid.UUID) *mRepositoryIMockGetConversationByUID { + if mmGetConversationByUID.mock.funcGetConversationByUID != nil { + mmGetConversationByUID.mock.t.Fatalf("RepositoryIMock.GetConversationByUID mock is already set by Set") } - if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation == nil { - mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation = &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation{} + if mmGetConversationByUID.defaultExpectation == nil { + mmGetConversationByUID.defaultExpectation = &RepositoryIMockGetConversationByUIDExpectation{} } - if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.paramPtrs != nil { - mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID mock is already set by ExpectParams functions") + if mmGetConversationByUID.defaultExpectation.paramPtrs != nil { + mmGetConversationByUID.mock.t.Fatalf("RepositoryIMock.GetConversationByUID 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) + mmGetConversationByUID.defaultExpectation.params = &RepositoryIMockGetConversationByUIDParams{ctx, convUID} + for _, e := range mmGetConversationByUID.expectations { + if minimock.Equal(e.params, mmGetConversationByUID.defaultExpectation.params) { + mmGetConversationByUID.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetConversationByUID.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 mmGetConversationByUID } -// 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.GetConversationByUID +func (mmGetConversationByUID *mRepositoryIMockGetConversationByUID) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockGetConversationByUID { + if mmGetConversationByUID.mock.funcGetConversationByUID != nil { + mmGetConversationByUID.mock.t.Fatalf("RepositoryIMock.GetConversationByUID mock is already set by Set") } - if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation == nil { - mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation = &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation{} + if mmGetConversationByUID.defaultExpectation == nil { + mmGetConversationByUID.defaultExpectation = &RepositoryIMockGetConversationByUIDExpectation{} } - if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.params != nil { - mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID mock is already set by Expect") + if mmGetConversationByUID.defaultExpectation.params != nil { + mmGetConversationByUID.mock.t.Fatalf("RepositoryIMock.GetConversationByUID mock is already set by Expect") } - if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.paramPtrs == nil { - mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.paramPtrs = &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParamPtrs{} + if mmGetConversationByUID.defaultExpectation.paramPtrs == nil { + mmGetConversationByUID.defaultExpectation.paramPtrs = &RepositoryIMockGetConversationByUIDParamPtrs{} } - mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.paramPtrs.ownerUID = &ownerUID + mmGetConversationByUID.defaultExpectation.paramPtrs.ctx = &ctx - return mmGetKnowledgeBaseByOwnerAndKbID + return mmGetConversationByUID } -// 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") +// ExpectConvUIDParam2 sets up expected param convUID for RepositoryI.GetConversationByUID +func (mmGetConversationByUID *mRepositoryIMockGetConversationByUID) ExpectConvUIDParam2(convUID uuid.UUID) *mRepositoryIMockGetConversationByUID { + if mmGetConversationByUID.mock.funcGetConversationByUID != nil { + mmGetConversationByUID.mock.t.Fatalf("RepositoryIMock.GetConversationByUID mock is already set by Set") } - if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation == nil { - mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation = &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation{} + if mmGetConversationByUID.defaultExpectation == nil { + mmGetConversationByUID.defaultExpectation = &RepositoryIMockGetConversationByUIDExpectation{} } - if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.params != nil { - mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID mock is already set by Expect") + if mmGetConversationByUID.defaultExpectation.params != nil { + mmGetConversationByUID.mock.t.Fatalf("RepositoryIMock.GetConversationByUID mock is already set by Expect") } - if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.paramPtrs == nil { - mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.paramPtrs = &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParamPtrs{} + if mmGetConversationByUID.defaultExpectation.paramPtrs == nil { + mmGetConversationByUID.defaultExpectation.paramPtrs = &RepositoryIMockGetConversationByUIDParamPtrs{} } - mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.paramPtrs.kbID = &kbID + mmGetConversationByUID.defaultExpectation.paramPtrs.convUID = &convUID - return mmGetKnowledgeBaseByOwnerAndKbID + return mmGetConversationByUID } -// 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.GetConversationByUID +func (mmGetConversationByUID *mRepositoryIMockGetConversationByUID) Inspect(f func(ctx context.Context, convUID uuid.UUID)) *mRepositoryIMockGetConversationByUID { + if mmGetConversationByUID.mock.inspectFuncGetConversationByUID != nil { + mmGetConversationByUID.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.GetConversationByUID") } - mmGetKnowledgeBaseByOwnerAndKbID.mock.inspectFuncGetKnowledgeBaseByOwnerAndKbID = f + mmGetConversationByUID.mock.inspectFuncGetConversationByUID = f - return mmGetKnowledgeBaseByOwnerAndKbID + return mmGetConversationByUID } -// 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.GetConversationByUID +func (mmGetConversationByUID *mRepositoryIMockGetConversationByUID) Return(cp1 *mm_repository.Conversation, err error) *RepositoryIMock { + if mmGetConversationByUID.mock.funcGetConversationByUID != nil { + mmGetConversationByUID.mock.t.Fatalf("RepositoryIMock.GetConversationByUID mock is already set by Set") } - if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation == nil { - mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation = &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation{mock: mmGetKnowledgeBaseByOwnerAndKbID.mock} + if mmGetConversationByUID.defaultExpectation == nil { + mmGetConversationByUID.defaultExpectation = &RepositoryIMockGetConversationByUIDExpectation{mock: mmGetConversationByUID.mock} } - mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.results = &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDResults{kp1, err} - return mmGetKnowledgeBaseByOwnerAndKbID.mock + mmGetConversationByUID.defaultExpectation.results = &RepositoryIMockGetConversationByUIDResults{cp1, err} + return mmGetConversationByUID.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.GetConversationByUID method +func (mmGetConversationByUID *mRepositoryIMockGetConversationByUID) Set(f func(ctx context.Context, convUID uuid.UUID) (cp1 *mm_repository.Conversation, err error)) *RepositoryIMock { + if mmGetConversationByUID.defaultExpectation != nil { + mmGetConversationByUID.mock.t.Fatalf("Default expectation is already set for the RepositoryI.GetConversationByUID method") } - if len(mmGetKnowledgeBaseByOwnerAndKbID.expectations) > 0 { - mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetKnowledgeBaseByOwnerAndKbID method") + if len(mmGetConversationByUID.expectations) > 0 { + mmGetConversationByUID.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetConversationByUID method") } - mmGetKnowledgeBaseByOwnerAndKbID.mock.funcGetKnowledgeBaseByOwnerAndKbID = f - return mmGetKnowledgeBaseByOwnerAndKbID.mock + mmGetConversationByUID.mock.funcGetConversationByUID = f + return mmGetConversationByUID.mock } -// When sets expectation for the RepositoryI.GetKnowledgeBaseByOwnerAndKbID which will trigger the result defined by the following +// When sets expectation for the RepositoryI.GetConversationByUID 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 (mmGetConversationByUID *mRepositoryIMockGetConversationByUID) When(ctx context.Context, convUID uuid.UUID) *RepositoryIMockGetConversationByUIDExpectation { + if mmGetConversationByUID.mock.funcGetConversationByUID != nil { + mmGetConversationByUID.mock.t.Fatalf("RepositoryIMock.GetConversationByUID mock is already set by Set") } - expectation := &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation{ - mock: mmGetKnowledgeBaseByOwnerAndKbID.mock, - params: &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParams{ctx, ownerUID, kbID}, + expectation := &RepositoryIMockGetConversationByUIDExpectation{ + mock: mmGetConversationByUID.mock, + params: &RepositoryIMockGetConversationByUIDParams{ctx, convUID}, } - mmGetKnowledgeBaseByOwnerAndKbID.expectations = append(mmGetKnowledgeBaseByOwnerAndKbID.expectations, expectation) + mmGetConversationByUID.expectations = append(mmGetConversationByUID.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.GetConversationByUID return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockGetConversationByUIDExpectation) Then(cp1 *mm_repository.Conversation, err error) *RepositoryIMock { + e.results = &RepositoryIMockGetConversationByUIDResults{cp1, 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.GetConversationByUID should be invoked +func (mmGetConversationByUID *mRepositoryIMockGetConversationByUID) Times(n uint64) *mRepositoryIMockGetConversationByUID { if n == 0 { - mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("Times of RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID mock can not be zero") + mmGetConversationByUID.mock.t.Fatalf("Times of RepositoryIMock.GetConversationByUID mock can not be zero") } - mm_atomic.StoreUint64(&mmGetKnowledgeBaseByOwnerAndKbID.expectedInvocations, n) - return mmGetKnowledgeBaseByOwnerAndKbID + mm_atomic.StoreUint64(&mmGetConversationByUID.expectedInvocations, n) + return mmGetConversationByUID } -func (mmGetKnowledgeBaseByOwnerAndKbID *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID) invocationsDone() bool { - if len(mmGetKnowledgeBaseByOwnerAndKbID.expectations) == 0 && mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation == nil && mmGetKnowledgeBaseByOwnerAndKbID.mock.funcGetKnowledgeBaseByOwnerAndKbID == nil { +func (mmGetConversationByUID *mRepositoryIMockGetConversationByUID) invocationsDone() bool { + if len(mmGetConversationByUID.expectations) == 0 && mmGetConversationByUID.defaultExpectation == nil && mmGetConversationByUID.mock.funcGetConversationByUID == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmGetKnowledgeBaseByOwnerAndKbID.mock.afterGetKnowledgeBaseByOwnerAndKbIDCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmGetKnowledgeBaseByOwnerAndKbID.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmGetConversationByUID.mock.afterGetConversationByUIDCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmGetConversationByUID.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) +// GetConversationByUID implements repository.RepositoryI +func (mmGetConversationByUID *RepositoryIMock) GetConversationByUID(ctx context.Context, convUID uuid.UUID) (cp1 *mm_repository.Conversation, err error) { + mm_atomic.AddUint64(&mmGetConversationByUID.beforeGetConversationByUIDCounter, 1) + defer mm_atomic.AddUint64(&mmGetConversationByUID.afterGetConversationByUIDCounter, 1) - if mmGetKnowledgeBaseByOwnerAndKbID.inspectFuncGetKnowledgeBaseByOwnerAndKbID != nil { - mmGetKnowledgeBaseByOwnerAndKbID.inspectFuncGetKnowledgeBaseByOwnerAndKbID(ctx, ownerUID, kbID) + if mmGetConversationByUID.inspectFuncGetConversationByUID != nil { + mmGetConversationByUID.inspectFuncGetConversationByUID(ctx, convUID) } - mm_params := RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParams{ctx, ownerUID, kbID} + mm_params := RepositoryIMockGetConversationByUIDParams{ctx, convUID} // Record call args - mmGetKnowledgeBaseByOwnerAndKbID.GetKnowledgeBaseByOwnerAndKbIDMock.mutex.Lock() - mmGetKnowledgeBaseByOwnerAndKbID.GetKnowledgeBaseByOwnerAndKbIDMock.callArgs = append(mmGetKnowledgeBaseByOwnerAndKbID.GetKnowledgeBaseByOwnerAndKbIDMock.callArgs, &mm_params) - mmGetKnowledgeBaseByOwnerAndKbID.GetKnowledgeBaseByOwnerAndKbIDMock.mutex.Unlock() + mmGetConversationByUID.GetConversationByUIDMock.mutex.Lock() + mmGetConversationByUID.GetConversationByUIDMock.callArgs = append(mmGetConversationByUID.GetConversationByUIDMock.callArgs, &mm_params) + mmGetConversationByUID.GetConversationByUIDMock.mutex.Unlock() - for _, e := range mmGetKnowledgeBaseByOwnerAndKbID.GetKnowledgeBaseByOwnerAndKbIDMock.expectations { + for _, e := range mmGetConversationByUID.GetConversationByUIDMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.kp1, e.results.err + return e.results.cp1, 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 mmGetConversationByUID.GetConversationByUIDMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmGetConversationByUID.GetConversationByUIDMock.defaultExpectation.Counter, 1) + mm_want := mmGetConversationByUID.GetConversationByUIDMock.defaultExpectation.params + mm_want_ptrs := mmGetConversationByUID.GetConversationByUIDMock.defaultExpectation.paramPtrs - mm_got := RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParams{ctx, ownerUID, kbID} + mm_got := RepositoryIMockGetConversationByUIDParams{ctx, convUID} 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)) + mmGetConversationByUID.t.Errorf("RepositoryIMock.GetConversationByUID 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.convUID != nil && !minimock.Equal(*mm_want_ptrs.convUID, mm_got.convUID) { + mmGetConversationByUID.t.Errorf("RepositoryIMock.GetConversationByUID got unexpected parameter convUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.convUID, mm_got.convUID, minimock.Diff(*mm_want_ptrs.convUID, mm_got.convUID)) } } 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)) + mmGetConversationByUID.t.Errorf("RepositoryIMock.GetConversationByUID 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 := mmGetConversationByUID.GetConversationByUIDMock.defaultExpectation.results if mm_results == nil { - mmGetKnowledgeBaseByOwnerAndKbID.t.Fatal("No results are set for the RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID") + mmGetConversationByUID.t.Fatal("No results are set for the RepositoryIMock.GetConversationByUID") } - return (*mm_results).kp1, (*mm_results).err + return (*mm_results).cp1, (*mm_results).err } - if mmGetKnowledgeBaseByOwnerAndKbID.funcGetKnowledgeBaseByOwnerAndKbID != nil { - return mmGetKnowledgeBaseByOwnerAndKbID.funcGetKnowledgeBaseByOwnerAndKbID(ctx, ownerUID, kbID) + if mmGetConversationByUID.funcGetConversationByUID != nil { + return mmGetConversationByUID.funcGetConversationByUID(ctx, convUID) } - mmGetKnowledgeBaseByOwnerAndKbID.t.Fatalf("Unexpected call to RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID. %v %v %v", ctx, ownerUID, kbID) + mmGetConversationByUID.t.Fatalf("Unexpected call to RepositoryIMock.GetConversationByUID. %v %v", ctx, convUID) return } -// GetKnowledgeBaseByOwnerAndKbIDAfterCounter returns a count of finished RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID invocations -func (mmGetKnowledgeBaseByOwnerAndKbID *RepositoryIMock) GetKnowledgeBaseByOwnerAndKbIDAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetKnowledgeBaseByOwnerAndKbID.afterGetKnowledgeBaseByOwnerAndKbIDCounter) +// GetConversationByUIDAfterCounter returns a count of finished RepositoryIMock.GetConversationByUID invocations +func (mmGetConversationByUID *RepositoryIMock) GetConversationByUIDAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetConversationByUID.afterGetConversationByUIDCounter) } -// GetKnowledgeBaseByOwnerAndKbIDBeforeCounter returns a count of RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID invocations -func (mmGetKnowledgeBaseByOwnerAndKbID *RepositoryIMock) GetKnowledgeBaseByOwnerAndKbIDBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetKnowledgeBaseByOwnerAndKbID.beforeGetKnowledgeBaseByOwnerAndKbIDCounter) +// GetConversationByUIDBeforeCounter returns a count of RepositoryIMock.GetConversationByUID invocations +func (mmGetConversationByUID *RepositoryIMock) GetConversationByUIDBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetConversationByUID.beforeGetConversationByUIDCounter) } -// 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.GetConversationByUID. // 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 (mmGetConversationByUID *mRepositoryIMockGetConversationByUID) Calls() []*RepositoryIMockGetConversationByUIDParams { + mmGetConversationByUID.mutex.RLock() - argCopy := make([]*RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParams, len(mmGetKnowledgeBaseByOwnerAndKbID.callArgs)) - copy(argCopy, mmGetKnowledgeBaseByOwnerAndKbID.callArgs) + argCopy := make([]*RepositoryIMockGetConversationByUIDParams, len(mmGetConversationByUID.callArgs)) + copy(argCopy, mmGetConversationByUID.callArgs) - mmGetKnowledgeBaseByOwnerAndKbID.mutex.RUnlock() + mmGetConversationByUID.mutex.RUnlock() return argCopy } -// MinimockGetKnowledgeBaseByOwnerAndKbIDDone returns true if the count of the GetKnowledgeBaseByOwnerAndKbID invocations corresponds +// MinimockGetConversationByUIDDone returns true if the count of the GetConversationByUID invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockGetKnowledgeBaseByOwnerAndKbIDDone() bool { - for _, e := range m.GetKnowledgeBaseByOwnerAndKbIDMock.expectations { +func (m *RepositoryIMock) MinimockGetConversationByUIDDone() bool { + for _, e := range m.GetConversationByUIDMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.GetKnowledgeBaseByOwnerAndKbIDMock.invocationsDone() + return m.GetConversationByUIDMock.invocationsDone() } -// MinimockGetKnowledgeBaseByOwnerAndKbIDInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockGetKnowledgeBaseByOwnerAndKbIDInspect() { - for _, e := range m.GetKnowledgeBaseByOwnerAndKbIDMock.expectations { +// MinimockGetConversationByUIDInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockGetConversationByUIDInspect() { + for _, e := range m.GetConversationByUIDMock.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.GetConversationByUID with params: %#v", *e.params) } } - afterGetKnowledgeBaseByOwnerAndKbIDCounter := mm_atomic.LoadUint64(&m.afterGetKnowledgeBaseByOwnerAndKbIDCounter) + afterGetConversationByUIDCounter := mm_atomic.LoadUint64(&m.afterGetConversationByUIDCounter) // 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.GetConversationByUIDMock.defaultExpectation != nil && afterGetConversationByUIDCounter < 1 { + if m.GetConversationByUIDMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.GetConversationByUID") } else { - m.t.Errorf("Expected call to RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID with params: %#v", *m.GetKnowledgeBaseByOwnerAndKbIDMock.defaultExpectation.params) + m.t.Errorf("Expected call to RepositoryIMock.GetConversationByUID with params: %#v", *m.GetConversationByUIDMock.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.funcGetConversationByUID != nil && afterGetConversationByUIDCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.GetConversationByUID") } - 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.GetConversationByUIDMock.invocationsDone() && afterGetConversationByUIDCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.GetConversationByUID but found %d calls", + mm_atomic.LoadUint64(&m.GetConversationByUIDMock.expectedInvocations), afterGetConversationByUIDCounter) } } -type mRepositoryIMockGetKnowledgeBaseCountByOwner struct { +type mRepositoryIMockGetConvertedFileByFileUID struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockGetKnowledgeBaseCountByOwnerExpectation - expectations []*RepositoryIMockGetKnowledgeBaseCountByOwnerExpectation + defaultExpectation *RepositoryIMockGetConvertedFileByFileUIDExpectation + expectations []*RepositoryIMockGetConvertedFileByFileUIDExpectation - callArgs []*RepositoryIMockGetKnowledgeBaseCountByOwnerParams + callArgs []*RepositoryIMockGetConvertedFileByFileUIDParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockGetKnowledgeBaseCountByOwnerExpectation specifies expectation struct of the RepositoryI.GetKnowledgeBaseCountByOwner -type RepositoryIMockGetKnowledgeBaseCountByOwnerExpectation struct { +// RepositoryIMockGetConvertedFileByFileUIDExpectation specifies expectation struct of the RepositoryI.GetConvertedFileByFileUID +type RepositoryIMockGetConvertedFileByFileUIDExpectation struct { mock *RepositoryIMock - params *RepositoryIMockGetKnowledgeBaseCountByOwnerParams - paramPtrs *RepositoryIMockGetKnowledgeBaseCountByOwnerParamPtrs - results *RepositoryIMockGetKnowledgeBaseCountByOwnerResults + params *RepositoryIMockGetConvertedFileByFileUIDParams + paramPtrs *RepositoryIMockGetConvertedFileByFileUIDParamPtrs + results *RepositoryIMockGetConvertedFileByFileUIDResults Counter uint64 } -// RepositoryIMockGetKnowledgeBaseCountByOwnerParams contains parameters of the RepositoryI.GetKnowledgeBaseCountByOwner -type RepositoryIMockGetKnowledgeBaseCountByOwnerParams struct { - ctx context.Context - ownerUID string +// RepositoryIMockGetConvertedFileByFileUIDParams contains parameters of the RepositoryI.GetConvertedFileByFileUID +type RepositoryIMockGetConvertedFileByFileUIDParams struct { + ctx context.Context + fileUID uuid.UUID } -// RepositoryIMockGetKnowledgeBaseCountByOwnerParamPtrs contains pointers to parameters of the RepositoryI.GetKnowledgeBaseCountByOwner -type RepositoryIMockGetKnowledgeBaseCountByOwnerParamPtrs struct { - ctx *context.Context - ownerUID *string +// RepositoryIMockGetConvertedFileByFileUIDParamPtrs contains pointers to parameters of the RepositoryI.GetConvertedFileByFileUID +type RepositoryIMockGetConvertedFileByFileUIDParamPtrs struct { + ctx *context.Context + fileUID *uuid.UUID } -// RepositoryIMockGetKnowledgeBaseCountByOwnerResults contains results of the RepositoryI.GetKnowledgeBaseCountByOwner -type RepositoryIMockGetKnowledgeBaseCountByOwnerResults struct { - i1 int64 +// RepositoryIMockGetConvertedFileByFileUIDResults contains results of the RepositoryI.GetConvertedFileByFileUID +type RepositoryIMockGetConvertedFileByFileUIDResults struct { + cp1 *mm_repository.ConvertedFile 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.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 mmGetKnowledgeBaseCountByOwner.defaultExpectation == nil { - mmGetKnowledgeBaseCountByOwner.defaultExpectation = &RepositoryIMockGetKnowledgeBaseCountByOwnerExpectation{} + if mmGetConvertedFileByFileUID.defaultExpectation == nil { + mmGetConvertedFileByFileUID.defaultExpectation = &RepositoryIMockGetConvertedFileByFileUIDExpectation{} } - if mmGetKnowledgeBaseCountByOwner.defaultExpectation.paramPtrs != nil { - mmGetKnowledgeBaseCountByOwner.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseCountByOwner 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") } - 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) + 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 mmGetKnowledgeBaseCountByOwner + return mmGetConvertedFileByFileUID } -// 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.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 mmGetKnowledgeBaseCountByOwner.defaultExpectation == nil { - mmGetKnowledgeBaseCountByOwner.defaultExpectation = &RepositoryIMockGetKnowledgeBaseCountByOwnerExpectation{} + if mmGetConvertedFileByFileUID.defaultExpectation == nil { + mmGetConvertedFileByFileUID.defaultExpectation = &RepositoryIMockGetConvertedFileByFileUIDExpectation{} } - if mmGetKnowledgeBaseCountByOwner.defaultExpectation.params != nil { - mmGetKnowledgeBaseCountByOwner.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseCountByOwner mock is already set by Expect") + if mmGetConvertedFileByFileUID.defaultExpectation.params != nil { + mmGetConvertedFileByFileUID.mock.t.Fatalf("RepositoryIMock.GetConvertedFileByFileUID mock is already set by Expect") } - if mmGetKnowledgeBaseCountByOwner.defaultExpectation.paramPtrs == nil { - mmGetKnowledgeBaseCountByOwner.defaultExpectation.paramPtrs = &RepositoryIMockGetKnowledgeBaseCountByOwnerParamPtrs{} + if mmGetConvertedFileByFileUID.defaultExpectation.paramPtrs == nil { + mmGetConvertedFileByFileUID.defaultExpectation.paramPtrs = &RepositoryIMockGetConvertedFileByFileUIDParamPtrs{} } - mmGetKnowledgeBaseCountByOwner.defaultExpectation.paramPtrs.ctx = &ctx + mmGetConvertedFileByFileUID.defaultExpectation.paramPtrs.ctx = &ctx - return mmGetKnowledgeBaseCountByOwner + return mmGetConvertedFileByFileUID } -// 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") +// 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 mmGetKnowledgeBaseCountByOwner.defaultExpectation == nil { - mmGetKnowledgeBaseCountByOwner.defaultExpectation = &RepositoryIMockGetKnowledgeBaseCountByOwnerExpectation{} + if mmGetConvertedFileByFileUID.defaultExpectation == nil { + mmGetConvertedFileByFileUID.defaultExpectation = &RepositoryIMockGetConvertedFileByFileUIDExpectation{} } - if mmGetKnowledgeBaseCountByOwner.defaultExpectation.params != nil { - mmGetKnowledgeBaseCountByOwner.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseCountByOwner mock is already set by Expect") + if mmGetConvertedFileByFileUID.defaultExpectation.params != nil { + mmGetConvertedFileByFileUID.mock.t.Fatalf("RepositoryIMock.GetConvertedFileByFileUID mock is already set by Expect") } - if mmGetKnowledgeBaseCountByOwner.defaultExpectation.paramPtrs == nil { - mmGetKnowledgeBaseCountByOwner.defaultExpectation.paramPtrs = &RepositoryIMockGetKnowledgeBaseCountByOwnerParamPtrs{} + if mmGetConvertedFileByFileUID.defaultExpectation.paramPtrs == nil { + mmGetConvertedFileByFileUID.defaultExpectation.paramPtrs = &RepositoryIMockGetConvertedFileByFileUIDParamPtrs{} } - mmGetKnowledgeBaseCountByOwner.defaultExpectation.paramPtrs.ownerUID = &ownerUID + mmGetConvertedFileByFileUID.defaultExpectation.paramPtrs.fileUID = &fileUID - return mmGetKnowledgeBaseCountByOwner + return mmGetConvertedFileByFileUID } -// 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.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") } - mmGetKnowledgeBaseCountByOwner.mock.inspectFuncGetKnowledgeBaseCountByOwner = f + mmGetConvertedFileByFileUID.mock.inspectFuncGetConvertedFileByFileUID = f - return mmGetKnowledgeBaseCountByOwner + return mmGetConvertedFileByFileUID } -// 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.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 mmGetKnowledgeBaseCountByOwner.defaultExpectation == nil { - mmGetKnowledgeBaseCountByOwner.defaultExpectation = &RepositoryIMockGetKnowledgeBaseCountByOwnerExpectation{mock: mmGetKnowledgeBaseCountByOwner.mock} + if mmGetConvertedFileByFileUID.defaultExpectation == nil { + mmGetConvertedFileByFileUID.defaultExpectation = &RepositoryIMockGetConvertedFileByFileUIDExpectation{mock: mmGetConvertedFileByFileUID.mock} } - mmGetKnowledgeBaseCountByOwner.defaultExpectation.results = &RepositoryIMockGetKnowledgeBaseCountByOwnerResults{i1, err} - return mmGetKnowledgeBaseCountByOwner.mock + mmGetConvertedFileByFileUID.defaultExpectation.results = &RepositoryIMockGetConvertedFileByFileUIDResults{cp1, err} + return mmGetConvertedFileByFileUID.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.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(mmGetKnowledgeBaseCountByOwner.expectations) > 0 { - mmGetKnowledgeBaseCountByOwner.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetKnowledgeBaseCountByOwner method") + if len(mmGetConvertedFileByFileUID.expectations) > 0 { + mmGetConvertedFileByFileUID.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetConvertedFileByFileUID method") } - mmGetKnowledgeBaseCountByOwner.mock.funcGetKnowledgeBaseCountByOwner = f - return mmGetKnowledgeBaseCountByOwner.mock + mmGetConvertedFileByFileUID.mock.funcGetConvertedFileByFileUID = f + return mmGetConvertedFileByFileUID.mock } -// When sets expectation for the RepositoryI.GetKnowledgeBaseCountByOwner 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 (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 (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 := &RepositoryIMockGetKnowledgeBaseCountByOwnerExpectation{ - mock: mmGetKnowledgeBaseCountByOwner.mock, - params: &RepositoryIMockGetKnowledgeBaseCountByOwnerParams{ctx, ownerUID}, + expectation := &RepositoryIMockGetConvertedFileByFileUIDExpectation{ + mock: mmGetConvertedFileByFileUID.mock, + params: &RepositoryIMockGetConvertedFileByFileUIDParams{ctx, fileUID}, } - mmGetKnowledgeBaseCountByOwner.expectations = append(mmGetKnowledgeBaseCountByOwner.expectations, expectation) + mmGetConvertedFileByFileUID.expectations = append(mmGetConvertedFileByFileUID.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.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.GetKnowledgeBaseCountByOwner should be invoked -func (mmGetKnowledgeBaseCountByOwner *mRepositoryIMockGetKnowledgeBaseCountByOwner) Times(n uint64) *mRepositoryIMockGetKnowledgeBaseCountByOwner { +// Times sets number of times RepositoryI.GetConvertedFileByFileUID should be invoked +func (mmGetConvertedFileByFileUID *mRepositoryIMockGetConvertedFileByFileUID) Times(n uint64) *mRepositoryIMockGetConvertedFileByFileUID { if n == 0 { - mmGetKnowledgeBaseCountByOwner.mock.t.Fatalf("Times of RepositoryIMock.GetKnowledgeBaseCountByOwner mock can not be zero") + mmGetConvertedFileByFileUID.mock.t.Fatalf("Times of RepositoryIMock.GetConvertedFileByFileUID mock can not be zero") } - mm_atomic.StoreUint64(&mmGetKnowledgeBaseCountByOwner.expectedInvocations, n) - return mmGetKnowledgeBaseCountByOwner + mm_atomic.StoreUint64(&mmGetConvertedFileByFileUID.expectedInvocations, n) + return mmGetConvertedFileByFileUID } -func (mmGetKnowledgeBaseCountByOwner *mRepositoryIMockGetKnowledgeBaseCountByOwner) invocationsDone() bool { - if len(mmGetKnowledgeBaseCountByOwner.expectations) == 0 && mmGetKnowledgeBaseCountByOwner.defaultExpectation == nil && mmGetKnowledgeBaseCountByOwner.mock.funcGetKnowledgeBaseCountByOwner == nil { +func (mmGetConvertedFileByFileUID *mRepositoryIMockGetConvertedFileByFileUID) invocationsDone() bool { + if len(mmGetConvertedFileByFileUID.expectations) == 0 && mmGetConvertedFileByFileUID.defaultExpectation == nil && mmGetConvertedFileByFileUID.mock.funcGetConvertedFileByFileUID == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmGetKnowledgeBaseCountByOwner.mock.afterGetKnowledgeBaseCountByOwnerCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmGetKnowledgeBaseCountByOwner.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmGetConvertedFileByFileUID.mock.afterGetConvertedFileByFileUIDCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmGetConvertedFileByFileUID.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) +// 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 mmGetKnowledgeBaseCountByOwner.inspectFuncGetKnowledgeBaseCountByOwner != nil { - mmGetKnowledgeBaseCountByOwner.inspectFuncGetKnowledgeBaseCountByOwner(ctx, ownerUID) + if mmGetConvertedFileByFileUID.inspectFuncGetConvertedFileByFileUID != nil { + mmGetConvertedFileByFileUID.inspectFuncGetConvertedFileByFileUID(ctx, fileUID) } - mm_params := RepositoryIMockGetKnowledgeBaseCountByOwnerParams{ctx, ownerUID} + mm_params := RepositoryIMockGetConvertedFileByFileUIDParams{ctx, fileUID} // Record call args - mmGetKnowledgeBaseCountByOwner.GetKnowledgeBaseCountByOwnerMock.mutex.Lock() - mmGetKnowledgeBaseCountByOwner.GetKnowledgeBaseCountByOwnerMock.callArgs = append(mmGetKnowledgeBaseCountByOwner.GetKnowledgeBaseCountByOwnerMock.callArgs, &mm_params) - mmGetKnowledgeBaseCountByOwner.GetKnowledgeBaseCountByOwnerMock.mutex.Unlock() + mmGetConvertedFileByFileUID.GetConvertedFileByFileUIDMock.mutex.Lock() + mmGetConvertedFileByFileUID.GetConvertedFileByFileUIDMock.callArgs = append(mmGetConvertedFileByFileUID.GetConvertedFileByFileUIDMock.callArgs, &mm_params) + mmGetConvertedFileByFileUID.GetConvertedFileByFileUIDMock.mutex.Unlock() - for _, e := range mmGetKnowledgeBaseCountByOwner.GetKnowledgeBaseCountByOwnerMock.expectations { + for _, e := range mmGetConvertedFileByFileUID.GetConvertedFileByFileUIDMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.i1, e.results.err + return e.results.cp1, 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 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 := RepositoryIMockGetKnowledgeBaseCountByOwnerParams{ctx, ownerUID} + 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) { - 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)) + 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.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.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) { - mmGetKnowledgeBaseCountByOwner.t.Errorf("RepositoryIMock.GetKnowledgeBaseCountByOwner 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 := mmGetKnowledgeBaseCountByOwner.GetKnowledgeBaseCountByOwnerMock.defaultExpectation.results + mm_results := mmGetConvertedFileByFileUID.GetConvertedFileByFileUIDMock.defaultExpectation.results if mm_results == nil { - mmGetKnowledgeBaseCountByOwner.t.Fatal("No results are set for the RepositoryIMock.GetKnowledgeBaseCountByOwner") + mmGetConvertedFileByFileUID.t.Fatal("No results are set for the RepositoryIMock.GetConvertedFileByFileUID") } - return (*mm_results).i1, (*mm_results).err + return (*mm_results).cp1, (*mm_results).err } - if mmGetKnowledgeBaseCountByOwner.funcGetKnowledgeBaseCountByOwner != nil { - return mmGetKnowledgeBaseCountByOwner.funcGetKnowledgeBaseCountByOwner(ctx, ownerUID) + if mmGetConvertedFileByFileUID.funcGetConvertedFileByFileUID != nil { + return mmGetConvertedFileByFileUID.funcGetConvertedFileByFileUID(ctx, fileUID) } - mmGetKnowledgeBaseCountByOwner.t.Fatalf("Unexpected call to RepositoryIMock.GetKnowledgeBaseCountByOwner. %v %v", ctx, ownerUID) + mmGetConvertedFileByFileUID.t.Fatalf("Unexpected call to RepositoryIMock.GetConvertedFileByFileUID. %v %v", ctx, fileUID) return } -// GetKnowledgeBaseCountByOwnerAfterCounter returns a count of finished RepositoryIMock.GetKnowledgeBaseCountByOwner invocations -func (mmGetKnowledgeBaseCountByOwner *RepositoryIMock) GetKnowledgeBaseCountByOwnerAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetKnowledgeBaseCountByOwner.afterGetKnowledgeBaseCountByOwnerCounter) +// GetConvertedFileByFileUIDAfterCounter returns a count of finished RepositoryIMock.GetConvertedFileByFileUID invocations +func (mmGetConvertedFileByFileUID *RepositoryIMock) GetConvertedFileByFileUIDAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetConvertedFileByFileUID.afterGetConvertedFileByFileUIDCounter) } -// GetKnowledgeBaseCountByOwnerBeforeCounter returns a count of RepositoryIMock.GetKnowledgeBaseCountByOwner invocations -func (mmGetKnowledgeBaseCountByOwner *RepositoryIMock) GetKnowledgeBaseCountByOwnerBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetKnowledgeBaseCountByOwner.beforeGetKnowledgeBaseCountByOwnerCounter) +// 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.GetKnowledgeBaseCountByOwner. +// 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 (mmGetKnowledgeBaseCountByOwner *mRepositoryIMockGetKnowledgeBaseCountByOwner) Calls() []*RepositoryIMockGetKnowledgeBaseCountByOwnerParams { - mmGetKnowledgeBaseCountByOwner.mutex.RLock() +func (mmGetConvertedFileByFileUID *mRepositoryIMockGetConvertedFileByFileUID) Calls() []*RepositoryIMockGetConvertedFileByFileUIDParams { + mmGetConvertedFileByFileUID.mutex.RLock() - argCopy := make([]*RepositoryIMockGetKnowledgeBaseCountByOwnerParams, len(mmGetKnowledgeBaseCountByOwner.callArgs)) - copy(argCopy, mmGetKnowledgeBaseCountByOwner.callArgs) + argCopy := make([]*RepositoryIMockGetConvertedFileByFileUIDParams, len(mmGetConvertedFileByFileUID.callArgs)) + copy(argCopy, mmGetConvertedFileByFileUID.callArgs) - mmGetKnowledgeBaseCountByOwner.mutex.RUnlock() + mmGetConvertedFileByFileUID.mutex.RUnlock() return argCopy } -// MinimockGetKnowledgeBaseCountByOwnerDone returns true if the count of the GetKnowledgeBaseCountByOwner invocations corresponds +// MinimockGetConvertedFileByFileUIDDone returns true if the count of the GetConvertedFileByFileUID invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockGetKnowledgeBaseCountByOwnerDone() bool { - for _, e := range m.GetKnowledgeBaseCountByOwnerMock.expectations { +func (m *RepositoryIMock) MinimockGetConvertedFileByFileUIDDone() bool { + for _, e := range m.GetConvertedFileByFileUIDMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.GetKnowledgeBaseCountByOwnerMock.invocationsDone() + return m.GetConvertedFileByFileUIDMock.invocationsDone() } -// MinimockGetKnowledgeBaseCountByOwnerInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockGetKnowledgeBaseCountByOwnerInspect() { - for _, e := range m.GetKnowledgeBaseCountByOwnerMock.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.GetKnowledgeBaseCountByOwner with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.GetConvertedFileByFileUID with params: %#v", *e.params) } } - afterGetKnowledgeBaseCountByOwnerCounter := mm_atomic.LoadUint64(&m.afterGetKnowledgeBaseCountByOwnerCounter) + afterGetConvertedFileByFileUIDCounter := mm_atomic.LoadUint64(&m.afterGetConvertedFileByFileUIDCounter) // 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.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.GetKnowledgeBaseCountByOwner with params: %#v", *m.GetKnowledgeBaseCountByOwnerMock.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.funcGetKnowledgeBaseCountByOwner != nil && afterGetKnowledgeBaseCountByOwnerCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.GetKnowledgeBaseCountByOwner") + if m.funcGetConvertedFileByFileUID != nil && afterGetConvertedFileByFileUIDCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.GetConvertedFileByFileUID") } - 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.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 mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs struct { +type mRepositoryIMockGetCountFilesByListKnowledgeBaseUID struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation - expectations []*RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation + defaultExpectation *RepositoryIMockGetCountFilesByListKnowledgeBaseUIDExpectation + expectations []*RepositoryIMockGetCountFilesByListKnowledgeBaseUIDExpectation - callArgs []*RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParams + callArgs []*RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation specifies expectation struct of the RepositoryI.GetKnowledgeBaseFilesByFileUIDs -type RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation struct { +// RepositoryIMockGetCountFilesByListKnowledgeBaseUIDExpectation specifies expectation struct of the RepositoryI.GetCountFilesByListKnowledgeBaseUID +type RepositoryIMockGetCountFilesByListKnowledgeBaseUIDExpectation struct { mock *RepositoryIMock - params *RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParams - paramPtrs *RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParamPtrs - results *RepositoryIMockGetKnowledgeBaseFilesByFileUIDsResults + params *RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParams + paramPtrs *RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParamPtrs + results *RepositoryIMockGetCountFilesByListKnowledgeBaseUIDResults Counter uint64 } -// RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParams contains parameters of the RepositoryI.GetKnowledgeBaseFilesByFileUIDs -type RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParams struct { - ctx context.Context - fileUIDs []uuid.UUID - columns []string +// RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParams contains parameters of the RepositoryI.GetCountFilesByListKnowledgeBaseUID +type RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParams struct { + ctx context.Context + kbUIDs []mm_repository.KbUID } -// RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParamPtrs contains pointers to parameters of the RepositoryI.GetKnowledgeBaseFilesByFileUIDs -type RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParamPtrs struct { - ctx *context.Context - fileUIDs *[]uuid.UUID - columns *[]string +// RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParamPtrs contains pointers to parameters of the RepositoryI.GetCountFilesByListKnowledgeBaseUID +type RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParamPtrs struct { + ctx *context.Context + kbUIDs *[]mm_repository.KbUID } -// RepositoryIMockGetKnowledgeBaseFilesByFileUIDsResults contains results of the RepositoryI.GetKnowledgeBaseFilesByFileUIDs -type RepositoryIMockGetKnowledgeBaseFilesByFileUIDsResults struct { - ka1 []mm_repository.KnowledgeBaseFile +// 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.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.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 mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation == nil { - mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation = &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation{} + if mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation == nil { + mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation = &RepositoryIMockGetCountFilesByListKnowledgeBaseUIDExpectation{} } - if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.paramPtrs != nil { - mmGetKnowledgeBaseFilesByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs 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") } - 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) + 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 mmGetKnowledgeBaseFilesByFileUIDs -} - -// 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 mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation == nil { - mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation = &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation{} - } - - if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.params != nil { - mmGetKnowledgeBaseFilesByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs mock is already set by Expect") - } - - if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.paramPtrs == nil { - mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.paramPtrs = &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParamPtrs{} - } - mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.paramPtrs.ctx = &ctx - - return mmGetKnowledgeBaseFilesByFileUIDs + return mmGetCountFilesByListKnowledgeBaseUID } -// 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") +// 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 mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation == nil { - mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation = &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation{} + if mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation == nil { + mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation = &RepositoryIMockGetCountFilesByListKnowledgeBaseUIDExpectation{} } - if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.params != nil { - mmGetKnowledgeBaseFilesByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs mock is already set by Expect") + if mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.params != nil { + mmGetCountFilesByListKnowledgeBaseUID.mock.t.Fatalf("RepositoryIMock.GetCountFilesByListKnowledgeBaseUID mock is already set by Expect") } - if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.paramPtrs == nil { - mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.paramPtrs = &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParamPtrs{} + if mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.paramPtrs == nil { + mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.paramPtrs = &RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParamPtrs{} } - mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.paramPtrs.fileUIDs = &fileUIDs + mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.paramPtrs.ctx = &ctx - return mmGetKnowledgeBaseFilesByFileUIDs + return mmGetCountFilesByListKnowledgeBaseUID } -// 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") +// 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 mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation == nil { - mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation = &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation{} + if mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation == nil { + mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation = &RepositoryIMockGetCountFilesByListKnowledgeBaseUIDExpectation{} } - if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.params != nil { - mmGetKnowledgeBaseFilesByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs mock is already set by Expect") + if mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.params != nil { + mmGetCountFilesByListKnowledgeBaseUID.mock.t.Fatalf("RepositoryIMock.GetCountFilesByListKnowledgeBaseUID mock is already set by Expect") } - if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.paramPtrs == nil { - mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.paramPtrs = &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParamPtrs{} + if mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.paramPtrs == nil { + mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.paramPtrs = &RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParamPtrs{} } - mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.paramPtrs.columns = &columns + mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.paramPtrs.kbUIDs = &kbUIDs - return mmGetKnowledgeBaseFilesByFileUIDs + return mmGetCountFilesByListKnowledgeBaseUID } -// 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.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") } - mmGetKnowledgeBaseFilesByFileUIDs.mock.inspectFuncGetKnowledgeBaseFilesByFileUIDs = f + mmGetCountFilesByListKnowledgeBaseUID.mock.inspectFuncGetCountFilesByListKnowledgeBaseUID = f - return mmGetKnowledgeBaseFilesByFileUIDs + return mmGetCountFilesByListKnowledgeBaseUID } -// 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.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 mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation == nil { - mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation = &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation{mock: mmGetKnowledgeBaseFilesByFileUIDs.mock} + if mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation == nil { + mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation = &RepositoryIMockGetCountFilesByListKnowledgeBaseUIDExpectation{mock: mmGetCountFilesByListKnowledgeBaseUID.mock} } - mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.results = &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsResults{ka1, err} - return mmGetKnowledgeBaseFilesByFileUIDs.mock + mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation.results = &RepositoryIMockGetCountFilesByListKnowledgeBaseUIDResults{m1, err} + return mmGetCountFilesByListKnowledgeBaseUID.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.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(mmGetKnowledgeBaseFilesByFileUIDs.expectations) > 0 { - mmGetKnowledgeBaseFilesByFileUIDs.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetKnowledgeBaseFilesByFileUIDs method") + if len(mmGetCountFilesByListKnowledgeBaseUID.expectations) > 0 { + mmGetCountFilesByListKnowledgeBaseUID.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetCountFilesByListKnowledgeBaseUID method") } - mmGetKnowledgeBaseFilesByFileUIDs.mock.funcGetKnowledgeBaseFilesByFileUIDs = f - return mmGetKnowledgeBaseFilesByFileUIDs.mock + mmGetCountFilesByListKnowledgeBaseUID.mock.funcGetCountFilesByListKnowledgeBaseUID = f + return mmGetCountFilesByListKnowledgeBaseUID.mock } -// When sets expectation for the RepositoryI.GetKnowledgeBaseFilesByFileUIDs 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 (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 (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 := &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation{ - mock: mmGetKnowledgeBaseFilesByFileUIDs.mock, - params: &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParams{ctx, fileUIDs, columns}, + expectation := &RepositoryIMockGetCountFilesByListKnowledgeBaseUIDExpectation{ + mock: mmGetCountFilesByListKnowledgeBaseUID.mock, + params: &RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParams{ctx, kbUIDs}, } - mmGetKnowledgeBaseFilesByFileUIDs.expectations = append(mmGetKnowledgeBaseFilesByFileUIDs.expectations, expectation) + mmGetCountFilesByListKnowledgeBaseUID.expectations = append(mmGetCountFilesByListKnowledgeBaseUID.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.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.GetKnowledgeBaseFilesByFileUIDs should be invoked -func (mmGetKnowledgeBaseFilesByFileUIDs *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs) Times(n uint64) *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs { +// Times sets number of times RepositoryI.GetCountFilesByListKnowledgeBaseUID should be invoked +func (mmGetCountFilesByListKnowledgeBaseUID *mRepositoryIMockGetCountFilesByListKnowledgeBaseUID) Times(n uint64) *mRepositoryIMockGetCountFilesByListKnowledgeBaseUID { if n == 0 { - mmGetKnowledgeBaseFilesByFileUIDs.mock.t.Fatalf("Times of RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs mock can not be zero") + mmGetCountFilesByListKnowledgeBaseUID.mock.t.Fatalf("Times of RepositoryIMock.GetCountFilesByListKnowledgeBaseUID mock can not be zero") } - mm_atomic.StoreUint64(&mmGetKnowledgeBaseFilesByFileUIDs.expectedInvocations, n) - return mmGetKnowledgeBaseFilesByFileUIDs + mm_atomic.StoreUint64(&mmGetCountFilesByListKnowledgeBaseUID.expectedInvocations, n) + return mmGetCountFilesByListKnowledgeBaseUID } -func (mmGetKnowledgeBaseFilesByFileUIDs *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs) invocationsDone() bool { - if len(mmGetKnowledgeBaseFilesByFileUIDs.expectations) == 0 && mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation == nil && mmGetKnowledgeBaseFilesByFileUIDs.mock.funcGetKnowledgeBaseFilesByFileUIDs == nil { +func (mmGetCountFilesByListKnowledgeBaseUID *mRepositoryIMockGetCountFilesByListKnowledgeBaseUID) invocationsDone() bool { + if len(mmGetCountFilesByListKnowledgeBaseUID.expectations) == 0 && mmGetCountFilesByListKnowledgeBaseUID.defaultExpectation == nil && mmGetCountFilesByListKnowledgeBaseUID.mock.funcGetCountFilesByListKnowledgeBaseUID == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmGetKnowledgeBaseFilesByFileUIDs.mock.afterGetKnowledgeBaseFilesByFileUIDsCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmGetKnowledgeBaseFilesByFileUIDs.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmGetCountFilesByListKnowledgeBaseUID.mock.afterGetCountFilesByListKnowledgeBaseUIDCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmGetCountFilesByListKnowledgeBaseUID.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) +// 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 mmGetKnowledgeBaseFilesByFileUIDs.inspectFuncGetKnowledgeBaseFilesByFileUIDs != nil { - mmGetKnowledgeBaseFilesByFileUIDs.inspectFuncGetKnowledgeBaseFilesByFileUIDs(ctx, fileUIDs, columns...) + if mmGetCountFilesByListKnowledgeBaseUID.inspectFuncGetCountFilesByListKnowledgeBaseUID != nil { + mmGetCountFilesByListKnowledgeBaseUID.inspectFuncGetCountFilesByListKnowledgeBaseUID(ctx, kbUIDs) } - mm_params := RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParams{ctx, fileUIDs, columns} + mm_params := RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParams{ctx, kbUIDs} // Record call args - mmGetKnowledgeBaseFilesByFileUIDs.GetKnowledgeBaseFilesByFileUIDsMock.mutex.Lock() - mmGetKnowledgeBaseFilesByFileUIDs.GetKnowledgeBaseFilesByFileUIDsMock.callArgs = append(mmGetKnowledgeBaseFilesByFileUIDs.GetKnowledgeBaseFilesByFileUIDsMock.callArgs, &mm_params) - mmGetKnowledgeBaseFilesByFileUIDs.GetKnowledgeBaseFilesByFileUIDsMock.mutex.Unlock() + mmGetCountFilesByListKnowledgeBaseUID.GetCountFilesByListKnowledgeBaseUIDMock.mutex.Lock() + mmGetCountFilesByListKnowledgeBaseUID.GetCountFilesByListKnowledgeBaseUIDMock.callArgs = append(mmGetCountFilesByListKnowledgeBaseUID.GetCountFilesByListKnowledgeBaseUIDMock.callArgs, &mm_params) + mmGetCountFilesByListKnowledgeBaseUID.GetCountFilesByListKnowledgeBaseUIDMock.mutex.Unlock() - for _, e := range mmGetKnowledgeBaseFilesByFileUIDs.GetKnowledgeBaseFilesByFileUIDsMock.expectations { + for _, e := range mmGetCountFilesByListKnowledgeBaseUID.GetCountFilesByListKnowledgeBaseUIDMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.ka1, e.results.err + return e.results.m1, 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 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 := RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParams{ctx, fileUIDs, columns} + 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) { - 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.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)) + 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.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.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) { - mmGetKnowledgeBaseFilesByFileUIDs.t.Errorf("RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs 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 := mmGetKnowledgeBaseFilesByFileUIDs.GetKnowledgeBaseFilesByFileUIDsMock.defaultExpectation.results + mm_results := mmGetCountFilesByListKnowledgeBaseUID.GetCountFilesByListKnowledgeBaseUIDMock.defaultExpectation.results if mm_results == nil { - mmGetKnowledgeBaseFilesByFileUIDs.t.Fatal("No results are set for the RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs") + mmGetCountFilesByListKnowledgeBaseUID.t.Fatal("No results are set for the RepositoryIMock.GetCountFilesByListKnowledgeBaseUID") } - return (*mm_results).ka1, (*mm_results).err + return (*mm_results).m1, (*mm_results).err } - if mmGetKnowledgeBaseFilesByFileUIDs.funcGetKnowledgeBaseFilesByFileUIDs != nil { - return mmGetKnowledgeBaseFilesByFileUIDs.funcGetKnowledgeBaseFilesByFileUIDs(ctx, fileUIDs, columns...) + if mmGetCountFilesByListKnowledgeBaseUID.funcGetCountFilesByListKnowledgeBaseUID != nil { + return mmGetCountFilesByListKnowledgeBaseUID.funcGetCountFilesByListKnowledgeBaseUID(ctx, kbUIDs) } - mmGetKnowledgeBaseFilesByFileUIDs.t.Fatalf("Unexpected call to RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs. %v %v %v", ctx, fileUIDs, columns) + mmGetCountFilesByListKnowledgeBaseUID.t.Fatalf("Unexpected call to RepositoryIMock.GetCountFilesByListKnowledgeBaseUID. %v %v", ctx, kbUIDs) return } -// GetKnowledgeBaseFilesByFileUIDsAfterCounter returns a count of finished RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs invocations -func (mmGetKnowledgeBaseFilesByFileUIDs *RepositoryIMock) GetKnowledgeBaseFilesByFileUIDsAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetKnowledgeBaseFilesByFileUIDs.afterGetKnowledgeBaseFilesByFileUIDsCounter) +// GetCountFilesByListKnowledgeBaseUIDAfterCounter returns a count of finished RepositoryIMock.GetCountFilesByListKnowledgeBaseUID invocations +func (mmGetCountFilesByListKnowledgeBaseUID *RepositoryIMock) GetCountFilesByListKnowledgeBaseUIDAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetCountFilesByListKnowledgeBaseUID.afterGetCountFilesByListKnowledgeBaseUIDCounter) } -// GetKnowledgeBaseFilesByFileUIDsBeforeCounter returns a count of RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs invocations -func (mmGetKnowledgeBaseFilesByFileUIDs *RepositoryIMock) GetKnowledgeBaseFilesByFileUIDsBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetKnowledgeBaseFilesByFileUIDs.beforeGetKnowledgeBaseFilesByFileUIDsCounter) +// 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.GetKnowledgeBaseFilesByFileUIDs. +// 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 (mmGetKnowledgeBaseFilesByFileUIDs *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs) Calls() []*RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParams { - mmGetKnowledgeBaseFilesByFileUIDs.mutex.RLock() +func (mmGetCountFilesByListKnowledgeBaseUID *mRepositoryIMockGetCountFilesByListKnowledgeBaseUID) Calls() []*RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParams { + mmGetCountFilesByListKnowledgeBaseUID.mutex.RLock() - argCopy := make([]*RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParams, len(mmGetKnowledgeBaseFilesByFileUIDs.callArgs)) - copy(argCopy, mmGetKnowledgeBaseFilesByFileUIDs.callArgs) + argCopy := make([]*RepositoryIMockGetCountFilesByListKnowledgeBaseUIDParams, len(mmGetCountFilesByListKnowledgeBaseUID.callArgs)) + copy(argCopy, mmGetCountFilesByListKnowledgeBaseUID.callArgs) - mmGetKnowledgeBaseFilesByFileUIDs.mutex.RUnlock() + mmGetCountFilesByListKnowledgeBaseUID.mutex.RUnlock() return argCopy } -// MinimockGetKnowledgeBaseFilesByFileUIDsDone returns true if the count of the GetKnowledgeBaseFilesByFileUIDs invocations corresponds +// MinimockGetCountFilesByListKnowledgeBaseUIDDone returns true if the count of the GetCountFilesByListKnowledgeBaseUID invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockGetKnowledgeBaseFilesByFileUIDsDone() bool { - for _, e := range m.GetKnowledgeBaseFilesByFileUIDsMock.expectations { +func (m *RepositoryIMock) MinimockGetCountFilesByListKnowledgeBaseUIDDone() bool { + for _, e := range m.GetCountFilesByListKnowledgeBaseUIDMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.GetKnowledgeBaseFilesByFileUIDsMock.invocationsDone() + return m.GetCountFilesByListKnowledgeBaseUIDMock.invocationsDone() } -// MinimockGetKnowledgeBaseFilesByFileUIDsInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockGetKnowledgeBaseFilesByFileUIDsInspect() { - for _, e := range m.GetKnowledgeBaseFilesByFileUIDsMock.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.GetKnowledgeBaseFilesByFileUIDs with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.GetCountFilesByListKnowledgeBaseUID with params: %#v", *e.params) } } - afterGetKnowledgeBaseFilesByFileUIDsCounter := mm_atomic.LoadUint64(&m.afterGetKnowledgeBaseFilesByFileUIDsCounter) + afterGetCountFilesByListKnowledgeBaseUIDCounter := mm_atomic.LoadUint64(&m.afterGetCountFilesByListKnowledgeBaseUIDCounter) // 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.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.GetKnowledgeBaseFilesByFileUIDs with params: %#v", *m.GetKnowledgeBaseFilesByFileUIDsMock.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.funcGetKnowledgeBaseFilesByFileUIDs != nil && afterGetKnowledgeBaseFilesByFileUIDsCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs") + if m.funcGetCountFilesByListKnowledgeBaseUID != nil && afterGetCountFilesByListKnowledgeBaseUIDCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.GetCountFilesByListKnowledgeBaseUID") } - 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.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 mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID struct { +type mRepositoryIMockGetEmbeddingByUIDs struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDExpectation - expectations []*RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDExpectation + defaultExpectation *RepositoryIMockGetEmbeddingByUIDsExpectation + expectations []*RepositoryIMockGetEmbeddingByUIDsExpectation - callArgs []*RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDParams + callArgs []*RepositoryIMockGetEmbeddingByUIDsParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDExpectation specifies expectation struct of the RepositoryI.GetKnowledgebaseFileByKbUIDAndFileID -type RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDExpectation struct { +// RepositoryIMockGetEmbeddingByUIDsExpectation specifies expectation struct of the RepositoryI.GetEmbeddingByUIDs +type RepositoryIMockGetEmbeddingByUIDsExpectation struct { mock *RepositoryIMock - params *RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDParams - paramPtrs *RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDParamPtrs - results *RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDResults + params *RepositoryIMockGetEmbeddingByUIDsParams + paramPtrs *RepositoryIMockGetEmbeddingByUIDsParamPtrs + results *RepositoryIMockGetEmbeddingByUIDsResults Counter uint64 } -// RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDParams contains parameters of the RepositoryI.GetKnowledgebaseFileByKbUIDAndFileID -type RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDParams struct { - ctx context.Context - kbUID uuid.UUID - fileID string +// RepositoryIMockGetEmbeddingByUIDsParams contains parameters of the RepositoryI.GetEmbeddingByUIDs +type RepositoryIMockGetEmbeddingByUIDsParams struct { + ctx context.Context + embUIDs []uuid.UUID } -// RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDParamPtrs contains pointers to parameters of the RepositoryI.GetKnowledgebaseFileByKbUIDAndFileID -type RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDParamPtrs struct { - ctx *context.Context - kbUID *uuid.UUID - fileID *string +// RepositoryIMockGetEmbeddingByUIDsParamPtrs contains pointers to parameters of the RepositoryI.GetEmbeddingByUIDs +type RepositoryIMockGetEmbeddingByUIDsParamPtrs struct { + ctx *context.Context + embUIDs *[]uuid.UUID } -// RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDResults contains results of the RepositoryI.GetKnowledgebaseFileByKbUIDAndFileID -type RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDResults struct { - kp1 *mm_repository.KnowledgeBaseFile +// RepositoryIMockGetEmbeddingByUIDsResults contains results of the RepositoryI.GetEmbeddingByUIDs +type RepositoryIMockGetEmbeddingByUIDsResults struct { + ea1 []mm_repository.Embedding err error } -// Expect sets up expected params for RepositoryI.GetKnowledgebaseFileByKbUIDAndFileID -func (mmGetKnowledgebaseFileByKbUIDAndFileID *mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID) Expect(ctx context.Context, kbUID uuid.UUID, fileID string) *mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID { - if mmGetKnowledgebaseFileByKbUIDAndFileID.mock.funcGetKnowledgebaseFileByKbUIDAndFileID != nil { - mmGetKnowledgebaseFileByKbUIDAndFileID.mock.t.Fatalf("RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID 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 mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation == nil { - mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation = &RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDExpectation{} + if mmGetEmbeddingByUIDs.defaultExpectation == nil { + mmGetEmbeddingByUIDs.defaultExpectation = &RepositoryIMockGetEmbeddingByUIDsExpectation{} } - if mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation.paramPtrs != nil { - mmGetKnowledgebaseFileByKbUIDAndFileID.mock.t.Fatalf("RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID 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") } - mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation.params = &RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDParams{ctx, kbUID, fileID} - for _, e := range mmGetKnowledgebaseFileByKbUIDAndFileID.expectations { - if minimock.Equal(e.params, mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation.params) { - mmGetKnowledgebaseFileByKbUIDAndFileID.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetKnowledgebaseFileByKbUIDAndFileID.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 mmGetKnowledgebaseFileByKbUIDAndFileID -} - -// ExpectCtxParam1 sets up expected param ctx for RepositoryI.GetKnowledgebaseFileByKbUIDAndFileID -func (mmGetKnowledgebaseFileByKbUIDAndFileID *mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID { - if mmGetKnowledgebaseFileByKbUIDAndFileID.mock.funcGetKnowledgebaseFileByKbUIDAndFileID != nil { - mmGetKnowledgebaseFileByKbUIDAndFileID.mock.t.Fatalf("RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID mock is already set by Set") - } - - if mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation == nil { - mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation = &RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDExpectation{} - } - - if mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation.params != nil { - mmGetKnowledgebaseFileByKbUIDAndFileID.mock.t.Fatalf("RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID mock is already set by Expect") - } - - if mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation.paramPtrs == nil { - mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation.paramPtrs = &RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDParamPtrs{} - } - mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation.paramPtrs.ctx = &ctx - - return mmGetKnowledgebaseFileByKbUIDAndFileID + return mmGetEmbeddingByUIDs } -// ExpectKbUIDParam2 sets up expected param kbUID for RepositoryI.GetKnowledgebaseFileByKbUIDAndFileID -func (mmGetKnowledgebaseFileByKbUIDAndFileID *mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID) ExpectKbUIDParam2(kbUID uuid.UUID) *mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID { - if mmGetKnowledgebaseFileByKbUIDAndFileID.mock.funcGetKnowledgebaseFileByKbUIDAndFileID != nil { - mmGetKnowledgebaseFileByKbUIDAndFileID.mock.t.Fatalf("RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID 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 mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation == nil { - mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation = &RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDExpectation{} + if mmGetEmbeddingByUIDs.defaultExpectation == nil { + mmGetEmbeddingByUIDs.defaultExpectation = &RepositoryIMockGetEmbeddingByUIDsExpectation{} } - if mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation.params != nil { - mmGetKnowledgebaseFileByKbUIDAndFileID.mock.t.Fatalf("RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID mock is already set by Expect") + if mmGetEmbeddingByUIDs.defaultExpectation.params != nil { + mmGetEmbeddingByUIDs.mock.t.Fatalf("RepositoryIMock.GetEmbeddingByUIDs mock is already set by Expect") } - if mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation.paramPtrs == nil { - mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation.paramPtrs = &RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDParamPtrs{} + if mmGetEmbeddingByUIDs.defaultExpectation.paramPtrs == nil { + mmGetEmbeddingByUIDs.defaultExpectation.paramPtrs = &RepositoryIMockGetEmbeddingByUIDsParamPtrs{} } - mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation.paramPtrs.kbUID = &kbUID + mmGetEmbeddingByUIDs.defaultExpectation.paramPtrs.ctx = &ctx - return mmGetKnowledgebaseFileByKbUIDAndFileID + return mmGetEmbeddingByUIDs } -// ExpectFileIDParam3 sets up expected param fileID for RepositoryI.GetKnowledgebaseFileByKbUIDAndFileID -func (mmGetKnowledgebaseFileByKbUIDAndFileID *mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID) ExpectFileIDParam3(fileID string) *mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID { - if mmGetKnowledgebaseFileByKbUIDAndFileID.mock.funcGetKnowledgebaseFileByKbUIDAndFileID != nil { - mmGetKnowledgebaseFileByKbUIDAndFileID.mock.t.Fatalf("RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID 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 mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation == nil { - mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation = &RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDExpectation{} + if mmGetEmbeddingByUIDs.defaultExpectation == nil { + mmGetEmbeddingByUIDs.defaultExpectation = &RepositoryIMockGetEmbeddingByUIDsExpectation{} } - if mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation.params != nil { - mmGetKnowledgebaseFileByKbUIDAndFileID.mock.t.Fatalf("RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID mock is already set by Expect") + if mmGetEmbeddingByUIDs.defaultExpectation.params != nil { + mmGetEmbeddingByUIDs.mock.t.Fatalf("RepositoryIMock.GetEmbeddingByUIDs mock is already set by Expect") } - if mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation.paramPtrs == nil { - mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation.paramPtrs = &RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDParamPtrs{} + if mmGetEmbeddingByUIDs.defaultExpectation.paramPtrs == nil { + mmGetEmbeddingByUIDs.defaultExpectation.paramPtrs = &RepositoryIMockGetEmbeddingByUIDsParamPtrs{} } - mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation.paramPtrs.fileID = &fileID + mmGetEmbeddingByUIDs.defaultExpectation.paramPtrs.embUIDs = &embUIDs - return mmGetKnowledgebaseFileByKbUIDAndFileID + return mmGetEmbeddingByUIDs } -// Inspect accepts an inspector function that has same arguments as the RepositoryI.GetKnowledgebaseFileByKbUIDAndFileID -func (mmGetKnowledgebaseFileByKbUIDAndFileID *mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID) Inspect(f func(ctx context.Context, kbUID uuid.UUID, fileID string)) *mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID { - if mmGetKnowledgebaseFileByKbUIDAndFileID.mock.inspectFuncGetKnowledgebaseFileByKbUIDAndFileID != nil { - mmGetKnowledgebaseFileByKbUIDAndFileID.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID") +// 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") } - mmGetKnowledgebaseFileByKbUIDAndFileID.mock.inspectFuncGetKnowledgebaseFileByKbUIDAndFileID = f + mmGetEmbeddingByUIDs.mock.inspectFuncGetEmbeddingByUIDs = f - return mmGetKnowledgebaseFileByKbUIDAndFileID + return mmGetEmbeddingByUIDs } -// Return sets up results that will be returned by RepositoryI.GetKnowledgebaseFileByKbUIDAndFileID -func (mmGetKnowledgebaseFileByKbUIDAndFileID *mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID) Return(kp1 *mm_repository.KnowledgeBaseFile, err error) *RepositoryIMock { - if mmGetKnowledgebaseFileByKbUIDAndFileID.mock.funcGetKnowledgebaseFileByKbUIDAndFileID != nil { - mmGetKnowledgebaseFileByKbUIDAndFileID.mock.t.Fatalf("RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID 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 mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation == nil { - mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation = &RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDExpectation{mock: mmGetKnowledgebaseFileByKbUIDAndFileID.mock} + if mmGetEmbeddingByUIDs.defaultExpectation == nil { + mmGetEmbeddingByUIDs.defaultExpectation = &RepositoryIMockGetEmbeddingByUIDsExpectation{mock: mmGetEmbeddingByUIDs.mock} } - mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation.results = &RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDResults{kp1, err} - return mmGetKnowledgebaseFileByKbUIDAndFileID.mock + mmGetEmbeddingByUIDs.defaultExpectation.results = &RepositoryIMockGetEmbeddingByUIDsResults{ea1, err} + return mmGetEmbeddingByUIDs.mock } -// Set uses given function f to mock the RepositoryI.GetKnowledgebaseFileByKbUIDAndFileID method -func (mmGetKnowledgebaseFileByKbUIDAndFileID *mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID) Set(f func(ctx context.Context, kbUID uuid.UUID, fileID string) (kp1 *mm_repository.KnowledgeBaseFile, err error)) *RepositoryIMock { - if mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation != nil { - mmGetKnowledgebaseFileByKbUIDAndFileID.mock.t.Fatalf("Default expectation is already set for the RepositoryI.GetKnowledgebaseFileByKbUIDAndFileID 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(mmGetKnowledgebaseFileByKbUIDAndFileID.expectations) > 0 { - mmGetKnowledgebaseFileByKbUIDAndFileID.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetKnowledgebaseFileByKbUIDAndFileID method") + if len(mmGetEmbeddingByUIDs.expectations) > 0 { + mmGetEmbeddingByUIDs.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetEmbeddingByUIDs method") } - mmGetKnowledgebaseFileByKbUIDAndFileID.mock.funcGetKnowledgebaseFileByKbUIDAndFileID = f - return mmGetKnowledgebaseFileByKbUIDAndFileID.mock + mmGetEmbeddingByUIDs.mock.funcGetEmbeddingByUIDs = f + return mmGetEmbeddingByUIDs.mock } -// When sets expectation for the RepositoryI.GetKnowledgebaseFileByKbUIDAndFileID 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 (mmGetKnowledgebaseFileByKbUIDAndFileID *mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID) When(ctx context.Context, kbUID uuid.UUID, fileID string) *RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDExpectation { - if mmGetKnowledgebaseFileByKbUIDAndFileID.mock.funcGetKnowledgebaseFileByKbUIDAndFileID != nil { - mmGetKnowledgebaseFileByKbUIDAndFileID.mock.t.Fatalf("RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID 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 := &RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDExpectation{ - mock: mmGetKnowledgebaseFileByKbUIDAndFileID.mock, - params: &RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDParams{ctx, kbUID, fileID}, + expectation := &RepositoryIMockGetEmbeddingByUIDsExpectation{ + mock: mmGetEmbeddingByUIDs.mock, + params: &RepositoryIMockGetEmbeddingByUIDsParams{ctx, embUIDs}, } - mmGetKnowledgebaseFileByKbUIDAndFileID.expectations = append(mmGetKnowledgebaseFileByKbUIDAndFileID.expectations, expectation) + mmGetEmbeddingByUIDs.expectations = append(mmGetEmbeddingByUIDs.expectations, expectation) return expectation } -// Then sets up RepositoryI.GetKnowledgebaseFileByKbUIDAndFileID return parameters for the expectation previously defined by the When method -func (e *RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDExpectation) Then(kp1 *mm_repository.KnowledgeBaseFile, err error) *RepositoryIMock { - e.results = &RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDResults{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.GetKnowledgebaseFileByKbUIDAndFileID should be invoked -func (mmGetKnowledgebaseFileByKbUIDAndFileID *mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID) Times(n uint64) *mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID { +// Times sets number of times RepositoryI.GetEmbeddingByUIDs should be invoked +func (mmGetEmbeddingByUIDs *mRepositoryIMockGetEmbeddingByUIDs) Times(n uint64) *mRepositoryIMockGetEmbeddingByUIDs { if n == 0 { - mmGetKnowledgebaseFileByKbUIDAndFileID.mock.t.Fatalf("Times of RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID mock can not be zero") + mmGetEmbeddingByUIDs.mock.t.Fatalf("Times of RepositoryIMock.GetEmbeddingByUIDs mock can not be zero") } - mm_atomic.StoreUint64(&mmGetKnowledgebaseFileByKbUIDAndFileID.expectedInvocations, n) - return mmGetKnowledgebaseFileByKbUIDAndFileID + mm_atomic.StoreUint64(&mmGetEmbeddingByUIDs.expectedInvocations, n) + return mmGetEmbeddingByUIDs } -func (mmGetKnowledgebaseFileByKbUIDAndFileID *mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID) invocationsDone() bool { - if len(mmGetKnowledgebaseFileByKbUIDAndFileID.expectations) == 0 && mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation == nil && mmGetKnowledgebaseFileByKbUIDAndFileID.mock.funcGetKnowledgebaseFileByKbUIDAndFileID == nil { +func (mmGetEmbeddingByUIDs *mRepositoryIMockGetEmbeddingByUIDs) invocationsDone() bool { + if len(mmGetEmbeddingByUIDs.expectations) == 0 && mmGetEmbeddingByUIDs.defaultExpectation == nil && mmGetEmbeddingByUIDs.mock.funcGetEmbeddingByUIDs == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmGetKnowledgebaseFileByKbUIDAndFileID.mock.afterGetKnowledgebaseFileByKbUIDAndFileIDCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmGetKnowledgebaseFileByKbUIDAndFileID.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmGetEmbeddingByUIDs.mock.afterGetEmbeddingByUIDsCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmGetEmbeddingByUIDs.expectedInvocations) return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) } -// GetKnowledgebaseFileByKbUIDAndFileID implements repository.RepositoryI -func (mmGetKnowledgebaseFileByKbUIDAndFileID *RepositoryIMock) GetKnowledgebaseFileByKbUIDAndFileID(ctx context.Context, kbUID uuid.UUID, fileID string) (kp1 *mm_repository.KnowledgeBaseFile, err error) { - mm_atomic.AddUint64(&mmGetKnowledgebaseFileByKbUIDAndFileID.beforeGetKnowledgebaseFileByKbUIDAndFileIDCounter, 1) - defer mm_atomic.AddUint64(&mmGetKnowledgebaseFileByKbUIDAndFileID.afterGetKnowledgebaseFileByKbUIDAndFileIDCounter, 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 mmGetKnowledgebaseFileByKbUIDAndFileID.inspectFuncGetKnowledgebaseFileByKbUIDAndFileID != nil { - mmGetKnowledgebaseFileByKbUIDAndFileID.inspectFuncGetKnowledgebaseFileByKbUIDAndFileID(ctx, kbUID, fileID) + if mmGetEmbeddingByUIDs.inspectFuncGetEmbeddingByUIDs != nil { + mmGetEmbeddingByUIDs.inspectFuncGetEmbeddingByUIDs(ctx, embUIDs) } - mm_params := RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDParams{ctx, kbUID, fileID} + mm_params := RepositoryIMockGetEmbeddingByUIDsParams{ctx, embUIDs} // Record call args - mmGetKnowledgebaseFileByKbUIDAndFileID.GetKnowledgebaseFileByKbUIDAndFileIDMock.mutex.Lock() - mmGetKnowledgebaseFileByKbUIDAndFileID.GetKnowledgebaseFileByKbUIDAndFileIDMock.callArgs = append(mmGetKnowledgebaseFileByKbUIDAndFileID.GetKnowledgebaseFileByKbUIDAndFileIDMock.callArgs, &mm_params) - mmGetKnowledgebaseFileByKbUIDAndFileID.GetKnowledgebaseFileByKbUIDAndFileIDMock.mutex.Unlock() + mmGetEmbeddingByUIDs.GetEmbeddingByUIDsMock.mutex.Lock() + mmGetEmbeddingByUIDs.GetEmbeddingByUIDsMock.callArgs = append(mmGetEmbeddingByUIDs.GetEmbeddingByUIDsMock.callArgs, &mm_params) + mmGetEmbeddingByUIDs.GetEmbeddingByUIDsMock.mutex.Unlock() - for _, e := range mmGetKnowledgebaseFileByKbUIDAndFileID.GetKnowledgebaseFileByKbUIDAndFileIDMock.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 mmGetKnowledgebaseFileByKbUIDAndFileID.GetKnowledgebaseFileByKbUIDAndFileIDMock.defaultExpectation != nil { - mm_atomic.AddUint64(&mmGetKnowledgebaseFileByKbUIDAndFileID.GetKnowledgebaseFileByKbUIDAndFileIDMock.defaultExpectation.Counter, 1) - mm_want := mmGetKnowledgebaseFileByKbUIDAndFileID.GetKnowledgebaseFileByKbUIDAndFileIDMock.defaultExpectation.params - mm_want_ptrs := mmGetKnowledgebaseFileByKbUIDAndFileID.GetKnowledgebaseFileByKbUIDAndFileIDMock.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 := RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDParams{ctx, kbUID, fileID} + 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) { - mmGetKnowledgebaseFileByKbUIDAndFileID.t.Errorf("RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID 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) { - mmGetKnowledgebaseFileByKbUIDAndFileID.t.Errorf("RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID 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)) + 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.fileID != nil && !minimock.Equal(*mm_want_ptrs.fileID, mm_got.fileID) { - mmGetKnowledgebaseFileByKbUIDAndFileID.t.Errorf("RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID got unexpected parameter fileID, want: %#v, got: %#v%s\n", *mm_want_ptrs.fileID, mm_got.fileID, minimock.Diff(*mm_want_ptrs.fileID, mm_got.fileID)) + 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) { - mmGetKnowledgebaseFileByKbUIDAndFileID.t.Errorf("RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID 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 := mmGetKnowledgebaseFileByKbUIDAndFileID.GetKnowledgebaseFileByKbUIDAndFileIDMock.defaultExpectation.results + mm_results := mmGetEmbeddingByUIDs.GetEmbeddingByUIDsMock.defaultExpectation.results if mm_results == nil { - mmGetKnowledgebaseFileByKbUIDAndFileID.t.Fatal("No results are set for the RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID") + 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 mmGetKnowledgebaseFileByKbUIDAndFileID.funcGetKnowledgebaseFileByKbUIDAndFileID != nil { - return mmGetKnowledgebaseFileByKbUIDAndFileID.funcGetKnowledgebaseFileByKbUIDAndFileID(ctx, kbUID, fileID) + if mmGetEmbeddingByUIDs.funcGetEmbeddingByUIDs != nil { + return mmGetEmbeddingByUIDs.funcGetEmbeddingByUIDs(ctx, embUIDs) } - mmGetKnowledgebaseFileByKbUIDAndFileID.t.Fatalf("Unexpected call to RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID. %v %v %v", ctx, kbUID, fileID) + mmGetEmbeddingByUIDs.t.Fatalf("Unexpected call to RepositoryIMock.GetEmbeddingByUIDs. %v %v", ctx, embUIDs) return } -// GetKnowledgebaseFileByKbUIDAndFileIDAfterCounter returns a count of finished RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID invocations -func (mmGetKnowledgebaseFileByKbUIDAndFileID *RepositoryIMock) GetKnowledgebaseFileByKbUIDAndFileIDAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetKnowledgebaseFileByKbUIDAndFileID.afterGetKnowledgebaseFileByKbUIDAndFileIDCounter) +// GetEmbeddingByUIDsAfterCounter returns a count of finished RepositoryIMock.GetEmbeddingByUIDs invocations +func (mmGetEmbeddingByUIDs *RepositoryIMock) GetEmbeddingByUIDsAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetEmbeddingByUIDs.afterGetEmbeddingByUIDsCounter) } -// GetKnowledgebaseFileByKbUIDAndFileIDBeforeCounter returns a count of RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID invocations -func (mmGetKnowledgebaseFileByKbUIDAndFileID *RepositoryIMock) GetKnowledgebaseFileByKbUIDAndFileIDBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetKnowledgebaseFileByKbUIDAndFileID.beforeGetKnowledgebaseFileByKbUIDAndFileIDCounter) +// 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.GetKnowledgebaseFileByKbUIDAndFileID. +// 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 (mmGetKnowledgebaseFileByKbUIDAndFileID *mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID) Calls() []*RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDParams { - mmGetKnowledgebaseFileByKbUIDAndFileID.mutex.RLock() +func (mmGetEmbeddingByUIDs *mRepositoryIMockGetEmbeddingByUIDs) Calls() []*RepositoryIMockGetEmbeddingByUIDsParams { + mmGetEmbeddingByUIDs.mutex.RLock() - argCopy := make([]*RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDParams, len(mmGetKnowledgebaseFileByKbUIDAndFileID.callArgs)) - copy(argCopy, mmGetKnowledgebaseFileByKbUIDAndFileID.callArgs) + argCopy := make([]*RepositoryIMockGetEmbeddingByUIDsParams, len(mmGetEmbeddingByUIDs.callArgs)) + copy(argCopy, mmGetEmbeddingByUIDs.callArgs) - mmGetKnowledgebaseFileByKbUIDAndFileID.mutex.RUnlock() + mmGetEmbeddingByUIDs.mutex.RUnlock() return argCopy } -// MinimockGetKnowledgebaseFileByKbUIDAndFileIDDone returns true if the count of the GetKnowledgebaseFileByKbUIDAndFileID invocations corresponds +// MinimockGetEmbeddingByUIDsDone returns true if the count of the GetEmbeddingByUIDs invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockGetKnowledgebaseFileByKbUIDAndFileIDDone() bool { - for _, e := range m.GetKnowledgebaseFileByKbUIDAndFileIDMock.expectations { +func (m *RepositoryIMock) MinimockGetEmbeddingByUIDsDone() bool { + for _, e := range m.GetEmbeddingByUIDsMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.GetKnowledgebaseFileByKbUIDAndFileIDMock.invocationsDone() + return m.GetEmbeddingByUIDsMock.invocationsDone() } -// MinimockGetKnowledgebaseFileByKbUIDAndFileIDInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockGetKnowledgebaseFileByKbUIDAndFileIDInspect() { - for _, e := range m.GetKnowledgebaseFileByKbUIDAndFileIDMock.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.GetKnowledgebaseFileByKbUIDAndFileID with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.GetEmbeddingByUIDs with params: %#v", *e.params) } } - afterGetKnowledgebaseFileByKbUIDAndFileIDCounter := mm_atomic.LoadUint64(&m.afterGetKnowledgebaseFileByKbUIDAndFileIDCounter) + afterGetEmbeddingByUIDsCounter := mm_atomic.LoadUint64(&m.afterGetEmbeddingByUIDsCounter) // if default expectation was set then invocations count should be greater than zero - if m.GetKnowledgebaseFileByKbUIDAndFileIDMock.defaultExpectation != nil && afterGetKnowledgebaseFileByKbUIDAndFileIDCounter < 1 { - if m.GetKnowledgebaseFileByKbUIDAndFileIDMock.defaultExpectation.params == nil { - m.t.Error("Expected call to RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID") + 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.GetKnowledgebaseFileByKbUIDAndFileID with params: %#v", *m.GetKnowledgebaseFileByKbUIDAndFileIDMock.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.funcGetKnowledgebaseFileByKbUIDAndFileID != nil && afterGetKnowledgebaseFileByKbUIDAndFileIDCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID") + if m.funcGetEmbeddingByUIDs != nil && afterGetEmbeddingByUIDsCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.GetEmbeddingByUIDs") } - if !m.GetKnowledgebaseFileByKbUIDAndFileIDMock.invocationsDone() && afterGetKnowledgebaseFileByKbUIDAndFileIDCounter > 0 { - m.t.Errorf("Expected %d calls to RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID but found %d calls", - mm_atomic.LoadUint64(&m.GetKnowledgebaseFileByKbUIDAndFileIDMock.expectedInvocations), afterGetKnowledgebaseFileByKbUIDAndFileIDCounter) + 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 mRepositoryIMockGetNeedProcessFiles struct { +type mRepositoryIMockGetFilesTotalTokens struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockGetNeedProcessFilesExpectation - expectations []*RepositoryIMockGetNeedProcessFilesExpectation + defaultExpectation *RepositoryIMockGetFilesTotalTokensExpectation + expectations []*RepositoryIMockGetFilesTotalTokensExpectation - callArgs []*RepositoryIMockGetNeedProcessFilesParams + callArgs []*RepositoryIMockGetFilesTotalTokensParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockGetNeedProcessFilesExpectation specifies expectation struct of the RepositoryI.GetNeedProcessFiles -type RepositoryIMockGetNeedProcessFilesExpectation struct { +// RepositoryIMockGetFilesTotalTokensExpectation specifies expectation struct of the RepositoryI.GetFilesTotalTokens +type RepositoryIMockGetFilesTotalTokensExpectation struct { mock *RepositoryIMock - params *RepositoryIMockGetNeedProcessFilesParams - paramPtrs *RepositoryIMockGetNeedProcessFilesParamPtrs - results *RepositoryIMockGetNeedProcessFilesResults + params *RepositoryIMockGetFilesTotalTokensParams + paramPtrs *RepositoryIMockGetFilesTotalTokensParamPtrs + results *RepositoryIMockGetFilesTotalTokensResults Counter uint64 } -// RepositoryIMockGetNeedProcessFilesParams contains parameters of the RepositoryI.GetNeedProcessFiles -type RepositoryIMockGetNeedProcessFilesParams struct { - ctx context.Context +// 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 + } } -// RepositoryIMockGetNeedProcessFilesParamPtrs contains pointers to parameters of the RepositoryI.GetNeedProcessFiles -type RepositoryIMockGetNeedProcessFilesParamPtrs struct { - ctx *context.Context +// 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 + } } -// RepositoryIMockGetNeedProcessFilesResults contains results of the RepositoryI.GetNeedProcessFiles -type RepositoryIMockGetNeedProcessFilesResults struct { - ka1 []mm_repository.KnowledgeBaseFile +// 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.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.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 mmGetNeedProcessFiles.defaultExpectation == nil { - mmGetNeedProcessFiles.defaultExpectation = &RepositoryIMockGetNeedProcessFilesExpectation{} + if mmGetFilesTotalTokens.defaultExpectation == nil { + mmGetFilesTotalTokens.defaultExpectation = &RepositoryIMockGetFilesTotalTokensExpectation{} } - if mmGetNeedProcessFiles.defaultExpectation.paramPtrs != nil { - mmGetNeedProcessFiles.mock.t.Fatalf("RepositoryIMock.GetNeedProcessFiles 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") } - 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) + 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 mmGetNeedProcessFiles + return mmGetFilesTotalTokens } -// 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.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 mmGetNeedProcessFiles.defaultExpectation == nil { - mmGetNeedProcessFiles.defaultExpectation = &RepositoryIMockGetNeedProcessFilesExpectation{} + if mmGetFilesTotalTokens.defaultExpectation == nil { + mmGetFilesTotalTokens.defaultExpectation = &RepositoryIMockGetFilesTotalTokensExpectation{} } - if mmGetNeedProcessFiles.defaultExpectation.params != nil { - mmGetNeedProcessFiles.mock.t.Fatalf("RepositoryIMock.GetNeedProcessFiles mock is already set by Expect") + if mmGetFilesTotalTokens.defaultExpectation.params != nil { + mmGetFilesTotalTokens.mock.t.Fatalf("RepositoryIMock.GetFilesTotalTokens mock is already set by Expect") } - if mmGetNeedProcessFiles.defaultExpectation.paramPtrs == nil { - mmGetNeedProcessFiles.defaultExpectation.paramPtrs = &RepositoryIMockGetNeedProcessFilesParamPtrs{} + if mmGetFilesTotalTokens.defaultExpectation.paramPtrs == nil { + mmGetFilesTotalTokens.defaultExpectation.paramPtrs = &RepositoryIMockGetFilesTotalTokensParamPtrs{} } - mmGetNeedProcessFiles.defaultExpectation.paramPtrs.ctx = &ctx + mmGetFilesTotalTokens.defaultExpectation.paramPtrs.ctx = &ctx - return mmGetNeedProcessFiles + return mmGetFilesTotalTokens } -// 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") +// 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") } - mmGetNeedProcessFiles.mock.inspectFuncGetNeedProcessFiles = f - - return mmGetNeedProcessFiles -} - -// 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 mmGetFilesTotalTokens.defaultExpectation == nil { + mmGetFilesTotalTokens.defaultExpectation = &RepositoryIMockGetFilesTotalTokensExpectation{} } - if mmGetNeedProcessFiles.defaultExpectation == nil { - mmGetNeedProcessFiles.defaultExpectation = &RepositoryIMockGetNeedProcessFilesExpectation{mock: mmGetNeedProcessFiles.mock} + if mmGetFilesTotalTokens.defaultExpectation.params != nil { + mmGetFilesTotalTokens.mock.t.Fatalf("RepositoryIMock.GetFilesTotalTokens mock is already set by Expect") } - mmGetNeedProcessFiles.defaultExpectation.results = &RepositoryIMockGetNeedProcessFilesResults{ka1} - return mmGetNeedProcessFiles.mock + + if mmGetFilesTotalTokens.defaultExpectation.paramPtrs == nil { + mmGetFilesTotalTokens.defaultExpectation.paramPtrs = &RepositoryIMockGetFilesTotalTokensParamPtrs{} + } + mmGetFilesTotalTokens.defaultExpectation.paramPtrs.sources = &sources + + return mmGetFilesTotalTokens } -// 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") +// 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") } - if len(mmGetNeedProcessFiles.expectations) > 0 { - mmGetNeedProcessFiles.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetNeedProcessFiles method") + mmGetFilesTotalTokens.mock.inspectFuncGetFilesTotalTokens = f + + return mmGetFilesTotalTokens +} + +// 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") } - mmGetNeedProcessFiles.mock.funcGetNeedProcessFiles = f - return mmGetNeedProcessFiles.mock + if mmGetFilesTotalTokens.defaultExpectation == nil { + mmGetFilesTotalTokens.defaultExpectation = &RepositoryIMockGetFilesTotalTokensExpectation{mock: mmGetFilesTotalTokens.mock} + } + mmGetFilesTotalTokens.defaultExpectation.results = &RepositoryIMockGetFilesTotalTokensResults{m1, err} + return mmGetFilesTotalTokens.mock } -// When sets expectation for the RepositoryI.GetNeedProcessFiles which will trigger the result defined by the following +// 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(mmGetFilesTotalTokens.expectations) > 0 { + mmGetFilesTotalTokens.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetFilesTotalTokens method") + } + + mmGetFilesTotalTokens.mock.funcGetFilesTotalTokens = f + return mmGetFilesTotalTokens.mock +} + +// When sets expectation for the RepositoryI.GetFilesTotalTokens 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 (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 := &RepositoryIMockGetNeedProcessFilesExpectation{ - mock: mmGetNeedProcessFiles.mock, - params: &RepositoryIMockGetNeedProcessFilesParams{ctx}, + expectation := &RepositoryIMockGetFilesTotalTokensExpectation{ + mock: mmGetFilesTotalTokens.mock, + params: &RepositoryIMockGetFilesTotalTokensParams{ctx, sources}, } - mmGetNeedProcessFiles.expectations = append(mmGetNeedProcessFiles.expectations, expectation) + mmGetFilesTotalTokens.expectations = append(mmGetFilesTotalTokens.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.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.GetNeedProcessFiles should be invoked -func (mmGetNeedProcessFiles *mRepositoryIMockGetNeedProcessFiles) Times(n uint64) *mRepositoryIMockGetNeedProcessFiles { +// Times sets number of times RepositoryI.GetFilesTotalTokens should be invoked +func (mmGetFilesTotalTokens *mRepositoryIMockGetFilesTotalTokens) Times(n uint64) *mRepositoryIMockGetFilesTotalTokens { if n == 0 { - mmGetNeedProcessFiles.mock.t.Fatalf("Times of RepositoryIMock.GetNeedProcessFiles mock can not be zero") + mmGetFilesTotalTokens.mock.t.Fatalf("Times of RepositoryIMock.GetFilesTotalTokens mock can not be zero") } - mm_atomic.StoreUint64(&mmGetNeedProcessFiles.expectedInvocations, n) - return mmGetNeedProcessFiles + mm_atomic.StoreUint64(&mmGetFilesTotalTokens.expectedInvocations, n) + return mmGetFilesTotalTokens } -func (mmGetNeedProcessFiles *mRepositoryIMockGetNeedProcessFiles) invocationsDone() bool { - if len(mmGetNeedProcessFiles.expectations) == 0 && mmGetNeedProcessFiles.defaultExpectation == nil && mmGetNeedProcessFiles.mock.funcGetNeedProcessFiles == nil { +func (mmGetFilesTotalTokens *mRepositoryIMockGetFilesTotalTokens) invocationsDone() bool { + if len(mmGetFilesTotalTokens.expectations) == 0 && mmGetFilesTotalTokens.defaultExpectation == nil && mmGetFilesTotalTokens.mock.funcGetFilesTotalTokens == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmGetNeedProcessFiles.mock.afterGetNeedProcessFilesCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmGetNeedProcessFiles.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmGetFilesTotalTokens.mock.afterGetFilesTotalTokensCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmGetFilesTotalTokens.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) +// 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 mmGetNeedProcessFiles.inspectFuncGetNeedProcessFiles != nil { - mmGetNeedProcessFiles.inspectFuncGetNeedProcessFiles(ctx) + if mmGetFilesTotalTokens.inspectFuncGetFilesTotalTokens != nil { + mmGetFilesTotalTokens.inspectFuncGetFilesTotalTokens(ctx, sources) } - mm_params := RepositoryIMockGetNeedProcessFilesParams{ctx} + mm_params := RepositoryIMockGetFilesTotalTokensParams{ctx, sources} // Record call args - mmGetNeedProcessFiles.GetNeedProcessFilesMock.mutex.Lock() - mmGetNeedProcessFiles.GetNeedProcessFilesMock.callArgs = append(mmGetNeedProcessFiles.GetNeedProcessFilesMock.callArgs, &mm_params) - mmGetNeedProcessFiles.GetNeedProcessFilesMock.mutex.Unlock() + mmGetFilesTotalTokens.GetFilesTotalTokensMock.mutex.Lock() + mmGetFilesTotalTokens.GetFilesTotalTokensMock.callArgs = append(mmGetFilesTotalTokens.GetFilesTotalTokensMock.callArgs, &mm_params) + mmGetFilesTotalTokens.GetFilesTotalTokensMock.mutex.Unlock() - for _, e := range mmGetNeedProcessFiles.GetNeedProcessFilesMock.expectations { + for _, e := range mmGetFilesTotalTokens.GetFilesTotalTokensMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.ka1 + return e.results.m1, 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 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 := RepositoryIMockGetNeedProcessFilesParams{ctx} + 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) { - 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)) + 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.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) { - mmGetNeedProcessFiles.t.Errorf("RepositoryIMock.GetNeedProcessFiles 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 := mmGetNeedProcessFiles.GetNeedProcessFilesMock.defaultExpectation.results + mm_results := mmGetFilesTotalTokens.GetFilesTotalTokensMock.defaultExpectation.results if mm_results == nil { - mmGetNeedProcessFiles.t.Fatal("No results are set for the RepositoryIMock.GetNeedProcessFiles") + mmGetFilesTotalTokens.t.Fatal("No results are set for the RepositoryIMock.GetFilesTotalTokens") } - return (*mm_results).ka1 + return (*mm_results).m1, (*mm_results).err } - if mmGetNeedProcessFiles.funcGetNeedProcessFiles != nil { - return mmGetNeedProcessFiles.funcGetNeedProcessFiles(ctx) + if mmGetFilesTotalTokens.funcGetFilesTotalTokens != nil { + return mmGetFilesTotalTokens.funcGetFilesTotalTokens(ctx, sources) } - mmGetNeedProcessFiles.t.Fatalf("Unexpected call to RepositoryIMock.GetNeedProcessFiles. %v", ctx) + mmGetFilesTotalTokens.t.Fatalf("Unexpected call to RepositoryIMock.GetFilesTotalTokens. %v %v", ctx, sources) return } -// GetNeedProcessFilesAfterCounter returns a count of finished RepositoryIMock.GetNeedProcessFiles invocations -func (mmGetNeedProcessFiles *RepositoryIMock) GetNeedProcessFilesAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetNeedProcessFiles.afterGetNeedProcessFilesCounter) +// GetFilesTotalTokensAfterCounter returns a count of finished RepositoryIMock.GetFilesTotalTokens invocations +func (mmGetFilesTotalTokens *RepositoryIMock) GetFilesTotalTokensAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetFilesTotalTokens.afterGetFilesTotalTokensCounter) } -// GetNeedProcessFilesBeforeCounter returns a count of RepositoryIMock.GetNeedProcessFiles invocations -func (mmGetNeedProcessFiles *RepositoryIMock) GetNeedProcessFilesBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetNeedProcessFiles.beforeGetNeedProcessFilesCounter) +// 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.GetNeedProcessFiles. +// 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 (mmGetNeedProcessFiles *mRepositoryIMockGetNeedProcessFiles) Calls() []*RepositoryIMockGetNeedProcessFilesParams { - mmGetNeedProcessFiles.mutex.RLock() +func (mmGetFilesTotalTokens *mRepositoryIMockGetFilesTotalTokens) Calls() []*RepositoryIMockGetFilesTotalTokensParams { + mmGetFilesTotalTokens.mutex.RLock() - argCopy := make([]*RepositoryIMockGetNeedProcessFilesParams, len(mmGetNeedProcessFiles.callArgs)) - copy(argCopy, mmGetNeedProcessFiles.callArgs) + argCopy := make([]*RepositoryIMockGetFilesTotalTokensParams, len(mmGetFilesTotalTokens.callArgs)) + copy(argCopy, mmGetFilesTotalTokens.callArgs) - mmGetNeedProcessFiles.mutex.RUnlock() + mmGetFilesTotalTokens.mutex.RUnlock() return argCopy } -// MinimockGetNeedProcessFilesDone returns true if the count of the GetNeedProcessFiles invocations corresponds +// MinimockGetFilesTotalTokensDone returns true if the count of the GetFilesTotalTokens invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockGetNeedProcessFilesDone() bool { - for _, e := range m.GetNeedProcessFilesMock.expectations { +func (m *RepositoryIMock) MinimockGetFilesTotalTokensDone() bool { + for _, e := range m.GetFilesTotalTokensMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.GetNeedProcessFilesMock.invocationsDone() + return m.GetFilesTotalTokensMock.invocationsDone() } -// MinimockGetNeedProcessFilesInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockGetNeedProcessFilesInspect() { - for _, e := range m.GetNeedProcessFilesMock.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.GetNeedProcessFiles with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.GetFilesTotalTokens with params: %#v", *e.params) } } - afterGetNeedProcessFilesCounter := mm_atomic.LoadUint64(&m.afterGetNeedProcessFilesCounter) + afterGetFilesTotalTokensCounter := mm_atomic.LoadUint64(&m.afterGetFilesTotalTokensCounter) // 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.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.GetNeedProcessFiles with params: %#v", *m.GetNeedProcessFilesMock.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.funcGetNeedProcessFiles != nil && afterGetNeedProcessFilesCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.GetNeedProcessFiles") + if m.funcGetFilesTotalTokens != nil && afterGetFilesTotalTokensCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.GetFilesTotalTokens") } - 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.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 mRepositoryIMockGetRepositoryTag struct { +type mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockGetRepositoryTagExpectation - expectations []*RepositoryIMockGetRepositoryTagExpectation + defaultExpectation *RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation + expectations []*RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation - callArgs []*RepositoryIMockGetRepositoryTagParams + callArgs []*RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockGetRepositoryTagExpectation specifies expectation struct of the RepositoryI.GetRepositoryTag -type RepositoryIMockGetRepositoryTagExpectation struct { +// RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation specifies expectation struct of the RepositoryI.GetKnowledgeBaseByOwnerAndKbID +type RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation struct { mock *RepositoryIMock - params *RepositoryIMockGetRepositoryTagParams - paramPtrs *RepositoryIMockGetRepositoryTagParamPtrs - results *RepositoryIMockGetRepositoryTagResults + params *RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParams + paramPtrs *RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParamPtrs + results *RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDResults Counter uint64 } -// RepositoryIMockGetRepositoryTagParams contains parameters of the RepositoryI.GetRepositoryTag -type RepositoryIMockGetRepositoryTagParams struct { - ctx context.Context - r1 utils.RepositoryTagName +// RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParams contains parameters of the RepositoryI.GetKnowledgeBaseByOwnerAndKbID +type RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParams struct { + ctx context.Context + ownerUID uuid.UUID + kbID string } -// RepositoryIMockGetRepositoryTagParamPtrs contains pointers to parameters of the RepositoryI.GetRepositoryTag -type RepositoryIMockGetRepositoryTagParamPtrs struct { - ctx *context.Context - r1 *utils.RepositoryTagName +// RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParamPtrs contains pointers to parameters of the RepositoryI.GetKnowledgeBaseByOwnerAndKbID +type RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParamPtrs struct { + ctx *context.Context + ownerUID *uuid.UUID + kbID *string } -// RepositoryIMockGetRepositoryTagResults contains results of the RepositoryI.GetRepositoryTag -type RepositoryIMockGetRepositoryTagResults struct { - rp1 *pb.RepositoryTag +// RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDResults contains results of the RepositoryI.GetKnowledgeBaseByOwnerAndKbID +type RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDResults struct { + kp1 *mm_repository.KnowledgeBase 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.GetKnowledgeBaseByOwnerAndKbID +func (mmGetKnowledgeBaseByOwnerAndKbID *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID) Expect(ctx context.Context, ownerUID uuid.UUID, kbID string) *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID { + if mmGetKnowledgeBaseByOwnerAndKbID.mock.funcGetKnowledgeBaseByOwnerAndKbID != nil { + mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID mock is already set by Set") } - if mmGetRepositoryTag.defaultExpectation == nil { - mmGetRepositoryTag.defaultExpectation = &RepositoryIMockGetRepositoryTagExpectation{} + if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation == nil { + mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation = &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation{} } - if mmGetRepositoryTag.defaultExpectation.paramPtrs != nil { - mmGetRepositoryTag.mock.t.Fatalf("RepositoryIMock.GetRepositoryTag 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") } - 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) + 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 mmGetRepositoryTag + return mmGetKnowledgeBaseByOwnerAndKbID } -// 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.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 mmGetRepositoryTag.defaultExpectation == nil { - mmGetRepositoryTag.defaultExpectation = &RepositoryIMockGetRepositoryTagExpectation{} + if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation == nil { + mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation = &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation{} } - if mmGetRepositoryTag.defaultExpectation.params != nil { - mmGetRepositoryTag.mock.t.Fatalf("RepositoryIMock.GetRepositoryTag mock is already set by Expect") + if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.params != nil { + mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID mock is already set by Expect") } - if mmGetRepositoryTag.defaultExpectation.paramPtrs == nil { - mmGetRepositoryTag.defaultExpectation.paramPtrs = &RepositoryIMockGetRepositoryTagParamPtrs{} + if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.paramPtrs == nil { + mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.paramPtrs = &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParamPtrs{} } - mmGetRepositoryTag.defaultExpectation.paramPtrs.ctx = &ctx + mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.paramPtrs.ctx = &ctx - return mmGetRepositoryTag + return mmGetKnowledgeBaseByOwnerAndKbID } -// 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") +// ExpectOwnerUIDParam2 sets up expected param ownerUID for RepositoryI.GetKnowledgeBaseByOwnerAndKbID +func (mmGetKnowledgeBaseByOwnerAndKbID *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID) ExpectOwnerUIDParam2(ownerUID uuid.UUID) *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID { + if mmGetKnowledgeBaseByOwnerAndKbID.mock.funcGetKnowledgeBaseByOwnerAndKbID != nil { + mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID mock is already set by Set") } - if mmGetRepositoryTag.defaultExpectation == nil { - mmGetRepositoryTag.defaultExpectation = &RepositoryIMockGetRepositoryTagExpectation{} + if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation == nil { + mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation = &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation{} } - if mmGetRepositoryTag.defaultExpectation.params != nil { - mmGetRepositoryTag.mock.t.Fatalf("RepositoryIMock.GetRepositoryTag mock is already set by Expect") + if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.params != nil { + mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID mock is already set by Expect") } - if mmGetRepositoryTag.defaultExpectation.paramPtrs == nil { - mmGetRepositoryTag.defaultExpectation.paramPtrs = &RepositoryIMockGetRepositoryTagParamPtrs{} + if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.paramPtrs == nil { + mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.paramPtrs = &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParamPtrs{} } - mmGetRepositoryTag.defaultExpectation.paramPtrs.r1 = &r1 + mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.paramPtrs.ownerUID = &ownerUID - return mmGetRepositoryTag + return mmGetKnowledgeBaseByOwnerAndKbID } -// 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") +// 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") } - mmGetRepositoryTag.mock.inspectFuncGetRepositoryTag = f + if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation == nil { + mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation = &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation{} + } - return mmGetRepositoryTag + 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.kbID = &kbID + + return mmGetKnowledgeBaseByOwnerAndKbID } -// 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") +// Inspect accepts an inspector function that has same arguments as the RepositoryI.GetKnowledgeBaseByOwnerAndKbID +func (mmGetKnowledgeBaseByOwnerAndKbID *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID) Inspect(f func(ctx context.Context, ownerUID uuid.UUID, kbID string)) *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID { + if mmGetKnowledgeBaseByOwnerAndKbID.mock.inspectFuncGetKnowledgeBaseByOwnerAndKbID != nil { + mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID") } - if mmGetRepositoryTag.defaultExpectation == nil { - mmGetRepositoryTag.defaultExpectation = &RepositoryIMockGetRepositoryTagExpectation{mock: mmGetRepositoryTag.mock} + mmGetKnowledgeBaseByOwnerAndKbID.mock.inspectFuncGetKnowledgeBaseByOwnerAndKbID = f + + return mmGetKnowledgeBaseByOwnerAndKbID +} + +// 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") } - mmGetRepositoryTag.defaultExpectation.results = &RepositoryIMockGetRepositoryTagResults{rp1, err} - return mmGetRepositoryTag.mock + + if mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation == nil { + mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation = &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation{mock: mmGetKnowledgeBaseByOwnerAndKbID.mock} + } + mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation.results = &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDResults{kp1, err} + return mmGetKnowledgeBaseByOwnerAndKbID.mock } -// 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") +// Set uses given function f to mock the RepositoryI.GetKnowledgeBaseByOwnerAndKbID method +func (mmGetKnowledgeBaseByOwnerAndKbID *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID) Set(f func(ctx context.Context, ownerUID uuid.UUID, 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(mmGetRepositoryTag.expectations) > 0 { - mmGetRepositoryTag.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetRepositoryTag method") + if len(mmGetKnowledgeBaseByOwnerAndKbID.expectations) > 0 { + mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetKnowledgeBaseByOwnerAndKbID method") } - mmGetRepositoryTag.mock.funcGetRepositoryTag = f - return mmGetRepositoryTag.mock + mmGetKnowledgeBaseByOwnerAndKbID.mock.funcGetKnowledgeBaseByOwnerAndKbID = f + return mmGetKnowledgeBaseByOwnerAndKbID.mock } -// When sets expectation for the RepositoryI.GetRepositoryTag 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 (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") +func (mmGetKnowledgeBaseByOwnerAndKbID *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID) When(ctx context.Context, ownerUID uuid.UUID, kbID string) *RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation { + if mmGetKnowledgeBaseByOwnerAndKbID.mock.funcGetKnowledgeBaseByOwnerAndKbID != nil { + mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID mock is already set by Set") } - expectation := &RepositoryIMockGetRepositoryTagExpectation{ - mock: mmGetRepositoryTag.mock, - params: &RepositoryIMockGetRepositoryTagParams{ctx, r1}, + expectation := &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation{ + mock: mmGetKnowledgeBaseByOwnerAndKbID.mock, + params: &RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParams{ctx, ownerUID, kbID}, } - mmGetRepositoryTag.expectations = append(mmGetRepositoryTag.expectations, expectation) + mmGetKnowledgeBaseByOwnerAndKbID.expectations = append(mmGetKnowledgeBaseByOwnerAndKbID.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.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.GetRepositoryTag should be invoked -func (mmGetRepositoryTag *mRepositoryIMockGetRepositoryTag) Times(n uint64) *mRepositoryIMockGetRepositoryTag { +// Times sets number of times RepositoryI.GetKnowledgeBaseByOwnerAndKbID should be invoked +func (mmGetKnowledgeBaseByOwnerAndKbID *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID) Times(n uint64) *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID { if n == 0 { - mmGetRepositoryTag.mock.t.Fatalf("Times of RepositoryIMock.GetRepositoryTag mock can not be zero") + mmGetKnowledgeBaseByOwnerAndKbID.mock.t.Fatalf("Times of RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID mock can not be zero") } - mm_atomic.StoreUint64(&mmGetRepositoryTag.expectedInvocations, n) - return mmGetRepositoryTag + mm_atomic.StoreUint64(&mmGetKnowledgeBaseByOwnerAndKbID.expectedInvocations, n) + return mmGetKnowledgeBaseByOwnerAndKbID } -func (mmGetRepositoryTag *mRepositoryIMockGetRepositoryTag) invocationsDone() bool { - if len(mmGetRepositoryTag.expectations) == 0 && mmGetRepositoryTag.defaultExpectation == nil && mmGetRepositoryTag.mock.funcGetRepositoryTag == nil { +func (mmGetKnowledgeBaseByOwnerAndKbID *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID) invocationsDone() bool { + if len(mmGetKnowledgeBaseByOwnerAndKbID.expectations) == 0 && mmGetKnowledgeBaseByOwnerAndKbID.defaultExpectation == nil && mmGetKnowledgeBaseByOwnerAndKbID.mock.funcGetKnowledgeBaseByOwnerAndKbID == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmGetRepositoryTag.mock.afterGetRepositoryTagCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmGetRepositoryTag.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmGetKnowledgeBaseByOwnerAndKbID.mock.afterGetKnowledgeBaseByOwnerAndKbIDCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmGetKnowledgeBaseByOwnerAndKbID.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) +// GetKnowledgeBaseByOwnerAndKbID implements repository.RepositoryI +func (mmGetKnowledgeBaseByOwnerAndKbID *RepositoryIMock) GetKnowledgeBaseByOwnerAndKbID(ctx context.Context, ownerUID uuid.UUID, kbID string) (kp1 *mm_repository.KnowledgeBase, err error) { + mm_atomic.AddUint64(&mmGetKnowledgeBaseByOwnerAndKbID.beforeGetKnowledgeBaseByOwnerAndKbIDCounter, 1) + defer mm_atomic.AddUint64(&mmGetKnowledgeBaseByOwnerAndKbID.afterGetKnowledgeBaseByOwnerAndKbIDCounter, 1) - if mmGetRepositoryTag.inspectFuncGetRepositoryTag != nil { - mmGetRepositoryTag.inspectFuncGetRepositoryTag(ctx, r1) + if mmGetKnowledgeBaseByOwnerAndKbID.inspectFuncGetKnowledgeBaseByOwnerAndKbID != nil { + mmGetKnowledgeBaseByOwnerAndKbID.inspectFuncGetKnowledgeBaseByOwnerAndKbID(ctx, ownerUID, kbID) } - mm_params := RepositoryIMockGetRepositoryTagParams{ctx, r1} + mm_params := RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParams{ctx, ownerUID, kbID} // Record call args - mmGetRepositoryTag.GetRepositoryTagMock.mutex.Lock() - mmGetRepositoryTag.GetRepositoryTagMock.callArgs = append(mmGetRepositoryTag.GetRepositoryTagMock.callArgs, &mm_params) - mmGetRepositoryTag.GetRepositoryTagMock.mutex.Unlock() + mmGetKnowledgeBaseByOwnerAndKbID.GetKnowledgeBaseByOwnerAndKbIDMock.mutex.Lock() + mmGetKnowledgeBaseByOwnerAndKbID.GetKnowledgeBaseByOwnerAndKbIDMock.callArgs = append(mmGetKnowledgeBaseByOwnerAndKbID.GetKnowledgeBaseByOwnerAndKbIDMock.callArgs, &mm_params) + mmGetKnowledgeBaseByOwnerAndKbID.GetKnowledgeBaseByOwnerAndKbIDMock.mutex.Unlock() - for _, e := range mmGetRepositoryTag.GetRepositoryTagMock.expectations { + for _, e := range mmGetKnowledgeBaseByOwnerAndKbID.GetKnowledgeBaseByOwnerAndKbIDMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.rp1, e.results.err + return e.results.kp1, 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 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 := RepositoryIMockGetRepositoryTagParams{ctx, r1} + 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) { - 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)) + 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.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.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.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) { - mmGetRepositoryTag.t.Errorf("RepositoryIMock.GetRepositoryTag 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 := mmGetRepositoryTag.GetRepositoryTagMock.defaultExpectation.results + mm_results := mmGetKnowledgeBaseByOwnerAndKbID.GetKnowledgeBaseByOwnerAndKbIDMock.defaultExpectation.results if mm_results == nil { - mmGetRepositoryTag.t.Fatal("No results are set for the RepositoryIMock.GetRepositoryTag") + mmGetKnowledgeBaseByOwnerAndKbID.t.Fatal("No results are set for the RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID") } - return (*mm_results).rp1, (*mm_results).err + return (*mm_results).kp1, (*mm_results).err } - if mmGetRepositoryTag.funcGetRepositoryTag != nil { - return mmGetRepositoryTag.funcGetRepositoryTag(ctx, r1) + if mmGetKnowledgeBaseByOwnerAndKbID.funcGetKnowledgeBaseByOwnerAndKbID != nil { + return mmGetKnowledgeBaseByOwnerAndKbID.funcGetKnowledgeBaseByOwnerAndKbID(ctx, ownerUID, kbID) } - mmGetRepositoryTag.t.Fatalf("Unexpected call to RepositoryIMock.GetRepositoryTag. %v %v", ctx, r1) + mmGetKnowledgeBaseByOwnerAndKbID.t.Fatalf("Unexpected call to RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID. %v %v %v", ctx, ownerUID, kbID) return } -// GetRepositoryTagAfterCounter returns a count of finished RepositoryIMock.GetRepositoryTag invocations -func (mmGetRepositoryTag *RepositoryIMock) GetRepositoryTagAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetRepositoryTag.afterGetRepositoryTagCounter) +// GetKnowledgeBaseByOwnerAndKbIDAfterCounter returns a count of finished RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID invocations +func (mmGetKnowledgeBaseByOwnerAndKbID *RepositoryIMock) GetKnowledgeBaseByOwnerAndKbIDAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetKnowledgeBaseByOwnerAndKbID.afterGetKnowledgeBaseByOwnerAndKbIDCounter) } -// GetRepositoryTagBeforeCounter returns a count of RepositoryIMock.GetRepositoryTag invocations -func (mmGetRepositoryTag *RepositoryIMock) GetRepositoryTagBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetRepositoryTag.beforeGetRepositoryTagCounter) +// 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.GetRepositoryTag. +// 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 (mmGetRepositoryTag *mRepositoryIMockGetRepositoryTag) Calls() []*RepositoryIMockGetRepositoryTagParams { - mmGetRepositoryTag.mutex.RLock() - - argCopy := make([]*RepositoryIMockGetRepositoryTagParams, len(mmGetRepositoryTag.callArgs)) - copy(argCopy, mmGetRepositoryTag.callArgs) +func (mmGetKnowledgeBaseByOwnerAndKbID *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID) Calls() []*RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParams { + mmGetKnowledgeBaseByOwnerAndKbID.mutex.RLock() - mmGetRepositoryTag.mutex.RUnlock() + argCopy := make([]*RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDParams, len(mmGetKnowledgeBaseByOwnerAndKbID.callArgs)) + copy(argCopy, mmGetKnowledgeBaseByOwnerAndKbID.callArgs) + + mmGetKnowledgeBaseByOwnerAndKbID.mutex.RUnlock() return argCopy } -// MinimockGetRepositoryTagDone returns true if the count of the GetRepositoryTag invocations corresponds +// MinimockGetKnowledgeBaseByOwnerAndKbIDDone returns true if the count of the GetKnowledgeBaseByOwnerAndKbID invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockGetRepositoryTagDone() bool { - for _, e := range m.GetRepositoryTagMock.expectations { +func (m *RepositoryIMock) MinimockGetKnowledgeBaseByOwnerAndKbIDDone() bool { + for _, e := range m.GetKnowledgeBaseByOwnerAndKbIDMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.GetRepositoryTagMock.invocationsDone() + return m.GetKnowledgeBaseByOwnerAndKbIDMock.invocationsDone() } -// MinimockGetRepositoryTagInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockGetRepositoryTagInspect() { - for _, e := range m.GetRepositoryTagMock.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.GetRepositoryTag with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID with params: %#v", *e.params) } } - afterGetRepositoryTagCounter := mm_atomic.LoadUint64(&m.afterGetRepositoryTagCounter) + afterGetKnowledgeBaseByOwnerAndKbIDCounter := mm_atomic.LoadUint64(&m.afterGetKnowledgeBaseByOwnerAndKbIDCounter) // 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.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.GetRepositoryTag with params: %#v", *m.GetRepositoryTagMock.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.funcGetRepositoryTag != nil && afterGetRepositoryTagCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.GetRepositoryTag") + if m.funcGetKnowledgeBaseByOwnerAndKbID != nil && afterGetKnowledgeBaseByOwnerAndKbIDCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.GetKnowledgeBaseByOwnerAndKbID") } - 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.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 mRepositoryIMockGetSourceTableAndUIDByFileUIDs struct { +type mRepositoryIMockGetKnowledgeBaseCountByOwner struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockGetSourceTableAndUIDByFileUIDsExpectation - expectations []*RepositoryIMockGetSourceTableAndUIDByFileUIDsExpectation + defaultExpectation *RepositoryIMockGetKnowledgeBaseCountByOwnerExpectation + expectations []*RepositoryIMockGetKnowledgeBaseCountByOwnerExpectation - callArgs []*RepositoryIMockGetSourceTableAndUIDByFileUIDsParams + callArgs []*RepositoryIMockGetKnowledgeBaseCountByOwnerParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockGetSourceTableAndUIDByFileUIDsExpectation specifies expectation struct of the RepositoryI.GetSourceTableAndUIDByFileUIDs -type RepositoryIMockGetSourceTableAndUIDByFileUIDsExpectation struct { +// RepositoryIMockGetKnowledgeBaseCountByOwnerExpectation specifies expectation struct of the RepositoryI.GetKnowledgeBaseCountByOwner +type RepositoryIMockGetKnowledgeBaseCountByOwnerExpectation struct { mock *RepositoryIMock - params *RepositoryIMockGetSourceTableAndUIDByFileUIDsParams - paramPtrs *RepositoryIMockGetSourceTableAndUIDByFileUIDsParamPtrs - results *RepositoryIMockGetSourceTableAndUIDByFileUIDsResults + params *RepositoryIMockGetKnowledgeBaseCountByOwnerParams + paramPtrs *RepositoryIMockGetKnowledgeBaseCountByOwnerParamPtrs + results *RepositoryIMockGetKnowledgeBaseCountByOwnerResults Counter uint64 } -// RepositoryIMockGetSourceTableAndUIDByFileUIDsParams contains parameters of the RepositoryI.GetSourceTableAndUIDByFileUIDs -type RepositoryIMockGetSourceTableAndUIDByFileUIDsParams struct { - ctx context.Context - files []mm_repository.KnowledgeBaseFile +// RepositoryIMockGetKnowledgeBaseCountByOwnerParams contains parameters of the RepositoryI.GetKnowledgeBaseCountByOwner +type RepositoryIMockGetKnowledgeBaseCountByOwnerParams struct { + ctx context.Context + ownerUID string } -// RepositoryIMockGetSourceTableAndUIDByFileUIDsParamPtrs contains pointers to parameters of the RepositoryI.GetSourceTableAndUIDByFileUIDs -type RepositoryIMockGetSourceTableAndUIDByFileUIDsParamPtrs struct { - ctx *context.Context - files *[]mm_repository.KnowledgeBaseFile +// RepositoryIMockGetKnowledgeBaseCountByOwnerParamPtrs contains pointers to parameters of the RepositoryI.GetKnowledgeBaseCountByOwner +type RepositoryIMockGetKnowledgeBaseCountByOwnerParamPtrs struct { + ctx *context.Context + ownerUID *string } -// RepositoryIMockGetSourceTableAndUIDByFileUIDsResults contains results of the RepositoryI.GetSourceTableAndUIDByFileUIDs -type RepositoryIMockGetSourceTableAndUIDByFileUIDsResults struct { - m1 map[mm_repository.FileUID]struct { - SourceTable string - SourceUID uuid.UUID - } +// RepositoryIMockGetKnowledgeBaseCountByOwnerResults contains results of the RepositoryI.GetKnowledgeBaseCountByOwner +type RepositoryIMockGetKnowledgeBaseCountByOwnerResults struct { + i1 int64 err error } -// 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.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 mmGetSourceTableAndUIDByFileUIDs.defaultExpectation == nil { - mmGetSourceTableAndUIDByFileUIDs.defaultExpectation = &RepositoryIMockGetSourceTableAndUIDByFileUIDsExpectation{} + if mmGetKnowledgeBaseCountByOwner.defaultExpectation == nil { + mmGetKnowledgeBaseCountByOwner.defaultExpectation = &RepositoryIMockGetKnowledgeBaseCountByOwnerExpectation{} } - if mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.paramPtrs != nil { - mmGetSourceTableAndUIDByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetSourceTableAndUIDByFileUIDs 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") } - 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) + 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 mmGetSourceTableAndUIDByFileUIDs + return mmGetKnowledgeBaseCountByOwner } -// 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") +// 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 mmGetSourceTableAndUIDByFileUIDs.defaultExpectation == nil { - mmGetSourceTableAndUIDByFileUIDs.defaultExpectation = &RepositoryIMockGetSourceTableAndUIDByFileUIDsExpectation{} + if mmGetKnowledgeBaseCountByOwner.defaultExpectation == nil { + mmGetKnowledgeBaseCountByOwner.defaultExpectation = &RepositoryIMockGetKnowledgeBaseCountByOwnerExpectation{} } - if mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.params != nil { - mmGetSourceTableAndUIDByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetSourceTableAndUIDByFileUIDs mock is already set by Expect") + if mmGetKnowledgeBaseCountByOwner.defaultExpectation.params != nil { + mmGetKnowledgeBaseCountByOwner.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseCountByOwner mock is already set by Expect") } - if mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.paramPtrs == nil { - mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.paramPtrs = &RepositoryIMockGetSourceTableAndUIDByFileUIDsParamPtrs{} + if mmGetKnowledgeBaseCountByOwner.defaultExpectation.paramPtrs == nil { + mmGetKnowledgeBaseCountByOwner.defaultExpectation.paramPtrs = &RepositoryIMockGetKnowledgeBaseCountByOwnerParamPtrs{} } - mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.paramPtrs.ctx = &ctx + mmGetKnowledgeBaseCountByOwner.defaultExpectation.paramPtrs.ctx = &ctx - return mmGetSourceTableAndUIDByFileUIDs + return mmGetKnowledgeBaseCountByOwner } -// 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") +// 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") } - if mmGetSourceTableAndUIDByFileUIDs.defaultExpectation == nil { - mmGetSourceTableAndUIDByFileUIDs.defaultExpectation = &RepositoryIMockGetSourceTableAndUIDByFileUIDsExpectation{} + if mmGetKnowledgeBaseCountByOwner.defaultExpectation == nil { + mmGetKnowledgeBaseCountByOwner.defaultExpectation = &RepositoryIMockGetKnowledgeBaseCountByOwnerExpectation{} } - if mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.params != nil { - mmGetSourceTableAndUIDByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetSourceTableAndUIDByFileUIDs mock is already set by Expect") + if mmGetKnowledgeBaseCountByOwner.defaultExpectation.params != nil { + mmGetKnowledgeBaseCountByOwner.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseCountByOwner mock is already set by Expect") } - if mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.paramPtrs == nil { - mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.paramPtrs = &RepositoryIMockGetSourceTableAndUIDByFileUIDsParamPtrs{} + if mmGetKnowledgeBaseCountByOwner.defaultExpectation.paramPtrs == nil { + mmGetKnowledgeBaseCountByOwner.defaultExpectation.paramPtrs = &RepositoryIMockGetKnowledgeBaseCountByOwnerParamPtrs{} } - mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.paramPtrs.files = &files + mmGetKnowledgeBaseCountByOwner.defaultExpectation.paramPtrs.ownerUID = &ownerUID - return mmGetSourceTableAndUIDByFileUIDs + return mmGetKnowledgeBaseCountByOwner } -// 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.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") } - mmGetSourceTableAndUIDByFileUIDs.mock.inspectFuncGetSourceTableAndUIDByFileUIDs = f + mmGetKnowledgeBaseCountByOwner.mock.inspectFuncGetKnowledgeBaseCountByOwner = f - return mmGetSourceTableAndUIDByFileUIDs + return mmGetKnowledgeBaseCountByOwner } -// 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.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") } - if mmGetSourceTableAndUIDByFileUIDs.defaultExpectation == nil { - mmGetSourceTableAndUIDByFileUIDs.defaultExpectation = &RepositoryIMockGetSourceTableAndUIDByFileUIDsExpectation{mock: mmGetSourceTableAndUIDByFileUIDs.mock} + if mmGetKnowledgeBaseCountByOwner.defaultExpectation == nil { + mmGetKnowledgeBaseCountByOwner.defaultExpectation = &RepositoryIMockGetKnowledgeBaseCountByOwnerExpectation{mock: mmGetKnowledgeBaseCountByOwner.mock} } - mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.results = &RepositoryIMockGetSourceTableAndUIDByFileUIDsResults{m1, err} - return mmGetSourceTableAndUIDByFileUIDs.mock + mmGetKnowledgeBaseCountByOwner.defaultExpectation.results = &RepositoryIMockGetKnowledgeBaseCountByOwnerResults{i1, err} + return mmGetKnowledgeBaseCountByOwner.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.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(mmGetSourceTableAndUIDByFileUIDs.expectations) > 0 { - mmGetSourceTableAndUIDByFileUIDs.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetSourceTableAndUIDByFileUIDs method") + if len(mmGetKnowledgeBaseCountByOwner.expectations) > 0 { + mmGetKnowledgeBaseCountByOwner.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetKnowledgeBaseCountByOwner method") } - mmGetSourceTableAndUIDByFileUIDs.mock.funcGetSourceTableAndUIDByFileUIDs = f - return mmGetSourceTableAndUIDByFileUIDs.mock + mmGetKnowledgeBaseCountByOwner.mock.funcGetKnowledgeBaseCountByOwner = f + return mmGetKnowledgeBaseCountByOwner.mock } -// When sets expectation for the RepositoryI.GetSourceTableAndUIDByFileUIDs 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 (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 (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 := &RepositoryIMockGetSourceTableAndUIDByFileUIDsExpectation{ - mock: mmGetSourceTableAndUIDByFileUIDs.mock, - params: &RepositoryIMockGetSourceTableAndUIDByFileUIDsParams{ctx, files}, + expectation := &RepositoryIMockGetKnowledgeBaseCountByOwnerExpectation{ + mock: mmGetKnowledgeBaseCountByOwner.mock, + params: &RepositoryIMockGetKnowledgeBaseCountByOwnerParams{ctx, ownerUID}, } - mmGetSourceTableAndUIDByFileUIDs.expectations = append(mmGetSourceTableAndUIDByFileUIDs.expectations, expectation) + mmGetKnowledgeBaseCountByOwner.expectations = append(mmGetKnowledgeBaseCountByOwner.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.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.GetSourceTableAndUIDByFileUIDs should be invoked -func (mmGetSourceTableAndUIDByFileUIDs *mRepositoryIMockGetSourceTableAndUIDByFileUIDs) Times(n uint64) *mRepositoryIMockGetSourceTableAndUIDByFileUIDs { +// Times sets number of times RepositoryI.GetKnowledgeBaseCountByOwner should be invoked +func (mmGetKnowledgeBaseCountByOwner *mRepositoryIMockGetKnowledgeBaseCountByOwner) Times(n uint64) *mRepositoryIMockGetKnowledgeBaseCountByOwner { if n == 0 { - mmGetSourceTableAndUIDByFileUIDs.mock.t.Fatalf("Times of RepositoryIMock.GetSourceTableAndUIDByFileUIDs mock can not be zero") + mmGetKnowledgeBaseCountByOwner.mock.t.Fatalf("Times of RepositoryIMock.GetKnowledgeBaseCountByOwner mock can not be zero") } - mm_atomic.StoreUint64(&mmGetSourceTableAndUIDByFileUIDs.expectedInvocations, n) - return mmGetSourceTableAndUIDByFileUIDs + mm_atomic.StoreUint64(&mmGetKnowledgeBaseCountByOwner.expectedInvocations, n) + return mmGetKnowledgeBaseCountByOwner } -func (mmGetSourceTableAndUIDByFileUIDs *mRepositoryIMockGetSourceTableAndUIDByFileUIDs) invocationsDone() bool { - if len(mmGetSourceTableAndUIDByFileUIDs.expectations) == 0 && mmGetSourceTableAndUIDByFileUIDs.defaultExpectation == nil && mmGetSourceTableAndUIDByFileUIDs.mock.funcGetSourceTableAndUIDByFileUIDs == nil { +func (mmGetKnowledgeBaseCountByOwner *mRepositoryIMockGetKnowledgeBaseCountByOwner) invocationsDone() bool { + if len(mmGetKnowledgeBaseCountByOwner.expectations) == 0 && mmGetKnowledgeBaseCountByOwner.defaultExpectation == nil && mmGetKnowledgeBaseCountByOwner.mock.funcGetKnowledgeBaseCountByOwner == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmGetSourceTableAndUIDByFileUIDs.mock.afterGetSourceTableAndUIDByFileUIDsCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmGetSourceTableAndUIDByFileUIDs.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmGetKnowledgeBaseCountByOwner.mock.afterGetKnowledgeBaseCountByOwnerCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmGetKnowledgeBaseCountByOwner.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) +// 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 mmGetSourceTableAndUIDByFileUIDs.inspectFuncGetSourceTableAndUIDByFileUIDs != nil { - mmGetSourceTableAndUIDByFileUIDs.inspectFuncGetSourceTableAndUIDByFileUIDs(ctx, files) + if mmGetKnowledgeBaseCountByOwner.inspectFuncGetKnowledgeBaseCountByOwner != nil { + mmGetKnowledgeBaseCountByOwner.inspectFuncGetKnowledgeBaseCountByOwner(ctx, ownerUID) } - mm_params := RepositoryIMockGetSourceTableAndUIDByFileUIDsParams{ctx, files} + mm_params := RepositoryIMockGetKnowledgeBaseCountByOwnerParams{ctx, ownerUID} // Record call args - mmGetSourceTableAndUIDByFileUIDs.GetSourceTableAndUIDByFileUIDsMock.mutex.Lock() - mmGetSourceTableAndUIDByFileUIDs.GetSourceTableAndUIDByFileUIDsMock.callArgs = append(mmGetSourceTableAndUIDByFileUIDs.GetSourceTableAndUIDByFileUIDsMock.callArgs, &mm_params) - mmGetSourceTableAndUIDByFileUIDs.GetSourceTableAndUIDByFileUIDsMock.mutex.Unlock() + mmGetKnowledgeBaseCountByOwner.GetKnowledgeBaseCountByOwnerMock.mutex.Lock() + mmGetKnowledgeBaseCountByOwner.GetKnowledgeBaseCountByOwnerMock.callArgs = append(mmGetKnowledgeBaseCountByOwner.GetKnowledgeBaseCountByOwnerMock.callArgs, &mm_params) + mmGetKnowledgeBaseCountByOwner.GetKnowledgeBaseCountByOwnerMock.mutex.Unlock() - for _, e := range mmGetSourceTableAndUIDByFileUIDs.GetSourceTableAndUIDByFileUIDsMock.expectations { + for _, e := range mmGetKnowledgeBaseCountByOwner.GetKnowledgeBaseCountByOwnerMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.m1, e.results.err + return e.results.i1, e.results.err } } - 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 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 := RepositoryIMockGetSourceTableAndUIDByFileUIDsParams{ctx, files} + 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) { - 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)) + 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.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)) + 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) { - mmGetSourceTableAndUIDByFileUIDs.t.Errorf("RepositoryIMock.GetSourceTableAndUIDByFileUIDs 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 := mmGetSourceTableAndUIDByFileUIDs.GetSourceTableAndUIDByFileUIDsMock.defaultExpectation.results + mm_results := mmGetKnowledgeBaseCountByOwner.GetKnowledgeBaseCountByOwnerMock.defaultExpectation.results if mm_results == nil { - mmGetSourceTableAndUIDByFileUIDs.t.Fatal("No results are set for the RepositoryIMock.GetSourceTableAndUIDByFileUIDs") + mmGetKnowledgeBaseCountByOwner.t.Fatal("No results are set for the RepositoryIMock.GetKnowledgeBaseCountByOwner") } - return (*mm_results).m1, (*mm_results).err + return (*mm_results).i1, (*mm_results).err } - if mmGetSourceTableAndUIDByFileUIDs.funcGetSourceTableAndUIDByFileUIDs != nil { - return mmGetSourceTableAndUIDByFileUIDs.funcGetSourceTableAndUIDByFileUIDs(ctx, files) + if mmGetKnowledgeBaseCountByOwner.funcGetKnowledgeBaseCountByOwner != nil { + return mmGetKnowledgeBaseCountByOwner.funcGetKnowledgeBaseCountByOwner(ctx, ownerUID) } - mmGetSourceTableAndUIDByFileUIDs.t.Fatalf("Unexpected call to RepositoryIMock.GetSourceTableAndUIDByFileUIDs. %v %v", ctx, files) + mmGetKnowledgeBaseCountByOwner.t.Fatalf("Unexpected call to RepositoryIMock.GetKnowledgeBaseCountByOwner. %v %v", ctx, ownerUID) return } -// GetSourceTableAndUIDByFileUIDsAfterCounter returns a count of finished RepositoryIMock.GetSourceTableAndUIDByFileUIDs invocations -func (mmGetSourceTableAndUIDByFileUIDs *RepositoryIMock) GetSourceTableAndUIDByFileUIDsAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetSourceTableAndUIDByFileUIDs.afterGetSourceTableAndUIDByFileUIDsCounter) +// GetKnowledgeBaseCountByOwnerAfterCounter returns a count of finished RepositoryIMock.GetKnowledgeBaseCountByOwner invocations +func (mmGetKnowledgeBaseCountByOwner *RepositoryIMock) GetKnowledgeBaseCountByOwnerAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetKnowledgeBaseCountByOwner.afterGetKnowledgeBaseCountByOwnerCounter) } -// GetSourceTableAndUIDByFileUIDsBeforeCounter returns a count of RepositoryIMock.GetSourceTableAndUIDByFileUIDs invocations -func (mmGetSourceTableAndUIDByFileUIDs *RepositoryIMock) GetSourceTableAndUIDByFileUIDsBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetSourceTableAndUIDByFileUIDs.beforeGetSourceTableAndUIDByFileUIDsCounter) +// 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.GetSourceTableAndUIDByFileUIDs. +// 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 (mmGetSourceTableAndUIDByFileUIDs *mRepositoryIMockGetSourceTableAndUIDByFileUIDs) Calls() []*RepositoryIMockGetSourceTableAndUIDByFileUIDsParams { - mmGetSourceTableAndUIDByFileUIDs.mutex.RLock() +func (mmGetKnowledgeBaseCountByOwner *mRepositoryIMockGetKnowledgeBaseCountByOwner) Calls() []*RepositoryIMockGetKnowledgeBaseCountByOwnerParams { + mmGetKnowledgeBaseCountByOwner.mutex.RLock() - argCopy := make([]*RepositoryIMockGetSourceTableAndUIDByFileUIDsParams, len(mmGetSourceTableAndUIDByFileUIDs.callArgs)) - copy(argCopy, mmGetSourceTableAndUIDByFileUIDs.callArgs) + argCopy := make([]*RepositoryIMockGetKnowledgeBaseCountByOwnerParams, len(mmGetKnowledgeBaseCountByOwner.callArgs)) + copy(argCopy, mmGetKnowledgeBaseCountByOwner.callArgs) - mmGetSourceTableAndUIDByFileUIDs.mutex.RUnlock() + mmGetKnowledgeBaseCountByOwner.mutex.RUnlock() return argCopy } -// MinimockGetSourceTableAndUIDByFileUIDsDone returns true if the count of the GetSourceTableAndUIDByFileUIDs invocations corresponds +// MinimockGetKnowledgeBaseCountByOwnerDone returns true if the count of the GetKnowledgeBaseCountByOwner invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockGetSourceTableAndUIDByFileUIDsDone() bool { - for _, e := range m.GetSourceTableAndUIDByFileUIDsMock.expectations { +func (m *RepositoryIMock) MinimockGetKnowledgeBaseCountByOwnerDone() bool { + for _, e := range m.GetKnowledgeBaseCountByOwnerMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.GetSourceTableAndUIDByFileUIDsMock.invocationsDone() + return m.GetKnowledgeBaseCountByOwnerMock.invocationsDone() } -// MinimockGetSourceTableAndUIDByFileUIDsInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockGetSourceTableAndUIDByFileUIDsInspect() { - for _, e := range m.GetSourceTableAndUIDByFileUIDsMock.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.GetSourceTableAndUIDByFileUIDs with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.GetKnowledgeBaseCountByOwner with params: %#v", *e.params) } } - afterGetSourceTableAndUIDByFileUIDsCounter := mm_atomic.LoadUint64(&m.afterGetSourceTableAndUIDByFileUIDsCounter) + afterGetKnowledgeBaseCountByOwnerCounter := mm_atomic.LoadUint64(&m.afterGetKnowledgeBaseCountByOwnerCounter) // 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.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.GetSourceTableAndUIDByFileUIDs with params: %#v", *m.GetSourceTableAndUIDByFileUIDsMock.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.funcGetSourceTableAndUIDByFileUIDs != nil && afterGetSourceTableAndUIDByFileUIDsCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.GetSourceTableAndUIDByFileUIDs") + if m.funcGetKnowledgeBaseCountByOwner != nil && afterGetKnowledgeBaseCountByOwnerCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.GetKnowledgeBaseCountByOwner") } - 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.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 mRepositoryIMockGetTextChunksBySource struct { +type mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockGetTextChunksBySourceExpectation - expectations []*RepositoryIMockGetTextChunksBySourceExpectation + defaultExpectation *RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation + expectations []*RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation - callArgs []*RepositoryIMockGetTextChunksBySourceParams + callArgs []*RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockGetTextChunksBySourceExpectation specifies expectation struct of the RepositoryI.GetTextChunksBySource -type RepositoryIMockGetTextChunksBySourceExpectation struct { +// RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation specifies expectation struct of the RepositoryI.GetKnowledgeBaseFilesByFileUIDs +type RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation struct { mock *RepositoryIMock - params *RepositoryIMockGetTextChunksBySourceParams - paramPtrs *RepositoryIMockGetTextChunksBySourceParamPtrs - results *RepositoryIMockGetTextChunksBySourceResults + params *RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParams + paramPtrs *RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParamPtrs + results *RepositoryIMockGetKnowledgeBaseFilesByFileUIDsResults Counter uint64 } -// RepositoryIMockGetTextChunksBySourceParams contains parameters of the RepositoryI.GetTextChunksBySource -type RepositoryIMockGetTextChunksBySourceParams struct { - ctx context.Context - sourceTable string - sourceUID uuid.UUID +// RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParams contains parameters of the RepositoryI.GetKnowledgeBaseFilesByFileUIDs +type RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParams struct { + ctx context.Context + fileUIDs []uuid.UUID + columns []string } -// RepositoryIMockGetTextChunksBySourceParamPtrs contains pointers to parameters of the RepositoryI.GetTextChunksBySource -type RepositoryIMockGetTextChunksBySourceParamPtrs struct { - ctx *context.Context - sourceTable *string - sourceUID *uuid.UUID +// RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParamPtrs contains pointers to parameters of the RepositoryI.GetKnowledgeBaseFilesByFileUIDs +type RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParamPtrs struct { + ctx *context.Context + fileUIDs *[]uuid.UUID + columns *[]string } -// RepositoryIMockGetTextChunksBySourceResults contains results of the RepositoryI.GetTextChunksBySource -type RepositoryIMockGetTextChunksBySourceResults struct { - ta1 []mm_repository.TextChunk +// RepositoryIMockGetKnowledgeBaseFilesByFileUIDsResults contains results of the RepositoryI.GetKnowledgeBaseFilesByFileUIDs +type RepositoryIMockGetKnowledgeBaseFilesByFileUIDsResults struct { + ka1 []mm_repository.KnowledgeBaseFile 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.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 mmGetTextChunksBySource.defaultExpectation == nil { - mmGetTextChunksBySource.defaultExpectation = &RepositoryIMockGetTextChunksBySourceExpectation{} + if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation == nil { + mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation = &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation{} } - if mmGetTextChunksBySource.defaultExpectation.paramPtrs != nil { - mmGetTextChunksBySource.mock.t.Fatalf("RepositoryIMock.GetTextChunksBySource 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") } - 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) + 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 mmGetTextChunksBySource + return mmGetKnowledgeBaseFilesByFileUIDs } -// 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") +// 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 mmGetTextChunksBySource.defaultExpectation == nil { - mmGetTextChunksBySource.defaultExpectation = &RepositoryIMockGetTextChunksBySourceExpectation{} + if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation == nil { + mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation = &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation{} } - if mmGetTextChunksBySource.defaultExpectation.params != nil { - mmGetTextChunksBySource.mock.t.Fatalf("RepositoryIMock.GetTextChunksBySource mock is already set by Expect") + if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.params != nil { + mmGetKnowledgeBaseFilesByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs mock is already set by Expect") } - if mmGetTextChunksBySource.defaultExpectation.paramPtrs == nil { - mmGetTextChunksBySource.defaultExpectation.paramPtrs = &RepositoryIMockGetTextChunksBySourceParamPtrs{} + if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.paramPtrs == nil { + mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.paramPtrs = &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParamPtrs{} } - mmGetTextChunksBySource.defaultExpectation.paramPtrs.ctx = &ctx + mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.paramPtrs.ctx = &ctx - return mmGetTextChunksBySource + return mmGetKnowledgeBaseFilesByFileUIDs } -// 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") +// 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 mmGetTextChunksBySource.defaultExpectation == nil { - mmGetTextChunksBySource.defaultExpectation = &RepositoryIMockGetTextChunksBySourceExpectation{} + if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation == nil { + mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation = &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation{} } - if mmGetTextChunksBySource.defaultExpectation.params != nil { - mmGetTextChunksBySource.mock.t.Fatalf("RepositoryIMock.GetTextChunksBySource mock is already set by Expect") + if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.params != nil { + mmGetKnowledgeBaseFilesByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs mock is already set by Expect") } - if mmGetTextChunksBySource.defaultExpectation.paramPtrs == nil { - mmGetTextChunksBySource.defaultExpectation.paramPtrs = &RepositoryIMockGetTextChunksBySourceParamPtrs{} + if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.paramPtrs == nil { + mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.paramPtrs = &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParamPtrs{} } - mmGetTextChunksBySource.defaultExpectation.paramPtrs.sourceTable = &sourceTable + mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.paramPtrs.fileUIDs = &fileUIDs - return mmGetTextChunksBySource + return mmGetKnowledgeBaseFilesByFileUIDs } -// 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") +// 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") } - if mmGetTextChunksBySource.defaultExpectation == nil { - mmGetTextChunksBySource.defaultExpectation = &RepositoryIMockGetTextChunksBySourceExpectation{} + if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation == nil { + mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation = &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation{} } - if mmGetTextChunksBySource.defaultExpectation.params != nil { - mmGetTextChunksBySource.mock.t.Fatalf("RepositoryIMock.GetTextChunksBySource mock is already set by Expect") + if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.params != nil { + mmGetKnowledgeBaseFilesByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs mock is already set by Expect") } - if mmGetTextChunksBySource.defaultExpectation.paramPtrs == nil { - mmGetTextChunksBySource.defaultExpectation.paramPtrs = &RepositoryIMockGetTextChunksBySourceParamPtrs{} + if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.paramPtrs == nil { + mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.paramPtrs = &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParamPtrs{} } - mmGetTextChunksBySource.defaultExpectation.paramPtrs.sourceUID = &sourceUID + mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.paramPtrs.columns = &columns - return mmGetTextChunksBySource + return mmGetKnowledgeBaseFilesByFileUIDs } -// 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.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") } - mmGetTextChunksBySource.mock.inspectFuncGetTextChunksBySource = f + mmGetKnowledgeBaseFilesByFileUIDs.mock.inspectFuncGetKnowledgeBaseFilesByFileUIDs = f - return mmGetTextChunksBySource + return mmGetKnowledgeBaseFilesByFileUIDs } -// 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.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") } - if mmGetTextChunksBySource.defaultExpectation == nil { - mmGetTextChunksBySource.defaultExpectation = &RepositoryIMockGetTextChunksBySourceExpectation{mock: mmGetTextChunksBySource.mock} + if mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation == nil { + mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation = &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation{mock: mmGetKnowledgeBaseFilesByFileUIDs.mock} } - mmGetTextChunksBySource.defaultExpectation.results = &RepositoryIMockGetTextChunksBySourceResults{ta1, err} - return mmGetTextChunksBySource.mock + mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation.results = &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsResults{ka1, err} + return mmGetKnowledgeBaseFilesByFileUIDs.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.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(mmGetTextChunksBySource.expectations) > 0 { - mmGetTextChunksBySource.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetTextChunksBySource method") + if len(mmGetKnowledgeBaseFilesByFileUIDs.expectations) > 0 { + mmGetKnowledgeBaseFilesByFileUIDs.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetKnowledgeBaseFilesByFileUIDs method") } - mmGetTextChunksBySource.mock.funcGetTextChunksBySource = f - return mmGetTextChunksBySource.mock + mmGetKnowledgeBaseFilesByFileUIDs.mock.funcGetKnowledgeBaseFilesByFileUIDs = f + return mmGetKnowledgeBaseFilesByFileUIDs.mock } -// When sets expectation for the RepositoryI.GetTextChunksBySource which will trigger the result defined by the following +// When sets expectation for the RepositoryI.GetKnowledgeBaseFilesByFileUIDs 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 (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 := &RepositoryIMockGetTextChunksBySourceExpectation{ - mock: mmGetTextChunksBySource.mock, - params: &RepositoryIMockGetTextChunksBySourceParams{ctx, sourceTable, sourceUID}, + expectation := &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation{ + mock: mmGetKnowledgeBaseFilesByFileUIDs.mock, + params: &RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParams{ctx, fileUIDs, columns}, } - mmGetTextChunksBySource.expectations = append(mmGetTextChunksBySource.expectations, expectation) + mmGetKnowledgeBaseFilesByFileUIDs.expectations = append(mmGetKnowledgeBaseFilesByFileUIDs.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.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.GetTextChunksBySource should be invoked -func (mmGetTextChunksBySource *mRepositoryIMockGetTextChunksBySource) Times(n uint64) *mRepositoryIMockGetTextChunksBySource { +// Times sets number of times RepositoryI.GetKnowledgeBaseFilesByFileUIDs should be invoked +func (mmGetKnowledgeBaseFilesByFileUIDs *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs) Times(n uint64) *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs { if n == 0 { - mmGetTextChunksBySource.mock.t.Fatalf("Times of RepositoryIMock.GetTextChunksBySource mock can not be zero") + mmGetKnowledgeBaseFilesByFileUIDs.mock.t.Fatalf("Times of RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs mock can not be zero") } - mm_atomic.StoreUint64(&mmGetTextChunksBySource.expectedInvocations, n) - return mmGetTextChunksBySource + mm_atomic.StoreUint64(&mmGetKnowledgeBaseFilesByFileUIDs.expectedInvocations, n) + return mmGetKnowledgeBaseFilesByFileUIDs } -func (mmGetTextChunksBySource *mRepositoryIMockGetTextChunksBySource) invocationsDone() bool { - if len(mmGetTextChunksBySource.expectations) == 0 && mmGetTextChunksBySource.defaultExpectation == nil && mmGetTextChunksBySource.mock.funcGetTextChunksBySource == nil { +func (mmGetKnowledgeBaseFilesByFileUIDs *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs) invocationsDone() bool { + if len(mmGetKnowledgeBaseFilesByFileUIDs.expectations) == 0 && mmGetKnowledgeBaseFilesByFileUIDs.defaultExpectation == nil && mmGetKnowledgeBaseFilesByFileUIDs.mock.funcGetKnowledgeBaseFilesByFileUIDs == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmGetTextChunksBySource.mock.afterGetTextChunksBySourceCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmGetTextChunksBySource.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmGetKnowledgeBaseFilesByFileUIDs.mock.afterGetKnowledgeBaseFilesByFileUIDsCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmGetKnowledgeBaseFilesByFileUIDs.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) +// 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 mmGetTextChunksBySource.inspectFuncGetTextChunksBySource != nil { - mmGetTextChunksBySource.inspectFuncGetTextChunksBySource(ctx, sourceTable, sourceUID) + if mmGetKnowledgeBaseFilesByFileUIDs.inspectFuncGetKnowledgeBaseFilesByFileUIDs != nil { + mmGetKnowledgeBaseFilesByFileUIDs.inspectFuncGetKnowledgeBaseFilesByFileUIDs(ctx, fileUIDs, columns...) } - mm_params := RepositoryIMockGetTextChunksBySourceParams{ctx, sourceTable, sourceUID} + mm_params := RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParams{ctx, fileUIDs, columns} // Record call args - mmGetTextChunksBySource.GetTextChunksBySourceMock.mutex.Lock() - mmGetTextChunksBySource.GetTextChunksBySourceMock.callArgs = append(mmGetTextChunksBySource.GetTextChunksBySourceMock.callArgs, &mm_params) - mmGetTextChunksBySource.GetTextChunksBySourceMock.mutex.Unlock() + mmGetKnowledgeBaseFilesByFileUIDs.GetKnowledgeBaseFilesByFileUIDsMock.mutex.Lock() + mmGetKnowledgeBaseFilesByFileUIDs.GetKnowledgeBaseFilesByFileUIDsMock.callArgs = append(mmGetKnowledgeBaseFilesByFileUIDs.GetKnowledgeBaseFilesByFileUIDsMock.callArgs, &mm_params) + mmGetKnowledgeBaseFilesByFileUIDs.GetKnowledgeBaseFilesByFileUIDsMock.mutex.Unlock() - for _, e := range mmGetTextChunksBySource.GetTextChunksBySourceMock.expectations { + for _, e := range mmGetKnowledgeBaseFilesByFileUIDs.GetKnowledgeBaseFilesByFileUIDsMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.ta1, e.results.err + return e.results.ka1, 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 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 := RepositoryIMockGetTextChunksBySourceParams{ctx, sourceTable, sourceUID} + 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) { - 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)) + 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.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.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.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.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) { - mmGetTextChunksBySource.t.Errorf("RepositoryIMock.GetTextChunksBySource 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 := mmGetTextChunksBySource.GetTextChunksBySourceMock.defaultExpectation.results + mm_results := mmGetKnowledgeBaseFilesByFileUIDs.GetKnowledgeBaseFilesByFileUIDsMock.defaultExpectation.results if mm_results == nil { - mmGetTextChunksBySource.t.Fatal("No results are set for the RepositoryIMock.GetTextChunksBySource") + mmGetKnowledgeBaseFilesByFileUIDs.t.Fatal("No results are set for the RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs") } - return (*mm_results).ta1, (*mm_results).err + return (*mm_results).ka1, (*mm_results).err } - if mmGetTextChunksBySource.funcGetTextChunksBySource != nil { - return mmGetTextChunksBySource.funcGetTextChunksBySource(ctx, sourceTable, sourceUID) + if mmGetKnowledgeBaseFilesByFileUIDs.funcGetKnowledgeBaseFilesByFileUIDs != nil { + return mmGetKnowledgeBaseFilesByFileUIDs.funcGetKnowledgeBaseFilesByFileUIDs(ctx, fileUIDs, columns...) } - mmGetTextChunksBySource.t.Fatalf("Unexpected call to RepositoryIMock.GetTextChunksBySource. %v %v %v", ctx, sourceTable, sourceUID) + mmGetKnowledgeBaseFilesByFileUIDs.t.Fatalf("Unexpected call to RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs. %v %v %v", ctx, fileUIDs, columns) return } -// GetTextChunksBySourceAfterCounter returns a count of finished RepositoryIMock.GetTextChunksBySource invocations -func (mmGetTextChunksBySource *RepositoryIMock) GetTextChunksBySourceAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetTextChunksBySource.afterGetTextChunksBySourceCounter) +// GetKnowledgeBaseFilesByFileUIDsAfterCounter returns a count of finished RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs invocations +func (mmGetKnowledgeBaseFilesByFileUIDs *RepositoryIMock) GetKnowledgeBaseFilesByFileUIDsAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetKnowledgeBaseFilesByFileUIDs.afterGetKnowledgeBaseFilesByFileUIDsCounter) } -// GetTextChunksBySourceBeforeCounter returns a count of RepositoryIMock.GetTextChunksBySource invocations -func (mmGetTextChunksBySource *RepositoryIMock) GetTextChunksBySourceBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetTextChunksBySource.beforeGetTextChunksBySourceCounter) +// 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.GetTextChunksBySource. +// 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 (mmGetTextChunksBySource *mRepositoryIMockGetTextChunksBySource) Calls() []*RepositoryIMockGetTextChunksBySourceParams { - mmGetTextChunksBySource.mutex.RLock() +func (mmGetKnowledgeBaseFilesByFileUIDs *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs) Calls() []*RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParams { + mmGetKnowledgeBaseFilesByFileUIDs.mutex.RLock() - argCopy := make([]*RepositoryIMockGetTextChunksBySourceParams, len(mmGetTextChunksBySource.callArgs)) - copy(argCopy, mmGetTextChunksBySource.callArgs) + argCopy := make([]*RepositoryIMockGetKnowledgeBaseFilesByFileUIDsParams, len(mmGetKnowledgeBaseFilesByFileUIDs.callArgs)) + copy(argCopy, mmGetKnowledgeBaseFilesByFileUIDs.callArgs) - mmGetTextChunksBySource.mutex.RUnlock() + mmGetKnowledgeBaseFilesByFileUIDs.mutex.RUnlock() return argCopy } -// MinimockGetTextChunksBySourceDone returns true if the count of the GetTextChunksBySource invocations corresponds +// MinimockGetKnowledgeBaseFilesByFileUIDsDone returns true if the count of the GetKnowledgeBaseFilesByFileUIDs invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockGetTextChunksBySourceDone() bool { - for _, e := range m.GetTextChunksBySourceMock.expectations { +func (m *RepositoryIMock) MinimockGetKnowledgeBaseFilesByFileUIDsDone() bool { + for _, e := range m.GetKnowledgeBaseFilesByFileUIDsMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.GetTextChunksBySourceMock.invocationsDone() + return m.GetKnowledgeBaseFilesByFileUIDsMock.invocationsDone() } -// MinimockGetTextChunksBySourceInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockGetTextChunksBySourceInspect() { - for _, e := range m.GetTextChunksBySourceMock.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.GetTextChunksBySource with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs with params: %#v", *e.params) } } - afterGetTextChunksBySourceCounter := mm_atomic.LoadUint64(&m.afterGetTextChunksBySourceCounter) + afterGetKnowledgeBaseFilesByFileUIDsCounter := mm_atomic.LoadUint64(&m.afterGetKnowledgeBaseFilesByFileUIDsCounter) // 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.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.GetTextChunksBySource with params: %#v", *m.GetTextChunksBySourceMock.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.funcGetTextChunksBySource != nil && afterGetTextChunksBySourceCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.GetTextChunksBySource") + if m.funcGetKnowledgeBaseFilesByFileUIDs != nil && afterGetKnowledgeBaseFilesByFileUIDsCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.GetKnowledgeBaseFilesByFileUIDs") } - 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.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 mRepositoryIMockGetTotalChunksBySources struct { +type mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockGetTotalChunksBySourcesExpectation - expectations []*RepositoryIMockGetTotalChunksBySourcesExpectation + defaultExpectation *RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDExpectation + expectations []*RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDExpectation - callArgs []*RepositoryIMockGetTotalChunksBySourcesParams + callArgs []*RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockGetTotalChunksBySourcesExpectation specifies expectation struct of the RepositoryI.GetTotalChunksBySources -type RepositoryIMockGetTotalChunksBySourcesExpectation struct { +// RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDExpectation specifies expectation struct of the RepositoryI.GetKnowledgebaseFileByKbUIDAndFileID +type RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDExpectation struct { mock *RepositoryIMock - params *RepositoryIMockGetTotalChunksBySourcesParams - paramPtrs *RepositoryIMockGetTotalChunksBySourcesParamPtrs - results *RepositoryIMockGetTotalChunksBySourcesResults + params *RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDParams + paramPtrs *RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDParamPtrs + results *RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDResults 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 - } +// RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDParams contains parameters of the RepositoryI.GetKnowledgebaseFileByKbUIDAndFileID +type RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDParams struct { + ctx context.Context + kbUID uuid.UUID + fileID string } -// 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 - } +// RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDParamPtrs contains pointers to parameters of the RepositoryI.GetKnowledgebaseFileByKbUIDAndFileID +type RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDParamPtrs struct { + ctx *context.Context + kbUID *uuid.UUID + fileID *string } -// RepositoryIMockGetTotalChunksBySourcesResults contains results of the RepositoryI.GetTotalChunksBySources -type RepositoryIMockGetTotalChunksBySourcesResults struct { - m1 map[mm_repository.FileUID]int +// RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDResults contains results of the RepositoryI.GetKnowledgebaseFileByKbUIDAndFileID +type RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDResults struct { + kp1 *mm_repository.KnowledgeBaseFile 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.GetKnowledgebaseFileByKbUIDAndFileID +func (mmGetKnowledgebaseFileByKbUIDAndFileID *mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID) Expect(ctx context.Context, kbUID uuid.UUID, fileID string) *mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID { + if mmGetKnowledgebaseFileByKbUIDAndFileID.mock.funcGetKnowledgebaseFileByKbUIDAndFileID != nil { + mmGetKnowledgebaseFileByKbUIDAndFileID.mock.t.Fatalf("RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID mock is already set by Set") + } - if mmGetTotalChunksBySources.defaultExpectation == nil { - mmGetTotalChunksBySources.defaultExpectation = &RepositoryIMockGetTotalChunksBySourcesExpectation{} + if mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation == nil { + mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation = &RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDExpectation{} } - if mmGetTotalChunksBySources.defaultExpectation.paramPtrs != nil { - mmGetTotalChunksBySources.mock.t.Fatalf("RepositoryIMock.GetTotalChunksBySources mock is already set by ExpectParams functions") + if mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation.paramPtrs != nil { + mmGetKnowledgebaseFileByKbUIDAndFileID.mock.t.Fatalf("RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID 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) + mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation.params = &RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDParams{ctx, kbUID, fileID} + for _, e := range mmGetKnowledgebaseFileByKbUIDAndFileID.expectations { + if minimock.Equal(e.params, mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation.params) { + mmGetKnowledgebaseFileByKbUIDAndFileID.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation.params) } } - return mmGetTotalChunksBySources + return mmGetKnowledgebaseFileByKbUIDAndFileID } -// 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.GetKnowledgebaseFileByKbUIDAndFileID +func (mmGetKnowledgebaseFileByKbUIDAndFileID *mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID { + if mmGetKnowledgebaseFileByKbUIDAndFileID.mock.funcGetKnowledgebaseFileByKbUIDAndFileID != nil { + mmGetKnowledgebaseFileByKbUIDAndFileID.mock.t.Fatalf("RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID mock is already set by Set") } - if mmGetTotalChunksBySources.defaultExpectation == nil { - mmGetTotalChunksBySources.defaultExpectation = &RepositoryIMockGetTotalChunksBySourcesExpectation{} + if mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation == nil { + mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation = &RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDExpectation{} } - if mmGetTotalChunksBySources.defaultExpectation.params != nil { - mmGetTotalChunksBySources.mock.t.Fatalf("RepositoryIMock.GetTotalChunksBySources mock is already set by Expect") + if mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation.params != nil { + mmGetKnowledgebaseFileByKbUIDAndFileID.mock.t.Fatalf("RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID mock is already set by Expect") } - if mmGetTotalChunksBySources.defaultExpectation.paramPtrs == nil { - mmGetTotalChunksBySources.defaultExpectation.paramPtrs = &RepositoryIMockGetTotalChunksBySourcesParamPtrs{} + if mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation.paramPtrs == nil { + mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation.paramPtrs = &RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDParamPtrs{} } - mmGetTotalChunksBySources.defaultExpectation.paramPtrs.ctx = &ctx + mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation.paramPtrs.ctx = &ctx - return mmGetTotalChunksBySources + return mmGetKnowledgebaseFileByKbUIDAndFileID } -// 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") +// ExpectKbUIDParam2 sets up expected param kbUID for RepositoryI.GetKnowledgebaseFileByKbUIDAndFileID +func (mmGetKnowledgebaseFileByKbUIDAndFileID *mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID) ExpectKbUIDParam2(kbUID uuid.UUID) *mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID { + if mmGetKnowledgebaseFileByKbUIDAndFileID.mock.funcGetKnowledgebaseFileByKbUIDAndFileID != nil { + mmGetKnowledgebaseFileByKbUIDAndFileID.mock.t.Fatalf("RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID mock is already set by Set") } - if mmGetTotalChunksBySources.defaultExpectation == nil { - mmGetTotalChunksBySources.defaultExpectation = &RepositoryIMockGetTotalChunksBySourcesExpectation{} + if mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation == nil { + mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation = &RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDExpectation{} } - if mmGetTotalChunksBySources.defaultExpectation.params != nil { - mmGetTotalChunksBySources.mock.t.Fatalf("RepositoryIMock.GetTotalChunksBySources mock is already set by Expect") + if mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation.params != nil { + mmGetKnowledgebaseFileByKbUIDAndFileID.mock.t.Fatalf("RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID mock is already set by Expect") } - if mmGetTotalChunksBySources.defaultExpectation.paramPtrs == nil { - mmGetTotalChunksBySources.defaultExpectation.paramPtrs = &RepositoryIMockGetTotalChunksBySourcesParamPtrs{} + if mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation.paramPtrs == nil { + mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation.paramPtrs = &RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDParamPtrs{} } - mmGetTotalChunksBySources.defaultExpectation.paramPtrs.sources = &sources + mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation.paramPtrs.kbUID = &kbUID - return mmGetTotalChunksBySources + return mmGetKnowledgebaseFileByKbUIDAndFileID } -// 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") +// ExpectFileIDParam3 sets up expected param fileID for RepositoryI.GetKnowledgebaseFileByKbUIDAndFileID +func (mmGetKnowledgebaseFileByKbUIDAndFileID *mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID) ExpectFileIDParam3(fileID string) *mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID { + if mmGetKnowledgebaseFileByKbUIDAndFileID.mock.funcGetKnowledgebaseFileByKbUIDAndFileID != nil { + mmGetKnowledgebaseFileByKbUIDAndFileID.mock.t.Fatalf("RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID mock is already set by Set") } - mmGetTotalChunksBySources.mock.inspectFuncGetTotalChunksBySources = f + if mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation == nil { + mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation = &RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDExpectation{} + } - return mmGetTotalChunksBySources + if mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation.params != nil { + mmGetKnowledgebaseFileByKbUIDAndFileID.mock.t.Fatalf("RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID mock is already set by Expect") + } + + if mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation.paramPtrs == nil { + mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation.paramPtrs = &RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDParamPtrs{} + } + mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation.paramPtrs.fileID = &fileID + + return mmGetKnowledgebaseFileByKbUIDAndFileID } -// 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") +// Inspect accepts an inspector function that has same arguments as the RepositoryI.GetKnowledgebaseFileByKbUIDAndFileID +func (mmGetKnowledgebaseFileByKbUIDAndFileID *mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID) Inspect(f func(ctx context.Context, kbUID uuid.UUID, fileID string)) *mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID { + if mmGetKnowledgebaseFileByKbUIDAndFileID.mock.inspectFuncGetKnowledgebaseFileByKbUIDAndFileID != nil { + mmGetKnowledgebaseFileByKbUIDAndFileID.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID") } - if mmGetTotalChunksBySources.defaultExpectation == nil { - mmGetTotalChunksBySources.defaultExpectation = &RepositoryIMockGetTotalChunksBySourcesExpectation{mock: mmGetTotalChunksBySources.mock} + mmGetKnowledgebaseFileByKbUIDAndFileID.mock.inspectFuncGetKnowledgebaseFileByKbUIDAndFileID = f + + return mmGetKnowledgebaseFileByKbUIDAndFileID +} + +// Return sets up results that will be returned by RepositoryI.GetKnowledgebaseFileByKbUIDAndFileID +func (mmGetKnowledgebaseFileByKbUIDAndFileID *mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID) Return(kp1 *mm_repository.KnowledgeBaseFile, err error) *RepositoryIMock { + if mmGetKnowledgebaseFileByKbUIDAndFileID.mock.funcGetKnowledgebaseFileByKbUIDAndFileID != nil { + mmGetKnowledgebaseFileByKbUIDAndFileID.mock.t.Fatalf("RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID mock is already set by Set") } - mmGetTotalChunksBySources.defaultExpectation.results = &RepositoryIMockGetTotalChunksBySourcesResults{m1, err} - return mmGetTotalChunksBySources.mock + + if mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation == nil { + mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation = &RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDExpectation{mock: mmGetKnowledgebaseFileByKbUIDAndFileID.mock} + } + mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation.results = &RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDResults{kp1, err} + return mmGetKnowledgebaseFileByKbUIDAndFileID.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") +// Set uses given function f to mock the RepositoryI.GetKnowledgebaseFileByKbUIDAndFileID method +func (mmGetKnowledgebaseFileByKbUIDAndFileID *mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID) Set(f func(ctx context.Context, kbUID uuid.UUID, fileID string) (kp1 *mm_repository.KnowledgeBaseFile, err error)) *RepositoryIMock { + if mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation != nil { + mmGetKnowledgebaseFileByKbUIDAndFileID.mock.t.Fatalf("Default expectation is already set for the RepositoryI.GetKnowledgebaseFileByKbUIDAndFileID method") } - if len(mmGetTotalChunksBySources.expectations) > 0 { - mmGetTotalChunksBySources.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetTotalChunksBySources method") + if len(mmGetKnowledgebaseFileByKbUIDAndFileID.expectations) > 0 { + mmGetKnowledgebaseFileByKbUIDAndFileID.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetKnowledgebaseFileByKbUIDAndFileID method") } - mmGetTotalChunksBySources.mock.funcGetTotalChunksBySources = f - return mmGetTotalChunksBySources.mock + mmGetKnowledgebaseFileByKbUIDAndFileID.mock.funcGetKnowledgebaseFileByKbUIDAndFileID = f + return mmGetKnowledgebaseFileByKbUIDAndFileID.mock } -// When sets expectation for the RepositoryI.GetTotalChunksBySources which will trigger the result defined by the following +// When sets expectation for the RepositoryI.GetKnowledgebaseFileByKbUIDAndFileID 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 (mmGetKnowledgebaseFileByKbUIDAndFileID *mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID) When(ctx context.Context, kbUID uuid.UUID, fileID string) *RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDExpectation { + if mmGetKnowledgebaseFileByKbUIDAndFileID.mock.funcGetKnowledgebaseFileByKbUIDAndFileID != nil { + mmGetKnowledgebaseFileByKbUIDAndFileID.mock.t.Fatalf("RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID mock is already set by Set") } - expectation := &RepositoryIMockGetTotalChunksBySourcesExpectation{ - mock: mmGetTotalChunksBySources.mock, - params: &RepositoryIMockGetTotalChunksBySourcesParams{ctx, sources}, + expectation := &RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDExpectation{ + mock: mmGetKnowledgebaseFileByKbUIDAndFileID.mock, + params: &RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDParams{ctx, kbUID, fileID}, } - mmGetTotalChunksBySources.expectations = append(mmGetTotalChunksBySources.expectations, expectation) + mmGetKnowledgebaseFileByKbUIDAndFileID.expectations = append(mmGetKnowledgebaseFileByKbUIDAndFileID.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.GetKnowledgebaseFileByKbUIDAndFileID return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDExpectation) Then(kp1 *mm_repository.KnowledgeBaseFile, err error) *RepositoryIMock { + e.results = &RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDResults{kp1, 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.GetKnowledgebaseFileByKbUIDAndFileID should be invoked +func (mmGetKnowledgebaseFileByKbUIDAndFileID *mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID) Times(n uint64) *mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID { if n == 0 { - mmGetTotalChunksBySources.mock.t.Fatalf("Times of RepositoryIMock.GetTotalChunksBySources mock can not be zero") + mmGetKnowledgebaseFileByKbUIDAndFileID.mock.t.Fatalf("Times of RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID mock can not be zero") } - mm_atomic.StoreUint64(&mmGetTotalChunksBySources.expectedInvocations, n) - return mmGetTotalChunksBySources + mm_atomic.StoreUint64(&mmGetKnowledgebaseFileByKbUIDAndFileID.expectedInvocations, n) + return mmGetKnowledgebaseFileByKbUIDAndFileID } -func (mmGetTotalChunksBySources *mRepositoryIMockGetTotalChunksBySources) invocationsDone() bool { - if len(mmGetTotalChunksBySources.expectations) == 0 && mmGetTotalChunksBySources.defaultExpectation == nil && mmGetTotalChunksBySources.mock.funcGetTotalChunksBySources == nil { +func (mmGetKnowledgebaseFileByKbUIDAndFileID *mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID) invocationsDone() bool { + if len(mmGetKnowledgebaseFileByKbUIDAndFileID.expectations) == 0 && mmGetKnowledgebaseFileByKbUIDAndFileID.defaultExpectation == nil && mmGetKnowledgebaseFileByKbUIDAndFileID.mock.funcGetKnowledgebaseFileByKbUIDAndFileID == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmGetTotalChunksBySources.mock.afterGetTotalChunksBySourcesCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmGetTotalChunksBySources.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmGetKnowledgebaseFileByKbUIDAndFileID.mock.afterGetKnowledgebaseFileByKbUIDAndFileIDCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmGetKnowledgebaseFileByKbUIDAndFileID.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) +// GetKnowledgebaseFileByKbUIDAndFileID implements repository.RepositoryI +func (mmGetKnowledgebaseFileByKbUIDAndFileID *RepositoryIMock) GetKnowledgebaseFileByKbUIDAndFileID(ctx context.Context, kbUID uuid.UUID, fileID string) (kp1 *mm_repository.KnowledgeBaseFile, err error) { + mm_atomic.AddUint64(&mmGetKnowledgebaseFileByKbUIDAndFileID.beforeGetKnowledgebaseFileByKbUIDAndFileIDCounter, 1) + defer mm_atomic.AddUint64(&mmGetKnowledgebaseFileByKbUIDAndFileID.afterGetKnowledgebaseFileByKbUIDAndFileIDCounter, 1) - if mmGetTotalChunksBySources.inspectFuncGetTotalChunksBySources != nil { - mmGetTotalChunksBySources.inspectFuncGetTotalChunksBySources(ctx, sources) + if mmGetKnowledgebaseFileByKbUIDAndFileID.inspectFuncGetKnowledgebaseFileByKbUIDAndFileID != nil { + mmGetKnowledgebaseFileByKbUIDAndFileID.inspectFuncGetKnowledgebaseFileByKbUIDAndFileID(ctx, kbUID, fileID) } - mm_params := RepositoryIMockGetTotalChunksBySourcesParams{ctx, sources} + mm_params := RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDParams{ctx, kbUID, fileID} // Record call args - mmGetTotalChunksBySources.GetTotalChunksBySourcesMock.mutex.Lock() - mmGetTotalChunksBySources.GetTotalChunksBySourcesMock.callArgs = append(mmGetTotalChunksBySources.GetTotalChunksBySourcesMock.callArgs, &mm_params) - mmGetTotalChunksBySources.GetTotalChunksBySourcesMock.mutex.Unlock() + mmGetKnowledgebaseFileByKbUIDAndFileID.GetKnowledgebaseFileByKbUIDAndFileIDMock.mutex.Lock() + mmGetKnowledgebaseFileByKbUIDAndFileID.GetKnowledgebaseFileByKbUIDAndFileIDMock.callArgs = append(mmGetKnowledgebaseFileByKbUIDAndFileID.GetKnowledgebaseFileByKbUIDAndFileIDMock.callArgs, &mm_params) + mmGetKnowledgebaseFileByKbUIDAndFileID.GetKnowledgebaseFileByKbUIDAndFileIDMock.mutex.Unlock() - for _, e := range mmGetTotalChunksBySources.GetTotalChunksBySourcesMock.expectations { + for _, e := range mmGetKnowledgebaseFileByKbUIDAndFileID.GetKnowledgebaseFileByKbUIDAndFileIDMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.m1, e.results.err + return e.results.kp1, 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 mmGetKnowledgebaseFileByKbUIDAndFileID.GetKnowledgebaseFileByKbUIDAndFileIDMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmGetKnowledgebaseFileByKbUIDAndFileID.GetKnowledgebaseFileByKbUIDAndFileIDMock.defaultExpectation.Counter, 1) + mm_want := mmGetKnowledgebaseFileByKbUIDAndFileID.GetKnowledgebaseFileByKbUIDAndFileIDMock.defaultExpectation.params + mm_want_ptrs := mmGetKnowledgebaseFileByKbUIDAndFileID.GetKnowledgebaseFileByKbUIDAndFileIDMock.defaultExpectation.paramPtrs - mm_got := RepositoryIMockGetTotalChunksBySourcesParams{ctx, sources} + mm_got := RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDParams{ctx, kbUID, fileID} 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)) + mmGetKnowledgebaseFileByKbUIDAndFileID.t.Errorf("RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID 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.kbUID != nil && !minimock.Equal(*mm_want_ptrs.kbUID, mm_got.kbUID) { + mmGetKnowledgebaseFileByKbUIDAndFileID.t.Errorf("RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID 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.fileID != nil && !minimock.Equal(*mm_want_ptrs.fileID, mm_got.fileID) { + mmGetKnowledgebaseFileByKbUIDAndFileID.t.Errorf("RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID got unexpected parameter fileID, want: %#v, got: %#v%s\n", *mm_want_ptrs.fileID, mm_got.fileID, minimock.Diff(*mm_want_ptrs.fileID, mm_got.fileID)) } } 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)) + mmGetKnowledgebaseFileByKbUIDAndFileID.t.Errorf("RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID 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 := mmGetKnowledgebaseFileByKbUIDAndFileID.GetKnowledgebaseFileByKbUIDAndFileIDMock.defaultExpectation.results if mm_results == nil { - mmGetTotalChunksBySources.t.Fatal("No results are set for the RepositoryIMock.GetTotalChunksBySources") + mmGetKnowledgebaseFileByKbUIDAndFileID.t.Fatal("No results are set for the RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID") } - return (*mm_results).m1, (*mm_results).err + return (*mm_results).kp1, (*mm_results).err } - if mmGetTotalChunksBySources.funcGetTotalChunksBySources != nil { - return mmGetTotalChunksBySources.funcGetTotalChunksBySources(ctx, sources) + if mmGetKnowledgebaseFileByKbUIDAndFileID.funcGetKnowledgebaseFileByKbUIDAndFileID != nil { + return mmGetKnowledgebaseFileByKbUIDAndFileID.funcGetKnowledgebaseFileByKbUIDAndFileID(ctx, kbUID, fileID) } - mmGetTotalChunksBySources.t.Fatalf("Unexpected call to RepositoryIMock.GetTotalChunksBySources. %v %v", ctx, sources) + mmGetKnowledgebaseFileByKbUIDAndFileID.t.Fatalf("Unexpected call to RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID. %v %v %v", ctx, kbUID, fileID) return } -// GetTotalChunksBySourcesAfterCounter returns a count of finished RepositoryIMock.GetTotalChunksBySources invocations -func (mmGetTotalChunksBySources *RepositoryIMock) GetTotalChunksBySourcesAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetTotalChunksBySources.afterGetTotalChunksBySourcesCounter) +// GetKnowledgebaseFileByKbUIDAndFileIDAfterCounter returns a count of finished RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID invocations +func (mmGetKnowledgebaseFileByKbUIDAndFileID *RepositoryIMock) GetKnowledgebaseFileByKbUIDAndFileIDAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetKnowledgebaseFileByKbUIDAndFileID.afterGetKnowledgebaseFileByKbUIDAndFileIDCounter) } -// GetTotalChunksBySourcesBeforeCounter returns a count of RepositoryIMock.GetTotalChunksBySources invocations -func (mmGetTotalChunksBySources *RepositoryIMock) GetTotalChunksBySourcesBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetTotalChunksBySources.beforeGetTotalChunksBySourcesCounter) +// GetKnowledgebaseFileByKbUIDAndFileIDBeforeCounter returns a count of RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID invocations +func (mmGetKnowledgebaseFileByKbUIDAndFileID *RepositoryIMock) GetKnowledgebaseFileByKbUIDAndFileIDBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetKnowledgebaseFileByKbUIDAndFileID.beforeGetKnowledgebaseFileByKbUIDAndFileIDCounter) } -// 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.GetKnowledgebaseFileByKbUIDAndFileID. // 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 (mmGetKnowledgebaseFileByKbUIDAndFileID *mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID) Calls() []*RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDParams { + mmGetKnowledgebaseFileByKbUIDAndFileID.mutex.RLock() - argCopy := make([]*RepositoryIMockGetTotalChunksBySourcesParams, len(mmGetTotalChunksBySources.callArgs)) - copy(argCopy, mmGetTotalChunksBySources.callArgs) + argCopy := make([]*RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDParams, len(mmGetKnowledgebaseFileByKbUIDAndFileID.callArgs)) + copy(argCopy, mmGetKnowledgebaseFileByKbUIDAndFileID.callArgs) - mmGetTotalChunksBySources.mutex.RUnlock() + mmGetKnowledgebaseFileByKbUIDAndFileID.mutex.RUnlock() return argCopy } -// MinimockGetTotalChunksBySourcesDone returns true if the count of the GetTotalChunksBySources invocations corresponds +// MinimockGetKnowledgebaseFileByKbUIDAndFileIDDone returns true if the count of the GetKnowledgebaseFileByKbUIDAndFileID invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockGetTotalChunksBySourcesDone() bool { - for _, e := range m.GetTotalChunksBySourcesMock.expectations { +func (m *RepositoryIMock) MinimockGetKnowledgebaseFileByKbUIDAndFileIDDone() bool { + for _, e := range m.GetKnowledgebaseFileByKbUIDAndFileIDMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.GetTotalChunksBySourcesMock.invocationsDone() + return m.GetKnowledgebaseFileByKbUIDAndFileIDMock.invocationsDone() } -// MinimockGetTotalChunksBySourcesInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockGetTotalChunksBySourcesInspect() { - for _, e := range m.GetTotalChunksBySourcesMock.expectations { +// MinimockGetKnowledgebaseFileByKbUIDAndFileIDInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockGetKnowledgebaseFileByKbUIDAndFileIDInspect() { + for _, e := range m.GetKnowledgebaseFileByKbUIDAndFileIDMock.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.GetKnowledgebaseFileByKbUIDAndFileID with params: %#v", *e.params) } } - afterGetTotalChunksBySourcesCounter := mm_atomic.LoadUint64(&m.afterGetTotalChunksBySourcesCounter) + afterGetKnowledgebaseFileByKbUIDAndFileIDCounter := mm_atomic.LoadUint64(&m.afterGetKnowledgebaseFileByKbUIDAndFileIDCounter) // 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.GetKnowledgebaseFileByKbUIDAndFileIDMock.defaultExpectation != nil && afterGetKnowledgebaseFileByKbUIDAndFileIDCounter < 1 { + if m.GetKnowledgebaseFileByKbUIDAndFileIDMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID") } else { - m.t.Errorf("Expected call to RepositoryIMock.GetTotalChunksBySources with params: %#v", *m.GetTotalChunksBySourcesMock.defaultExpectation.params) + m.t.Errorf("Expected call to RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID with params: %#v", *m.GetKnowledgebaseFileByKbUIDAndFileIDMock.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.funcGetKnowledgebaseFileByKbUIDAndFileID != nil && afterGetKnowledgebaseFileByKbUIDAndFileIDCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID") } - 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.GetKnowledgebaseFileByKbUIDAndFileIDMock.invocationsDone() && afterGetKnowledgebaseFileByKbUIDAndFileIDCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.GetKnowledgebaseFileByKbUIDAndFileID but found %d calls", + mm_atomic.LoadUint64(&m.GetKnowledgebaseFileByKbUIDAndFileIDMock.expectedInvocations), afterGetKnowledgebaseFileByKbUIDAndFileIDCounter) } } -type mRepositoryIMockGetTotalTokensByListKBUIDs struct { +type mRepositoryIMockGetMessageByUID struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockGetTotalTokensByListKBUIDsExpectation - expectations []*RepositoryIMockGetTotalTokensByListKBUIDsExpectation + defaultExpectation *RepositoryIMockGetMessageByUIDExpectation + expectations []*RepositoryIMockGetMessageByUIDExpectation - callArgs []*RepositoryIMockGetTotalTokensByListKBUIDsParams + callArgs []*RepositoryIMockGetMessageByUIDParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockGetTotalTokensByListKBUIDsExpectation specifies expectation struct of the RepositoryI.GetTotalTokensByListKBUIDs -type RepositoryIMockGetTotalTokensByListKBUIDsExpectation struct { +// RepositoryIMockGetMessageByUIDExpectation specifies expectation struct of the RepositoryI.GetMessageByUID +type RepositoryIMockGetMessageByUIDExpectation struct { mock *RepositoryIMock - params *RepositoryIMockGetTotalTokensByListKBUIDsParams - paramPtrs *RepositoryIMockGetTotalTokensByListKBUIDsParamPtrs - results *RepositoryIMockGetTotalTokensByListKBUIDsResults + params *RepositoryIMockGetMessageByUIDParams + paramPtrs *RepositoryIMockGetMessageByUIDParamPtrs + results *RepositoryIMockGetMessageByUIDResults Counter uint64 } -// RepositoryIMockGetTotalTokensByListKBUIDsParams contains parameters of the RepositoryI.GetTotalTokensByListKBUIDs -type RepositoryIMockGetTotalTokensByListKBUIDsParams struct { - ctx context.Context - kbUIDs []uuid.UUID +// RepositoryIMockGetMessageByUIDParams contains parameters of the RepositoryI.GetMessageByUID +type RepositoryIMockGetMessageByUIDParams struct { + ctx context.Context + messageUID uuid.UUID } -// RepositoryIMockGetTotalTokensByListKBUIDsParamPtrs contains pointers to parameters of the RepositoryI.GetTotalTokensByListKBUIDs -type RepositoryIMockGetTotalTokensByListKBUIDsParamPtrs struct { - ctx *context.Context - kbUIDs *[]uuid.UUID +// RepositoryIMockGetMessageByUIDParamPtrs contains pointers to parameters of the RepositoryI.GetMessageByUID +type RepositoryIMockGetMessageByUIDParamPtrs struct { + ctx *context.Context + messageUID *uuid.UUID } -// RepositoryIMockGetTotalTokensByListKBUIDsResults contains results of the RepositoryI.GetTotalTokensByListKBUIDs -type RepositoryIMockGetTotalTokensByListKBUIDsResults struct { - m1 map[uuid.UUID]int +// RepositoryIMockGetMessageByUIDResults contains results of the RepositoryI.GetMessageByUID +type RepositoryIMockGetMessageByUIDResults struct { + mp1 *mm_repository.Message 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.GetMessageByUID +func (mmGetMessageByUID *mRepositoryIMockGetMessageByUID) Expect(ctx context.Context, messageUID uuid.UUID) *mRepositoryIMockGetMessageByUID { + if mmGetMessageByUID.mock.funcGetMessageByUID != nil { + mmGetMessageByUID.mock.t.Fatalf("RepositoryIMock.GetMessageByUID mock is already set by Set") } - if mmGetTotalTokensByListKBUIDs.defaultExpectation == nil { - mmGetTotalTokensByListKBUIDs.defaultExpectation = &RepositoryIMockGetTotalTokensByListKBUIDsExpectation{} + if mmGetMessageByUID.defaultExpectation == nil { + mmGetMessageByUID.defaultExpectation = &RepositoryIMockGetMessageByUIDExpectation{} } - if mmGetTotalTokensByListKBUIDs.defaultExpectation.paramPtrs != nil { - mmGetTotalTokensByListKBUIDs.mock.t.Fatalf("RepositoryIMock.GetTotalTokensByListKBUIDs mock is already set by ExpectParams functions") + if mmGetMessageByUID.defaultExpectation.paramPtrs != nil { + mmGetMessageByUID.mock.t.Fatalf("RepositoryIMock.GetMessageByUID 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) + mmGetMessageByUID.defaultExpectation.params = &RepositoryIMockGetMessageByUIDParams{ctx, messageUID} + for _, e := range mmGetMessageByUID.expectations { + if minimock.Equal(e.params, mmGetMessageByUID.defaultExpectation.params) { + mmGetMessageByUID.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGetMessageByUID.defaultExpectation.params) } } - return mmGetTotalTokensByListKBUIDs + return mmGetMessageByUID } -// 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.GetMessageByUID +func (mmGetMessageByUID *mRepositoryIMockGetMessageByUID) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockGetMessageByUID { + if mmGetMessageByUID.mock.funcGetMessageByUID != nil { + mmGetMessageByUID.mock.t.Fatalf("RepositoryIMock.GetMessageByUID mock is already set by Set") } - if mmGetTotalTokensByListKBUIDs.defaultExpectation == nil { - mmGetTotalTokensByListKBUIDs.defaultExpectation = &RepositoryIMockGetTotalTokensByListKBUIDsExpectation{} + if mmGetMessageByUID.defaultExpectation == nil { + mmGetMessageByUID.defaultExpectation = &RepositoryIMockGetMessageByUIDExpectation{} } - if mmGetTotalTokensByListKBUIDs.defaultExpectation.params != nil { - mmGetTotalTokensByListKBUIDs.mock.t.Fatalf("RepositoryIMock.GetTotalTokensByListKBUIDs mock is already set by Expect") + if mmGetMessageByUID.defaultExpectation.params != nil { + mmGetMessageByUID.mock.t.Fatalf("RepositoryIMock.GetMessageByUID mock is already set by Expect") } - if mmGetTotalTokensByListKBUIDs.defaultExpectation.paramPtrs == nil { - mmGetTotalTokensByListKBUIDs.defaultExpectation.paramPtrs = &RepositoryIMockGetTotalTokensByListKBUIDsParamPtrs{} + if mmGetMessageByUID.defaultExpectation.paramPtrs == nil { + mmGetMessageByUID.defaultExpectation.paramPtrs = &RepositoryIMockGetMessageByUIDParamPtrs{} } - mmGetTotalTokensByListKBUIDs.defaultExpectation.paramPtrs.ctx = &ctx + mmGetMessageByUID.defaultExpectation.paramPtrs.ctx = &ctx - return mmGetTotalTokensByListKBUIDs + return mmGetMessageByUID } -// 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") +// ExpectMessageUIDParam2 sets up expected param messageUID for RepositoryI.GetMessageByUID +func (mmGetMessageByUID *mRepositoryIMockGetMessageByUID) ExpectMessageUIDParam2(messageUID uuid.UUID) *mRepositoryIMockGetMessageByUID { + if mmGetMessageByUID.mock.funcGetMessageByUID != nil { + mmGetMessageByUID.mock.t.Fatalf("RepositoryIMock.GetMessageByUID mock is already set by Set") } - if mmGetTotalTokensByListKBUIDs.defaultExpectation == nil { - mmGetTotalTokensByListKBUIDs.defaultExpectation = &RepositoryIMockGetTotalTokensByListKBUIDsExpectation{} + if mmGetMessageByUID.defaultExpectation == nil { + mmGetMessageByUID.defaultExpectation = &RepositoryIMockGetMessageByUIDExpectation{} } - if mmGetTotalTokensByListKBUIDs.defaultExpectation.params != nil { - mmGetTotalTokensByListKBUIDs.mock.t.Fatalf("RepositoryIMock.GetTotalTokensByListKBUIDs mock is already set by Expect") + if mmGetMessageByUID.defaultExpectation.params != nil { + mmGetMessageByUID.mock.t.Fatalf("RepositoryIMock.GetMessageByUID mock is already set by Expect") } - if mmGetTotalTokensByListKBUIDs.defaultExpectation.paramPtrs == nil { - mmGetTotalTokensByListKBUIDs.defaultExpectation.paramPtrs = &RepositoryIMockGetTotalTokensByListKBUIDsParamPtrs{} + if mmGetMessageByUID.defaultExpectation.paramPtrs == nil { + mmGetMessageByUID.defaultExpectation.paramPtrs = &RepositoryIMockGetMessageByUIDParamPtrs{} } - mmGetTotalTokensByListKBUIDs.defaultExpectation.paramPtrs.kbUIDs = &kbUIDs + mmGetMessageByUID.defaultExpectation.paramPtrs.messageUID = &messageUID - return mmGetTotalTokensByListKBUIDs + return mmGetMessageByUID } -// 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") +// Inspect accepts an inspector function that has same arguments as the RepositoryI.GetMessageByUID +func (mmGetMessageByUID *mRepositoryIMockGetMessageByUID) Inspect(f func(ctx context.Context, messageUID uuid.UUID)) *mRepositoryIMockGetMessageByUID { + if mmGetMessageByUID.mock.inspectFuncGetMessageByUID != nil { + mmGetMessageByUID.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.GetMessageByUID") } - mmGetTotalTokensByListKBUIDs.mock.inspectFuncGetTotalTokensByListKBUIDs = f + mmGetMessageByUID.mock.inspectFuncGetMessageByUID = f - return mmGetTotalTokensByListKBUIDs + return mmGetMessageByUID } -// 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") +// Return sets up results that will be returned by RepositoryI.GetMessageByUID +func (mmGetMessageByUID *mRepositoryIMockGetMessageByUID) Return(mp1 *mm_repository.Message, err error) *RepositoryIMock { + if mmGetMessageByUID.mock.funcGetMessageByUID != nil { + mmGetMessageByUID.mock.t.Fatalf("RepositoryIMock.GetMessageByUID mock is already set by Set") } - if mmGetTotalTokensByListKBUIDs.defaultExpectation == nil { - mmGetTotalTokensByListKBUIDs.defaultExpectation = &RepositoryIMockGetTotalTokensByListKBUIDsExpectation{mock: mmGetTotalTokensByListKBUIDs.mock} + if mmGetMessageByUID.defaultExpectation == nil { + mmGetMessageByUID.defaultExpectation = &RepositoryIMockGetMessageByUIDExpectation{mock: mmGetMessageByUID.mock} } - mmGetTotalTokensByListKBUIDs.defaultExpectation.results = &RepositoryIMockGetTotalTokensByListKBUIDsResults{m1, err} - return mmGetTotalTokensByListKBUIDs.mock + mmGetMessageByUID.defaultExpectation.results = &RepositoryIMockGetMessageByUIDResults{mp1, err} + return mmGetMessageByUID.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.GetMessageByUID method +func (mmGetMessageByUID *mRepositoryIMockGetMessageByUID) Set(f func(ctx context.Context, messageUID uuid.UUID) (mp1 *mm_repository.Message, err error)) *RepositoryIMock { + if mmGetMessageByUID.defaultExpectation != nil { + mmGetMessageByUID.mock.t.Fatalf("Default expectation is already set for the RepositoryI.GetMessageByUID method") } - if len(mmGetTotalTokensByListKBUIDs.expectations) > 0 { - mmGetTotalTokensByListKBUIDs.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetTotalTokensByListKBUIDs method") + if len(mmGetMessageByUID.expectations) > 0 { + mmGetMessageByUID.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetMessageByUID method") } - mmGetTotalTokensByListKBUIDs.mock.funcGetTotalTokensByListKBUIDs = f - return mmGetTotalTokensByListKBUIDs.mock + mmGetMessageByUID.mock.funcGetMessageByUID = f + return mmGetMessageByUID.mock } -// When sets expectation for the RepositoryI.GetTotalTokensByListKBUIDs which will trigger the result defined by the following +// When sets expectation for the RepositoryI.GetMessageByUID 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 (mmGetMessageByUID *mRepositoryIMockGetMessageByUID) When(ctx context.Context, messageUID uuid.UUID) *RepositoryIMockGetMessageByUIDExpectation { + if mmGetMessageByUID.mock.funcGetMessageByUID != nil { + mmGetMessageByUID.mock.t.Fatalf("RepositoryIMock.GetMessageByUID mock is already set by Set") } - expectation := &RepositoryIMockGetTotalTokensByListKBUIDsExpectation{ - mock: mmGetTotalTokensByListKBUIDs.mock, - params: &RepositoryIMockGetTotalTokensByListKBUIDsParams{ctx, kbUIDs}, + expectation := &RepositoryIMockGetMessageByUIDExpectation{ + mock: mmGetMessageByUID.mock, + params: &RepositoryIMockGetMessageByUIDParams{ctx, messageUID}, } - mmGetTotalTokensByListKBUIDs.expectations = append(mmGetTotalTokensByListKBUIDs.expectations, expectation) + mmGetMessageByUID.expectations = append(mmGetMessageByUID.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.GetMessageByUID return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockGetMessageByUIDExpectation) Then(mp1 *mm_repository.Message, err error) *RepositoryIMock { + e.results = &RepositoryIMockGetMessageByUIDResults{mp1, 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.GetMessageByUID should be invoked +func (mmGetMessageByUID *mRepositoryIMockGetMessageByUID) Times(n uint64) *mRepositoryIMockGetMessageByUID { if n == 0 { - mmGetTotalTokensByListKBUIDs.mock.t.Fatalf("Times of RepositoryIMock.GetTotalTokensByListKBUIDs mock can not be zero") + mmGetMessageByUID.mock.t.Fatalf("Times of RepositoryIMock.GetMessageByUID mock can not be zero") } - mm_atomic.StoreUint64(&mmGetTotalTokensByListKBUIDs.expectedInvocations, n) - return mmGetTotalTokensByListKBUIDs + mm_atomic.StoreUint64(&mmGetMessageByUID.expectedInvocations, n) + return mmGetMessageByUID } -func (mmGetTotalTokensByListKBUIDs *mRepositoryIMockGetTotalTokensByListKBUIDs) invocationsDone() bool { - if len(mmGetTotalTokensByListKBUIDs.expectations) == 0 && mmGetTotalTokensByListKBUIDs.defaultExpectation == nil && mmGetTotalTokensByListKBUIDs.mock.funcGetTotalTokensByListKBUIDs == nil { +func (mmGetMessageByUID *mRepositoryIMockGetMessageByUID) invocationsDone() bool { + if len(mmGetMessageByUID.expectations) == 0 && mmGetMessageByUID.defaultExpectation == nil && mmGetMessageByUID.mock.funcGetMessageByUID == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmGetTotalTokensByListKBUIDs.mock.afterGetTotalTokensByListKBUIDsCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmGetTotalTokensByListKBUIDs.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmGetMessageByUID.mock.afterGetMessageByUIDCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmGetMessageByUID.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) +// GetMessageByUID implements repository.RepositoryI +func (mmGetMessageByUID *RepositoryIMock) GetMessageByUID(ctx context.Context, messageUID uuid.UUID) (mp1 *mm_repository.Message, err error) { + mm_atomic.AddUint64(&mmGetMessageByUID.beforeGetMessageByUIDCounter, 1) + defer mm_atomic.AddUint64(&mmGetMessageByUID.afterGetMessageByUIDCounter, 1) - if mmGetTotalTokensByListKBUIDs.inspectFuncGetTotalTokensByListKBUIDs != nil { - mmGetTotalTokensByListKBUIDs.inspectFuncGetTotalTokensByListKBUIDs(ctx, kbUIDs) + if mmGetMessageByUID.inspectFuncGetMessageByUID != nil { + mmGetMessageByUID.inspectFuncGetMessageByUID(ctx, messageUID) } - mm_params := RepositoryIMockGetTotalTokensByListKBUIDsParams{ctx, kbUIDs} + mm_params := RepositoryIMockGetMessageByUIDParams{ctx, messageUID} // Record call args - mmGetTotalTokensByListKBUIDs.GetTotalTokensByListKBUIDsMock.mutex.Lock() - mmGetTotalTokensByListKBUIDs.GetTotalTokensByListKBUIDsMock.callArgs = append(mmGetTotalTokensByListKBUIDs.GetTotalTokensByListKBUIDsMock.callArgs, &mm_params) - mmGetTotalTokensByListKBUIDs.GetTotalTokensByListKBUIDsMock.mutex.Unlock() + mmGetMessageByUID.GetMessageByUIDMock.mutex.Lock() + mmGetMessageByUID.GetMessageByUIDMock.callArgs = append(mmGetMessageByUID.GetMessageByUIDMock.callArgs, &mm_params) + mmGetMessageByUID.GetMessageByUIDMock.mutex.Unlock() - for _, e := range mmGetTotalTokensByListKBUIDs.GetTotalTokensByListKBUIDsMock.expectations { + for _, e := range mmGetMessageByUID.GetMessageByUIDMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.m1, e.results.err + return e.results.mp1, 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 mmGetMessageByUID.GetMessageByUIDMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmGetMessageByUID.GetMessageByUIDMock.defaultExpectation.Counter, 1) + mm_want := mmGetMessageByUID.GetMessageByUIDMock.defaultExpectation.params + mm_want_ptrs := mmGetMessageByUID.GetMessageByUIDMock.defaultExpectation.paramPtrs - mm_got := RepositoryIMockGetTotalTokensByListKBUIDsParams{ctx, kbUIDs} + mm_got := RepositoryIMockGetMessageByUIDParams{ctx, messageUID} 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)) + mmGetMessageByUID.t.Errorf("RepositoryIMock.GetMessageByUID 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.messageUID != nil && !minimock.Equal(*mm_want_ptrs.messageUID, mm_got.messageUID) { + mmGetMessageByUID.t.Errorf("RepositoryIMock.GetMessageByUID got unexpected parameter messageUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.messageUID, mm_got.messageUID, minimock.Diff(*mm_want_ptrs.messageUID, mm_got.messageUID)) } } 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)) + mmGetMessageByUID.t.Errorf("RepositoryIMock.GetMessageByUID 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 := mmGetMessageByUID.GetMessageByUIDMock.defaultExpectation.results if mm_results == nil { - mmGetTotalTokensByListKBUIDs.t.Fatal("No results are set for the RepositoryIMock.GetTotalTokensByListKBUIDs") + mmGetMessageByUID.t.Fatal("No results are set for the RepositoryIMock.GetMessageByUID") } - return (*mm_results).m1, (*mm_results).err + return (*mm_results).mp1, (*mm_results).err } - if mmGetTotalTokensByListKBUIDs.funcGetTotalTokensByListKBUIDs != nil { - return mmGetTotalTokensByListKBUIDs.funcGetTotalTokensByListKBUIDs(ctx, kbUIDs) + if mmGetMessageByUID.funcGetMessageByUID != nil { + return mmGetMessageByUID.funcGetMessageByUID(ctx, messageUID) } - mmGetTotalTokensByListKBUIDs.t.Fatalf("Unexpected call to RepositoryIMock.GetTotalTokensByListKBUIDs. %v %v", ctx, kbUIDs) + mmGetMessageByUID.t.Fatalf("Unexpected call to RepositoryIMock.GetMessageByUID. %v %v", ctx, messageUID) return } -// GetTotalTokensByListKBUIDsAfterCounter returns a count of finished RepositoryIMock.GetTotalTokensByListKBUIDs invocations -func (mmGetTotalTokensByListKBUIDs *RepositoryIMock) GetTotalTokensByListKBUIDsAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetTotalTokensByListKBUIDs.afterGetTotalTokensByListKBUIDsCounter) +// GetMessageByUIDAfterCounter returns a count of finished RepositoryIMock.GetMessageByUID invocations +func (mmGetMessageByUID *RepositoryIMock) GetMessageByUIDAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetMessageByUID.afterGetMessageByUIDCounter) } -// GetTotalTokensByListKBUIDsBeforeCounter returns a count of RepositoryIMock.GetTotalTokensByListKBUIDs invocations -func (mmGetTotalTokensByListKBUIDs *RepositoryIMock) GetTotalTokensByListKBUIDsBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetTotalTokensByListKBUIDs.beforeGetTotalTokensByListKBUIDsCounter) +// GetMessageByUIDBeforeCounter returns a count of RepositoryIMock.GetMessageByUID invocations +func (mmGetMessageByUID *RepositoryIMock) GetMessageByUIDBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetMessageByUID.beforeGetMessageByUIDCounter) } -// 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.GetMessageByUID. // 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 (mmGetMessageByUID *mRepositoryIMockGetMessageByUID) Calls() []*RepositoryIMockGetMessageByUIDParams { + mmGetMessageByUID.mutex.RLock() - argCopy := make([]*RepositoryIMockGetTotalTokensByListKBUIDsParams, len(mmGetTotalTokensByListKBUIDs.callArgs)) - copy(argCopy, mmGetTotalTokensByListKBUIDs.callArgs) + argCopy := make([]*RepositoryIMockGetMessageByUIDParams, len(mmGetMessageByUID.callArgs)) + copy(argCopy, mmGetMessageByUID.callArgs) - mmGetTotalTokensByListKBUIDs.mutex.RUnlock() + mmGetMessageByUID.mutex.RUnlock() return argCopy } -// MinimockGetTotalTokensByListKBUIDsDone returns true if the count of the GetTotalTokensByListKBUIDs invocations corresponds +// MinimockGetMessageByUIDDone returns true if the count of the GetMessageByUID invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockGetTotalTokensByListKBUIDsDone() bool { - for _, e := range m.GetTotalTokensByListKBUIDsMock.expectations { +func (m *RepositoryIMock) MinimockGetMessageByUIDDone() bool { + for _, e := range m.GetMessageByUIDMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.GetTotalTokensByListKBUIDsMock.invocationsDone() + return m.GetMessageByUIDMock.invocationsDone() } -// MinimockGetTotalTokensByListKBUIDsInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockGetTotalTokensByListKBUIDsInspect() { - for _, e := range m.GetTotalTokensByListKBUIDsMock.expectations { +// MinimockGetMessageByUIDInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockGetMessageByUIDInspect() { + for _, e := range m.GetMessageByUIDMock.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.GetMessageByUID with params: %#v", *e.params) } } - afterGetTotalTokensByListKBUIDsCounter := mm_atomic.LoadUint64(&m.afterGetTotalTokensByListKBUIDsCounter) + afterGetMessageByUIDCounter := mm_atomic.LoadUint64(&m.afterGetMessageByUIDCounter) // 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.GetMessageByUIDMock.defaultExpectation != nil && afterGetMessageByUIDCounter < 1 { + if m.GetMessageByUIDMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.GetMessageByUID") } else { - m.t.Errorf("Expected call to RepositoryIMock.GetTotalTokensByListKBUIDs with params: %#v", *m.GetTotalTokensByListKBUIDsMock.defaultExpectation.params) + m.t.Errorf("Expected call to RepositoryIMock.GetMessageByUID with params: %#v", *m.GetMessageByUIDMock.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.funcGetMessageByUID != nil && afterGetMessageByUIDCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.GetMessageByUID") } - 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.GetMessageByUIDMock.invocationsDone() && afterGetMessageByUIDCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.GetMessageByUID but found %d calls", + mm_atomic.LoadUint64(&m.GetMessageByUIDMock.expectedInvocations), afterGetMessageByUIDCounter) } } -type mRepositoryIMockGetTruthSourceByFileUID struct { +type mRepositoryIMockGetNeedProcessFiles struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockGetTruthSourceByFileUIDExpectation - expectations []*RepositoryIMockGetTruthSourceByFileUIDExpectation + defaultExpectation *RepositoryIMockGetNeedProcessFilesExpectation + expectations []*RepositoryIMockGetNeedProcessFilesExpectation - callArgs []*RepositoryIMockGetTruthSourceByFileUIDParams + callArgs []*RepositoryIMockGetNeedProcessFilesParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockGetTruthSourceByFileUIDExpectation specifies expectation struct of the RepositoryI.GetTruthSourceByFileUID -type RepositoryIMockGetTruthSourceByFileUIDExpectation struct { +// RepositoryIMockGetNeedProcessFilesExpectation specifies expectation struct of the RepositoryI.GetNeedProcessFiles +type RepositoryIMockGetNeedProcessFilesExpectation struct { mock *RepositoryIMock - params *RepositoryIMockGetTruthSourceByFileUIDParams - paramPtrs *RepositoryIMockGetTruthSourceByFileUIDParamPtrs - results *RepositoryIMockGetTruthSourceByFileUIDResults + params *RepositoryIMockGetNeedProcessFilesParams + paramPtrs *RepositoryIMockGetNeedProcessFilesParamPtrs + results *RepositoryIMockGetNeedProcessFilesResults Counter uint64 } -// RepositoryIMockGetTruthSourceByFileUIDParams contains parameters of the RepositoryI.GetTruthSourceByFileUID -type RepositoryIMockGetTruthSourceByFileUIDParams struct { - ctx context.Context - fileUID uuid.UUID +// RepositoryIMockGetNeedProcessFilesParams contains parameters of the RepositoryI.GetNeedProcessFiles +type RepositoryIMockGetNeedProcessFilesParams struct { + ctx context.Context } -// RepositoryIMockGetTruthSourceByFileUIDParamPtrs contains pointers to parameters of the RepositoryI.GetTruthSourceByFileUID -type RepositoryIMockGetTruthSourceByFileUIDParamPtrs struct { - ctx *context.Context - fileUID *uuid.UUID +// RepositoryIMockGetNeedProcessFilesParamPtrs contains pointers to parameters of the RepositoryI.GetNeedProcessFiles +type RepositoryIMockGetNeedProcessFilesParamPtrs struct { + ctx *context.Context } -// RepositoryIMockGetTruthSourceByFileUIDResults contains results of the RepositoryI.GetTruthSourceByFileUID -type RepositoryIMockGetTruthSourceByFileUIDResults struct { - sp1 *mm_repository.SourceMeta - err error +// RepositoryIMockGetNeedProcessFilesResults contains results of the RepositoryI.GetNeedProcessFiles +type RepositoryIMockGetNeedProcessFilesResults struct { + ka1 []mm_repository.KnowledgeBaseFile } -// 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") +// 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 mmGetTruthSourceByFileUID.defaultExpectation == nil { - mmGetTruthSourceByFileUID.defaultExpectation = &RepositoryIMockGetTruthSourceByFileUIDExpectation{} + if mmGetNeedProcessFiles.defaultExpectation == nil { + mmGetNeedProcessFiles.defaultExpectation = &RepositoryIMockGetNeedProcessFilesExpectation{} } - if mmGetTruthSourceByFileUID.defaultExpectation.params != nil { - mmGetTruthSourceByFileUID.mock.t.Fatalf("RepositoryIMock.GetTruthSourceByFileUID mock is already set by Expect") + if mmGetNeedProcessFiles.defaultExpectation.paramPtrs != nil { + mmGetNeedProcessFiles.mock.t.Fatalf("RepositoryIMock.GetNeedProcessFiles mock is already set by ExpectParams functions") } - if mmGetTruthSourceByFileUID.defaultExpectation.paramPtrs == nil { - mmGetTruthSourceByFileUID.defaultExpectation.paramPtrs = &RepositoryIMockGetTruthSourceByFileUIDParamPtrs{} + 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) + } } - mmGetTruthSourceByFileUID.defaultExpectation.paramPtrs.ctx = &ctx - return mmGetTruthSourceByFileUID + return mmGetNeedProcessFiles } -// 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") +// 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 mmGetTruthSourceByFileUID.defaultExpectation == nil { - mmGetTruthSourceByFileUID.defaultExpectation = &RepositoryIMockGetTruthSourceByFileUIDExpectation{} + if mmGetNeedProcessFiles.defaultExpectation == nil { + mmGetNeedProcessFiles.defaultExpectation = &RepositoryIMockGetNeedProcessFilesExpectation{} } - if mmGetTruthSourceByFileUID.defaultExpectation.params != nil { - mmGetTruthSourceByFileUID.mock.t.Fatalf("RepositoryIMock.GetTruthSourceByFileUID mock is already set by Expect") + if mmGetNeedProcessFiles.defaultExpectation.params != nil { + mmGetNeedProcessFiles.mock.t.Fatalf("RepositoryIMock.GetNeedProcessFiles mock is already set by Expect") } - if mmGetTruthSourceByFileUID.defaultExpectation.paramPtrs == nil { - mmGetTruthSourceByFileUID.defaultExpectation.paramPtrs = &RepositoryIMockGetTruthSourceByFileUIDParamPtrs{} + if mmGetNeedProcessFiles.defaultExpectation.paramPtrs == nil { + mmGetNeedProcessFiles.defaultExpectation.paramPtrs = &RepositoryIMockGetNeedProcessFilesParamPtrs{} } - mmGetTruthSourceByFileUID.defaultExpectation.paramPtrs.fileUID = &fileUID + mmGetNeedProcessFiles.defaultExpectation.paramPtrs.ctx = &ctx - return mmGetTruthSourceByFileUID + return mmGetNeedProcessFiles } -// 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.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") } - mmGetTruthSourceByFileUID.mock.inspectFuncGetTruthSourceByFileUID = f + mmGetNeedProcessFiles.mock.inspectFuncGetNeedProcessFiles = f - return mmGetTruthSourceByFileUID + return mmGetNeedProcessFiles } -// 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.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 mmGetTruthSourceByFileUID.defaultExpectation == nil { - mmGetTruthSourceByFileUID.defaultExpectation = &RepositoryIMockGetTruthSourceByFileUIDExpectation{mock: mmGetTruthSourceByFileUID.mock} + if mmGetNeedProcessFiles.defaultExpectation == nil { + mmGetNeedProcessFiles.defaultExpectation = &RepositoryIMockGetNeedProcessFilesExpectation{mock: mmGetNeedProcessFiles.mock} } - mmGetTruthSourceByFileUID.defaultExpectation.results = &RepositoryIMockGetTruthSourceByFileUIDResults{sp1, err} - return mmGetTruthSourceByFileUID.mock + mmGetNeedProcessFiles.defaultExpectation.results = &RepositoryIMockGetNeedProcessFilesResults{ka1} + return mmGetNeedProcessFiles.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.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(mmGetTruthSourceByFileUID.expectations) > 0 { - mmGetTruthSourceByFileUID.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetTruthSourceByFileUID method") + if len(mmGetNeedProcessFiles.expectations) > 0 { + mmGetNeedProcessFiles.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetNeedProcessFiles method") } - mmGetTruthSourceByFileUID.mock.funcGetTruthSourceByFileUID = f - return mmGetTruthSourceByFileUID.mock + mmGetNeedProcessFiles.mock.funcGetNeedProcessFiles = f + return mmGetNeedProcessFiles.mock } -// When sets expectation for the RepositoryI.GetTruthSourceByFileUID 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 (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 (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 := &RepositoryIMockGetTruthSourceByFileUIDExpectation{ - mock: mmGetTruthSourceByFileUID.mock, - params: &RepositoryIMockGetTruthSourceByFileUIDParams{ctx, fileUID}, + expectation := &RepositoryIMockGetNeedProcessFilesExpectation{ + mock: mmGetNeedProcessFiles.mock, + params: &RepositoryIMockGetNeedProcessFilesParams{ctx}, } - mmGetTruthSourceByFileUID.expectations = append(mmGetTruthSourceByFileUID.expectations, expectation) + mmGetNeedProcessFiles.expectations = append(mmGetNeedProcessFiles.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} +// 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.GetTruthSourceByFileUID should be invoked -func (mmGetTruthSourceByFileUID *mRepositoryIMockGetTruthSourceByFileUID) Times(n uint64) *mRepositoryIMockGetTruthSourceByFileUID { +// Times sets number of times RepositoryI.GetNeedProcessFiles should be invoked +func (mmGetNeedProcessFiles *mRepositoryIMockGetNeedProcessFiles) Times(n uint64) *mRepositoryIMockGetNeedProcessFiles { if n == 0 { - mmGetTruthSourceByFileUID.mock.t.Fatalf("Times of RepositoryIMock.GetTruthSourceByFileUID mock can not be zero") + mmGetNeedProcessFiles.mock.t.Fatalf("Times of RepositoryIMock.GetNeedProcessFiles mock can not be zero") } - mm_atomic.StoreUint64(&mmGetTruthSourceByFileUID.expectedInvocations, n) - return mmGetTruthSourceByFileUID + mm_atomic.StoreUint64(&mmGetNeedProcessFiles.expectedInvocations, n) + return mmGetNeedProcessFiles } -func (mmGetTruthSourceByFileUID *mRepositoryIMockGetTruthSourceByFileUID) invocationsDone() bool { - if len(mmGetTruthSourceByFileUID.expectations) == 0 && mmGetTruthSourceByFileUID.defaultExpectation == nil && mmGetTruthSourceByFileUID.mock.funcGetTruthSourceByFileUID == nil { +func (mmGetNeedProcessFiles *mRepositoryIMockGetNeedProcessFiles) invocationsDone() bool { + if len(mmGetNeedProcessFiles.expectations) == 0 && mmGetNeedProcessFiles.defaultExpectation == nil && mmGetNeedProcessFiles.mock.funcGetNeedProcessFiles == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmGetTruthSourceByFileUID.mock.afterGetTruthSourceByFileUIDCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmGetTruthSourceByFileUID.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmGetNeedProcessFiles.mock.afterGetNeedProcessFilesCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmGetNeedProcessFiles.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) +// 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 mmGetTruthSourceByFileUID.inspectFuncGetTruthSourceByFileUID != nil { - mmGetTruthSourceByFileUID.inspectFuncGetTruthSourceByFileUID(ctx, fileUID) + if mmGetNeedProcessFiles.inspectFuncGetNeedProcessFiles != nil { + mmGetNeedProcessFiles.inspectFuncGetNeedProcessFiles(ctx) } - mm_params := RepositoryIMockGetTruthSourceByFileUIDParams{ctx, fileUID} + mm_params := RepositoryIMockGetNeedProcessFilesParams{ctx} // Record call args - mmGetTruthSourceByFileUID.GetTruthSourceByFileUIDMock.mutex.Lock() - mmGetTruthSourceByFileUID.GetTruthSourceByFileUIDMock.callArgs = append(mmGetTruthSourceByFileUID.GetTruthSourceByFileUIDMock.callArgs, &mm_params) - mmGetTruthSourceByFileUID.GetTruthSourceByFileUIDMock.mutex.Unlock() + mmGetNeedProcessFiles.GetNeedProcessFilesMock.mutex.Lock() + mmGetNeedProcessFiles.GetNeedProcessFilesMock.callArgs = append(mmGetNeedProcessFiles.GetNeedProcessFilesMock.callArgs, &mm_params) + mmGetNeedProcessFiles.GetNeedProcessFilesMock.mutex.Unlock() - for _, e := range mmGetTruthSourceByFileUID.GetTruthSourceByFileUIDMock.expectations { + for _, e := range mmGetNeedProcessFiles.GetNeedProcessFilesMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.sp1, e.results.err + return e.results.ka1 } } - 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 + 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 := RepositoryIMockGetTruthSourceByFileUIDParams{ctx, fileUID} + mm_got := RepositoryIMockGetNeedProcessFilesParams{ctx} 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)) + 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) { - mmGetTruthSourceByFileUID.t.Errorf("RepositoryIMock.GetTruthSourceByFileUID 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 := mmGetTruthSourceByFileUID.GetTruthSourceByFileUIDMock.defaultExpectation.results + mm_results := mmGetNeedProcessFiles.GetNeedProcessFilesMock.defaultExpectation.results if mm_results == nil { - mmGetTruthSourceByFileUID.t.Fatal("No results are set for the RepositoryIMock.GetTruthSourceByFileUID") + mmGetNeedProcessFiles.t.Fatal("No results are set for the RepositoryIMock.GetNeedProcessFiles") } - return (*mm_results).sp1, (*mm_results).err + return (*mm_results).ka1 } - if mmGetTruthSourceByFileUID.funcGetTruthSourceByFileUID != nil { - return mmGetTruthSourceByFileUID.funcGetTruthSourceByFileUID(ctx, fileUID) + if mmGetNeedProcessFiles.funcGetNeedProcessFiles != nil { + return mmGetNeedProcessFiles.funcGetNeedProcessFiles(ctx) } - mmGetTruthSourceByFileUID.t.Fatalf("Unexpected call to RepositoryIMock.GetTruthSourceByFileUID. %v %v", ctx, fileUID) + mmGetNeedProcessFiles.t.Fatalf("Unexpected call to RepositoryIMock.GetNeedProcessFiles. %v", ctx) return } -// GetTruthSourceByFileUIDAfterCounter returns a count of finished RepositoryIMock.GetTruthSourceByFileUID invocations -func (mmGetTruthSourceByFileUID *RepositoryIMock) GetTruthSourceByFileUIDAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetTruthSourceByFileUID.afterGetTruthSourceByFileUIDCounter) +// GetNeedProcessFilesAfterCounter returns a count of finished RepositoryIMock.GetNeedProcessFiles invocations +func (mmGetNeedProcessFiles *RepositoryIMock) GetNeedProcessFilesAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetNeedProcessFiles.afterGetNeedProcessFilesCounter) } -// GetTruthSourceByFileUIDBeforeCounter returns a count of RepositoryIMock.GetTruthSourceByFileUID invocations -func (mmGetTruthSourceByFileUID *RepositoryIMock) GetTruthSourceByFileUIDBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmGetTruthSourceByFileUID.beforeGetTruthSourceByFileUIDCounter) +// 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.GetTruthSourceByFileUID. +// 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 (mmGetTruthSourceByFileUID *mRepositoryIMockGetTruthSourceByFileUID) Calls() []*RepositoryIMockGetTruthSourceByFileUIDParams { - mmGetTruthSourceByFileUID.mutex.RLock() +func (mmGetNeedProcessFiles *mRepositoryIMockGetNeedProcessFiles) Calls() []*RepositoryIMockGetNeedProcessFilesParams { + mmGetNeedProcessFiles.mutex.RLock() - argCopy := make([]*RepositoryIMockGetTruthSourceByFileUIDParams, len(mmGetTruthSourceByFileUID.callArgs)) - copy(argCopy, mmGetTruthSourceByFileUID.callArgs) + argCopy := make([]*RepositoryIMockGetNeedProcessFilesParams, len(mmGetNeedProcessFiles.callArgs)) + copy(argCopy, mmGetNeedProcessFiles.callArgs) - mmGetTruthSourceByFileUID.mutex.RUnlock() + mmGetNeedProcessFiles.mutex.RUnlock() return argCopy } -// MinimockGetTruthSourceByFileUIDDone returns true if the count of the GetTruthSourceByFileUID invocations corresponds +// MinimockGetNeedProcessFilesDone returns true if the count of the GetNeedProcessFiles invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockGetTruthSourceByFileUIDDone() bool { - for _, e := range m.GetTruthSourceByFileUIDMock.expectations { +func (m *RepositoryIMock) MinimockGetNeedProcessFilesDone() bool { + for _, e := range m.GetNeedProcessFilesMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.GetTruthSourceByFileUIDMock.invocationsDone() + return m.GetNeedProcessFilesMock.invocationsDone() } -// MinimockGetTruthSourceByFileUIDInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockGetTruthSourceByFileUIDInspect() { - for _, e := range m.GetTruthSourceByFileUIDMock.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.GetTruthSourceByFileUID with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.GetNeedProcessFiles with params: %#v", *e.params) } } - afterGetTruthSourceByFileUIDCounter := mm_atomic.LoadUint64(&m.afterGetTruthSourceByFileUIDCounter) + afterGetNeedProcessFilesCounter := mm_atomic.LoadUint64(&m.afterGetNeedProcessFilesCounter) // 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") + 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.GetTruthSourceByFileUID with params: %#v", *m.GetTruthSourceByFileUIDMock.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.funcGetTruthSourceByFileUID != nil && afterGetTruthSourceByFileUIDCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.GetTruthSourceByFileUID") + if m.funcGetNeedProcessFiles != nil && afterGetNeedProcessFilesCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.GetNeedProcessFiles") } - 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.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 mRepositoryIMockHardDeleteChunksByKbFileUID struct { +type mRepositoryIMockGetRepositoryTag struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockHardDeleteChunksByKbFileUIDExpectation - expectations []*RepositoryIMockHardDeleteChunksByKbFileUIDExpectation + defaultExpectation *RepositoryIMockGetRepositoryTagExpectation + expectations []*RepositoryIMockGetRepositoryTagExpectation - callArgs []*RepositoryIMockHardDeleteChunksByKbFileUIDParams + callArgs []*RepositoryIMockGetRepositoryTagParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockHardDeleteChunksByKbFileUIDExpectation specifies expectation struct of the RepositoryI.HardDeleteChunksByKbFileUID -type RepositoryIMockHardDeleteChunksByKbFileUIDExpectation struct { +// RepositoryIMockGetRepositoryTagExpectation specifies expectation struct of the RepositoryI.GetRepositoryTag +type RepositoryIMockGetRepositoryTagExpectation struct { mock *RepositoryIMock - params *RepositoryIMockHardDeleteChunksByKbFileUIDParams - paramPtrs *RepositoryIMockHardDeleteChunksByKbFileUIDParamPtrs - results *RepositoryIMockHardDeleteChunksByKbFileUIDResults + params *RepositoryIMockGetRepositoryTagParams + paramPtrs *RepositoryIMockGetRepositoryTagParamPtrs + results *RepositoryIMockGetRepositoryTagResults Counter uint64 } -// RepositoryIMockHardDeleteChunksByKbFileUIDParams contains parameters of the RepositoryI.HardDeleteChunksByKbFileUID -type RepositoryIMockHardDeleteChunksByKbFileUIDParams struct { - ctx context.Context - kbFileUID uuid.UUID +// RepositoryIMockGetRepositoryTagParams contains parameters of the RepositoryI.GetRepositoryTag +type RepositoryIMockGetRepositoryTagParams struct { + ctx context.Context + r1 utils.RepositoryTagName } -// RepositoryIMockHardDeleteChunksByKbFileUIDParamPtrs contains pointers to parameters of the RepositoryI.HardDeleteChunksByKbFileUID -type RepositoryIMockHardDeleteChunksByKbFileUIDParamPtrs struct { - ctx *context.Context - kbFileUID *uuid.UUID +// RepositoryIMockGetRepositoryTagParamPtrs contains pointers to parameters of the RepositoryI.GetRepositoryTag +type RepositoryIMockGetRepositoryTagParamPtrs struct { + ctx *context.Context + r1 *utils.RepositoryTagName } -// RepositoryIMockHardDeleteChunksByKbFileUIDResults contains results of the RepositoryI.HardDeleteChunksByKbFileUID -type RepositoryIMockHardDeleteChunksByKbFileUIDResults struct { +// RepositoryIMockGetRepositoryTagResults contains results of the RepositoryI.GetRepositoryTag +type RepositoryIMockGetRepositoryTagResults struct { + rp1 *pb.RepositoryTag 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") +// 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 mmHardDeleteChunksByKbFileUID.defaultExpectation == nil { - mmHardDeleteChunksByKbFileUID.defaultExpectation = &RepositoryIMockHardDeleteChunksByKbFileUIDExpectation{} + if mmGetRepositoryTag.defaultExpectation == nil { + mmGetRepositoryTag.defaultExpectation = &RepositoryIMockGetRepositoryTagExpectation{} } - if mmHardDeleteChunksByKbFileUID.defaultExpectation.paramPtrs != nil { - mmHardDeleteChunksByKbFileUID.mock.t.Fatalf("RepositoryIMock.HardDeleteChunksByKbFileUID 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") } - 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) + 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 mmHardDeleteChunksByKbFileUID + return mmGetRepositoryTag } -// 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") +// 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 mmHardDeleteChunksByKbFileUID.defaultExpectation == nil { - mmHardDeleteChunksByKbFileUID.defaultExpectation = &RepositoryIMockHardDeleteChunksByKbFileUIDExpectation{} + if mmGetRepositoryTag.defaultExpectation == nil { + mmGetRepositoryTag.defaultExpectation = &RepositoryIMockGetRepositoryTagExpectation{} } - if mmHardDeleteChunksByKbFileUID.defaultExpectation.params != nil { - mmHardDeleteChunksByKbFileUID.mock.t.Fatalf("RepositoryIMock.HardDeleteChunksByKbFileUID mock is already set by Expect") + if mmGetRepositoryTag.defaultExpectation.params != nil { + mmGetRepositoryTag.mock.t.Fatalf("RepositoryIMock.GetRepositoryTag mock is already set by Expect") } - if mmHardDeleteChunksByKbFileUID.defaultExpectation.paramPtrs == nil { - mmHardDeleteChunksByKbFileUID.defaultExpectation.paramPtrs = &RepositoryIMockHardDeleteChunksByKbFileUIDParamPtrs{} + if mmGetRepositoryTag.defaultExpectation.paramPtrs == nil { + mmGetRepositoryTag.defaultExpectation.paramPtrs = &RepositoryIMockGetRepositoryTagParamPtrs{} } - mmHardDeleteChunksByKbFileUID.defaultExpectation.paramPtrs.ctx = &ctx + mmGetRepositoryTag.defaultExpectation.paramPtrs.ctx = &ctx - return mmHardDeleteChunksByKbFileUID + return mmGetRepositoryTag } -// 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") +// 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 mmHardDeleteChunksByKbFileUID.defaultExpectation == nil { - mmHardDeleteChunksByKbFileUID.defaultExpectation = &RepositoryIMockHardDeleteChunksByKbFileUIDExpectation{} + if mmGetRepositoryTag.defaultExpectation == nil { + mmGetRepositoryTag.defaultExpectation = &RepositoryIMockGetRepositoryTagExpectation{} } - if mmHardDeleteChunksByKbFileUID.defaultExpectation.params != nil { - mmHardDeleteChunksByKbFileUID.mock.t.Fatalf("RepositoryIMock.HardDeleteChunksByKbFileUID mock is already set by Expect") + if mmGetRepositoryTag.defaultExpectation.params != nil { + mmGetRepositoryTag.mock.t.Fatalf("RepositoryIMock.GetRepositoryTag mock is already set by Expect") } - if mmHardDeleteChunksByKbFileUID.defaultExpectation.paramPtrs == nil { - mmHardDeleteChunksByKbFileUID.defaultExpectation.paramPtrs = &RepositoryIMockHardDeleteChunksByKbFileUIDParamPtrs{} + if mmGetRepositoryTag.defaultExpectation.paramPtrs == nil { + mmGetRepositoryTag.defaultExpectation.paramPtrs = &RepositoryIMockGetRepositoryTagParamPtrs{} } - mmHardDeleteChunksByKbFileUID.defaultExpectation.paramPtrs.kbFileUID = &kbFileUID + mmGetRepositoryTag.defaultExpectation.paramPtrs.r1 = &r1 - return mmHardDeleteChunksByKbFileUID + return mmGetRepositoryTag } -// 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") +// 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") } - mmHardDeleteChunksByKbFileUID.mock.inspectFuncHardDeleteChunksByKbFileUID = f + mmGetRepositoryTag.mock.inspectFuncGetRepositoryTag = f - return mmHardDeleteChunksByKbFileUID + return mmGetRepositoryTag } -// 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") +// 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 mmHardDeleteChunksByKbFileUID.defaultExpectation == nil { - mmHardDeleteChunksByKbFileUID.defaultExpectation = &RepositoryIMockHardDeleteChunksByKbFileUIDExpectation{mock: mmHardDeleteChunksByKbFileUID.mock} + if mmGetRepositoryTag.defaultExpectation == nil { + mmGetRepositoryTag.defaultExpectation = &RepositoryIMockGetRepositoryTagExpectation{mock: mmGetRepositoryTag.mock} } - mmHardDeleteChunksByKbFileUID.defaultExpectation.results = &RepositoryIMockHardDeleteChunksByKbFileUIDResults{err} - return mmHardDeleteChunksByKbFileUID.mock + mmGetRepositoryTag.defaultExpectation.results = &RepositoryIMockGetRepositoryTagResults{rp1, err} + return mmGetRepositoryTag.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") +// 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(mmHardDeleteChunksByKbFileUID.expectations) > 0 { - mmHardDeleteChunksByKbFileUID.mock.t.Fatalf("Some expectations are already set for the RepositoryI.HardDeleteChunksByKbFileUID method") + if len(mmGetRepositoryTag.expectations) > 0 { + mmGetRepositoryTag.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetRepositoryTag method") } - mmHardDeleteChunksByKbFileUID.mock.funcHardDeleteChunksByKbFileUID = f - return mmHardDeleteChunksByKbFileUID.mock + mmGetRepositoryTag.mock.funcGetRepositoryTag = f + return mmGetRepositoryTag.mock } -// When sets expectation for the RepositoryI.HardDeleteChunksByKbFileUID 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 (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") +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 := &RepositoryIMockHardDeleteChunksByKbFileUIDExpectation{ - mock: mmHardDeleteChunksByKbFileUID.mock, - params: &RepositoryIMockHardDeleteChunksByKbFileUIDParams{ctx, kbFileUID}, + expectation := &RepositoryIMockGetRepositoryTagExpectation{ + mock: mmGetRepositoryTag.mock, + params: &RepositoryIMockGetRepositoryTagParams{ctx, r1}, } - mmHardDeleteChunksByKbFileUID.expectations = append(mmHardDeleteChunksByKbFileUID.expectations, expectation) + mmGetRepositoryTag.expectations = append(mmGetRepositoryTag.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} +// 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.HardDeleteChunksByKbFileUID should be invoked -func (mmHardDeleteChunksByKbFileUID *mRepositoryIMockHardDeleteChunksByKbFileUID) Times(n uint64) *mRepositoryIMockHardDeleteChunksByKbFileUID { +// Times sets number of times RepositoryI.GetRepositoryTag should be invoked +func (mmGetRepositoryTag *mRepositoryIMockGetRepositoryTag) Times(n uint64) *mRepositoryIMockGetRepositoryTag { if n == 0 { - mmHardDeleteChunksByKbFileUID.mock.t.Fatalf("Times of RepositoryIMock.HardDeleteChunksByKbFileUID mock can not be zero") + mmGetRepositoryTag.mock.t.Fatalf("Times of RepositoryIMock.GetRepositoryTag mock can not be zero") } - mm_atomic.StoreUint64(&mmHardDeleteChunksByKbFileUID.expectedInvocations, n) - return mmHardDeleteChunksByKbFileUID + mm_atomic.StoreUint64(&mmGetRepositoryTag.expectedInvocations, n) + return mmGetRepositoryTag } -func (mmHardDeleteChunksByKbFileUID *mRepositoryIMockHardDeleteChunksByKbFileUID) invocationsDone() bool { - if len(mmHardDeleteChunksByKbFileUID.expectations) == 0 && mmHardDeleteChunksByKbFileUID.defaultExpectation == nil && mmHardDeleteChunksByKbFileUID.mock.funcHardDeleteChunksByKbFileUID == nil { +func (mmGetRepositoryTag *mRepositoryIMockGetRepositoryTag) invocationsDone() bool { + if len(mmGetRepositoryTag.expectations) == 0 && mmGetRepositoryTag.defaultExpectation == nil && mmGetRepositoryTag.mock.funcGetRepositoryTag == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmHardDeleteChunksByKbFileUID.mock.afterHardDeleteChunksByKbFileUIDCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmHardDeleteChunksByKbFileUID.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmGetRepositoryTag.mock.afterGetRepositoryTagCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmGetRepositoryTag.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) +// 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 mmHardDeleteChunksByKbFileUID.inspectFuncHardDeleteChunksByKbFileUID != nil { - mmHardDeleteChunksByKbFileUID.inspectFuncHardDeleteChunksByKbFileUID(ctx, kbFileUID) + if mmGetRepositoryTag.inspectFuncGetRepositoryTag != nil { + mmGetRepositoryTag.inspectFuncGetRepositoryTag(ctx, r1) } - mm_params := RepositoryIMockHardDeleteChunksByKbFileUIDParams{ctx, kbFileUID} + mm_params := RepositoryIMockGetRepositoryTagParams{ctx, r1} // Record call args - mmHardDeleteChunksByKbFileUID.HardDeleteChunksByKbFileUIDMock.mutex.Lock() - mmHardDeleteChunksByKbFileUID.HardDeleteChunksByKbFileUIDMock.callArgs = append(mmHardDeleteChunksByKbFileUID.HardDeleteChunksByKbFileUIDMock.callArgs, &mm_params) - mmHardDeleteChunksByKbFileUID.HardDeleteChunksByKbFileUIDMock.mutex.Unlock() + mmGetRepositoryTag.GetRepositoryTagMock.mutex.Lock() + mmGetRepositoryTag.GetRepositoryTagMock.callArgs = append(mmGetRepositoryTag.GetRepositoryTagMock.callArgs, &mm_params) + mmGetRepositoryTag.GetRepositoryTagMock.mutex.Unlock() - for _, e := range mmHardDeleteChunksByKbFileUID.HardDeleteChunksByKbFileUIDMock.expectations { + for _, e := range mmGetRepositoryTag.GetRepositoryTagMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.err + return e.results.rp1, 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 + 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 := RepositoryIMockHardDeleteChunksByKbFileUIDParams{ctx, kbFileUID} + 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) { - 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)) + 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.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)) + 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) { - mmHardDeleteChunksByKbFileUID.t.Errorf("RepositoryIMock.HardDeleteChunksByKbFileUID 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 := mmHardDeleteChunksByKbFileUID.HardDeleteChunksByKbFileUIDMock.defaultExpectation.results + mm_results := mmGetRepositoryTag.GetRepositoryTagMock.defaultExpectation.results if mm_results == nil { - mmHardDeleteChunksByKbFileUID.t.Fatal("No results are set for the RepositoryIMock.HardDeleteChunksByKbFileUID") + mmGetRepositoryTag.t.Fatal("No results are set for the RepositoryIMock.GetRepositoryTag") } - return (*mm_results).err + return (*mm_results).rp1, (*mm_results).err } - if mmHardDeleteChunksByKbFileUID.funcHardDeleteChunksByKbFileUID != nil { - return mmHardDeleteChunksByKbFileUID.funcHardDeleteChunksByKbFileUID(ctx, kbFileUID) + if mmGetRepositoryTag.funcGetRepositoryTag != nil { + return mmGetRepositoryTag.funcGetRepositoryTag(ctx, r1) } - mmHardDeleteChunksByKbFileUID.t.Fatalf("Unexpected call to RepositoryIMock.HardDeleteChunksByKbFileUID. %v %v", ctx, kbFileUID) + mmGetRepositoryTag.t.Fatalf("Unexpected call to RepositoryIMock.GetRepositoryTag. %v %v", ctx, r1) return } -// HardDeleteChunksByKbFileUIDAfterCounter returns a count of finished RepositoryIMock.HardDeleteChunksByKbFileUID invocations -func (mmHardDeleteChunksByKbFileUID *RepositoryIMock) HardDeleteChunksByKbFileUIDAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmHardDeleteChunksByKbFileUID.afterHardDeleteChunksByKbFileUIDCounter) +// GetRepositoryTagAfterCounter returns a count of finished RepositoryIMock.GetRepositoryTag invocations +func (mmGetRepositoryTag *RepositoryIMock) GetRepositoryTagAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetRepositoryTag.afterGetRepositoryTagCounter) } -// HardDeleteChunksByKbFileUIDBeforeCounter returns a count of RepositoryIMock.HardDeleteChunksByKbFileUID invocations -func (mmHardDeleteChunksByKbFileUID *RepositoryIMock) HardDeleteChunksByKbFileUIDBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmHardDeleteChunksByKbFileUID.beforeHardDeleteChunksByKbFileUIDCounter) +// 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.HardDeleteChunksByKbFileUID. +// 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 (mmHardDeleteChunksByKbFileUID *mRepositoryIMockHardDeleteChunksByKbFileUID) Calls() []*RepositoryIMockHardDeleteChunksByKbFileUIDParams { - mmHardDeleteChunksByKbFileUID.mutex.RLock() +func (mmGetRepositoryTag *mRepositoryIMockGetRepositoryTag) Calls() []*RepositoryIMockGetRepositoryTagParams { + mmGetRepositoryTag.mutex.RLock() - argCopy := make([]*RepositoryIMockHardDeleteChunksByKbFileUIDParams, len(mmHardDeleteChunksByKbFileUID.callArgs)) - copy(argCopy, mmHardDeleteChunksByKbFileUID.callArgs) + argCopy := make([]*RepositoryIMockGetRepositoryTagParams, len(mmGetRepositoryTag.callArgs)) + copy(argCopy, mmGetRepositoryTag.callArgs) - mmHardDeleteChunksByKbFileUID.mutex.RUnlock() + mmGetRepositoryTag.mutex.RUnlock() return argCopy } -// MinimockHardDeleteChunksByKbFileUIDDone returns true if the count of the HardDeleteChunksByKbFileUID invocations corresponds +// MinimockGetRepositoryTagDone returns true if the count of the GetRepositoryTag invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockHardDeleteChunksByKbFileUIDDone() bool { - for _, e := range m.HardDeleteChunksByKbFileUIDMock.expectations { +func (m *RepositoryIMock) MinimockGetRepositoryTagDone() bool { + for _, e := range m.GetRepositoryTagMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.HardDeleteChunksByKbFileUIDMock.invocationsDone() + return m.GetRepositoryTagMock.invocationsDone() } -// MinimockHardDeleteChunksByKbFileUIDInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockHardDeleteChunksByKbFileUIDInspect() { - for _, e := range m.HardDeleteChunksByKbFileUIDMock.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.HardDeleteChunksByKbFileUID with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.GetRepositoryTag with params: %#v", *e.params) } } - afterHardDeleteChunksByKbFileUIDCounter := mm_atomic.LoadUint64(&m.afterHardDeleteChunksByKbFileUIDCounter) + afterGetRepositoryTagCounter := mm_atomic.LoadUint64(&m.afterGetRepositoryTagCounter) // 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") + 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.HardDeleteChunksByKbFileUID with params: %#v", *m.HardDeleteChunksByKbFileUIDMock.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.funcHardDeleteChunksByKbFileUID != nil && afterHardDeleteChunksByKbFileUIDCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.HardDeleteChunksByKbFileUID") + if m.funcGetRepositoryTag != nil && afterGetRepositoryTagCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.GetRepositoryTag") } - 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) + 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 mRepositoryIMockHardDeleteChunksByKbUID struct { +type mRepositoryIMockGetSourceTableAndUIDByFileUIDs struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockHardDeleteChunksByKbUIDExpectation - expectations []*RepositoryIMockHardDeleteChunksByKbUIDExpectation + defaultExpectation *RepositoryIMockGetSourceTableAndUIDByFileUIDsExpectation + expectations []*RepositoryIMockGetSourceTableAndUIDByFileUIDsExpectation - callArgs []*RepositoryIMockHardDeleteChunksByKbUIDParams + callArgs []*RepositoryIMockGetSourceTableAndUIDByFileUIDsParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockHardDeleteChunksByKbUIDExpectation specifies expectation struct of the RepositoryI.HardDeleteChunksByKbUID -type RepositoryIMockHardDeleteChunksByKbUIDExpectation struct { +// RepositoryIMockGetSourceTableAndUIDByFileUIDsExpectation specifies expectation struct of the RepositoryI.GetSourceTableAndUIDByFileUIDs +type RepositoryIMockGetSourceTableAndUIDByFileUIDsExpectation struct { mock *RepositoryIMock - params *RepositoryIMockHardDeleteChunksByKbUIDParams - paramPtrs *RepositoryIMockHardDeleteChunksByKbUIDParamPtrs - results *RepositoryIMockHardDeleteChunksByKbUIDResults + params *RepositoryIMockGetSourceTableAndUIDByFileUIDsParams + paramPtrs *RepositoryIMockGetSourceTableAndUIDByFileUIDsParamPtrs + results *RepositoryIMockGetSourceTableAndUIDByFileUIDsResults Counter uint64 } -// RepositoryIMockHardDeleteChunksByKbUIDParams contains parameters of the RepositoryI.HardDeleteChunksByKbUID -type RepositoryIMockHardDeleteChunksByKbUIDParams struct { +// RepositoryIMockGetSourceTableAndUIDByFileUIDsParams contains parameters of the RepositoryI.GetSourceTableAndUIDByFileUIDs +type RepositoryIMockGetSourceTableAndUIDByFileUIDsParams struct { ctx context.Context - kbUID uuid.UUID + files []mm_repository.KnowledgeBaseFile } -// RepositoryIMockHardDeleteChunksByKbUIDParamPtrs contains pointers to parameters of the RepositoryI.HardDeleteChunksByKbUID -type RepositoryIMockHardDeleteChunksByKbUIDParamPtrs struct { +// RepositoryIMockGetSourceTableAndUIDByFileUIDsParamPtrs contains pointers to parameters of the RepositoryI.GetSourceTableAndUIDByFileUIDs +type RepositoryIMockGetSourceTableAndUIDByFileUIDsParamPtrs struct { ctx *context.Context - kbUID *uuid.UUID + files *[]mm_repository.KnowledgeBaseFile } -// RepositoryIMockHardDeleteChunksByKbUIDResults contains results of the RepositoryI.HardDeleteChunksByKbUID -type RepositoryIMockHardDeleteChunksByKbUIDResults struct { +// 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.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") +// 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 mmHardDeleteChunksByKbUID.defaultExpectation == nil { - mmHardDeleteChunksByKbUID.defaultExpectation = &RepositoryIMockHardDeleteChunksByKbUIDExpectation{} + if mmGetSourceTableAndUIDByFileUIDs.defaultExpectation == nil { + mmGetSourceTableAndUIDByFileUIDs.defaultExpectation = &RepositoryIMockGetSourceTableAndUIDByFileUIDsExpectation{} } - if mmHardDeleteChunksByKbUID.defaultExpectation.paramPtrs != nil { - mmHardDeleteChunksByKbUID.mock.t.Fatalf("RepositoryIMock.HardDeleteChunksByKbUID 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") } - 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) + 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 mmHardDeleteChunksByKbUID + return mmGetSourceTableAndUIDByFileUIDs } -// 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") +// 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 mmHardDeleteChunksByKbUID.defaultExpectation == nil { - mmHardDeleteChunksByKbUID.defaultExpectation = &RepositoryIMockHardDeleteChunksByKbUIDExpectation{} + if mmGetSourceTableAndUIDByFileUIDs.defaultExpectation == nil { + mmGetSourceTableAndUIDByFileUIDs.defaultExpectation = &RepositoryIMockGetSourceTableAndUIDByFileUIDsExpectation{} } - if mmHardDeleteChunksByKbUID.defaultExpectation.params != nil { - mmHardDeleteChunksByKbUID.mock.t.Fatalf("RepositoryIMock.HardDeleteChunksByKbUID mock is already set by Expect") + if mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.params != nil { + mmGetSourceTableAndUIDByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetSourceTableAndUIDByFileUIDs mock is already set by Expect") } - if mmHardDeleteChunksByKbUID.defaultExpectation.paramPtrs == nil { - mmHardDeleteChunksByKbUID.defaultExpectation.paramPtrs = &RepositoryIMockHardDeleteChunksByKbUIDParamPtrs{} + if mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.paramPtrs == nil { + mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.paramPtrs = &RepositoryIMockGetSourceTableAndUIDByFileUIDsParamPtrs{} } - mmHardDeleteChunksByKbUID.defaultExpectation.paramPtrs.ctx = &ctx + mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.paramPtrs.ctx = &ctx - return mmHardDeleteChunksByKbUID + return mmGetSourceTableAndUIDByFileUIDs } -// 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") +// 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 mmHardDeleteChunksByKbUID.defaultExpectation == nil { - mmHardDeleteChunksByKbUID.defaultExpectation = &RepositoryIMockHardDeleteChunksByKbUIDExpectation{} + if mmGetSourceTableAndUIDByFileUIDs.defaultExpectation == nil { + mmGetSourceTableAndUIDByFileUIDs.defaultExpectation = &RepositoryIMockGetSourceTableAndUIDByFileUIDsExpectation{} } - if mmHardDeleteChunksByKbUID.defaultExpectation.params != nil { - mmHardDeleteChunksByKbUID.mock.t.Fatalf("RepositoryIMock.HardDeleteChunksByKbUID mock is already set by Expect") + if mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.params != nil { + mmGetSourceTableAndUIDByFileUIDs.mock.t.Fatalf("RepositoryIMock.GetSourceTableAndUIDByFileUIDs mock is already set by Expect") } - if mmHardDeleteChunksByKbUID.defaultExpectation.paramPtrs == nil { - mmHardDeleteChunksByKbUID.defaultExpectation.paramPtrs = &RepositoryIMockHardDeleteChunksByKbUIDParamPtrs{} + if mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.paramPtrs == nil { + mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.paramPtrs = &RepositoryIMockGetSourceTableAndUIDByFileUIDsParamPtrs{} } - mmHardDeleteChunksByKbUID.defaultExpectation.paramPtrs.kbUID = &kbUID + mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.paramPtrs.files = &files - return mmHardDeleteChunksByKbUID + return mmGetSourceTableAndUIDByFileUIDs } -// 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") +// 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") } - mmHardDeleteChunksByKbUID.mock.inspectFuncHardDeleteChunksByKbUID = f + mmGetSourceTableAndUIDByFileUIDs.mock.inspectFuncGetSourceTableAndUIDByFileUIDs = f - return mmHardDeleteChunksByKbUID + return mmGetSourceTableAndUIDByFileUIDs } -// 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") +// 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 mmHardDeleteChunksByKbUID.defaultExpectation == nil { - mmHardDeleteChunksByKbUID.defaultExpectation = &RepositoryIMockHardDeleteChunksByKbUIDExpectation{mock: mmHardDeleteChunksByKbUID.mock} + if mmGetSourceTableAndUIDByFileUIDs.defaultExpectation == nil { + mmGetSourceTableAndUIDByFileUIDs.defaultExpectation = &RepositoryIMockGetSourceTableAndUIDByFileUIDsExpectation{mock: mmGetSourceTableAndUIDByFileUIDs.mock} } - mmHardDeleteChunksByKbUID.defaultExpectation.results = &RepositoryIMockHardDeleteChunksByKbUIDResults{err} - return mmHardDeleteChunksByKbUID.mock + mmGetSourceTableAndUIDByFileUIDs.defaultExpectation.results = &RepositoryIMockGetSourceTableAndUIDByFileUIDsResults{m1, err} + return mmGetSourceTableAndUIDByFileUIDs.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") +// 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(mmHardDeleteChunksByKbUID.expectations) > 0 { - mmHardDeleteChunksByKbUID.mock.t.Fatalf("Some expectations are already set for the RepositoryI.HardDeleteChunksByKbUID method") + if len(mmGetSourceTableAndUIDByFileUIDs.expectations) > 0 { + mmGetSourceTableAndUIDByFileUIDs.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetSourceTableAndUIDByFileUIDs method") } - mmHardDeleteChunksByKbUID.mock.funcHardDeleteChunksByKbUID = f - return mmHardDeleteChunksByKbUID.mock + mmGetSourceTableAndUIDByFileUIDs.mock.funcGetSourceTableAndUIDByFileUIDs = f + return mmGetSourceTableAndUIDByFileUIDs.mock } -// When sets expectation for the RepositoryI.HardDeleteChunksByKbUID 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 (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") +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 := &RepositoryIMockHardDeleteChunksByKbUIDExpectation{ - mock: mmHardDeleteChunksByKbUID.mock, - params: &RepositoryIMockHardDeleteChunksByKbUIDParams{ctx, kbUID}, + expectation := &RepositoryIMockGetSourceTableAndUIDByFileUIDsExpectation{ + mock: mmGetSourceTableAndUIDByFileUIDs.mock, + params: &RepositoryIMockGetSourceTableAndUIDByFileUIDsParams{ctx, files}, } - mmHardDeleteChunksByKbUID.expectations = append(mmHardDeleteChunksByKbUID.expectations, expectation) + mmGetSourceTableAndUIDByFileUIDs.expectations = append(mmGetSourceTableAndUIDByFileUIDs.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} +// 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.HardDeleteChunksByKbUID should be invoked -func (mmHardDeleteChunksByKbUID *mRepositoryIMockHardDeleteChunksByKbUID) Times(n uint64) *mRepositoryIMockHardDeleteChunksByKbUID { +// Times sets number of times RepositoryI.GetSourceTableAndUIDByFileUIDs should be invoked +func (mmGetSourceTableAndUIDByFileUIDs *mRepositoryIMockGetSourceTableAndUIDByFileUIDs) Times(n uint64) *mRepositoryIMockGetSourceTableAndUIDByFileUIDs { if n == 0 { - mmHardDeleteChunksByKbUID.mock.t.Fatalf("Times of RepositoryIMock.HardDeleteChunksByKbUID mock can not be zero") + mmGetSourceTableAndUIDByFileUIDs.mock.t.Fatalf("Times of RepositoryIMock.GetSourceTableAndUIDByFileUIDs mock can not be zero") } - mm_atomic.StoreUint64(&mmHardDeleteChunksByKbUID.expectedInvocations, n) - return mmHardDeleteChunksByKbUID + mm_atomic.StoreUint64(&mmGetSourceTableAndUIDByFileUIDs.expectedInvocations, n) + return mmGetSourceTableAndUIDByFileUIDs } -func (mmHardDeleteChunksByKbUID *mRepositoryIMockHardDeleteChunksByKbUID) invocationsDone() bool { - if len(mmHardDeleteChunksByKbUID.expectations) == 0 && mmHardDeleteChunksByKbUID.defaultExpectation == nil && mmHardDeleteChunksByKbUID.mock.funcHardDeleteChunksByKbUID == nil { +func (mmGetSourceTableAndUIDByFileUIDs *mRepositoryIMockGetSourceTableAndUIDByFileUIDs) invocationsDone() bool { + if len(mmGetSourceTableAndUIDByFileUIDs.expectations) == 0 && mmGetSourceTableAndUIDByFileUIDs.defaultExpectation == nil && mmGetSourceTableAndUIDByFileUIDs.mock.funcGetSourceTableAndUIDByFileUIDs == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmHardDeleteChunksByKbUID.mock.afterHardDeleteChunksByKbUIDCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmHardDeleteChunksByKbUID.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmGetSourceTableAndUIDByFileUIDs.mock.afterGetSourceTableAndUIDByFileUIDsCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmGetSourceTableAndUIDByFileUIDs.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) +// 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 mmHardDeleteChunksByKbUID.inspectFuncHardDeleteChunksByKbUID != nil { - mmHardDeleteChunksByKbUID.inspectFuncHardDeleteChunksByKbUID(ctx, kbUID) + if mmGetSourceTableAndUIDByFileUIDs.inspectFuncGetSourceTableAndUIDByFileUIDs != nil { + mmGetSourceTableAndUIDByFileUIDs.inspectFuncGetSourceTableAndUIDByFileUIDs(ctx, files) } - mm_params := RepositoryIMockHardDeleteChunksByKbUIDParams{ctx, kbUID} + mm_params := RepositoryIMockGetSourceTableAndUIDByFileUIDsParams{ctx, files} // Record call args - mmHardDeleteChunksByKbUID.HardDeleteChunksByKbUIDMock.mutex.Lock() - mmHardDeleteChunksByKbUID.HardDeleteChunksByKbUIDMock.callArgs = append(mmHardDeleteChunksByKbUID.HardDeleteChunksByKbUIDMock.callArgs, &mm_params) - mmHardDeleteChunksByKbUID.HardDeleteChunksByKbUIDMock.mutex.Unlock() + mmGetSourceTableAndUIDByFileUIDs.GetSourceTableAndUIDByFileUIDsMock.mutex.Lock() + mmGetSourceTableAndUIDByFileUIDs.GetSourceTableAndUIDByFileUIDsMock.callArgs = append(mmGetSourceTableAndUIDByFileUIDs.GetSourceTableAndUIDByFileUIDsMock.callArgs, &mm_params) + mmGetSourceTableAndUIDByFileUIDs.GetSourceTableAndUIDByFileUIDsMock.mutex.Unlock() - for _, e := range mmHardDeleteChunksByKbUID.HardDeleteChunksByKbUIDMock.expectations { + for _, e := range mmGetSourceTableAndUIDByFileUIDs.GetSourceTableAndUIDByFileUIDsMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.err + return e.results.m1, 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 + 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 := RepositoryIMockHardDeleteChunksByKbUIDParams{ctx, kbUID} + 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) { - 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)) + 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.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)) + 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) { - mmHardDeleteChunksByKbUID.t.Errorf("RepositoryIMock.HardDeleteChunksByKbUID 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 := mmHardDeleteChunksByKbUID.HardDeleteChunksByKbUIDMock.defaultExpectation.results + mm_results := mmGetSourceTableAndUIDByFileUIDs.GetSourceTableAndUIDByFileUIDsMock.defaultExpectation.results if mm_results == nil { - mmHardDeleteChunksByKbUID.t.Fatal("No results are set for the RepositoryIMock.HardDeleteChunksByKbUID") + mmGetSourceTableAndUIDByFileUIDs.t.Fatal("No results are set for the RepositoryIMock.GetSourceTableAndUIDByFileUIDs") } - return (*mm_results).err + return (*mm_results).m1, (*mm_results).err } - if mmHardDeleteChunksByKbUID.funcHardDeleteChunksByKbUID != nil { - return mmHardDeleteChunksByKbUID.funcHardDeleteChunksByKbUID(ctx, kbUID) + if mmGetSourceTableAndUIDByFileUIDs.funcGetSourceTableAndUIDByFileUIDs != nil { + return mmGetSourceTableAndUIDByFileUIDs.funcGetSourceTableAndUIDByFileUIDs(ctx, files) } - mmHardDeleteChunksByKbUID.t.Fatalf("Unexpected call to RepositoryIMock.HardDeleteChunksByKbUID. %v %v", ctx, kbUID) + mmGetSourceTableAndUIDByFileUIDs.t.Fatalf("Unexpected call to RepositoryIMock.GetSourceTableAndUIDByFileUIDs. %v %v", ctx, files) return } -// HardDeleteChunksByKbUIDAfterCounter returns a count of finished RepositoryIMock.HardDeleteChunksByKbUID invocations -func (mmHardDeleteChunksByKbUID *RepositoryIMock) HardDeleteChunksByKbUIDAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmHardDeleteChunksByKbUID.afterHardDeleteChunksByKbUIDCounter) +// GetSourceTableAndUIDByFileUIDsAfterCounter returns a count of finished RepositoryIMock.GetSourceTableAndUIDByFileUIDs invocations +func (mmGetSourceTableAndUIDByFileUIDs *RepositoryIMock) GetSourceTableAndUIDByFileUIDsAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetSourceTableAndUIDByFileUIDs.afterGetSourceTableAndUIDByFileUIDsCounter) } -// HardDeleteChunksByKbUIDBeforeCounter returns a count of RepositoryIMock.HardDeleteChunksByKbUID invocations -func (mmHardDeleteChunksByKbUID *RepositoryIMock) HardDeleteChunksByKbUIDBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmHardDeleteChunksByKbUID.beforeHardDeleteChunksByKbUIDCounter) +// 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.HardDeleteChunksByKbUID. +// 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 (mmHardDeleteChunksByKbUID *mRepositoryIMockHardDeleteChunksByKbUID) Calls() []*RepositoryIMockHardDeleteChunksByKbUIDParams { - mmHardDeleteChunksByKbUID.mutex.RLock() +func (mmGetSourceTableAndUIDByFileUIDs *mRepositoryIMockGetSourceTableAndUIDByFileUIDs) Calls() []*RepositoryIMockGetSourceTableAndUIDByFileUIDsParams { + mmGetSourceTableAndUIDByFileUIDs.mutex.RLock() - argCopy := make([]*RepositoryIMockHardDeleteChunksByKbUIDParams, len(mmHardDeleteChunksByKbUID.callArgs)) - copy(argCopy, mmHardDeleteChunksByKbUID.callArgs) + argCopy := make([]*RepositoryIMockGetSourceTableAndUIDByFileUIDsParams, len(mmGetSourceTableAndUIDByFileUIDs.callArgs)) + copy(argCopy, mmGetSourceTableAndUIDByFileUIDs.callArgs) - mmHardDeleteChunksByKbUID.mutex.RUnlock() + mmGetSourceTableAndUIDByFileUIDs.mutex.RUnlock() return argCopy } -// MinimockHardDeleteChunksByKbUIDDone returns true if the count of the HardDeleteChunksByKbUID invocations corresponds +// MinimockGetSourceTableAndUIDByFileUIDsDone returns true if the count of the GetSourceTableAndUIDByFileUIDs invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockHardDeleteChunksByKbUIDDone() bool { - for _, e := range m.HardDeleteChunksByKbUIDMock.expectations { +func (m *RepositoryIMock) MinimockGetSourceTableAndUIDByFileUIDsDone() bool { + for _, e := range m.GetSourceTableAndUIDByFileUIDsMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.HardDeleteChunksByKbUIDMock.invocationsDone() + return m.GetSourceTableAndUIDByFileUIDsMock.invocationsDone() } -// MinimockHardDeleteChunksByKbUIDInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockHardDeleteChunksByKbUIDInspect() { - for _, e := range m.HardDeleteChunksByKbUIDMock.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.HardDeleteChunksByKbUID with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.GetSourceTableAndUIDByFileUIDs with params: %#v", *e.params) } } - afterHardDeleteChunksByKbUIDCounter := mm_atomic.LoadUint64(&m.afterHardDeleteChunksByKbUIDCounter) + afterGetSourceTableAndUIDByFileUIDsCounter := mm_atomic.LoadUint64(&m.afterGetSourceTableAndUIDByFileUIDsCounter) // 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") + 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.HardDeleteChunksByKbUID with params: %#v", *m.HardDeleteChunksByKbUIDMock.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.funcHardDeleteChunksByKbUID != nil && afterHardDeleteChunksByKbUIDCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.HardDeleteChunksByKbUID") + if m.funcGetSourceTableAndUIDByFileUIDs != nil && afterGetSourceTableAndUIDByFileUIDsCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.GetSourceTableAndUIDByFileUIDs") } - 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) + 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 mRepositoryIMockHardDeleteConvertedFileByFileUID struct { +type mRepositoryIMockGetTextChunksBySource struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockHardDeleteConvertedFileByFileUIDExpectation - expectations []*RepositoryIMockHardDeleteConvertedFileByFileUIDExpectation + defaultExpectation *RepositoryIMockGetTextChunksBySourceExpectation + expectations []*RepositoryIMockGetTextChunksBySourceExpectation - callArgs []*RepositoryIMockHardDeleteConvertedFileByFileUIDParams + callArgs []*RepositoryIMockGetTextChunksBySourceParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockHardDeleteConvertedFileByFileUIDExpectation specifies expectation struct of the RepositoryI.HardDeleteConvertedFileByFileUID -type RepositoryIMockHardDeleteConvertedFileByFileUIDExpectation struct { +// RepositoryIMockGetTextChunksBySourceExpectation specifies expectation struct of the RepositoryI.GetTextChunksBySource +type RepositoryIMockGetTextChunksBySourceExpectation struct { mock *RepositoryIMock - params *RepositoryIMockHardDeleteConvertedFileByFileUIDParams - paramPtrs *RepositoryIMockHardDeleteConvertedFileByFileUIDParamPtrs - results *RepositoryIMockHardDeleteConvertedFileByFileUIDResults + params *RepositoryIMockGetTextChunksBySourceParams + paramPtrs *RepositoryIMockGetTextChunksBySourceParamPtrs + results *RepositoryIMockGetTextChunksBySourceResults Counter uint64 } -// RepositoryIMockHardDeleteConvertedFileByFileUIDParams contains parameters of the RepositoryI.HardDeleteConvertedFileByFileUID -type RepositoryIMockHardDeleteConvertedFileByFileUIDParams struct { - ctx context.Context - fileUID uuid.UUID +// RepositoryIMockGetTextChunksBySourceParams contains parameters of the RepositoryI.GetTextChunksBySource +type RepositoryIMockGetTextChunksBySourceParams struct { + ctx context.Context + sourceTable string + sourceUID uuid.UUID } -// RepositoryIMockHardDeleteConvertedFileByFileUIDParamPtrs contains pointers to parameters of the RepositoryI.HardDeleteConvertedFileByFileUID -type RepositoryIMockHardDeleteConvertedFileByFileUIDParamPtrs struct { - ctx *context.Context - fileUID *uuid.UUID +// RepositoryIMockGetTextChunksBySourceParamPtrs contains pointers to parameters of the RepositoryI.GetTextChunksBySource +type RepositoryIMockGetTextChunksBySourceParamPtrs struct { + ctx *context.Context + sourceTable *string + sourceUID *uuid.UUID } -// RepositoryIMockHardDeleteConvertedFileByFileUIDResults contains results of the RepositoryI.HardDeleteConvertedFileByFileUID -type RepositoryIMockHardDeleteConvertedFileByFileUIDResults struct { +// RepositoryIMockGetTextChunksBySourceResults contains results of the RepositoryI.GetTextChunksBySource +type RepositoryIMockGetTextChunksBySourceResults struct { + ta1 []mm_repository.TextChunk 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") +// 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 mmHardDeleteConvertedFileByFileUID.defaultExpectation == nil { - mmHardDeleteConvertedFileByFileUID.defaultExpectation = &RepositoryIMockHardDeleteConvertedFileByFileUIDExpectation{} + if mmGetTextChunksBySource.defaultExpectation == nil { + mmGetTextChunksBySource.defaultExpectation = &RepositoryIMockGetTextChunksBySourceExpectation{} } - if mmHardDeleteConvertedFileByFileUID.defaultExpectation.paramPtrs != nil { - mmHardDeleteConvertedFileByFileUID.mock.t.Fatalf("RepositoryIMock.HardDeleteConvertedFileByFileUID 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") } - 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) + 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 mmHardDeleteConvertedFileByFileUID + return mmGetTextChunksBySource } -// 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") +// 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 mmHardDeleteConvertedFileByFileUID.defaultExpectation == nil { - mmHardDeleteConvertedFileByFileUID.defaultExpectation = &RepositoryIMockHardDeleteConvertedFileByFileUIDExpectation{} + if mmGetTextChunksBySource.defaultExpectation == nil { + mmGetTextChunksBySource.defaultExpectation = &RepositoryIMockGetTextChunksBySourceExpectation{} } - if mmHardDeleteConvertedFileByFileUID.defaultExpectation.params != nil { - mmHardDeleteConvertedFileByFileUID.mock.t.Fatalf("RepositoryIMock.HardDeleteConvertedFileByFileUID mock is already set by Expect") + if mmGetTextChunksBySource.defaultExpectation.params != nil { + mmGetTextChunksBySource.mock.t.Fatalf("RepositoryIMock.GetTextChunksBySource mock is already set by Expect") } - if mmHardDeleteConvertedFileByFileUID.defaultExpectation.paramPtrs == nil { - mmHardDeleteConvertedFileByFileUID.defaultExpectation.paramPtrs = &RepositoryIMockHardDeleteConvertedFileByFileUIDParamPtrs{} + if mmGetTextChunksBySource.defaultExpectation.paramPtrs == nil { + mmGetTextChunksBySource.defaultExpectation.paramPtrs = &RepositoryIMockGetTextChunksBySourceParamPtrs{} } - mmHardDeleteConvertedFileByFileUID.defaultExpectation.paramPtrs.ctx = &ctx + mmGetTextChunksBySource.defaultExpectation.paramPtrs.ctx = &ctx - return mmHardDeleteConvertedFileByFileUID + return mmGetTextChunksBySource } -// 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") +// 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 mmHardDeleteConvertedFileByFileUID.defaultExpectation == nil { - mmHardDeleteConvertedFileByFileUID.defaultExpectation = &RepositoryIMockHardDeleteConvertedFileByFileUIDExpectation{} + if mmGetTextChunksBySource.defaultExpectation == nil { + mmGetTextChunksBySource.defaultExpectation = &RepositoryIMockGetTextChunksBySourceExpectation{} } - if mmHardDeleteConvertedFileByFileUID.defaultExpectation.params != nil { - mmHardDeleteConvertedFileByFileUID.mock.t.Fatalf("RepositoryIMock.HardDeleteConvertedFileByFileUID mock is already set by Expect") + if mmGetTextChunksBySource.defaultExpectation.params != nil { + mmGetTextChunksBySource.mock.t.Fatalf("RepositoryIMock.GetTextChunksBySource mock is already set by Expect") } - if mmHardDeleteConvertedFileByFileUID.defaultExpectation.paramPtrs == nil { - mmHardDeleteConvertedFileByFileUID.defaultExpectation.paramPtrs = &RepositoryIMockHardDeleteConvertedFileByFileUIDParamPtrs{} + if mmGetTextChunksBySource.defaultExpectation.paramPtrs == nil { + mmGetTextChunksBySource.defaultExpectation.paramPtrs = &RepositoryIMockGetTextChunksBySourceParamPtrs{} } - mmHardDeleteConvertedFileByFileUID.defaultExpectation.paramPtrs.fileUID = &fileUID + mmGetTextChunksBySource.defaultExpectation.paramPtrs.sourceTable = &sourceTable - return mmHardDeleteConvertedFileByFileUID + return mmGetTextChunksBySource } -// 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") +// 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") } - mmHardDeleteConvertedFileByFileUID.mock.inspectFuncHardDeleteConvertedFileByFileUID = f - - return mmHardDeleteConvertedFileByFileUID + 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.sourceUID = &sourceUID + + return mmGetTextChunksBySource } -// 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") +// 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 mmHardDeleteConvertedFileByFileUID.defaultExpectation == nil { - mmHardDeleteConvertedFileByFileUID.defaultExpectation = &RepositoryIMockHardDeleteConvertedFileByFileUIDExpectation{mock: mmHardDeleteConvertedFileByFileUID.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") } - mmHardDeleteConvertedFileByFileUID.defaultExpectation.results = &RepositoryIMockHardDeleteConvertedFileByFileUIDResults{err} - return mmHardDeleteConvertedFileByFileUID.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.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") +// 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(mmHardDeleteConvertedFileByFileUID.expectations) > 0 { - mmHardDeleteConvertedFileByFileUID.mock.t.Fatalf("Some expectations are already set for the RepositoryI.HardDeleteConvertedFileByFileUID method") + if len(mmGetTextChunksBySource.expectations) > 0 { + mmGetTextChunksBySource.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetTextChunksBySource method") } - mmHardDeleteConvertedFileByFileUID.mock.funcHardDeleteConvertedFileByFileUID = f - return mmHardDeleteConvertedFileByFileUID.mock + mmGetTextChunksBySource.mock.funcGetTextChunksBySource = f + return mmGetTextChunksBySource.mock } -// When sets expectation for the RepositoryI.HardDeleteConvertedFileByFileUID 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 (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") +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 := &RepositoryIMockHardDeleteConvertedFileByFileUIDExpectation{ - mock: mmHardDeleteConvertedFileByFileUID.mock, - params: &RepositoryIMockHardDeleteConvertedFileByFileUIDParams{ctx, fileUID}, + expectation := &RepositoryIMockGetTextChunksBySourceExpectation{ + mock: mmGetTextChunksBySource.mock, + params: &RepositoryIMockGetTextChunksBySourceParams{ctx, sourceTable, sourceUID}, } - mmHardDeleteConvertedFileByFileUID.expectations = append(mmHardDeleteConvertedFileByFileUID.expectations, expectation) + mmGetTextChunksBySource.expectations = append(mmGetTextChunksBySource.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} +// 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.HardDeleteConvertedFileByFileUID should be invoked -func (mmHardDeleteConvertedFileByFileUID *mRepositoryIMockHardDeleteConvertedFileByFileUID) Times(n uint64) *mRepositoryIMockHardDeleteConvertedFileByFileUID { +// Times sets number of times RepositoryI.GetTextChunksBySource should be invoked +func (mmGetTextChunksBySource *mRepositoryIMockGetTextChunksBySource) Times(n uint64) *mRepositoryIMockGetTextChunksBySource { if n == 0 { - mmHardDeleteConvertedFileByFileUID.mock.t.Fatalf("Times of RepositoryIMock.HardDeleteConvertedFileByFileUID mock can not be zero") + mmGetTextChunksBySource.mock.t.Fatalf("Times of RepositoryIMock.GetTextChunksBySource mock can not be zero") } - mm_atomic.StoreUint64(&mmHardDeleteConvertedFileByFileUID.expectedInvocations, n) - return mmHardDeleteConvertedFileByFileUID + mm_atomic.StoreUint64(&mmGetTextChunksBySource.expectedInvocations, n) + return mmGetTextChunksBySource } -func (mmHardDeleteConvertedFileByFileUID *mRepositoryIMockHardDeleteConvertedFileByFileUID) invocationsDone() bool { - if len(mmHardDeleteConvertedFileByFileUID.expectations) == 0 && mmHardDeleteConvertedFileByFileUID.defaultExpectation == nil && mmHardDeleteConvertedFileByFileUID.mock.funcHardDeleteConvertedFileByFileUID == nil { +func (mmGetTextChunksBySource *mRepositoryIMockGetTextChunksBySource) invocationsDone() bool { + if len(mmGetTextChunksBySource.expectations) == 0 && mmGetTextChunksBySource.defaultExpectation == nil && mmGetTextChunksBySource.mock.funcGetTextChunksBySource == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmHardDeleteConvertedFileByFileUID.mock.afterHardDeleteConvertedFileByFileUIDCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmHardDeleteConvertedFileByFileUID.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmGetTextChunksBySource.mock.afterGetTextChunksBySourceCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmGetTextChunksBySource.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) +// 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 mmHardDeleteConvertedFileByFileUID.inspectFuncHardDeleteConvertedFileByFileUID != nil { - mmHardDeleteConvertedFileByFileUID.inspectFuncHardDeleteConvertedFileByFileUID(ctx, fileUID) + if mmGetTextChunksBySource.inspectFuncGetTextChunksBySource != nil { + mmGetTextChunksBySource.inspectFuncGetTextChunksBySource(ctx, sourceTable, sourceUID) } - mm_params := RepositoryIMockHardDeleteConvertedFileByFileUIDParams{ctx, fileUID} + mm_params := RepositoryIMockGetTextChunksBySourceParams{ctx, sourceTable, sourceUID} // Record call args - mmHardDeleteConvertedFileByFileUID.HardDeleteConvertedFileByFileUIDMock.mutex.Lock() - mmHardDeleteConvertedFileByFileUID.HardDeleteConvertedFileByFileUIDMock.callArgs = append(mmHardDeleteConvertedFileByFileUID.HardDeleteConvertedFileByFileUIDMock.callArgs, &mm_params) - mmHardDeleteConvertedFileByFileUID.HardDeleteConvertedFileByFileUIDMock.mutex.Unlock() + mmGetTextChunksBySource.GetTextChunksBySourceMock.mutex.Lock() + mmGetTextChunksBySource.GetTextChunksBySourceMock.callArgs = append(mmGetTextChunksBySource.GetTextChunksBySourceMock.callArgs, &mm_params) + mmGetTextChunksBySource.GetTextChunksBySourceMock.mutex.Unlock() - for _, e := range mmHardDeleteConvertedFileByFileUID.HardDeleteConvertedFileByFileUIDMock.expectations { + for _, e := range mmGetTextChunksBySource.GetTextChunksBySourceMock.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 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 + 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 := RepositoryIMockHardDeleteConvertedFileByFileUIDParams{ctx, fileUID} + 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) { - 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)) + 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.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)) + 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) { - mmHardDeleteConvertedFileByFileUID.t.Errorf("RepositoryIMock.HardDeleteConvertedFileByFileUID 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 := mmHardDeleteConvertedFileByFileUID.HardDeleteConvertedFileByFileUIDMock.defaultExpectation.results + mm_results := mmGetTextChunksBySource.GetTextChunksBySourceMock.defaultExpectation.results if mm_results == nil { - mmHardDeleteConvertedFileByFileUID.t.Fatal("No results are set for the RepositoryIMock.HardDeleteConvertedFileByFileUID") + mmGetTextChunksBySource.t.Fatal("No results are set for the RepositoryIMock.GetTextChunksBySource") } - return (*mm_results).err + return (*mm_results).ta1, (*mm_results).err } - if mmHardDeleteConvertedFileByFileUID.funcHardDeleteConvertedFileByFileUID != nil { - return mmHardDeleteConvertedFileByFileUID.funcHardDeleteConvertedFileByFileUID(ctx, fileUID) + if mmGetTextChunksBySource.funcGetTextChunksBySource != nil { + return mmGetTextChunksBySource.funcGetTextChunksBySource(ctx, sourceTable, sourceUID) } - mmHardDeleteConvertedFileByFileUID.t.Fatalf("Unexpected call to RepositoryIMock.HardDeleteConvertedFileByFileUID. %v %v", ctx, fileUID) + mmGetTextChunksBySource.t.Fatalf("Unexpected call to RepositoryIMock.GetTextChunksBySource. %v %v %v", ctx, sourceTable, sourceUID) return } -// HardDeleteConvertedFileByFileUIDAfterCounter returns a count of finished RepositoryIMock.HardDeleteConvertedFileByFileUID invocations -func (mmHardDeleteConvertedFileByFileUID *RepositoryIMock) HardDeleteConvertedFileByFileUIDAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmHardDeleteConvertedFileByFileUID.afterHardDeleteConvertedFileByFileUIDCounter) +// GetTextChunksBySourceAfterCounter returns a count of finished RepositoryIMock.GetTextChunksBySource invocations +func (mmGetTextChunksBySource *RepositoryIMock) GetTextChunksBySourceAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetTextChunksBySource.afterGetTextChunksBySourceCounter) } -// HardDeleteConvertedFileByFileUIDBeforeCounter returns a count of RepositoryIMock.HardDeleteConvertedFileByFileUID invocations -func (mmHardDeleteConvertedFileByFileUID *RepositoryIMock) HardDeleteConvertedFileByFileUIDBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmHardDeleteConvertedFileByFileUID.beforeHardDeleteConvertedFileByFileUIDCounter) +// 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.HardDeleteConvertedFileByFileUID. +// 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 (mmHardDeleteConvertedFileByFileUID *mRepositoryIMockHardDeleteConvertedFileByFileUID) Calls() []*RepositoryIMockHardDeleteConvertedFileByFileUIDParams { - mmHardDeleteConvertedFileByFileUID.mutex.RLock() +func (mmGetTextChunksBySource *mRepositoryIMockGetTextChunksBySource) Calls() []*RepositoryIMockGetTextChunksBySourceParams { + mmGetTextChunksBySource.mutex.RLock() - argCopy := make([]*RepositoryIMockHardDeleteConvertedFileByFileUIDParams, len(mmHardDeleteConvertedFileByFileUID.callArgs)) - copy(argCopy, mmHardDeleteConvertedFileByFileUID.callArgs) + argCopy := make([]*RepositoryIMockGetTextChunksBySourceParams, len(mmGetTextChunksBySource.callArgs)) + copy(argCopy, mmGetTextChunksBySource.callArgs) - mmHardDeleteConvertedFileByFileUID.mutex.RUnlock() + mmGetTextChunksBySource.mutex.RUnlock() return argCopy } -// MinimockHardDeleteConvertedFileByFileUIDDone returns true if the count of the HardDeleteConvertedFileByFileUID invocations corresponds +// MinimockGetTextChunksBySourceDone returns true if the count of the GetTextChunksBySource invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockHardDeleteConvertedFileByFileUIDDone() bool { - for _, e := range m.HardDeleteConvertedFileByFileUIDMock.expectations { +func (m *RepositoryIMock) MinimockGetTextChunksBySourceDone() bool { + for _, e := range m.GetTextChunksBySourceMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.HardDeleteConvertedFileByFileUIDMock.invocationsDone() + return m.GetTextChunksBySourceMock.invocationsDone() } -// MinimockHardDeleteConvertedFileByFileUIDInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockHardDeleteConvertedFileByFileUIDInspect() { - for _, e := range m.HardDeleteConvertedFileByFileUIDMock.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.HardDeleteConvertedFileByFileUID with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.GetTextChunksBySource with params: %#v", *e.params) } } - afterHardDeleteConvertedFileByFileUIDCounter := mm_atomic.LoadUint64(&m.afterHardDeleteConvertedFileByFileUIDCounter) + afterGetTextChunksBySourceCounter := mm_atomic.LoadUint64(&m.afterGetTextChunksBySourceCounter) // 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") + 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.HardDeleteConvertedFileByFileUID with params: %#v", *m.HardDeleteConvertedFileByFileUIDMock.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.funcHardDeleteConvertedFileByFileUID != nil && afterHardDeleteConvertedFileByFileUIDCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.HardDeleteConvertedFileByFileUID") + if m.funcGetTextChunksBySource != nil && afterGetTextChunksBySourceCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.GetTextChunksBySource") } - 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) + 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 mRepositoryIMockHardDeleteEmbeddingsByKbFileUID struct { +type mRepositoryIMockGetTotalChunksBySources struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockHardDeleteEmbeddingsByKbFileUIDExpectation - expectations []*RepositoryIMockHardDeleteEmbeddingsByKbFileUIDExpectation + defaultExpectation *RepositoryIMockGetTotalChunksBySourcesExpectation + expectations []*RepositoryIMockGetTotalChunksBySourcesExpectation - callArgs []*RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParams + callArgs []*RepositoryIMockGetTotalChunksBySourcesParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockHardDeleteEmbeddingsByKbFileUIDExpectation specifies expectation struct of the RepositoryI.HardDeleteEmbeddingsByKbFileUID -type RepositoryIMockHardDeleteEmbeddingsByKbFileUIDExpectation struct { +// RepositoryIMockGetTotalChunksBySourcesExpectation specifies expectation struct of the RepositoryI.GetTotalChunksBySources +type RepositoryIMockGetTotalChunksBySourcesExpectation struct { mock *RepositoryIMock - params *RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParams - paramPtrs *RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParamPtrs - results *RepositoryIMockHardDeleteEmbeddingsByKbFileUIDResults + params *RepositoryIMockGetTotalChunksBySourcesParams + paramPtrs *RepositoryIMockGetTotalChunksBySourcesParamPtrs + results *RepositoryIMockGetTotalChunksBySourcesResults Counter uint64 } -// RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParams contains parameters of the RepositoryI.HardDeleteEmbeddingsByKbFileUID -type RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParams struct { - ctx context.Context - kbFileUID uuid.UUID +// 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 + } } -// RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParamPtrs contains pointers to parameters of the RepositoryI.HardDeleteEmbeddingsByKbFileUID -type RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParamPtrs struct { - ctx *context.Context - kbFileUID *uuid.UUID +// 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 + } } -// RepositoryIMockHardDeleteEmbeddingsByKbFileUIDResults contains results of the RepositoryI.HardDeleteEmbeddingsByKbFileUID -type RepositoryIMockHardDeleteEmbeddingsByKbFileUIDResults struct { +// 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.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") +// 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 mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation == nil { - mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation = &RepositoryIMockHardDeleteEmbeddingsByKbFileUIDExpectation{} + if mmGetTotalChunksBySources.defaultExpectation == nil { + mmGetTotalChunksBySources.defaultExpectation = &RepositoryIMockGetTotalChunksBySourcesExpectation{} } - if mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation.paramPtrs != nil { - mmHardDeleteEmbeddingsByKbFileUID.mock.t.Fatalf("RepositoryIMock.HardDeleteEmbeddingsByKbFileUID 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") } - 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) + 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 mmHardDeleteEmbeddingsByKbFileUID + return mmGetTotalChunksBySources } -// 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") +// 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 mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation == nil { - mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation = &RepositoryIMockHardDeleteEmbeddingsByKbFileUIDExpectation{} + if mmGetTotalChunksBySources.defaultExpectation == nil { + mmGetTotalChunksBySources.defaultExpectation = &RepositoryIMockGetTotalChunksBySourcesExpectation{} } - if mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation.params != nil { - mmHardDeleteEmbeddingsByKbFileUID.mock.t.Fatalf("RepositoryIMock.HardDeleteEmbeddingsByKbFileUID mock is already set by Expect") + if mmGetTotalChunksBySources.defaultExpectation.params != nil { + mmGetTotalChunksBySources.mock.t.Fatalf("RepositoryIMock.GetTotalChunksBySources mock is already set by Expect") } - if mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation.paramPtrs == nil { - mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation.paramPtrs = &RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParamPtrs{} + if mmGetTotalChunksBySources.defaultExpectation.paramPtrs == nil { + mmGetTotalChunksBySources.defaultExpectation.paramPtrs = &RepositoryIMockGetTotalChunksBySourcesParamPtrs{} } - mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation.paramPtrs.ctx = &ctx + mmGetTotalChunksBySources.defaultExpectation.paramPtrs.ctx = &ctx - return mmHardDeleteEmbeddingsByKbFileUID + return mmGetTotalChunksBySources } -// 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") +// 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 mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation == nil { - mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation = &RepositoryIMockHardDeleteEmbeddingsByKbFileUIDExpectation{} + if mmGetTotalChunksBySources.defaultExpectation == nil { + mmGetTotalChunksBySources.defaultExpectation = &RepositoryIMockGetTotalChunksBySourcesExpectation{} } - if mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation.params != nil { - mmHardDeleteEmbeddingsByKbFileUID.mock.t.Fatalf("RepositoryIMock.HardDeleteEmbeddingsByKbFileUID mock is already set by Expect") + if mmGetTotalChunksBySources.defaultExpectation.params != nil { + mmGetTotalChunksBySources.mock.t.Fatalf("RepositoryIMock.GetTotalChunksBySources mock is already set by Expect") } - if mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation.paramPtrs == nil { - mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation.paramPtrs = &RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParamPtrs{} + if mmGetTotalChunksBySources.defaultExpectation.paramPtrs == nil { + mmGetTotalChunksBySources.defaultExpectation.paramPtrs = &RepositoryIMockGetTotalChunksBySourcesParamPtrs{} } - mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation.paramPtrs.kbFileUID = &kbFileUID + mmGetTotalChunksBySources.defaultExpectation.paramPtrs.sources = &sources - return mmHardDeleteEmbeddingsByKbFileUID + return mmGetTotalChunksBySources } -// 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") +// 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") } - mmHardDeleteEmbeddingsByKbFileUID.mock.inspectFuncHardDeleteEmbeddingsByKbFileUID = f + mmGetTotalChunksBySources.mock.inspectFuncGetTotalChunksBySources = f - return mmHardDeleteEmbeddingsByKbFileUID + return mmGetTotalChunksBySources } -// 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") +// 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 mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation == nil { - mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation = &RepositoryIMockHardDeleteEmbeddingsByKbFileUIDExpectation{mock: mmHardDeleteEmbeddingsByKbFileUID.mock} + if mmGetTotalChunksBySources.defaultExpectation == nil { + mmGetTotalChunksBySources.defaultExpectation = &RepositoryIMockGetTotalChunksBySourcesExpectation{mock: mmGetTotalChunksBySources.mock} } - mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation.results = &RepositoryIMockHardDeleteEmbeddingsByKbFileUIDResults{err} - return mmHardDeleteEmbeddingsByKbFileUID.mock + mmGetTotalChunksBySources.defaultExpectation.results = &RepositoryIMockGetTotalChunksBySourcesResults{m1, err} + return mmGetTotalChunksBySources.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") +// 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(mmHardDeleteEmbeddingsByKbFileUID.expectations) > 0 { - mmHardDeleteEmbeddingsByKbFileUID.mock.t.Fatalf("Some expectations are already set for the RepositoryI.HardDeleteEmbeddingsByKbFileUID method") + if len(mmGetTotalChunksBySources.expectations) > 0 { + mmGetTotalChunksBySources.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetTotalChunksBySources method") } - mmHardDeleteEmbeddingsByKbFileUID.mock.funcHardDeleteEmbeddingsByKbFileUID = f - return mmHardDeleteEmbeddingsByKbFileUID.mock + mmGetTotalChunksBySources.mock.funcGetTotalChunksBySources = f + return mmGetTotalChunksBySources.mock } -// When sets expectation for the RepositoryI.HardDeleteEmbeddingsByKbFileUID 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 (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") +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 := &RepositoryIMockHardDeleteEmbeddingsByKbFileUIDExpectation{ - mock: mmHardDeleteEmbeddingsByKbFileUID.mock, - params: &RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParams{ctx, kbFileUID}, + expectation := &RepositoryIMockGetTotalChunksBySourcesExpectation{ + mock: mmGetTotalChunksBySources.mock, + params: &RepositoryIMockGetTotalChunksBySourcesParams{ctx, sources}, } - mmHardDeleteEmbeddingsByKbFileUID.expectations = append(mmHardDeleteEmbeddingsByKbFileUID.expectations, expectation) + mmGetTotalChunksBySources.expectations = append(mmGetTotalChunksBySources.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} +// 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.HardDeleteEmbeddingsByKbFileUID should be invoked -func (mmHardDeleteEmbeddingsByKbFileUID *mRepositoryIMockHardDeleteEmbeddingsByKbFileUID) Times(n uint64) *mRepositoryIMockHardDeleteEmbeddingsByKbFileUID { +// Times sets number of times RepositoryI.GetTotalChunksBySources should be invoked +func (mmGetTotalChunksBySources *mRepositoryIMockGetTotalChunksBySources) Times(n uint64) *mRepositoryIMockGetTotalChunksBySources { if n == 0 { - mmHardDeleteEmbeddingsByKbFileUID.mock.t.Fatalf("Times of RepositoryIMock.HardDeleteEmbeddingsByKbFileUID mock can not be zero") + mmGetTotalChunksBySources.mock.t.Fatalf("Times of RepositoryIMock.GetTotalChunksBySources mock can not be zero") } - mm_atomic.StoreUint64(&mmHardDeleteEmbeddingsByKbFileUID.expectedInvocations, n) - return mmHardDeleteEmbeddingsByKbFileUID + mm_atomic.StoreUint64(&mmGetTotalChunksBySources.expectedInvocations, n) + return mmGetTotalChunksBySources } -func (mmHardDeleteEmbeddingsByKbFileUID *mRepositoryIMockHardDeleteEmbeddingsByKbFileUID) invocationsDone() bool { - if len(mmHardDeleteEmbeddingsByKbFileUID.expectations) == 0 && mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation == nil && mmHardDeleteEmbeddingsByKbFileUID.mock.funcHardDeleteEmbeddingsByKbFileUID == nil { +func (mmGetTotalChunksBySources *mRepositoryIMockGetTotalChunksBySources) invocationsDone() bool { + if len(mmGetTotalChunksBySources.expectations) == 0 && mmGetTotalChunksBySources.defaultExpectation == nil && mmGetTotalChunksBySources.mock.funcGetTotalChunksBySources == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmHardDeleteEmbeddingsByKbFileUID.mock.afterHardDeleteEmbeddingsByKbFileUIDCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmHardDeleteEmbeddingsByKbFileUID.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmGetTotalChunksBySources.mock.afterGetTotalChunksBySourcesCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmGetTotalChunksBySources.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) +// 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 mmHardDeleteEmbeddingsByKbFileUID.inspectFuncHardDeleteEmbeddingsByKbFileUID != nil { - mmHardDeleteEmbeddingsByKbFileUID.inspectFuncHardDeleteEmbeddingsByKbFileUID(ctx, kbFileUID) + if mmGetTotalChunksBySources.inspectFuncGetTotalChunksBySources != nil { + mmGetTotalChunksBySources.inspectFuncGetTotalChunksBySources(ctx, sources) } - mm_params := RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParams{ctx, kbFileUID} + mm_params := RepositoryIMockGetTotalChunksBySourcesParams{ctx, sources} // Record call args - mmHardDeleteEmbeddingsByKbFileUID.HardDeleteEmbeddingsByKbFileUIDMock.mutex.Lock() - mmHardDeleteEmbeddingsByKbFileUID.HardDeleteEmbeddingsByKbFileUIDMock.callArgs = append(mmHardDeleteEmbeddingsByKbFileUID.HardDeleteEmbeddingsByKbFileUIDMock.callArgs, &mm_params) - mmHardDeleteEmbeddingsByKbFileUID.HardDeleteEmbeddingsByKbFileUIDMock.mutex.Unlock() + mmGetTotalChunksBySources.GetTotalChunksBySourcesMock.mutex.Lock() + mmGetTotalChunksBySources.GetTotalChunksBySourcesMock.callArgs = append(mmGetTotalChunksBySources.GetTotalChunksBySourcesMock.callArgs, &mm_params) + mmGetTotalChunksBySources.GetTotalChunksBySourcesMock.mutex.Unlock() - for _, e := range mmHardDeleteEmbeddingsByKbFileUID.HardDeleteEmbeddingsByKbFileUIDMock.expectations { + for _, e := range mmGetTotalChunksBySources.GetTotalChunksBySourcesMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.err + return e.results.m1, 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 + 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 := RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParams{ctx, kbFileUID} + 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) { - 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)) + 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.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)) + 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) { - mmHardDeleteEmbeddingsByKbFileUID.t.Errorf("RepositoryIMock.HardDeleteEmbeddingsByKbFileUID got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*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 := mmHardDeleteEmbeddingsByKbFileUID.HardDeleteEmbeddingsByKbFileUIDMock.defaultExpectation.results + mm_results := mmGetTotalChunksBySources.GetTotalChunksBySourcesMock.defaultExpectation.results if mm_results == nil { - mmHardDeleteEmbeddingsByKbFileUID.t.Fatal("No results are set for the RepositoryIMock.HardDeleteEmbeddingsByKbFileUID") + mmGetTotalChunksBySources.t.Fatal("No results are set for the RepositoryIMock.GetTotalChunksBySources") } - return (*mm_results).err + return (*mm_results).m1, (*mm_results).err } - if mmHardDeleteEmbeddingsByKbFileUID.funcHardDeleteEmbeddingsByKbFileUID != nil { - return mmHardDeleteEmbeddingsByKbFileUID.funcHardDeleteEmbeddingsByKbFileUID(ctx, kbFileUID) + if mmGetTotalChunksBySources.funcGetTotalChunksBySources != nil { + return mmGetTotalChunksBySources.funcGetTotalChunksBySources(ctx, sources) } - mmHardDeleteEmbeddingsByKbFileUID.t.Fatalf("Unexpected call to RepositoryIMock.HardDeleteEmbeddingsByKbFileUID. %v %v", ctx, kbFileUID) + mmGetTotalChunksBySources.t.Fatalf("Unexpected call to RepositoryIMock.GetTotalChunksBySources. %v %v", ctx, sources) return } -// HardDeleteEmbeddingsByKbFileUIDAfterCounter returns a count of finished RepositoryIMock.HardDeleteEmbeddingsByKbFileUID invocations -func (mmHardDeleteEmbeddingsByKbFileUID *RepositoryIMock) HardDeleteEmbeddingsByKbFileUIDAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmHardDeleteEmbeddingsByKbFileUID.afterHardDeleteEmbeddingsByKbFileUIDCounter) +// GetTotalChunksBySourcesAfterCounter returns a count of finished RepositoryIMock.GetTotalChunksBySources invocations +func (mmGetTotalChunksBySources *RepositoryIMock) GetTotalChunksBySourcesAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetTotalChunksBySources.afterGetTotalChunksBySourcesCounter) } -// HardDeleteEmbeddingsByKbFileUIDBeforeCounter returns a count of RepositoryIMock.HardDeleteEmbeddingsByKbFileUID invocations -func (mmHardDeleteEmbeddingsByKbFileUID *RepositoryIMock) HardDeleteEmbeddingsByKbFileUIDBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmHardDeleteEmbeddingsByKbFileUID.beforeHardDeleteEmbeddingsByKbFileUIDCounter) +// 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.HardDeleteEmbeddingsByKbFileUID. +// 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 (mmHardDeleteEmbeddingsByKbFileUID *mRepositoryIMockHardDeleteEmbeddingsByKbFileUID) Calls() []*RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParams { - mmHardDeleteEmbeddingsByKbFileUID.mutex.RLock() +func (mmGetTotalChunksBySources *mRepositoryIMockGetTotalChunksBySources) Calls() []*RepositoryIMockGetTotalChunksBySourcesParams { + mmGetTotalChunksBySources.mutex.RLock() - argCopy := make([]*RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParams, len(mmHardDeleteEmbeddingsByKbFileUID.callArgs)) - copy(argCopy, mmHardDeleteEmbeddingsByKbFileUID.callArgs) + argCopy := make([]*RepositoryIMockGetTotalChunksBySourcesParams, len(mmGetTotalChunksBySources.callArgs)) + copy(argCopy, mmGetTotalChunksBySources.callArgs) - mmHardDeleteEmbeddingsByKbFileUID.mutex.RUnlock() + mmGetTotalChunksBySources.mutex.RUnlock() return argCopy } -// MinimockHardDeleteEmbeddingsByKbFileUIDDone returns true if the count of the HardDeleteEmbeddingsByKbFileUID invocations corresponds +// MinimockGetTotalChunksBySourcesDone returns true if the count of the GetTotalChunksBySources invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockHardDeleteEmbeddingsByKbFileUIDDone() bool { - for _, e := range m.HardDeleteEmbeddingsByKbFileUIDMock.expectations { +func (m *RepositoryIMock) MinimockGetTotalChunksBySourcesDone() bool { + for _, e := range m.GetTotalChunksBySourcesMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.HardDeleteEmbeddingsByKbFileUIDMock.invocationsDone() + return m.GetTotalChunksBySourcesMock.invocationsDone() } -// MinimockHardDeleteEmbeddingsByKbFileUIDInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockHardDeleteEmbeddingsByKbFileUIDInspect() { - for _, e := range m.HardDeleteEmbeddingsByKbFileUIDMock.expectations { +// 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.HardDeleteEmbeddingsByKbFileUID with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.GetTotalChunksBySources with params: %#v", *e.params) } } - afterHardDeleteEmbeddingsByKbFileUIDCounter := mm_atomic.LoadUint64(&m.afterHardDeleteEmbeddingsByKbFileUIDCounter) + afterGetTotalChunksBySourcesCounter := mm_atomic.LoadUint64(&m.afterGetTotalChunksBySourcesCounter) // 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") + 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.HardDeleteEmbeddingsByKbFileUID with params: %#v", *m.HardDeleteEmbeddingsByKbFileUIDMock.defaultExpectation.params) + 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.funcHardDeleteEmbeddingsByKbFileUID != nil && afterHardDeleteEmbeddingsByKbFileUIDCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.HardDeleteEmbeddingsByKbFileUID") + if m.funcGetTotalChunksBySources != nil && afterGetTotalChunksBySourcesCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.GetTotalChunksBySources") } - 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) + 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 mRepositoryIMockHardDeleteEmbeddingsByKbUID struct { +type mRepositoryIMockGetTotalTokensByListKBUIDs struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockHardDeleteEmbeddingsByKbUIDExpectation - expectations []*RepositoryIMockHardDeleteEmbeddingsByKbUIDExpectation + defaultExpectation *RepositoryIMockGetTotalTokensByListKBUIDsExpectation + expectations []*RepositoryIMockGetTotalTokensByListKBUIDsExpectation - callArgs []*RepositoryIMockHardDeleteEmbeddingsByKbUIDParams + callArgs []*RepositoryIMockGetTotalTokensByListKBUIDsParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockHardDeleteEmbeddingsByKbUIDExpectation specifies expectation struct of the RepositoryI.HardDeleteEmbeddingsByKbUID -type RepositoryIMockHardDeleteEmbeddingsByKbUIDExpectation struct { +// RepositoryIMockGetTotalTokensByListKBUIDsExpectation specifies expectation struct of the RepositoryI.GetTotalTokensByListKBUIDs +type RepositoryIMockGetTotalTokensByListKBUIDsExpectation struct { mock *RepositoryIMock - params *RepositoryIMockHardDeleteEmbeddingsByKbUIDParams - paramPtrs *RepositoryIMockHardDeleteEmbeddingsByKbUIDParamPtrs - results *RepositoryIMockHardDeleteEmbeddingsByKbUIDResults + params *RepositoryIMockGetTotalTokensByListKBUIDsParams + paramPtrs *RepositoryIMockGetTotalTokensByListKBUIDsParamPtrs + results *RepositoryIMockGetTotalTokensByListKBUIDsResults Counter uint64 } -// RepositoryIMockHardDeleteEmbeddingsByKbUIDParams contains parameters of the RepositoryI.HardDeleteEmbeddingsByKbUID -type RepositoryIMockHardDeleteEmbeddingsByKbUIDParams struct { - ctx context.Context - kbUID uuid.UUID +// RepositoryIMockGetTotalTokensByListKBUIDsParams contains parameters of the RepositoryI.GetTotalTokensByListKBUIDs +type RepositoryIMockGetTotalTokensByListKBUIDsParams struct { + ctx context.Context + kbUIDs []uuid.UUID } -// RepositoryIMockHardDeleteEmbeddingsByKbUIDParamPtrs contains pointers to parameters of the RepositoryI.HardDeleteEmbeddingsByKbUID -type RepositoryIMockHardDeleteEmbeddingsByKbUIDParamPtrs struct { - ctx *context.Context - kbUID *uuid.UUID +// RepositoryIMockGetTotalTokensByListKBUIDsParamPtrs contains pointers to parameters of the RepositoryI.GetTotalTokensByListKBUIDs +type RepositoryIMockGetTotalTokensByListKBUIDsParamPtrs struct { + ctx *context.Context + kbUIDs *[]uuid.UUID } -// RepositoryIMockHardDeleteEmbeddingsByKbUIDResults contains results of the RepositoryI.HardDeleteEmbeddingsByKbUID -type RepositoryIMockHardDeleteEmbeddingsByKbUIDResults struct { +// RepositoryIMockGetTotalTokensByListKBUIDsResults contains results of the RepositoryI.GetTotalTokensByListKBUIDs +type RepositoryIMockGetTotalTokensByListKBUIDsResults struct { + m1 map[uuid.UUID]int 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") +// 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 mmHardDeleteEmbeddingsByKbUID.defaultExpectation == nil { - mmHardDeleteEmbeddingsByKbUID.defaultExpectation = &RepositoryIMockHardDeleteEmbeddingsByKbUIDExpectation{} + if mmGetTotalTokensByListKBUIDs.defaultExpectation == nil { + mmGetTotalTokensByListKBUIDs.defaultExpectation = &RepositoryIMockGetTotalTokensByListKBUIDsExpectation{} } - if mmHardDeleteEmbeddingsByKbUID.defaultExpectation.paramPtrs != nil { - mmHardDeleteEmbeddingsByKbUID.mock.t.Fatalf("RepositoryIMock.HardDeleteEmbeddingsByKbUID mock is already set by ExpectParams functions") + if mmGetTotalTokensByListKBUIDs.defaultExpectation.paramPtrs != nil { + mmGetTotalTokensByListKBUIDs.mock.t.Fatalf("RepositoryIMock.GetTotalTokensByListKBUIDs 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) + 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 mmHardDeleteEmbeddingsByKbUID + return mmGetTotalTokensByListKBUIDs } -// 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") +// 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 mmHardDeleteEmbeddingsByKbUID.defaultExpectation == nil { - mmHardDeleteEmbeddingsByKbUID.defaultExpectation = &RepositoryIMockHardDeleteEmbeddingsByKbUIDExpectation{} + if mmGetTotalTokensByListKBUIDs.defaultExpectation == nil { + mmGetTotalTokensByListKBUIDs.defaultExpectation = &RepositoryIMockGetTotalTokensByListKBUIDsExpectation{} } - if mmHardDeleteEmbeddingsByKbUID.defaultExpectation.params != nil { - mmHardDeleteEmbeddingsByKbUID.mock.t.Fatalf("RepositoryIMock.HardDeleteEmbeddingsByKbUID mock is already set by Expect") + if mmGetTotalTokensByListKBUIDs.defaultExpectation.params != nil { + mmGetTotalTokensByListKBUIDs.mock.t.Fatalf("RepositoryIMock.GetTotalTokensByListKBUIDs mock is already set by Expect") } - if mmHardDeleteEmbeddingsByKbUID.defaultExpectation.paramPtrs == nil { - mmHardDeleteEmbeddingsByKbUID.defaultExpectation.paramPtrs = &RepositoryIMockHardDeleteEmbeddingsByKbUIDParamPtrs{} + if mmGetTotalTokensByListKBUIDs.defaultExpectation.paramPtrs == nil { + mmGetTotalTokensByListKBUIDs.defaultExpectation.paramPtrs = &RepositoryIMockGetTotalTokensByListKBUIDsParamPtrs{} } - mmHardDeleteEmbeddingsByKbUID.defaultExpectation.paramPtrs.ctx = &ctx + mmGetTotalTokensByListKBUIDs.defaultExpectation.paramPtrs.ctx = &ctx - return mmHardDeleteEmbeddingsByKbUID + return mmGetTotalTokensByListKBUIDs } -// 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") +// 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 mmHardDeleteEmbeddingsByKbUID.defaultExpectation == nil { - mmHardDeleteEmbeddingsByKbUID.defaultExpectation = &RepositoryIMockHardDeleteEmbeddingsByKbUIDExpectation{} + if mmGetTotalTokensByListKBUIDs.defaultExpectation == nil { + mmGetTotalTokensByListKBUIDs.defaultExpectation = &RepositoryIMockGetTotalTokensByListKBUIDsExpectation{} } - if mmHardDeleteEmbeddingsByKbUID.defaultExpectation.params != nil { - mmHardDeleteEmbeddingsByKbUID.mock.t.Fatalf("RepositoryIMock.HardDeleteEmbeddingsByKbUID mock is already set by Expect") + if mmGetTotalTokensByListKBUIDs.defaultExpectation.params != nil { + mmGetTotalTokensByListKBUIDs.mock.t.Fatalf("RepositoryIMock.GetTotalTokensByListKBUIDs mock is already set by Expect") } - if mmHardDeleteEmbeddingsByKbUID.defaultExpectation.paramPtrs == nil { - mmHardDeleteEmbeddingsByKbUID.defaultExpectation.paramPtrs = &RepositoryIMockHardDeleteEmbeddingsByKbUIDParamPtrs{} + if mmGetTotalTokensByListKBUIDs.defaultExpectation.paramPtrs == nil { + mmGetTotalTokensByListKBUIDs.defaultExpectation.paramPtrs = &RepositoryIMockGetTotalTokensByListKBUIDsParamPtrs{} } - mmHardDeleteEmbeddingsByKbUID.defaultExpectation.paramPtrs.kbUID = &kbUID + mmGetTotalTokensByListKBUIDs.defaultExpectation.paramPtrs.kbUIDs = &kbUIDs - return mmHardDeleteEmbeddingsByKbUID + return mmGetTotalTokensByListKBUIDs } -// 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") +// 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") } - mmHardDeleteEmbeddingsByKbUID.mock.inspectFuncHardDeleteEmbeddingsByKbUID = f + mmGetTotalTokensByListKBUIDs.mock.inspectFuncGetTotalTokensByListKBUIDs = f - return mmHardDeleteEmbeddingsByKbUID + return mmGetTotalTokensByListKBUIDs } -// 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") +// 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 mmHardDeleteEmbeddingsByKbUID.defaultExpectation == nil { - mmHardDeleteEmbeddingsByKbUID.defaultExpectation = &RepositoryIMockHardDeleteEmbeddingsByKbUIDExpectation{mock: mmHardDeleteEmbeddingsByKbUID.mock} + if mmGetTotalTokensByListKBUIDs.defaultExpectation == nil { + mmGetTotalTokensByListKBUIDs.defaultExpectation = &RepositoryIMockGetTotalTokensByListKBUIDsExpectation{mock: mmGetTotalTokensByListKBUIDs.mock} } - mmHardDeleteEmbeddingsByKbUID.defaultExpectation.results = &RepositoryIMockHardDeleteEmbeddingsByKbUIDResults{err} - return mmHardDeleteEmbeddingsByKbUID.mock + mmGetTotalTokensByListKBUIDs.defaultExpectation.results = &RepositoryIMockGetTotalTokensByListKBUIDsResults{m1, err} + return mmGetTotalTokensByListKBUIDs.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") +// 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(mmHardDeleteEmbeddingsByKbUID.expectations) > 0 { - mmHardDeleteEmbeddingsByKbUID.mock.t.Fatalf("Some expectations are already set for the RepositoryI.HardDeleteEmbeddingsByKbUID method") + if len(mmGetTotalTokensByListKBUIDs.expectations) > 0 { + mmGetTotalTokensByListKBUIDs.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetTotalTokensByListKBUIDs method") } - mmHardDeleteEmbeddingsByKbUID.mock.funcHardDeleteEmbeddingsByKbUID = f - return mmHardDeleteEmbeddingsByKbUID.mock + mmGetTotalTokensByListKBUIDs.mock.funcGetTotalTokensByListKBUIDs = f + return mmGetTotalTokensByListKBUIDs.mock } -// When sets expectation for the RepositoryI.HardDeleteEmbeddingsByKbUID which will trigger the result defined by the following +// When sets expectation for the RepositoryI.GetTotalTokensByListKBUIDs 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") +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 := &RepositoryIMockHardDeleteEmbeddingsByKbUIDExpectation{ - mock: mmHardDeleteEmbeddingsByKbUID.mock, - params: &RepositoryIMockHardDeleteEmbeddingsByKbUIDParams{ctx, kbUID}, + expectation := &RepositoryIMockGetTotalTokensByListKBUIDsExpectation{ + mock: mmGetTotalTokensByListKBUIDs.mock, + params: &RepositoryIMockGetTotalTokensByListKBUIDsParams{ctx, kbUIDs}, } - mmHardDeleteEmbeddingsByKbUID.expectations = append(mmHardDeleteEmbeddingsByKbUID.expectations, expectation) + mmGetTotalTokensByListKBUIDs.expectations = append(mmGetTotalTokensByListKBUIDs.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} +// 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.HardDeleteEmbeddingsByKbUID should be invoked -func (mmHardDeleteEmbeddingsByKbUID *mRepositoryIMockHardDeleteEmbeddingsByKbUID) Times(n uint64) *mRepositoryIMockHardDeleteEmbeddingsByKbUID { +// Times sets number of times RepositoryI.GetTotalTokensByListKBUIDs should be invoked +func (mmGetTotalTokensByListKBUIDs *mRepositoryIMockGetTotalTokensByListKBUIDs) Times(n uint64) *mRepositoryIMockGetTotalTokensByListKBUIDs { if n == 0 { - mmHardDeleteEmbeddingsByKbUID.mock.t.Fatalf("Times of RepositoryIMock.HardDeleteEmbeddingsByKbUID mock can not be zero") + mmGetTotalTokensByListKBUIDs.mock.t.Fatalf("Times of RepositoryIMock.GetTotalTokensByListKBUIDs mock can not be zero") } - mm_atomic.StoreUint64(&mmHardDeleteEmbeddingsByKbUID.expectedInvocations, n) - return mmHardDeleteEmbeddingsByKbUID + mm_atomic.StoreUint64(&mmGetTotalTokensByListKBUIDs.expectedInvocations, n) + return mmGetTotalTokensByListKBUIDs } -func (mmHardDeleteEmbeddingsByKbUID *mRepositoryIMockHardDeleteEmbeddingsByKbUID) invocationsDone() bool { - if len(mmHardDeleteEmbeddingsByKbUID.expectations) == 0 && mmHardDeleteEmbeddingsByKbUID.defaultExpectation == nil && mmHardDeleteEmbeddingsByKbUID.mock.funcHardDeleteEmbeddingsByKbUID == nil { +func (mmGetTotalTokensByListKBUIDs *mRepositoryIMockGetTotalTokensByListKBUIDs) invocationsDone() bool { + if len(mmGetTotalTokensByListKBUIDs.expectations) == 0 && mmGetTotalTokensByListKBUIDs.defaultExpectation == nil && mmGetTotalTokensByListKBUIDs.mock.funcGetTotalTokensByListKBUIDs == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmHardDeleteEmbeddingsByKbUID.mock.afterHardDeleteEmbeddingsByKbUIDCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmHardDeleteEmbeddingsByKbUID.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmGetTotalTokensByListKBUIDs.mock.afterGetTotalTokensByListKBUIDsCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmGetTotalTokensByListKBUIDs.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) +// 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 mmHardDeleteEmbeddingsByKbUID.inspectFuncHardDeleteEmbeddingsByKbUID != nil { - mmHardDeleteEmbeddingsByKbUID.inspectFuncHardDeleteEmbeddingsByKbUID(ctx, kbUID) + if mmGetTotalTokensByListKBUIDs.inspectFuncGetTotalTokensByListKBUIDs != nil { + mmGetTotalTokensByListKBUIDs.inspectFuncGetTotalTokensByListKBUIDs(ctx, kbUIDs) } - mm_params := RepositoryIMockHardDeleteEmbeddingsByKbUIDParams{ctx, kbUID} + mm_params := RepositoryIMockGetTotalTokensByListKBUIDsParams{ctx, kbUIDs} // Record call args - mmHardDeleteEmbeddingsByKbUID.HardDeleteEmbeddingsByKbUIDMock.mutex.Lock() - mmHardDeleteEmbeddingsByKbUID.HardDeleteEmbeddingsByKbUIDMock.callArgs = append(mmHardDeleteEmbeddingsByKbUID.HardDeleteEmbeddingsByKbUIDMock.callArgs, &mm_params) - mmHardDeleteEmbeddingsByKbUID.HardDeleteEmbeddingsByKbUIDMock.mutex.Unlock() + mmGetTotalTokensByListKBUIDs.GetTotalTokensByListKBUIDsMock.mutex.Lock() + mmGetTotalTokensByListKBUIDs.GetTotalTokensByListKBUIDsMock.callArgs = append(mmGetTotalTokensByListKBUIDs.GetTotalTokensByListKBUIDsMock.callArgs, &mm_params) + mmGetTotalTokensByListKBUIDs.GetTotalTokensByListKBUIDsMock.mutex.Unlock() - for _, e := range mmHardDeleteEmbeddingsByKbUID.HardDeleteEmbeddingsByKbUIDMock.expectations { + for _, e := range mmGetTotalTokensByListKBUIDs.GetTotalTokensByListKBUIDsMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.err + return e.results.m1, 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 + 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 := RepositoryIMockHardDeleteEmbeddingsByKbUIDParams{ctx, kbUID} + 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) { - 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)) + 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.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)) + 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) { - mmHardDeleteEmbeddingsByKbUID.t.Errorf("RepositoryIMock.HardDeleteEmbeddingsByKbUID got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*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 := mmHardDeleteEmbeddingsByKbUID.HardDeleteEmbeddingsByKbUIDMock.defaultExpectation.results + mm_results := mmGetTotalTokensByListKBUIDs.GetTotalTokensByListKBUIDsMock.defaultExpectation.results if mm_results == nil { - mmHardDeleteEmbeddingsByKbUID.t.Fatal("No results are set for the RepositoryIMock.HardDeleteEmbeddingsByKbUID") + mmGetTotalTokensByListKBUIDs.t.Fatal("No results are set for the RepositoryIMock.GetTotalTokensByListKBUIDs") } - return (*mm_results).err + return (*mm_results).m1, (*mm_results).err } - if mmHardDeleteEmbeddingsByKbUID.funcHardDeleteEmbeddingsByKbUID != nil { - return mmHardDeleteEmbeddingsByKbUID.funcHardDeleteEmbeddingsByKbUID(ctx, kbUID) + if mmGetTotalTokensByListKBUIDs.funcGetTotalTokensByListKBUIDs != nil { + return mmGetTotalTokensByListKBUIDs.funcGetTotalTokensByListKBUIDs(ctx, kbUIDs) } - mmHardDeleteEmbeddingsByKbUID.t.Fatalf("Unexpected call to RepositoryIMock.HardDeleteEmbeddingsByKbUID. %v %v", ctx, kbUID) + mmGetTotalTokensByListKBUIDs.t.Fatalf("Unexpected call to RepositoryIMock.GetTotalTokensByListKBUIDs. %v %v", ctx, kbUIDs) return } -// HardDeleteEmbeddingsByKbUIDAfterCounter returns a count of finished RepositoryIMock.HardDeleteEmbeddingsByKbUID invocations -func (mmHardDeleteEmbeddingsByKbUID *RepositoryIMock) HardDeleteEmbeddingsByKbUIDAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmHardDeleteEmbeddingsByKbUID.afterHardDeleteEmbeddingsByKbUIDCounter) +// GetTotalTokensByListKBUIDsAfterCounter returns a count of finished RepositoryIMock.GetTotalTokensByListKBUIDs invocations +func (mmGetTotalTokensByListKBUIDs *RepositoryIMock) GetTotalTokensByListKBUIDsAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetTotalTokensByListKBUIDs.afterGetTotalTokensByListKBUIDsCounter) } -// HardDeleteEmbeddingsByKbUIDBeforeCounter returns a count of RepositoryIMock.HardDeleteEmbeddingsByKbUID invocations -func (mmHardDeleteEmbeddingsByKbUID *RepositoryIMock) HardDeleteEmbeddingsByKbUIDBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmHardDeleteEmbeddingsByKbUID.beforeHardDeleteEmbeddingsByKbUIDCounter) +// 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.HardDeleteEmbeddingsByKbUID. +// 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 (mmHardDeleteEmbeddingsByKbUID *mRepositoryIMockHardDeleteEmbeddingsByKbUID) Calls() []*RepositoryIMockHardDeleteEmbeddingsByKbUIDParams { - mmHardDeleteEmbeddingsByKbUID.mutex.RLock() +func (mmGetTotalTokensByListKBUIDs *mRepositoryIMockGetTotalTokensByListKBUIDs) Calls() []*RepositoryIMockGetTotalTokensByListKBUIDsParams { + mmGetTotalTokensByListKBUIDs.mutex.RLock() - argCopy := make([]*RepositoryIMockHardDeleteEmbeddingsByKbUIDParams, len(mmHardDeleteEmbeddingsByKbUID.callArgs)) - copy(argCopy, mmHardDeleteEmbeddingsByKbUID.callArgs) + argCopy := make([]*RepositoryIMockGetTotalTokensByListKBUIDsParams, len(mmGetTotalTokensByListKBUIDs.callArgs)) + copy(argCopy, mmGetTotalTokensByListKBUIDs.callArgs) - mmHardDeleteEmbeddingsByKbUID.mutex.RUnlock() + mmGetTotalTokensByListKBUIDs.mutex.RUnlock() return argCopy } -// MinimockHardDeleteEmbeddingsByKbUIDDone returns true if the count of the HardDeleteEmbeddingsByKbUID invocations corresponds +// MinimockGetTotalTokensByListKBUIDsDone returns true if the count of the GetTotalTokensByListKBUIDs invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockHardDeleteEmbeddingsByKbUIDDone() bool { - for _, e := range m.HardDeleteEmbeddingsByKbUIDMock.expectations { +func (m *RepositoryIMock) MinimockGetTotalTokensByListKBUIDsDone() bool { + for _, e := range m.GetTotalTokensByListKBUIDsMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.HardDeleteEmbeddingsByKbUIDMock.invocationsDone() + return m.GetTotalTokensByListKBUIDsMock.invocationsDone() } -// MinimockHardDeleteEmbeddingsByKbUIDInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockHardDeleteEmbeddingsByKbUIDInspect() { - for _, e := range m.HardDeleteEmbeddingsByKbUIDMock.expectations { +// 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.HardDeleteEmbeddingsByKbUID with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.GetTotalTokensByListKBUIDs with params: %#v", *e.params) } } - afterHardDeleteEmbeddingsByKbUIDCounter := mm_atomic.LoadUint64(&m.afterHardDeleteEmbeddingsByKbUIDCounter) + afterGetTotalTokensByListKBUIDsCounter := mm_atomic.LoadUint64(&m.afterGetTotalTokensByListKBUIDsCounter) // 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") + 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.HardDeleteEmbeddingsByKbUID with params: %#v", *m.HardDeleteEmbeddingsByKbUIDMock.defaultExpectation.params) + 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.funcHardDeleteEmbeddingsByKbUID != nil && afterHardDeleteEmbeddingsByKbUIDCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.HardDeleteEmbeddingsByKbUID") + if m.funcGetTotalTokensByListKBUIDs != nil && afterGetTotalTokensByListKBUIDsCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.GetTotalTokensByListKBUIDs") } - 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) + 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 mRepositoryIMockIncreaseKnowledgeBaseUsage struct { +type mRepositoryIMockGetTruthSourceByFileUID struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockIncreaseKnowledgeBaseUsageExpectation - expectations []*RepositoryIMockIncreaseKnowledgeBaseUsageExpectation + defaultExpectation *RepositoryIMockGetTruthSourceByFileUIDExpectation + expectations []*RepositoryIMockGetTruthSourceByFileUIDExpectation - callArgs []*RepositoryIMockIncreaseKnowledgeBaseUsageParams + callArgs []*RepositoryIMockGetTruthSourceByFileUIDParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockIncreaseKnowledgeBaseUsageExpectation specifies expectation struct of the RepositoryI.IncreaseKnowledgeBaseUsage -type RepositoryIMockIncreaseKnowledgeBaseUsageExpectation struct { +// RepositoryIMockGetTruthSourceByFileUIDExpectation specifies expectation struct of the RepositoryI.GetTruthSourceByFileUID +type RepositoryIMockGetTruthSourceByFileUIDExpectation struct { mock *RepositoryIMock - params *RepositoryIMockIncreaseKnowledgeBaseUsageParams - paramPtrs *RepositoryIMockIncreaseKnowledgeBaseUsageParamPtrs - results *RepositoryIMockIncreaseKnowledgeBaseUsageResults + params *RepositoryIMockGetTruthSourceByFileUIDParams + paramPtrs *RepositoryIMockGetTruthSourceByFileUIDParamPtrs + results *RepositoryIMockGetTruthSourceByFileUIDResults Counter uint64 } -// RepositoryIMockIncreaseKnowledgeBaseUsageParams contains parameters of the RepositoryI.IncreaseKnowledgeBaseUsage -type RepositoryIMockIncreaseKnowledgeBaseUsageParams struct { - ctx context.Context - kbUID string - amount int +// RepositoryIMockGetTruthSourceByFileUIDParams contains parameters of the RepositoryI.GetTruthSourceByFileUID +type RepositoryIMockGetTruthSourceByFileUIDParams struct { + ctx context.Context + fileUID uuid.UUID } -// RepositoryIMockIncreaseKnowledgeBaseUsageParamPtrs contains pointers to parameters of the RepositoryI.IncreaseKnowledgeBaseUsage -type RepositoryIMockIncreaseKnowledgeBaseUsageParamPtrs struct { - ctx *context.Context - kbUID *string - amount *int +// RepositoryIMockGetTruthSourceByFileUIDParamPtrs contains pointers to parameters of the RepositoryI.GetTruthSourceByFileUID +type RepositoryIMockGetTruthSourceByFileUIDParamPtrs struct { + ctx *context.Context + fileUID *uuid.UUID } -// RepositoryIMockIncreaseKnowledgeBaseUsageResults contains results of the RepositoryI.IncreaseKnowledgeBaseUsage -type RepositoryIMockIncreaseKnowledgeBaseUsageResults struct { +// RepositoryIMockGetTruthSourceByFileUIDResults contains results of the RepositoryI.GetTruthSourceByFileUID +type RepositoryIMockGetTruthSourceByFileUIDResults struct { + sp1 *mm_repository.SourceMeta 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.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 mmIncreaseKnowledgeBaseUsage.defaultExpectation == nil { - mmIncreaseKnowledgeBaseUsage.defaultExpectation = &RepositoryIMockIncreaseKnowledgeBaseUsageExpectation{} + if mmGetTruthSourceByFileUID.defaultExpectation == nil { + mmGetTruthSourceByFileUID.defaultExpectation = &RepositoryIMockGetTruthSourceByFileUIDExpectation{} } - if mmIncreaseKnowledgeBaseUsage.defaultExpectation.paramPtrs != nil { - mmIncreaseKnowledgeBaseUsage.mock.t.Fatalf("RepositoryIMock.IncreaseKnowledgeBaseUsage mock is already set by ExpectParams functions") + if mmGetTruthSourceByFileUID.defaultExpectation.paramPtrs != nil { + mmGetTruthSourceByFileUID.mock.t.Fatalf("RepositoryIMock.GetTruthSourceByFileUID 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) + 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 mmIncreaseKnowledgeBaseUsage + return mmGetTruthSourceByFileUID } -// 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") +// 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 mmIncreaseKnowledgeBaseUsage.defaultExpectation == nil { - mmIncreaseKnowledgeBaseUsage.defaultExpectation = &RepositoryIMockIncreaseKnowledgeBaseUsageExpectation{} + if mmGetTruthSourceByFileUID.defaultExpectation == nil { + mmGetTruthSourceByFileUID.defaultExpectation = &RepositoryIMockGetTruthSourceByFileUIDExpectation{} } - if mmIncreaseKnowledgeBaseUsage.defaultExpectation.params != nil { - mmIncreaseKnowledgeBaseUsage.mock.t.Fatalf("RepositoryIMock.IncreaseKnowledgeBaseUsage mock is already set by Expect") + if mmGetTruthSourceByFileUID.defaultExpectation.params != nil { + mmGetTruthSourceByFileUID.mock.t.Fatalf("RepositoryIMock.GetTruthSourceByFileUID mock is already set by Expect") } - if mmIncreaseKnowledgeBaseUsage.defaultExpectation.paramPtrs == nil { - mmIncreaseKnowledgeBaseUsage.defaultExpectation.paramPtrs = &RepositoryIMockIncreaseKnowledgeBaseUsageParamPtrs{} + if mmGetTruthSourceByFileUID.defaultExpectation.paramPtrs == nil { + mmGetTruthSourceByFileUID.defaultExpectation.paramPtrs = &RepositoryIMockGetTruthSourceByFileUIDParamPtrs{} } - mmIncreaseKnowledgeBaseUsage.defaultExpectation.paramPtrs.ctx = &ctx + mmGetTruthSourceByFileUID.defaultExpectation.paramPtrs.ctx = &ctx - return mmIncreaseKnowledgeBaseUsage + return mmGetTruthSourceByFileUID } -// 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") +// 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 mmIncreaseKnowledgeBaseUsage.defaultExpectation == nil { - mmIncreaseKnowledgeBaseUsage.defaultExpectation = &RepositoryIMockIncreaseKnowledgeBaseUsageExpectation{} + if mmGetTruthSourceByFileUID.defaultExpectation == nil { + mmGetTruthSourceByFileUID.defaultExpectation = &RepositoryIMockGetTruthSourceByFileUIDExpectation{} } - if mmIncreaseKnowledgeBaseUsage.defaultExpectation.params != nil { - mmIncreaseKnowledgeBaseUsage.mock.t.Fatalf("RepositoryIMock.IncreaseKnowledgeBaseUsage mock is already set by Expect") + if mmGetTruthSourceByFileUID.defaultExpectation.params != nil { + mmGetTruthSourceByFileUID.mock.t.Fatalf("RepositoryIMock.GetTruthSourceByFileUID mock is already set by Expect") } - if mmIncreaseKnowledgeBaseUsage.defaultExpectation.paramPtrs == nil { - mmIncreaseKnowledgeBaseUsage.defaultExpectation.paramPtrs = &RepositoryIMockIncreaseKnowledgeBaseUsageParamPtrs{} + if mmGetTruthSourceByFileUID.defaultExpectation.paramPtrs == nil { + mmGetTruthSourceByFileUID.defaultExpectation.paramPtrs = &RepositoryIMockGetTruthSourceByFileUIDParamPtrs{} } - mmIncreaseKnowledgeBaseUsage.defaultExpectation.paramPtrs.kbUID = &kbUID + mmGetTruthSourceByFileUID.defaultExpectation.paramPtrs.fileUID = &fileUID - return mmIncreaseKnowledgeBaseUsage + return mmGetTruthSourceByFileUID } -// 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") +// 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") } - if mmIncreaseKnowledgeBaseUsage.defaultExpectation == nil { - mmIncreaseKnowledgeBaseUsage.defaultExpectation = &RepositoryIMockIncreaseKnowledgeBaseUsageExpectation{} - } + mmGetTruthSourceByFileUID.mock.inspectFuncGetTruthSourceByFileUID = f - if mmIncreaseKnowledgeBaseUsage.defaultExpectation.params != nil { - mmIncreaseKnowledgeBaseUsage.mock.t.Fatalf("RepositoryIMock.IncreaseKnowledgeBaseUsage mock is already set by Expect") - } + return mmGetTruthSourceByFileUID +} - if mmIncreaseKnowledgeBaseUsage.defaultExpectation.paramPtrs == nil { - mmIncreaseKnowledgeBaseUsage.defaultExpectation.paramPtrs = &RepositoryIMockIncreaseKnowledgeBaseUsageParamPtrs{} +// 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") } - mmIncreaseKnowledgeBaseUsage.defaultExpectation.paramPtrs.amount = &amount - return mmIncreaseKnowledgeBaseUsage + if mmGetTruthSourceByFileUID.defaultExpectation == nil { + mmGetTruthSourceByFileUID.defaultExpectation = &RepositoryIMockGetTruthSourceByFileUIDExpectation{mock: mmGetTruthSourceByFileUID.mock} + } + mmGetTruthSourceByFileUID.defaultExpectation.results = &RepositoryIMockGetTruthSourceByFileUIDResults{sp1, err} + return mmGetTruthSourceByFileUID.mock } -// 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") +// 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") } - mmIncreaseKnowledgeBaseUsage.mock.inspectFuncIncreaseKnowledgeBaseUsage = f + if len(mmGetTruthSourceByFileUID.expectations) > 0 { + mmGetTruthSourceByFileUID.mock.t.Fatalf("Some expectations are already set for the RepositoryI.GetTruthSourceByFileUID method") + } - return mmIncreaseKnowledgeBaseUsage + mmGetTruthSourceByFileUID.mock.funcGetTruthSourceByFileUID = f + return mmGetTruthSourceByFileUID.mock } -// 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 +// When sets expectation for the RepositoryI.GetTruthSourceByFileUID 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 (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 := &RepositoryIMockIncreaseKnowledgeBaseUsageExpectation{ - mock: mmIncreaseKnowledgeBaseUsage.mock, - params: &RepositoryIMockIncreaseKnowledgeBaseUsageParams{ctx, kbUID, amount}, + expectation := &RepositoryIMockGetTruthSourceByFileUIDExpectation{ + mock: mmGetTruthSourceByFileUID.mock, + params: &RepositoryIMockGetTruthSourceByFileUIDParams{ctx, fileUID}, } - mmIncreaseKnowledgeBaseUsage.expectations = append(mmIncreaseKnowledgeBaseUsage.expectations, expectation) + mmGetTruthSourceByFileUID.expectations = append(mmGetTruthSourceByFileUID.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.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.IncreaseKnowledgeBaseUsage should be invoked -func (mmIncreaseKnowledgeBaseUsage *mRepositoryIMockIncreaseKnowledgeBaseUsage) Times(n uint64) *mRepositoryIMockIncreaseKnowledgeBaseUsage { +// Times sets number of times RepositoryI.GetTruthSourceByFileUID should be invoked +func (mmGetTruthSourceByFileUID *mRepositoryIMockGetTruthSourceByFileUID) Times(n uint64) *mRepositoryIMockGetTruthSourceByFileUID { if n == 0 { - mmIncreaseKnowledgeBaseUsage.mock.t.Fatalf("Times of RepositoryIMock.IncreaseKnowledgeBaseUsage mock can not be zero") + mmGetTruthSourceByFileUID.mock.t.Fatalf("Times of RepositoryIMock.GetTruthSourceByFileUID mock can not be zero") } - mm_atomic.StoreUint64(&mmIncreaseKnowledgeBaseUsage.expectedInvocations, n) - return mmIncreaseKnowledgeBaseUsage + mm_atomic.StoreUint64(&mmGetTruthSourceByFileUID.expectedInvocations, n) + return mmGetTruthSourceByFileUID } -func (mmIncreaseKnowledgeBaseUsage *mRepositoryIMockIncreaseKnowledgeBaseUsage) invocationsDone() bool { - if len(mmIncreaseKnowledgeBaseUsage.expectations) == 0 && mmIncreaseKnowledgeBaseUsage.defaultExpectation == nil && mmIncreaseKnowledgeBaseUsage.mock.funcIncreaseKnowledgeBaseUsage == nil { +func (mmGetTruthSourceByFileUID *mRepositoryIMockGetTruthSourceByFileUID) invocationsDone() bool { + if len(mmGetTruthSourceByFileUID.expectations) == 0 && mmGetTruthSourceByFileUID.defaultExpectation == nil && mmGetTruthSourceByFileUID.mock.funcGetTruthSourceByFileUID == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmIncreaseKnowledgeBaseUsage.mock.afterIncreaseKnowledgeBaseUsageCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmIncreaseKnowledgeBaseUsage.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmGetTruthSourceByFileUID.mock.afterGetTruthSourceByFileUIDCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmGetTruthSourceByFileUID.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) +// 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 mmIncreaseKnowledgeBaseUsage.inspectFuncIncreaseKnowledgeBaseUsage != nil { - mmIncreaseKnowledgeBaseUsage.inspectFuncIncreaseKnowledgeBaseUsage(ctx, kbUID, amount) + if mmGetTruthSourceByFileUID.inspectFuncGetTruthSourceByFileUID != nil { + mmGetTruthSourceByFileUID.inspectFuncGetTruthSourceByFileUID(ctx, fileUID) } - mm_params := RepositoryIMockIncreaseKnowledgeBaseUsageParams{ctx, kbUID, amount} + mm_params := RepositoryIMockGetTruthSourceByFileUIDParams{ctx, fileUID} // Record call args - mmIncreaseKnowledgeBaseUsage.IncreaseKnowledgeBaseUsageMock.mutex.Lock() - mmIncreaseKnowledgeBaseUsage.IncreaseKnowledgeBaseUsageMock.callArgs = append(mmIncreaseKnowledgeBaseUsage.IncreaseKnowledgeBaseUsageMock.callArgs, &mm_params) - mmIncreaseKnowledgeBaseUsage.IncreaseKnowledgeBaseUsageMock.mutex.Unlock() + mmGetTruthSourceByFileUID.GetTruthSourceByFileUIDMock.mutex.Lock() + mmGetTruthSourceByFileUID.GetTruthSourceByFileUIDMock.callArgs = append(mmGetTruthSourceByFileUID.GetTruthSourceByFileUIDMock.callArgs, &mm_params) + mmGetTruthSourceByFileUID.GetTruthSourceByFileUIDMock.mutex.Unlock() - for _, e := range mmIncreaseKnowledgeBaseUsage.IncreaseKnowledgeBaseUsageMock.expectations { + for _, e := range mmGetTruthSourceByFileUID.GetTruthSourceByFileUIDMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.err + return e.results.sp1, 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 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 := RepositoryIMockIncreaseKnowledgeBaseUsageParams{ctx, kbUID, amount} + 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) { - 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)) + 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.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.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) { - mmIncreaseKnowledgeBaseUsage.t.Errorf("RepositoryIMock.IncreaseKnowledgeBaseUsage got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*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 := mmIncreaseKnowledgeBaseUsage.IncreaseKnowledgeBaseUsageMock.defaultExpectation.results + mm_results := mmGetTruthSourceByFileUID.GetTruthSourceByFileUIDMock.defaultExpectation.results if mm_results == nil { - mmIncreaseKnowledgeBaseUsage.t.Fatal("No results are set for the RepositoryIMock.IncreaseKnowledgeBaseUsage") + mmGetTruthSourceByFileUID.t.Fatal("No results are set for the RepositoryIMock.GetTruthSourceByFileUID") } - return (*mm_results).err + return (*mm_results).sp1, (*mm_results).err } - if mmIncreaseKnowledgeBaseUsage.funcIncreaseKnowledgeBaseUsage != nil { - return mmIncreaseKnowledgeBaseUsage.funcIncreaseKnowledgeBaseUsage(ctx, kbUID, amount) + if mmGetTruthSourceByFileUID.funcGetTruthSourceByFileUID != nil { + return mmGetTruthSourceByFileUID.funcGetTruthSourceByFileUID(ctx, fileUID) } - mmIncreaseKnowledgeBaseUsage.t.Fatalf("Unexpected call to RepositoryIMock.IncreaseKnowledgeBaseUsage. %v %v %v", ctx, kbUID, amount) + mmGetTruthSourceByFileUID.t.Fatalf("Unexpected call to RepositoryIMock.GetTruthSourceByFileUID. %v %v", ctx, fileUID) return } -// IncreaseKnowledgeBaseUsageAfterCounter returns a count of finished RepositoryIMock.IncreaseKnowledgeBaseUsage invocations -func (mmIncreaseKnowledgeBaseUsage *RepositoryIMock) IncreaseKnowledgeBaseUsageAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmIncreaseKnowledgeBaseUsage.afterIncreaseKnowledgeBaseUsageCounter) +// GetTruthSourceByFileUIDAfterCounter returns a count of finished RepositoryIMock.GetTruthSourceByFileUID invocations +func (mmGetTruthSourceByFileUID *RepositoryIMock) GetTruthSourceByFileUIDAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmGetTruthSourceByFileUID.afterGetTruthSourceByFileUIDCounter) } -// IncreaseKnowledgeBaseUsageBeforeCounter returns a count of RepositoryIMock.IncreaseKnowledgeBaseUsage invocations -func (mmIncreaseKnowledgeBaseUsage *RepositoryIMock) IncreaseKnowledgeBaseUsageBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmIncreaseKnowledgeBaseUsage.beforeIncreaseKnowledgeBaseUsageCounter) +// 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.IncreaseKnowledgeBaseUsage. +// 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 (mmIncreaseKnowledgeBaseUsage *mRepositoryIMockIncreaseKnowledgeBaseUsage) Calls() []*RepositoryIMockIncreaseKnowledgeBaseUsageParams { - mmIncreaseKnowledgeBaseUsage.mutex.RLock() +func (mmGetTruthSourceByFileUID *mRepositoryIMockGetTruthSourceByFileUID) Calls() []*RepositoryIMockGetTruthSourceByFileUIDParams { + mmGetTruthSourceByFileUID.mutex.RLock() - argCopy := make([]*RepositoryIMockIncreaseKnowledgeBaseUsageParams, len(mmIncreaseKnowledgeBaseUsage.callArgs)) - copy(argCopy, mmIncreaseKnowledgeBaseUsage.callArgs) + argCopy := make([]*RepositoryIMockGetTruthSourceByFileUIDParams, len(mmGetTruthSourceByFileUID.callArgs)) + copy(argCopy, mmGetTruthSourceByFileUID.callArgs) - mmIncreaseKnowledgeBaseUsage.mutex.RUnlock() + mmGetTruthSourceByFileUID.mutex.RUnlock() return argCopy } -// MinimockIncreaseKnowledgeBaseUsageDone returns true if the count of the IncreaseKnowledgeBaseUsage invocations corresponds +// MinimockGetTruthSourceByFileUIDDone returns true if the count of the GetTruthSourceByFileUID invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockIncreaseKnowledgeBaseUsageDone() bool { - for _, e := range m.IncreaseKnowledgeBaseUsageMock.expectations { +func (m *RepositoryIMock) MinimockGetTruthSourceByFileUIDDone() bool { + for _, e := range m.GetTruthSourceByFileUIDMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.IncreaseKnowledgeBaseUsageMock.invocationsDone() + return m.GetTruthSourceByFileUIDMock.invocationsDone() } -// MinimockIncreaseKnowledgeBaseUsageInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockIncreaseKnowledgeBaseUsageInspect() { - for _, e := range m.IncreaseKnowledgeBaseUsageMock.expectations { +// 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.IncreaseKnowledgeBaseUsage with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.GetTruthSourceByFileUID with params: %#v", *e.params) } } - afterIncreaseKnowledgeBaseUsageCounter := mm_atomic.LoadUint64(&m.afterIncreaseKnowledgeBaseUsageCounter) + afterGetTruthSourceByFileUIDCounter := mm_atomic.LoadUint64(&m.afterGetTruthSourceByFileUIDCounter) // 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.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.IncreaseKnowledgeBaseUsage with params: %#v", *m.IncreaseKnowledgeBaseUsageMock.defaultExpectation.params) + 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.funcIncreaseKnowledgeBaseUsage != nil && afterIncreaseKnowledgeBaseUsageCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.IncreaseKnowledgeBaseUsage") + if m.funcGetTruthSourceByFileUID != nil && afterGetTruthSourceByFileUIDCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.GetTruthSourceByFileUID") } - 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.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 mRepositoryIMockKnowledgeBaseFileTableName struct { +type mRepositoryIMockHardDeleteChunksByKbFileUID struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockKnowledgeBaseFileTableNameExpectation - expectations []*RepositoryIMockKnowledgeBaseFileTableNameExpectation + defaultExpectation *RepositoryIMockHardDeleteChunksByKbFileUIDExpectation + expectations []*RepositoryIMockHardDeleteChunksByKbFileUIDExpectation + + callArgs []*RepositoryIMockHardDeleteChunksByKbFileUIDParams + mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockKnowledgeBaseFileTableNameExpectation specifies expectation struct of the RepositoryI.KnowledgeBaseFileTableName -type RepositoryIMockKnowledgeBaseFileTableNameExpectation struct { - mock *RepositoryIMock +// RepositoryIMockHardDeleteChunksByKbFileUIDExpectation specifies expectation struct of the RepositoryI.HardDeleteChunksByKbFileUID +type RepositoryIMockHardDeleteChunksByKbFileUIDExpectation struct { + mock *RepositoryIMock + params *RepositoryIMockHardDeleteChunksByKbFileUIDParams + paramPtrs *RepositoryIMockHardDeleteChunksByKbFileUIDParamPtrs + results *RepositoryIMockHardDeleteChunksByKbFileUIDResults + Counter uint64 +} - results *RepositoryIMockKnowledgeBaseFileTableNameResults - Counter uint64 +// RepositoryIMockHardDeleteChunksByKbFileUIDParams contains parameters of the RepositoryI.HardDeleteChunksByKbFileUID +type RepositoryIMockHardDeleteChunksByKbFileUIDParams struct { + ctx context.Context + kbFileUID uuid.UUID } -// RepositoryIMockKnowledgeBaseFileTableNameResults contains results of the RepositoryI.KnowledgeBaseFileTableName -type RepositoryIMockKnowledgeBaseFileTableNameResults struct { - s1 string +// RepositoryIMockHardDeleteChunksByKbFileUIDParamPtrs contains pointers to parameters of the RepositoryI.HardDeleteChunksByKbFileUID +type RepositoryIMockHardDeleteChunksByKbFileUIDParamPtrs 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") - } +// RepositoryIMockHardDeleteChunksByKbFileUIDResults contains results of the RepositoryI.HardDeleteChunksByKbFileUID +type RepositoryIMockHardDeleteChunksByKbFileUIDResults struct { + err error +} - if mmKnowledgeBaseFileTableName.defaultExpectation == nil { - mmKnowledgeBaseFileTableName.defaultExpectation = &RepositoryIMockKnowledgeBaseFileTableNameExpectation{} +// 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") } - return mmKnowledgeBaseFileTableName -} + if mmHardDeleteChunksByKbFileUID.defaultExpectation == nil { + mmHardDeleteChunksByKbFileUID.defaultExpectation = &RepositoryIMockHardDeleteChunksByKbFileUIDExpectation{} + } -// 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") + if mmHardDeleteChunksByKbFileUID.defaultExpectation.paramPtrs != nil { + mmHardDeleteChunksByKbFileUID.mock.t.Fatalf("RepositoryIMock.HardDeleteChunksByKbFileUID mock is already set by ExpectParams functions") } - mmKnowledgeBaseFileTableName.mock.inspectFuncKnowledgeBaseFileTableName = f + 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 mmKnowledgeBaseFileTableName + return mmHardDeleteChunksByKbFileUID } -// 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} +// 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") } - mmKnowledgeBaseFileTableName.defaultExpectation.results = &RepositoryIMockKnowledgeBaseFileTableNameResults{s1} - return mmKnowledgeBaseFileTableName.mock + + 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 } -// 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") +// 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 len(mmKnowledgeBaseFileTableName.expectations) > 0 { - mmKnowledgeBaseFileTableName.mock.t.Fatalf("Some expectations are already set for the RepositoryI.KnowledgeBaseFileTableName method") + if mmHardDeleteChunksByKbFileUID.defaultExpectation == nil { + mmHardDeleteChunksByKbFileUID.defaultExpectation = &RepositoryIMockHardDeleteChunksByKbFileUIDExpectation{} } - mmKnowledgeBaseFileTableName.mock.funcKnowledgeBaseFileTableName = f - return mmKnowledgeBaseFileTableName.mock + 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 } -// Times sets number of times RepositoryI.KnowledgeBaseFileTableName should be invoked -func (mmKnowledgeBaseFileTableName *mRepositoryIMockKnowledgeBaseFileTableName) Times(n uint64) *mRepositoryIMockKnowledgeBaseFileTableName { +// 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 { - mmKnowledgeBaseFileTableName.mock.t.Fatalf("Times of RepositoryIMock.KnowledgeBaseFileTableName mock can not be zero") + mmHardDeleteChunksByKbFileUID.mock.t.Fatalf("Times of RepositoryIMock.HardDeleteChunksByKbFileUID mock can not be zero") } - mm_atomic.StoreUint64(&mmKnowledgeBaseFileTableName.expectedInvocations, n) - return mmKnowledgeBaseFileTableName + mm_atomic.StoreUint64(&mmHardDeleteChunksByKbFileUID.expectedInvocations, n) + return mmHardDeleteChunksByKbFileUID } -func (mmKnowledgeBaseFileTableName *mRepositoryIMockKnowledgeBaseFileTableName) invocationsDone() bool { - if len(mmKnowledgeBaseFileTableName.expectations) == 0 && mmKnowledgeBaseFileTableName.defaultExpectation == nil && mmKnowledgeBaseFileTableName.mock.funcKnowledgeBaseFileTableName == nil { +func (mmHardDeleteChunksByKbFileUID *mRepositoryIMockHardDeleteChunksByKbFileUID) invocationsDone() bool { + if len(mmHardDeleteChunksByKbFileUID.expectations) == 0 && mmHardDeleteChunksByKbFileUID.defaultExpectation == nil && mmHardDeleteChunksByKbFileUID.mock.funcHardDeleteChunksByKbFileUID == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmKnowledgeBaseFileTableName.mock.afterKnowledgeBaseFileTableNameCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmKnowledgeBaseFileTableName.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmHardDeleteChunksByKbFileUID.mock.afterHardDeleteChunksByKbFileUIDCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmHardDeleteChunksByKbFileUID.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) +// 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 mmKnowledgeBaseFileTableName.inspectFuncKnowledgeBaseFileTableName != nil { - mmKnowledgeBaseFileTableName.inspectFuncKnowledgeBaseFileTableName() + if mmHardDeleteChunksByKbFileUID.inspectFuncHardDeleteChunksByKbFileUID != nil { + mmHardDeleteChunksByKbFileUID.inspectFuncHardDeleteChunksByKbFileUID(ctx, kbFileUID) } - if mmKnowledgeBaseFileTableName.KnowledgeBaseFileTableNameMock.defaultExpectation != nil { - mm_atomic.AddUint64(&mmKnowledgeBaseFileTableName.KnowledgeBaseFileTableNameMock.defaultExpectation.Counter, 1) + mm_params := RepositoryIMockHardDeleteChunksByKbFileUIDParams{ctx, kbFileUID} - mm_results := mmKnowledgeBaseFileTableName.KnowledgeBaseFileTableNameMock.defaultExpectation.results + // 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 { - mmKnowledgeBaseFileTableName.t.Fatal("No results are set for the RepositoryIMock.KnowledgeBaseFileTableName") + mmHardDeleteChunksByKbFileUID.t.Fatal("No results are set for the RepositoryIMock.HardDeleteChunksByKbFileUID") } - return (*mm_results).s1 + return (*mm_results).err } - if mmKnowledgeBaseFileTableName.funcKnowledgeBaseFileTableName != nil { - return mmKnowledgeBaseFileTableName.funcKnowledgeBaseFileTableName() + if mmHardDeleteChunksByKbFileUID.funcHardDeleteChunksByKbFileUID != nil { + return mmHardDeleteChunksByKbFileUID.funcHardDeleteChunksByKbFileUID(ctx, kbFileUID) } - mmKnowledgeBaseFileTableName.t.Fatalf("Unexpected call to RepositoryIMock.KnowledgeBaseFileTableName.") + mmHardDeleteChunksByKbFileUID.t.Fatalf("Unexpected call to RepositoryIMock.HardDeleteChunksByKbFileUID. %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) +// HardDeleteChunksByKbFileUIDAfterCounter returns a count of finished RepositoryIMock.HardDeleteChunksByKbFileUID invocations +func (mmHardDeleteChunksByKbFileUID *RepositoryIMock) HardDeleteChunksByKbFileUIDAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmHardDeleteChunksByKbFileUID.afterHardDeleteChunksByKbFileUIDCounter) } -// KnowledgeBaseFileTableNameBeforeCounter returns a count of RepositoryIMock.KnowledgeBaseFileTableName invocations -func (mmKnowledgeBaseFileTableName *RepositoryIMock) KnowledgeBaseFileTableNameBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmKnowledgeBaseFileTableName.beforeKnowledgeBaseFileTableNameCounter) +// HardDeleteChunksByKbFileUIDBeforeCounter returns a count of RepositoryIMock.HardDeleteChunksByKbFileUID invocations +func (mmHardDeleteChunksByKbFileUID *RepositoryIMock) HardDeleteChunksByKbFileUIDBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmHardDeleteChunksByKbFileUID.beforeHardDeleteChunksByKbFileUIDCounter) } -// MinimockKnowledgeBaseFileTableNameDone returns true if the count of the KnowledgeBaseFileTableName invocations corresponds +// 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) MinimockKnowledgeBaseFileTableNameDone() bool { - for _, e := range m.KnowledgeBaseFileTableNameMock.expectations { +func (m *RepositoryIMock) MinimockHardDeleteChunksByKbFileUIDDone() bool { + for _, e := range m.HardDeleteChunksByKbFileUIDMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.KnowledgeBaseFileTableNameMock.invocationsDone() + return m.HardDeleteChunksByKbFileUIDMock.invocationsDone() } -// MinimockKnowledgeBaseFileTableNameInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockKnowledgeBaseFileTableNameInspect() { - for _, e := range m.KnowledgeBaseFileTableNameMock.expectations { +// MinimockHardDeleteChunksByKbFileUIDInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockHardDeleteChunksByKbFileUIDInspect() { + for _, e := range m.HardDeleteChunksByKbFileUIDMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { - m.t.Error("Expected call to RepositoryIMock.KnowledgeBaseFileTableName") + m.t.Errorf("Expected call to RepositoryIMock.HardDeleteChunksByKbFileUID with params: %#v", *e.params) } } - afterKnowledgeBaseFileTableNameCounter := mm_atomic.LoadUint64(&m.afterKnowledgeBaseFileTableNameCounter) + afterHardDeleteChunksByKbFileUIDCounter := mm_atomic.LoadUint64(&m.afterHardDeleteChunksByKbFileUIDCounter) // 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.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.funcKnowledgeBaseFileTableName != nil && afterKnowledgeBaseFileTableNameCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.KnowledgeBaseFileTableName") + if m.funcHardDeleteChunksByKbFileUID != nil && afterHardDeleteChunksByKbFileUIDCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.HardDeleteChunksByKbFileUID") } - 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.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 mRepositoryIMockListChunksByKbFileUID struct { +type mRepositoryIMockHardDeleteChunksByKbUID struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockListChunksByKbFileUIDExpectation - expectations []*RepositoryIMockListChunksByKbFileUIDExpectation + defaultExpectation *RepositoryIMockHardDeleteChunksByKbUIDExpectation + expectations []*RepositoryIMockHardDeleteChunksByKbUIDExpectation - callArgs []*RepositoryIMockListChunksByKbFileUIDParams + callArgs []*RepositoryIMockHardDeleteChunksByKbUIDParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockListChunksByKbFileUIDExpectation specifies expectation struct of the RepositoryI.ListChunksByKbFileUID -type RepositoryIMockListChunksByKbFileUIDExpectation struct { - mock *RepositoryIMock - params *RepositoryIMockListChunksByKbFileUIDParams - paramPtrs *RepositoryIMockListChunksByKbFileUIDParamPtrs - results *RepositoryIMockListChunksByKbFileUIDResults +// RepositoryIMockHardDeleteChunksByKbUIDExpectation specifies expectation struct of the RepositoryI.HardDeleteChunksByKbUID +type RepositoryIMockHardDeleteChunksByKbUIDExpectation struct { + mock *RepositoryIMock + params *RepositoryIMockHardDeleteChunksByKbUIDParams + paramPtrs *RepositoryIMockHardDeleteChunksByKbUIDParamPtrs + results *RepositoryIMockHardDeleteChunksByKbUIDResults Counter uint64 } -// RepositoryIMockListChunksByKbFileUIDParams contains parameters of the RepositoryI.ListChunksByKbFileUID -type RepositoryIMockListChunksByKbFileUIDParams struct { - ctx context.Context - kbFileUID uuid.UUID +// RepositoryIMockHardDeleteChunksByKbUIDParams contains parameters of the RepositoryI.HardDeleteChunksByKbUID +type RepositoryIMockHardDeleteChunksByKbUIDParams struct { + ctx context.Context + kbUID uuid.UUID } -// RepositoryIMockListChunksByKbFileUIDParamPtrs contains pointers to parameters of the RepositoryI.ListChunksByKbFileUID -type RepositoryIMockListChunksByKbFileUIDParamPtrs struct { - ctx *context.Context - kbFileUID *uuid.UUID +// RepositoryIMockHardDeleteChunksByKbUIDParamPtrs contains pointers to parameters of the RepositoryI.HardDeleteChunksByKbUID +type RepositoryIMockHardDeleteChunksByKbUIDParamPtrs struct { + ctx *context.Context + kbUID *uuid.UUID } -// RepositoryIMockListChunksByKbFileUIDResults contains results of the RepositoryI.ListChunksByKbFileUID -type RepositoryIMockListChunksByKbFileUIDResults struct { - ta1 []mm_repository.TextChunk +// RepositoryIMockHardDeleteChunksByKbUIDResults contains results of the RepositoryI.HardDeleteChunksByKbUID +type RepositoryIMockHardDeleteChunksByKbUIDResults struct { err error } -// 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") +// 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 mmListChunksByKbFileUID.defaultExpectation == nil { - mmListChunksByKbFileUID.defaultExpectation = &RepositoryIMockListChunksByKbFileUIDExpectation{} + if mmHardDeleteChunksByKbUID.defaultExpectation == nil { + mmHardDeleteChunksByKbUID.defaultExpectation = &RepositoryIMockHardDeleteChunksByKbUIDExpectation{} } - if mmListChunksByKbFileUID.defaultExpectation.paramPtrs != nil { - mmListChunksByKbFileUID.mock.t.Fatalf("RepositoryIMock.ListChunksByKbFileUID mock is already set by ExpectParams functions") + if mmHardDeleteChunksByKbUID.defaultExpectation.paramPtrs != nil { + mmHardDeleteChunksByKbUID.mock.t.Fatalf("RepositoryIMock.HardDeleteChunksByKbUID mock is already set by ExpectParams functions") } - 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) + 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 mmListChunksByKbFileUID + return mmHardDeleteChunksByKbUID } -// 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") +// 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 mmListChunksByKbFileUID.defaultExpectation == nil { - mmListChunksByKbFileUID.defaultExpectation = &RepositoryIMockListChunksByKbFileUIDExpectation{} + if mmHardDeleteChunksByKbUID.defaultExpectation == nil { + mmHardDeleteChunksByKbUID.defaultExpectation = &RepositoryIMockHardDeleteChunksByKbUIDExpectation{} } - if mmListChunksByKbFileUID.defaultExpectation.params != nil { - mmListChunksByKbFileUID.mock.t.Fatalf("RepositoryIMock.ListChunksByKbFileUID mock is already set by Expect") + if mmHardDeleteChunksByKbUID.defaultExpectation.params != nil { + mmHardDeleteChunksByKbUID.mock.t.Fatalf("RepositoryIMock.HardDeleteChunksByKbUID mock is already set by Expect") } - if mmListChunksByKbFileUID.defaultExpectation.paramPtrs == nil { - mmListChunksByKbFileUID.defaultExpectation.paramPtrs = &RepositoryIMockListChunksByKbFileUIDParamPtrs{} + if mmHardDeleteChunksByKbUID.defaultExpectation.paramPtrs == nil { + mmHardDeleteChunksByKbUID.defaultExpectation.paramPtrs = &RepositoryIMockHardDeleteChunksByKbUIDParamPtrs{} } - mmListChunksByKbFileUID.defaultExpectation.paramPtrs.ctx = &ctx + mmHardDeleteChunksByKbUID.defaultExpectation.paramPtrs.ctx = &ctx - return mmListChunksByKbFileUID + return mmHardDeleteChunksByKbUID } -// 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") +// 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 mmListChunksByKbFileUID.defaultExpectation == nil { - mmListChunksByKbFileUID.defaultExpectation = &RepositoryIMockListChunksByKbFileUIDExpectation{} + if mmHardDeleteChunksByKbUID.defaultExpectation == nil { + mmHardDeleteChunksByKbUID.defaultExpectation = &RepositoryIMockHardDeleteChunksByKbUIDExpectation{} } - if mmListChunksByKbFileUID.defaultExpectation.params != nil { - mmListChunksByKbFileUID.mock.t.Fatalf("RepositoryIMock.ListChunksByKbFileUID mock is already set by Expect") + if mmHardDeleteChunksByKbUID.defaultExpectation.params != nil { + mmHardDeleteChunksByKbUID.mock.t.Fatalf("RepositoryIMock.HardDeleteChunksByKbUID mock is already set by Expect") } - if mmListChunksByKbFileUID.defaultExpectation.paramPtrs == nil { - mmListChunksByKbFileUID.defaultExpectation.paramPtrs = &RepositoryIMockListChunksByKbFileUIDParamPtrs{} + if mmHardDeleteChunksByKbUID.defaultExpectation.paramPtrs == nil { + mmHardDeleteChunksByKbUID.defaultExpectation.paramPtrs = &RepositoryIMockHardDeleteChunksByKbUIDParamPtrs{} } - mmListChunksByKbFileUID.defaultExpectation.paramPtrs.kbFileUID = &kbFileUID + mmHardDeleteChunksByKbUID.defaultExpectation.paramPtrs.kbUID = &kbUID - return mmListChunksByKbFileUID + return mmHardDeleteChunksByKbUID } -// 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") +// 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") } - mmListChunksByKbFileUID.mock.inspectFuncListChunksByKbFileUID = f + mmHardDeleteChunksByKbUID.mock.inspectFuncHardDeleteChunksByKbUID = f - return mmListChunksByKbFileUID + return mmHardDeleteChunksByKbUID } -// 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") +// 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 mmListChunksByKbFileUID.defaultExpectation == nil { - mmListChunksByKbFileUID.defaultExpectation = &RepositoryIMockListChunksByKbFileUIDExpectation{mock: mmListChunksByKbFileUID.mock} + if mmHardDeleteChunksByKbUID.defaultExpectation == nil { + mmHardDeleteChunksByKbUID.defaultExpectation = &RepositoryIMockHardDeleteChunksByKbUIDExpectation{mock: mmHardDeleteChunksByKbUID.mock} } - mmListChunksByKbFileUID.defaultExpectation.results = &RepositoryIMockListChunksByKbFileUIDResults{ta1, err} - return mmListChunksByKbFileUID.mock + mmHardDeleteChunksByKbUID.defaultExpectation.results = &RepositoryIMockHardDeleteChunksByKbUIDResults{err} + return mmHardDeleteChunksByKbUID.mock } -// 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") +// 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(mmListChunksByKbFileUID.expectations) > 0 { - mmListChunksByKbFileUID.mock.t.Fatalf("Some expectations are already set for the RepositoryI.ListChunksByKbFileUID method") + if len(mmHardDeleteChunksByKbUID.expectations) > 0 { + mmHardDeleteChunksByKbUID.mock.t.Fatalf("Some expectations are already set for the RepositoryI.HardDeleteChunksByKbUID method") } - mmListChunksByKbFileUID.mock.funcListChunksByKbFileUID = f - return mmListChunksByKbFileUID.mock + mmHardDeleteChunksByKbUID.mock.funcHardDeleteChunksByKbUID = f + return mmHardDeleteChunksByKbUID.mock } -// When sets expectation for the RepositoryI.ListChunksByKbFileUID which will trigger the result defined by the following +// When sets expectation for the RepositoryI.HardDeleteChunksByKbUID which will trigger the result defined by the following // Then helper -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") +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 := &RepositoryIMockListChunksByKbFileUIDExpectation{ - mock: mmListChunksByKbFileUID.mock, - params: &RepositoryIMockListChunksByKbFileUIDParams{ctx, kbFileUID}, + expectation := &RepositoryIMockHardDeleteChunksByKbUIDExpectation{ + mock: mmHardDeleteChunksByKbUID.mock, + params: &RepositoryIMockHardDeleteChunksByKbUIDParams{ctx, kbUID}, } - mmListChunksByKbFileUID.expectations = append(mmListChunksByKbFileUID.expectations, expectation) + mmHardDeleteChunksByKbUID.expectations = append(mmHardDeleteChunksByKbUID.expectations, expectation) return expectation } -// 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} +// 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.ListChunksByKbFileUID should be invoked -func (mmListChunksByKbFileUID *mRepositoryIMockListChunksByKbFileUID) Times(n uint64) *mRepositoryIMockListChunksByKbFileUID { +// Times sets number of times RepositoryI.HardDeleteChunksByKbUID should be invoked +func (mmHardDeleteChunksByKbUID *mRepositoryIMockHardDeleteChunksByKbUID) Times(n uint64) *mRepositoryIMockHardDeleteChunksByKbUID { if n == 0 { - mmListChunksByKbFileUID.mock.t.Fatalf("Times of RepositoryIMock.ListChunksByKbFileUID mock can not be zero") + mmHardDeleteChunksByKbUID.mock.t.Fatalf("Times of RepositoryIMock.HardDeleteChunksByKbUID mock can not be zero") } - mm_atomic.StoreUint64(&mmListChunksByKbFileUID.expectedInvocations, n) - return mmListChunksByKbFileUID + mm_atomic.StoreUint64(&mmHardDeleteChunksByKbUID.expectedInvocations, n) + return mmHardDeleteChunksByKbUID } -func (mmListChunksByKbFileUID *mRepositoryIMockListChunksByKbFileUID) invocationsDone() bool { - if len(mmListChunksByKbFileUID.expectations) == 0 && mmListChunksByKbFileUID.defaultExpectation == nil && mmListChunksByKbFileUID.mock.funcListChunksByKbFileUID == nil { +func (mmHardDeleteChunksByKbUID *mRepositoryIMockHardDeleteChunksByKbUID) invocationsDone() bool { + if len(mmHardDeleteChunksByKbUID.expectations) == 0 && mmHardDeleteChunksByKbUID.defaultExpectation == nil && mmHardDeleteChunksByKbUID.mock.funcHardDeleteChunksByKbUID == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmListChunksByKbFileUID.mock.afterListChunksByKbFileUIDCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmListChunksByKbFileUID.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmHardDeleteChunksByKbUID.mock.afterHardDeleteChunksByKbUIDCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmHardDeleteChunksByKbUID.expectedInvocations) return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) } -// 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) +// 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 mmListChunksByKbFileUID.inspectFuncListChunksByKbFileUID != nil { - mmListChunksByKbFileUID.inspectFuncListChunksByKbFileUID(ctx, kbFileUID) + if mmHardDeleteChunksByKbUID.inspectFuncHardDeleteChunksByKbUID != nil { + mmHardDeleteChunksByKbUID.inspectFuncHardDeleteChunksByKbUID(ctx, kbUID) } - mm_params := RepositoryIMockListChunksByKbFileUIDParams{ctx, kbFileUID} + mm_params := RepositoryIMockHardDeleteChunksByKbUIDParams{ctx, kbUID} // Record call args - mmListChunksByKbFileUID.ListChunksByKbFileUIDMock.mutex.Lock() - mmListChunksByKbFileUID.ListChunksByKbFileUIDMock.callArgs = append(mmListChunksByKbFileUID.ListChunksByKbFileUIDMock.callArgs, &mm_params) - mmListChunksByKbFileUID.ListChunksByKbFileUIDMock.mutex.Unlock() + mmHardDeleteChunksByKbUID.HardDeleteChunksByKbUIDMock.mutex.Lock() + mmHardDeleteChunksByKbUID.HardDeleteChunksByKbUIDMock.callArgs = append(mmHardDeleteChunksByKbUID.HardDeleteChunksByKbUIDMock.callArgs, &mm_params) + mmHardDeleteChunksByKbUID.HardDeleteChunksByKbUIDMock.mutex.Unlock() - for _, e := range mmListChunksByKbFileUID.ListChunksByKbFileUIDMock.expectations { + for _, e := range mmHardDeleteChunksByKbUID.HardDeleteChunksByKbUIDMock.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 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 + 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 := RepositoryIMockListChunksByKbFileUIDParams{ctx, kbFileUID} + 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) { - 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)) + 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.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)) + 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) { - mmListChunksByKbFileUID.t.Errorf("RepositoryIMock.ListChunksByKbFileUID got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*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 := mmListChunksByKbFileUID.ListChunksByKbFileUIDMock.defaultExpectation.results + mm_results := mmHardDeleteChunksByKbUID.HardDeleteChunksByKbUIDMock.defaultExpectation.results if mm_results == nil { - mmListChunksByKbFileUID.t.Fatal("No results are set for the RepositoryIMock.ListChunksByKbFileUID") + mmHardDeleteChunksByKbUID.t.Fatal("No results are set for the RepositoryIMock.HardDeleteChunksByKbUID") } - return (*mm_results).ta1, (*mm_results).err + return (*mm_results).err } - if mmListChunksByKbFileUID.funcListChunksByKbFileUID != nil { - return mmListChunksByKbFileUID.funcListChunksByKbFileUID(ctx, kbFileUID) + if mmHardDeleteChunksByKbUID.funcHardDeleteChunksByKbUID != nil { + return mmHardDeleteChunksByKbUID.funcHardDeleteChunksByKbUID(ctx, kbUID) } - mmListChunksByKbFileUID.t.Fatalf("Unexpected call to RepositoryIMock.ListChunksByKbFileUID. %v %v", ctx, kbFileUID) + mmHardDeleteChunksByKbUID.t.Fatalf("Unexpected call to RepositoryIMock.HardDeleteChunksByKbUID. %v %v", ctx, kbUID) return } -// ListChunksByKbFileUIDAfterCounter returns a count of finished RepositoryIMock.ListChunksByKbFileUID invocations -func (mmListChunksByKbFileUID *RepositoryIMock) ListChunksByKbFileUIDAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmListChunksByKbFileUID.afterListChunksByKbFileUIDCounter) +// HardDeleteChunksByKbUIDAfterCounter returns a count of finished RepositoryIMock.HardDeleteChunksByKbUID invocations +func (mmHardDeleteChunksByKbUID *RepositoryIMock) HardDeleteChunksByKbUIDAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmHardDeleteChunksByKbUID.afterHardDeleteChunksByKbUIDCounter) } -// ListChunksByKbFileUIDBeforeCounter returns a count of RepositoryIMock.ListChunksByKbFileUID invocations -func (mmListChunksByKbFileUID *RepositoryIMock) ListChunksByKbFileUIDBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmListChunksByKbFileUID.beforeListChunksByKbFileUIDCounter) +// 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.ListChunksByKbFileUID. +// 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 (mmListChunksByKbFileUID *mRepositoryIMockListChunksByKbFileUID) Calls() []*RepositoryIMockListChunksByKbFileUIDParams { - mmListChunksByKbFileUID.mutex.RLock() +func (mmHardDeleteChunksByKbUID *mRepositoryIMockHardDeleteChunksByKbUID) Calls() []*RepositoryIMockHardDeleteChunksByKbUIDParams { + mmHardDeleteChunksByKbUID.mutex.RLock() - argCopy := make([]*RepositoryIMockListChunksByKbFileUIDParams, len(mmListChunksByKbFileUID.callArgs)) - copy(argCopy, mmListChunksByKbFileUID.callArgs) + argCopy := make([]*RepositoryIMockHardDeleteChunksByKbUIDParams, len(mmHardDeleteChunksByKbUID.callArgs)) + copy(argCopy, mmHardDeleteChunksByKbUID.callArgs) - mmListChunksByKbFileUID.mutex.RUnlock() + mmHardDeleteChunksByKbUID.mutex.RUnlock() return argCopy } -// MinimockListChunksByKbFileUIDDone returns true if the count of the ListChunksByKbFileUID invocations corresponds +// MinimockHardDeleteChunksByKbUIDDone returns true if the count of the HardDeleteChunksByKbUID invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockListChunksByKbFileUIDDone() bool { - for _, e := range m.ListChunksByKbFileUIDMock.expectations { +func (m *RepositoryIMock) MinimockHardDeleteChunksByKbUIDDone() bool { + for _, e := range m.HardDeleteChunksByKbUIDMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.ListChunksByKbFileUIDMock.invocationsDone() + return m.HardDeleteChunksByKbUIDMock.invocationsDone() } -// MinimockListChunksByKbFileUIDInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockListChunksByKbFileUIDInspect() { - for _, e := range m.ListChunksByKbFileUIDMock.expectations { +// 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.ListChunksByKbFileUID with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.HardDeleteChunksByKbUID with params: %#v", *e.params) } } - afterListChunksByKbFileUIDCounter := mm_atomic.LoadUint64(&m.afterListChunksByKbFileUIDCounter) + afterHardDeleteChunksByKbUIDCounter := mm_atomic.LoadUint64(&m.afterHardDeleteChunksByKbUIDCounter) // if default expectation was set then invocations count should be greater than zero - if m.ListChunksByKbFileUIDMock.defaultExpectation != nil && afterListChunksByKbFileUIDCounter < 1 { - if m.ListChunksByKbFileUIDMock.defaultExpectation.params == nil { - m.t.Error("Expected call to RepositoryIMock.ListChunksByKbFileUID") + 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.ListChunksByKbFileUID with params: %#v", *m.ListChunksByKbFileUIDMock.defaultExpectation.params) + 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.funcListChunksByKbFileUID != nil && afterListChunksByKbFileUIDCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.ListChunksByKbFileUID") + if m.funcHardDeleteChunksByKbUID != nil && afterHardDeleteChunksByKbUIDCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.HardDeleteChunksByKbUID") } - 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) + 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 mRepositoryIMockListEmbeddingsByKbFileUID struct { +type mRepositoryIMockHardDeleteConvertedFileByFileUID struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockListEmbeddingsByKbFileUIDExpectation - expectations []*RepositoryIMockListEmbeddingsByKbFileUIDExpectation + defaultExpectation *RepositoryIMockHardDeleteConvertedFileByFileUIDExpectation + expectations []*RepositoryIMockHardDeleteConvertedFileByFileUIDExpectation - callArgs []*RepositoryIMockListEmbeddingsByKbFileUIDParams + callArgs []*RepositoryIMockHardDeleteConvertedFileByFileUIDParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockListEmbeddingsByKbFileUIDExpectation specifies expectation struct of the RepositoryI.ListEmbeddingsByKbFileUID -type RepositoryIMockListEmbeddingsByKbFileUIDExpectation struct { +// RepositoryIMockHardDeleteConvertedFileByFileUIDExpectation specifies expectation struct of the RepositoryI.HardDeleteConvertedFileByFileUID +type RepositoryIMockHardDeleteConvertedFileByFileUIDExpectation struct { mock *RepositoryIMock - params *RepositoryIMockListEmbeddingsByKbFileUIDParams - paramPtrs *RepositoryIMockListEmbeddingsByKbFileUIDParamPtrs - results *RepositoryIMockListEmbeddingsByKbFileUIDResults + params *RepositoryIMockHardDeleteConvertedFileByFileUIDParams + paramPtrs *RepositoryIMockHardDeleteConvertedFileByFileUIDParamPtrs + results *RepositoryIMockHardDeleteConvertedFileByFileUIDResults Counter uint64 } -// RepositoryIMockListEmbeddingsByKbFileUIDParams contains parameters of the RepositoryI.ListEmbeddingsByKbFileUID -type RepositoryIMockListEmbeddingsByKbFileUIDParams struct { - ctx context.Context - kbFileUID uuid.UUID +// RepositoryIMockHardDeleteConvertedFileByFileUIDParams contains parameters of the RepositoryI.HardDeleteConvertedFileByFileUID +type RepositoryIMockHardDeleteConvertedFileByFileUIDParams struct { + ctx context.Context + fileUID uuid.UUID } -// RepositoryIMockListEmbeddingsByKbFileUIDParamPtrs contains pointers to parameters of the RepositoryI.ListEmbeddingsByKbFileUID -type RepositoryIMockListEmbeddingsByKbFileUIDParamPtrs struct { - ctx *context.Context - kbFileUID *uuid.UUID +// RepositoryIMockHardDeleteConvertedFileByFileUIDParamPtrs contains pointers to parameters of the RepositoryI.HardDeleteConvertedFileByFileUID +type RepositoryIMockHardDeleteConvertedFileByFileUIDParamPtrs struct { + ctx *context.Context + fileUID *uuid.UUID } -// RepositoryIMockListEmbeddingsByKbFileUIDResults contains results of the RepositoryI.ListEmbeddingsByKbFileUID -type RepositoryIMockListEmbeddingsByKbFileUIDResults struct { - ea1 []mm_repository.Embedding +// RepositoryIMockHardDeleteConvertedFileByFileUIDResults contains results of the RepositoryI.HardDeleteConvertedFileByFileUID +type RepositoryIMockHardDeleteConvertedFileByFileUIDResults struct { 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") +// 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 mmListEmbeddingsByKbFileUID.defaultExpectation == nil { - mmListEmbeddingsByKbFileUID.defaultExpectation = &RepositoryIMockListEmbeddingsByKbFileUIDExpectation{} + if mmHardDeleteConvertedFileByFileUID.defaultExpectation == nil { + mmHardDeleteConvertedFileByFileUID.defaultExpectation = &RepositoryIMockHardDeleteConvertedFileByFileUIDExpectation{} } - if mmListEmbeddingsByKbFileUID.defaultExpectation.paramPtrs != nil { - mmListEmbeddingsByKbFileUID.mock.t.Fatalf("RepositoryIMock.ListEmbeddingsByKbFileUID mock is already set by ExpectParams functions") + if mmHardDeleteConvertedFileByFileUID.defaultExpectation.paramPtrs != nil { + mmHardDeleteConvertedFileByFileUID.mock.t.Fatalf("RepositoryIMock.HardDeleteConvertedFileByFileUID 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) + 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 mmListEmbeddingsByKbFileUID + return mmHardDeleteConvertedFileByFileUID } -// 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") +// 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 mmListEmbeddingsByKbFileUID.defaultExpectation == nil { - mmListEmbeddingsByKbFileUID.defaultExpectation = &RepositoryIMockListEmbeddingsByKbFileUIDExpectation{} + if mmHardDeleteConvertedFileByFileUID.defaultExpectation == nil { + mmHardDeleteConvertedFileByFileUID.defaultExpectation = &RepositoryIMockHardDeleteConvertedFileByFileUIDExpectation{} } - if mmListEmbeddingsByKbFileUID.defaultExpectation.params != nil { - mmListEmbeddingsByKbFileUID.mock.t.Fatalf("RepositoryIMock.ListEmbeddingsByKbFileUID mock is already set by Expect") + if mmHardDeleteConvertedFileByFileUID.defaultExpectation.params != nil { + mmHardDeleteConvertedFileByFileUID.mock.t.Fatalf("RepositoryIMock.HardDeleteConvertedFileByFileUID mock is already set by Expect") } - if mmListEmbeddingsByKbFileUID.defaultExpectation.paramPtrs == nil { - mmListEmbeddingsByKbFileUID.defaultExpectation.paramPtrs = &RepositoryIMockListEmbeddingsByKbFileUIDParamPtrs{} + if mmHardDeleteConvertedFileByFileUID.defaultExpectation.paramPtrs == nil { + mmHardDeleteConvertedFileByFileUID.defaultExpectation.paramPtrs = &RepositoryIMockHardDeleteConvertedFileByFileUIDParamPtrs{} } - mmListEmbeddingsByKbFileUID.defaultExpectation.paramPtrs.ctx = &ctx + mmHardDeleteConvertedFileByFileUID.defaultExpectation.paramPtrs.ctx = &ctx - return mmListEmbeddingsByKbFileUID + return mmHardDeleteConvertedFileByFileUID } -// 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") +// 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 mmListEmbeddingsByKbFileUID.defaultExpectation == nil { - mmListEmbeddingsByKbFileUID.defaultExpectation = &RepositoryIMockListEmbeddingsByKbFileUIDExpectation{} + if mmHardDeleteConvertedFileByFileUID.defaultExpectation == nil { + mmHardDeleteConvertedFileByFileUID.defaultExpectation = &RepositoryIMockHardDeleteConvertedFileByFileUIDExpectation{} } - if mmListEmbeddingsByKbFileUID.defaultExpectation.params != nil { - mmListEmbeddingsByKbFileUID.mock.t.Fatalf("RepositoryIMock.ListEmbeddingsByKbFileUID mock is already set by Expect") + if mmHardDeleteConvertedFileByFileUID.defaultExpectation.params != nil { + mmHardDeleteConvertedFileByFileUID.mock.t.Fatalf("RepositoryIMock.HardDeleteConvertedFileByFileUID mock is already set by Expect") } - if mmListEmbeddingsByKbFileUID.defaultExpectation.paramPtrs == nil { - mmListEmbeddingsByKbFileUID.defaultExpectation.paramPtrs = &RepositoryIMockListEmbeddingsByKbFileUIDParamPtrs{} + if mmHardDeleteConvertedFileByFileUID.defaultExpectation.paramPtrs == nil { + mmHardDeleteConvertedFileByFileUID.defaultExpectation.paramPtrs = &RepositoryIMockHardDeleteConvertedFileByFileUIDParamPtrs{} } - mmListEmbeddingsByKbFileUID.defaultExpectation.paramPtrs.kbFileUID = &kbFileUID + mmHardDeleteConvertedFileByFileUID.defaultExpectation.paramPtrs.fileUID = &fileUID - return mmListEmbeddingsByKbFileUID + return mmHardDeleteConvertedFileByFileUID } -// 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") +// 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") } - mmListEmbeddingsByKbFileUID.mock.inspectFuncListEmbeddingsByKbFileUID = f + mmHardDeleteConvertedFileByFileUID.mock.inspectFuncHardDeleteConvertedFileByFileUID = f - return mmListEmbeddingsByKbFileUID + return mmHardDeleteConvertedFileByFileUID } -// 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") +// 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 mmListEmbeddingsByKbFileUID.defaultExpectation == nil { - mmListEmbeddingsByKbFileUID.defaultExpectation = &RepositoryIMockListEmbeddingsByKbFileUIDExpectation{mock: mmListEmbeddingsByKbFileUID.mock} + if mmHardDeleteConvertedFileByFileUID.defaultExpectation == nil { + mmHardDeleteConvertedFileByFileUID.defaultExpectation = &RepositoryIMockHardDeleteConvertedFileByFileUIDExpectation{mock: mmHardDeleteConvertedFileByFileUID.mock} } - mmListEmbeddingsByKbFileUID.defaultExpectation.results = &RepositoryIMockListEmbeddingsByKbFileUIDResults{ea1, err} - return mmListEmbeddingsByKbFileUID.mock + mmHardDeleteConvertedFileByFileUID.defaultExpectation.results = &RepositoryIMockHardDeleteConvertedFileByFileUIDResults{err} + return mmHardDeleteConvertedFileByFileUID.mock } -// 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") +// 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(mmListEmbeddingsByKbFileUID.expectations) > 0 { - mmListEmbeddingsByKbFileUID.mock.t.Fatalf("Some expectations are already set for the RepositoryI.ListEmbeddingsByKbFileUID method") + if len(mmHardDeleteConvertedFileByFileUID.expectations) > 0 { + mmHardDeleteConvertedFileByFileUID.mock.t.Fatalf("Some expectations are already set for the RepositoryI.HardDeleteConvertedFileByFileUID method") } - mmListEmbeddingsByKbFileUID.mock.funcListEmbeddingsByKbFileUID = f - return mmListEmbeddingsByKbFileUID.mock + mmHardDeleteConvertedFileByFileUID.mock.funcHardDeleteConvertedFileByFileUID = f + return mmHardDeleteConvertedFileByFileUID.mock } -// When sets expectation for the RepositoryI.ListEmbeddingsByKbFileUID which will trigger the result defined by the following +// When sets expectation for the RepositoryI.HardDeleteConvertedFileByFileUID 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") +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 := &RepositoryIMockListEmbeddingsByKbFileUIDExpectation{ - mock: mmListEmbeddingsByKbFileUID.mock, - params: &RepositoryIMockListEmbeddingsByKbFileUIDParams{ctx, kbFileUID}, + expectation := &RepositoryIMockHardDeleteConvertedFileByFileUIDExpectation{ + mock: mmHardDeleteConvertedFileByFileUID.mock, + params: &RepositoryIMockHardDeleteConvertedFileByFileUIDParams{ctx, fileUID}, } - mmListEmbeddingsByKbFileUID.expectations = append(mmListEmbeddingsByKbFileUID.expectations, expectation) + mmHardDeleteConvertedFileByFileUID.expectations = append(mmHardDeleteConvertedFileByFileUID.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} +// 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.ListEmbeddingsByKbFileUID should be invoked -func (mmListEmbeddingsByKbFileUID *mRepositoryIMockListEmbeddingsByKbFileUID) Times(n uint64) *mRepositoryIMockListEmbeddingsByKbFileUID { +// Times sets number of times RepositoryI.HardDeleteConvertedFileByFileUID should be invoked +func (mmHardDeleteConvertedFileByFileUID *mRepositoryIMockHardDeleteConvertedFileByFileUID) Times(n uint64) *mRepositoryIMockHardDeleteConvertedFileByFileUID { if n == 0 { - mmListEmbeddingsByKbFileUID.mock.t.Fatalf("Times of RepositoryIMock.ListEmbeddingsByKbFileUID mock can not be zero") + mmHardDeleteConvertedFileByFileUID.mock.t.Fatalf("Times of RepositoryIMock.HardDeleteConvertedFileByFileUID mock can not be zero") } - mm_atomic.StoreUint64(&mmListEmbeddingsByKbFileUID.expectedInvocations, n) - return mmListEmbeddingsByKbFileUID + mm_atomic.StoreUint64(&mmHardDeleteConvertedFileByFileUID.expectedInvocations, n) + return mmHardDeleteConvertedFileByFileUID } -func (mmListEmbeddingsByKbFileUID *mRepositoryIMockListEmbeddingsByKbFileUID) invocationsDone() bool { - if len(mmListEmbeddingsByKbFileUID.expectations) == 0 && mmListEmbeddingsByKbFileUID.defaultExpectation == nil && mmListEmbeddingsByKbFileUID.mock.funcListEmbeddingsByKbFileUID == nil { +func (mmHardDeleteConvertedFileByFileUID *mRepositoryIMockHardDeleteConvertedFileByFileUID) invocationsDone() bool { + if len(mmHardDeleteConvertedFileByFileUID.expectations) == 0 && mmHardDeleteConvertedFileByFileUID.defaultExpectation == nil && mmHardDeleteConvertedFileByFileUID.mock.funcHardDeleteConvertedFileByFileUID == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmListEmbeddingsByKbFileUID.mock.afterListEmbeddingsByKbFileUIDCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmListEmbeddingsByKbFileUID.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmHardDeleteConvertedFileByFileUID.mock.afterHardDeleteConvertedFileByFileUIDCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmHardDeleteConvertedFileByFileUID.expectedInvocations) return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) } -// 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) +// 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 mmListEmbeddingsByKbFileUID.inspectFuncListEmbeddingsByKbFileUID != nil { - mmListEmbeddingsByKbFileUID.inspectFuncListEmbeddingsByKbFileUID(ctx, kbFileUID) + if mmHardDeleteConvertedFileByFileUID.inspectFuncHardDeleteConvertedFileByFileUID != nil { + mmHardDeleteConvertedFileByFileUID.inspectFuncHardDeleteConvertedFileByFileUID(ctx, fileUID) } - mm_params := RepositoryIMockListEmbeddingsByKbFileUIDParams{ctx, kbFileUID} + mm_params := RepositoryIMockHardDeleteConvertedFileByFileUIDParams{ctx, fileUID} // Record call args - mmListEmbeddingsByKbFileUID.ListEmbeddingsByKbFileUIDMock.mutex.Lock() - mmListEmbeddingsByKbFileUID.ListEmbeddingsByKbFileUIDMock.callArgs = append(mmListEmbeddingsByKbFileUID.ListEmbeddingsByKbFileUIDMock.callArgs, &mm_params) - mmListEmbeddingsByKbFileUID.ListEmbeddingsByKbFileUIDMock.mutex.Unlock() + mmHardDeleteConvertedFileByFileUID.HardDeleteConvertedFileByFileUIDMock.mutex.Lock() + mmHardDeleteConvertedFileByFileUID.HardDeleteConvertedFileByFileUIDMock.callArgs = append(mmHardDeleteConvertedFileByFileUID.HardDeleteConvertedFileByFileUIDMock.callArgs, &mm_params) + mmHardDeleteConvertedFileByFileUID.HardDeleteConvertedFileByFileUIDMock.mutex.Unlock() - for _, e := range mmListEmbeddingsByKbFileUID.ListEmbeddingsByKbFileUIDMock.expectations { + for _, e := range mmHardDeleteConvertedFileByFileUID.HardDeleteConvertedFileByFileUIDMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.ea1, e.results.err + return 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 + 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 := RepositoryIMockListEmbeddingsByKbFileUIDParams{ctx, kbFileUID} + 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) { - 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)) + 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.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)) + 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) { - mmListEmbeddingsByKbFileUID.t.Errorf("RepositoryIMock.ListEmbeddingsByKbFileUID got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*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 := mmListEmbeddingsByKbFileUID.ListEmbeddingsByKbFileUIDMock.defaultExpectation.results + mm_results := mmHardDeleteConvertedFileByFileUID.HardDeleteConvertedFileByFileUIDMock.defaultExpectation.results if mm_results == nil { - mmListEmbeddingsByKbFileUID.t.Fatal("No results are set for the RepositoryIMock.ListEmbeddingsByKbFileUID") + mmHardDeleteConvertedFileByFileUID.t.Fatal("No results are set for the RepositoryIMock.HardDeleteConvertedFileByFileUID") } - return (*mm_results).ea1, (*mm_results).err + return (*mm_results).err } - if mmListEmbeddingsByKbFileUID.funcListEmbeddingsByKbFileUID != nil { - return mmListEmbeddingsByKbFileUID.funcListEmbeddingsByKbFileUID(ctx, kbFileUID) + if mmHardDeleteConvertedFileByFileUID.funcHardDeleteConvertedFileByFileUID != nil { + return mmHardDeleteConvertedFileByFileUID.funcHardDeleteConvertedFileByFileUID(ctx, fileUID) } - mmListEmbeddingsByKbFileUID.t.Fatalf("Unexpected call to RepositoryIMock.ListEmbeddingsByKbFileUID. %v %v", ctx, kbFileUID) + mmHardDeleteConvertedFileByFileUID.t.Fatalf("Unexpected call to RepositoryIMock.HardDeleteConvertedFileByFileUID. %v %v", ctx, fileUID) return } -// ListEmbeddingsByKbFileUIDAfterCounter returns a count of finished RepositoryIMock.ListEmbeddingsByKbFileUID invocations -func (mmListEmbeddingsByKbFileUID *RepositoryIMock) ListEmbeddingsByKbFileUIDAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmListEmbeddingsByKbFileUID.afterListEmbeddingsByKbFileUIDCounter) +// HardDeleteConvertedFileByFileUIDAfterCounter returns a count of finished RepositoryIMock.HardDeleteConvertedFileByFileUID invocations +func (mmHardDeleteConvertedFileByFileUID *RepositoryIMock) HardDeleteConvertedFileByFileUIDAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmHardDeleteConvertedFileByFileUID.afterHardDeleteConvertedFileByFileUIDCounter) } -// ListEmbeddingsByKbFileUIDBeforeCounter returns a count of RepositoryIMock.ListEmbeddingsByKbFileUID invocations -func (mmListEmbeddingsByKbFileUID *RepositoryIMock) ListEmbeddingsByKbFileUIDBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmListEmbeddingsByKbFileUID.beforeListEmbeddingsByKbFileUIDCounter) +// 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.ListEmbeddingsByKbFileUID. +// 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 (mmListEmbeddingsByKbFileUID *mRepositoryIMockListEmbeddingsByKbFileUID) Calls() []*RepositoryIMockListEmbeddingsByKbFileUIDParams { - mmListEmbeddingsByKbFileUID.mutex.RLock() +func (mmHardDeleteConvertedFileByFileUID *mRepositoryIMockHardDeleteConvertedFileByFileUID) Calls() []*RepositoryIMockHardDeleteConvertedFileByFileUIDParams { + mmHardDeleteConvertedFileByFileUID.mutex.RLock() - argCopy := make([]*RepositoryIMockListEmbeddingsByKbFileUIDParams, len(mmListEmbeddingsByKbFileUID.callArgs)) - copy(argCopy, mmListEmbeddingsByKbFileUID.callArgs) + argCopy := make([]*RepositoryIMockHardDeleteConvertedFileByFileUIDParams, len(mmHardDeleteConvertedFileByFileUID.callArgs)) + copy(argCopy, mmHardDeleteConvertedFileByFileUID.callArgs) - mmListEmbeddingsByKbFileUID.mutex.RUnlock() + mmHardDeleteConvertedFileByFileUID.mutex.RUnlock() return argCopy } -// MinimockListEmbeddingsByKbFileUIDDone returns true if the count of the ListEmbeddingsByKbFileUID invocations corresponds +// MinimockHardDeleteConvertedFileByFileUIDDone returns true if the count of the HardDeleteConvertedFileByFileUID invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockListEmbeddingsByKbFileUIDDone() bool { - for _, e := range m.ListEmbeddingsByKbFileUIDMock.expectations { +func (m *RepositoryIMock) MinimockHardDeleteConvertedFileByFileUIDDone() bool { + for _, e := range m.HardDeleteConvertedFileByFileUIDMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.ListEmbeddingsByKbFileUIDMock.invocationsDone() + return m.HardDeleteConvertedFileByFileUIDMock.invocationsDone() } -// MinimockListEmbeddingsByKbFileUIDInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockListEmbeddingsByKbFileUIDInspect() { - for _, e := range m.ListEmbeddingsByKbFileUIDMock.expectations { +// 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.ListEmbeddingsByKbFileUID with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.HardDeleteConvertedFileByFileUID with params: %#v", *e.params) } } - afterListEmbeddingsByKbFileUIDCounter := mm_atomic.LoadUint64(&m.afterListEmbeddingsByKbFileUIDCounter) + afterHardDeleteConvertedFileByFileUIDCounter := mm_atomic.LoadUint64(&m.afterHardDeleteConvertedFileByFileUIDCounter) // if default expectation was set then invocations count should be greater than zero - if m.ListEmbeddingsByKbFileUIDMock.defaultExpectation != nil && afterListEmbeddingsByKbFileUIDCounter < 1 { - if m.ListEmbeddingsByKbFileUIDMock.defaultExpectation.params == nil { - m.t.Error("Expected call to RepositoryIMock.ListEmbeddingsByKbFileUID") + 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.ListEmbeddingsByKbFileUID with params: %#v", *m.ListEmbeddingsByKbFileUIDMock.defaultExpectation.params) + 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.funcListEmbeddingsByKbFileUID != nil && afterListEmbeddingsByKbFileUIDCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.ListEmbeddingsByKbFileUID") + if m.funcHardDeleteConvertedFileByFileUID != nil && afterHardDeleteConvertedFileByFileUIDCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.HardDeleteConvertedFileByFileUID") } - 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) + 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 mRepositoryIMockListKnowledgeBaseFiles struct { +type mRepositoryIMockHardDeleteEmbeddingsByKbFileUID struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockListKnowledgeBaseFilesExpectation - expectations []*RepositoryIMockListKnowledgeBaseFilesExpectation + defaultExpectation *RepositoryIMockHardDeleteEmbeddingsByKbFileUIDExpectation + expectations []*RepositoryIMockHardDeleteEmbeddingsByKbFileUIDExpectation - callArgs []*RepositoryIMockListKnowledgeBaseFilesParams + callArgs []*RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockListKnowledgeBaseFilesExpectation specifies expectation struct of the RepositoryI.ListKnowledgeBaseFiles -type RepositoryIMockListKnowledgeBaseFilesExpectation struct { +// RepositoryIMockHardDeleteEmbeddingsByKbFileUIDExpectation specifies expectation struct of the RepositoryI.HardDeleteEmbeddingsByKbFileUID +type RepositoryIMockHardDeleteEmbeddingsByKbFileUIDExpectation struct { mock *RepositoryIMock - params *RepositoryIMockListKnowledgeBaseFilesParams - paramPtrs *RepositoryIMockListKnowledgeBaseFilesParamPtrs - results *RepositoryIMockListKnowledgeBaseFilesResults + params *RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParams + paramPtrs *RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParamPtrs + results *RepositoryIMockHardDeleteEmbeddingsByKbFileUIDResults Counter uint64 } -// RepositoryIMockListKnowledgeBaseFilesParams contains parameters of the RepositoryI.ListKnowledgeBaseFiles -type RepositoryIMockListKnowledgeBaseFilesParams struct { - ctx context.Context - uid string - ownerUID string - kbUID string - pageSize int32 - nextPageToken string - filesUID []string +// RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParams contains parameters of the RepositoryI.HardDeleteEmbeddingsByKbFileUID +type RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParams struct { + ctx context.Context + kbFileUID uuid.UUID } -// RepositoryIMockListKnowledgeBaseFilesParamPtrs contains pointers to parameters of the RepositoryI.ListKnowledgeBaseFiles -type RepositoryIMockListKnowledgeBaseFilesParamPtrs struct { - ctx *context.Context - uid *string - ownerUID *string - kbUID *string - pageSize *int32 - nextPageToken *string - filesUID *[]string +// RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParamPtrs contains pointers to parameters of the RepositoryI.HardDeleteEmbeddingsByKbFileUID +type RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParamPtrs struct { + ctx *context.Context + kbFileUID *uuid.UUID } -// RepositoryIMockListKnowledgeBaseFilesResults contains results of the RepositoryI.ListKnowledgeBaseFiles -type RepositoryIMockListKnowledgeBaseFilesResults struct { - ka1 []mm_repository.KnowledgeBaseFile - i1 int - s1 string +// RepositoryIMockHardDeleteEmbeddingsByKbFileUIDResults contains results of the RepositoryI.HardDeleteEmbeddingsByKbFileUID +type RepositoryIMockHardDeleteEmbeddingsByKbFileUIDResults struct { err error } -// Expect sets up expected params for RepositoryI.ListKnowledgeBaseFiles -func (mmListKnowledgeBaseFiles *mRepositoryIMockListKnowledgeBaseFiles) Expect(ctx context.Context, uid string, ownerUID string, kbUID string, pageSize int32, nextPageToken string, filesUID []string) *mRepositoryIMockListKnowledgeBaseFiles { - if mmListKnowledgeBaseFiles.mock.funcListKnowledgeBaseFiles != nil { - mmListKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBaseFiles mock is already set by Set") +// 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 mmListKnowledgeBaseFiles.defaultExpectation == nil { - mmListKnowledgeBaseFiles.defaultExpectation = &RepositoryIMockListKnowledgeBaseFilesExpectation{} + if mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation == nil { + mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation = &RepositoryIMockHardDeleteEmbeddingsByKbFileUIDExpectation{} } - if mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs != nil { - mmListKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBaseFiles mock is already set by ExpectParams functions") + if mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation.paramPtrs != nil { + mmHardDeleteEmbeddingsByKbFileUID.mock.t.Fatalf("RepositoryIMock.HardDeleteEmbeddingsByKbFileUID mock is already set by ExpectParams functions") } - mmListKnowledgeBaseFiles.defaultExpectation.params = &RepositoryIMockListKnowledgeBaseFilesParams{ctx, uid, ownerUID, kbUID, pageSize, nextPageToken, filesUID} - for _, e := range mmListKnowledgeBaseFiles.expectations { - if minimock.Equal(e.params, mmListKnowledgeBaseFiles.defaultExpectation.params) { - mmListKnowledgeBaseFiles.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmListKnowledgeBaseFiles.defaultExpectation.params) + 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 mmListKnowledgeBaseFiles + return mmHardDeleteEmbeddingsByKbFileUID } -// ExpectCtxParam1 sets up expected param ctx for RepositoryI.ListKnowledgeBaseFiles -func (mmListKnowledgeBaseFiles *mRepositoryIMockListKnowledgeBaseFiles) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockListKnowledgeBaseFiles { - if mmListKnowledgeBaseFiles.mock.funcListKnowledgeBaseFiles != nil { - mmListKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBaseFiles mock is already set by Set") +// 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 mmListKnowledgeBaseFiles.defaultExpectation == nil { - mmListKnowledgeBaseFiles.defaultExpectation = &RepositoryIMockListKnowledgeBaseFilesExpectation{} + if mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation == nil { + mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation = &RepositoryIMockHardDeleteEmbeddingsByKbFileUIDExpectation{} } - if mmListKnowledgeBaseFiles.defaultExpectation.params != nil { - mmListKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBaseFiles mock is already set by Expect") + if mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation.params != nil { + mmHardDeleteEmbeddingsByKbFileUID.mock.t.Fatalf("RepositoryIMock.HardDeleteEmbeddingsByKbFileUID mock is already set by Expect") } - if mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs == nil { - mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs = &RepositoryIMockListKnowledgeBaseFilesParamPtrs{} + if mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation.paramPtrs == nil { + mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation.paramPtrs = &RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParamPtrs{} } - mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs.ctx = &ctx + mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation.paramPtrs.ctx = &ctx - return mmListKnowledgeBaseFiles + return mmHardDeleteEmbeddingsByKbFileUID } -// ExpectUidParam2 sets up expected param uid for RepositoryI.ListKnowledgeBaseFiles -func (mmListKnowledgeBaseFiles *mRepositoryIMockListKnowledgeBaseFiles) ExpectUidParam2(uid string) *mRepositoryIMockListKnowledgeBaseFiles { - if mmListKnowledgeBaseFiles.mock.funcListKnowledgeBaseFiles != nil { - mmListKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBaseFiles mock is already set by Set") +// 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 mmListKnowledgeBaseFiles.defaultExpectation == nil { - mmListKnowledgeBaseFiles.defaultExpectation = &RepositoryIMockListKnowledgeBaseFilesExpectation{} + if mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation == nil { + mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation = &RepositoryIMockHardDeleteEmbeddingsByKbFileUIDExpectation{} } - if mmListKnowledgeBaseFiles.defaultExpectation.params != nil { - mmListKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBaseFiles mock is already set by Expect") + if mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation.params != nil { + mmHardDeleteEmbeddingsByKbFileUID.mock.t.Fatalf("RepositoryIMock.HardDeleteEmbeddingsByKbFileUID mock is already set by Expect") } - if mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs == nil { - mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs = &RepositoryIMockListKnowledgeBaseFilesParamPtrs{} + if mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation.paramPtrs == nil { + mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation.paramPtrs = &RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParamPtrs{} } - mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs.uid = &uid + mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation.paramPtrs.kbFileUID = &kbFileUID - return mmListKnowledgeBaseFiles + return mmHardDeleteEmbeddingsByKbFileUID } -// ExpectOwnerUIDParam3 sets up expected param ownerUID for RepositoryI.ListKnowledgeBaseFiles -func (mmListKnowledgeBaseFiles *mRepositoryIMockListKnowledgeBaseFiles) ExpectOwnerUIDParam3(ownerUID string) *mRepositoryIMockListKnowledgeBaseFiles { - if mmListKnowledgeBaseFiles.mock.funcListKnowledgeBaseFiles != nil { - mmListKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBaseFiles mock is already set by Set") +// 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") } - if mmListKnowledgeBaseFiles.defaultExpectation == nil { - mmListKnowledgeBaseFiles.defaultExpectation = &RepositoryIMockListKnowledgeBaseFilesExpectation{} - } + mmHardDeleteEmbeddingsByKbFileUID.mock.inspectFuncHardDeleteEmbeddingsByKbFileUID = f - if mmListKnowledgeBaseFiles.defaultExpectation.params != nil { - mmListKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBaseFiles mock is already set by Expect") - } + return mmHardDeleteEmbeddingsByKbFileUID +} - if mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs == nil { - mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs = &RepositoryIMockListKnowledgeBaseFilesParamPtrs{} +// 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") } - mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs.ownerUID = &ownerUID - return mmListKnowledgeBaseFiles + if mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation == nil { + mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation = &RepositoryIMockHardDeleteEmbeddingsByKbFileUIDExpectation{mock: mmHardDeleteEmbeddingsByKbFileUID.mock} + } + mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation.results = &RepositoryIMockHardDeleteEmbeddingsByKbFileUIDResults{err} + return mmHardDeleteEmbeddingsByKbFileUID.mock } -// ExpectKbUIDParam4 sets up expected param kbUID for RepositoryI.ListKnowledgeBaseFiles -func (mmListKnowledgeBaseFiles *mRepositoryIMockListKnowledgeBaseFiles) ExpectKbUIDParam4(kbUID string) *mRepositoryIMockListKnowledgeBaseFiles { - if mmListKnowledgeBaseFiles.mock.funcListKnowledgeBaseFiles != nil { - mmListKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBaseFiles mock is already set by Set") - } - - if mmListKnowledgeBaseFiles.defaultExpectation == nil { - mmListKnowledgeBaseFiles.defaultExpectation = &RepositoryIMockListKnowledgeBaseFilesExpectation{} - } - - if mmListKnowledgeBaseFiles.defaultExpectation.params != nil { - mmListKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBaseFiles mock is already set by Expect") - } - - if mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs == nil { - mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs = &RepositoryIMockListKnowledgeBaseFilesParamPtrs{} - } - mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs.kbUID = &kbUID - - return mmListKnowledgeBaseFiles -} - -// ExpectPageSizeParam5 sets up expected param pageSize for RepositoryI.ListKnowledgeBaseFiles -func (mmListKnowledgeBaseFiles *mRepositoryIMockListKnowledgeBaseFiles) ExpectPageSizeParam5(pageSize int32) *mRepositoryIMockListKnowledgeBaseFiles { - if mmListKnowledgeBaseFiles.mock.funcListKnowledgeBaseFiles != nil { - mmListKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBaseFiles mock is already set by Set") - } - - if mmListKnowledgeBaseFiles.defaultExpectation == nil { - mmListKnowledgeBaseFiles.defaultExpectation = &RepositoryIMockListKnowledgeBaseFilesExpectation{} - } - - if mmListKnowledgeBaseFiles.defaultExpectation.params != nil { - mmListKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBaseFiles mock is already set by Expect") - } - - if mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs == nil { - mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs = &RepositoryIMockListKnowledgeBaseFilesParamPtrs{} - } - mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs.pageSize = &pageSize - - return mmListKnowledgeBaseFiles -} - -// ExpectNextPageTokenParam6 sets up expected param nextPageToken for RepositoryI.ListKnowledgeBaseFiles -func (mmListKnowledgeBaseFiles *mRepositoryIMockListKnowledgeBaseFiles) ExpectNextPageTokenParam6(nextPageToken string) *mRepositoryIMockListKnowledgeBaseFiles { - if mmListKnowledgeBaseFiles.mock.funcListKnowledgeBaseFiles != nil { - mmListKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBaseFiles mock is already set by Set") - } - - if mmListKnowledgeBaseFiles.defaultExpectation == nil { - mmListKnowledgeBaseFiles.defaultExpectation = &RepositoryIMockListKnowledgeBaseFilesExpectation{} - } - - if mmListKnowledgeBaseFiles.defaultExpectation.params != nil { - mmListKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBaseFiles mock is already set by Expect") - } - - if mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs == nil { - mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs = &RepositoryIMockListKnowledgeBaseFilesParamPtrs{} - } - mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs.nextPageToken = &nextPageToken - - return mmListKnowledgeBaseFiles -} - -// ExpectFilesUIDParam7 sets up expected param filesUID for RepositoryI.ListKnowledgeBaseFiles -func (mmListKnowledgeBaseFiles *mRepositoryIMockListKnowledgeBaseFiles) ExpectFilesUIDParam7(filesUID []string) *mRepositoryIMockListKnowledgeBaseFiles { - if mmListKnowledgeBaseFiles.mock.funcListKnowledgeBaseFiles != nil { - mmListKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBaseFiles mock is already set by Set") - } - - if mmListKnowledgeBaseFiles.defaultExpectation == nil { - mmListKnowledgeBaseFiles.defaultExpectation = &RepositoryIMockListKnowledgeBaseFilesExpectation{} - } - - if mmListKnowledgeBaseFiles.defaultExpectation.params != nil { - mmListKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBaseFiles mock is already set by Expect") - } - - if mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs == nil { - mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs = &RepositoryIMockListKnowledgeBaseFilesParamPtrs{} - } - mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs.filesUID = &filesUID - - return mmListKnowledgeBaseFiles -} - -// Inspect accepts an inspector function that has same arguments as the RepositoryI.ListKnowledgeBaseFiles -func (mmListKnowledgeBaseFiles *mRepositoryIMockListKnowledgeBaseFiles) Inspect(f func(ctx context.Context, uid string, ownerUID string, kbUID string, pageSize int32, nextPageToken string, filesUID []string)) *mRepositoryIMockListKnowledgeBaseFiles { - if mmListKnowledgeBaseFiles.mock.inspectFuncListKnowledgeBaseFiles != nil { - mmListKnowledgeBaseFiles.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.ListKnowledgeBaseFiles") - } - - mmListKnowledgeBaseFiles.mock.inspectFuncListKnowledgeBaseFiles = f - - return mmListKnowledgeBaseFiles -} - -// Return sets up results that will be returned by RepositoryI.ListKnowledgeBaseFiles -func (mmListKnowledgeBaseFiles *mRepositoryIMockListKnowledgeBaseFiles) Return(ka1 []mm_repository.KnowledgeBaseFile, i1 int, s1 string, err error) *RepositoryIMock { - if mmListKnowledgeBaseFiles.mock.funcListKnowledgeBaseFiles != nil { - mmListKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBaseFiles mock is already set by Set") - } - - if mmListKnowledgeBaseFiles.defaultExpectation == nil { - mmListKnowledgeBaseFiles.defaultExpectation = &RepositoryIMockListKnowledgeBaseFilesExpectation{mock: mmListKnowledgeBaseFiles.mock} - } - mmListKnowledgeBaseFiles.defaultExpectation.results = &RepositoryIMockListKnowledgeBaseFilesResults{ka1, i1, s1, err} - return mmListKnowledgeBaseFiles.mock -} - -// Set uses given function f to mock the RepositoryI.ListKnowledgeBaseFiles method -func (mmListKnowledgeBaseFiles *mRepositoryIMockListKnowledgeBaseFiles) Set(f 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)) *RepositoryIMock { - if mmListKnowledgeBaseFiles.defaultExpectation != nil { - mmListKnowledgeBaseFiles.mock.t.Fatalf("Default expectation is already set for the RepositoryI.ListKnowledgeBaseFiles method") +// 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(mmListKnowledgeBaseFiles.expectations) > 0 { - mmListKnowledgeBaseFiles.mock.t.Fatalf("Some expectations are already set for the RepositoryI.ListKnowledgeBaseFiles method") + if len(mmHardDeleteEmbeddingsByKbFileUID.expectations) > 0 { + mmHardDeleteEmbeddingsByKbFileUID.mock.t.Fatalf("Some expectations are already set for the RepositoryI.HardDeleteEmbeddingsByKbFileUID method") } - mmListKnowledgeBaseFiles.mock.funcListKnowledgeBaseFiles = f - return mmListKnowledgeBaseFiles.mock + mmHardDeleteEmbeddingsByKbFileUID.mock.funcHardDeleteEmbeddingsByKbFileUID = f + return mmHardDeleteEmbeddingsByKbFileUID.mock } -// When sets expectation for the RepositoryI.ListKnowledgeBaseFiles which will trigger the result defined by the following +// When sets expectation for the RepositoryI.HardDeleteEmbeddingsByKbFileUID which will trigger the result defined by the following // Then helper -func (mmListKnowledgeBaseFiles *mRepositoryIMockListKnowledgeBaseFiles) When(ctx context.Context, uid string, ownerUID string, kbUID string, pageSize int32, nextPageToken string, filesUID []string) *RepositoryIMockListKnowledgeBaseFilesExpectation { - if mmListKnowledgeBaseFiles.mock.funcListKnowledgeBaseFiles != nil { - mmListKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBaseFiles mock is already set by Set") +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 := &RepositoryIMockListKnowledgeBaseFilesExpectation{ - mock: mmListKnowledgeBaseFiles.mock, - params: &RepositoryIMockListKnowledgeBaseFilesParams{ctx, uid, ownerUID, kbUID, pageSize, nextPageToken, filesUID}, + expectation := &RepositoryIMockHardDeleteEmbeddingsByKbFileUIDExpectation{ + mock: mmHardDeleteEmbeddingsByKbFileUID.mock, + params: &RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParams{ctx, kbFileUID}, } - mmListKnowledgeBaseFiles.expectations = append(mmListKnowledgeBaseFiles.expectations, expectation) + mmHardDeleteEmbeddingsByKbFileUID.expectations = append(mmHardDeleteEmbeddingsByKbFileUID.expectations, expectation) return expectation } -// Then sets up RepositoryI.ListKnowledgeBaseFiles return parameters for the expectation previously defined by the When method -func (e *RepositoryIMockListKnowledgeBaseFilesExpectation) Then(ka1 []mm_repository.KnowledgeBaseFile, i1 int, s1 string, err error) *RepositoryIMock { - e.results = &RepositoryIMockListKnowledgeBaseFilesResults{ka1, i1, s1, err} +// 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.ListKnowledgeBaseFiles should be invoked -func (mmListKnowledgeBaseFiles *mRepositoryIMockListKnowledgeBaseFiles) Times(n uint64) *mRepositoryIMockListKnowledgeBaseFiles { +// Times sets number of times RepositoryI.HardDeleteEmbeddingsByKbFileUID should be invoked +func (mmHardDeleteEmbeddingsByKbFileUID *mRepositoryIMockHardDeleteEmbeddingsByKbFileUID) Times(n uint64) *mRepositoryIMockHardDeleteEmbeddingsByKbFileUID { if n == 0 { - mmListKnowledgeBaseFiles.mock.t.Fatalf("Times of RepositoryIMock.ListKnowledgeBaseFiles mock can not be zero") + mmHardDeleteEmbeddingsByKbFileUID.mock.t.Fatalf("Times of RepositoryIMock.HardDeleteEmbeddingsByKbFileUID mock can not be zero") } - mm_atomic.StoreUint64(&mmListKnowledgeBaseFiles.expectedInvocations, n) - return mmListKnowledgeBaseFiles + mm_atomic.StoreUint64(&mmHardDeleteEmbeddingsByKbFileUID.expectedInvocations, n) + return mmHardDeleteEmbeddingsByKbFileUID } -func (mmListKnowledgeBaseFiles *mRepositoryIMockListKnowledgeBaseFiles) invocationsDone() bool { - if len(mmListKnowledgeBaseFiles.expectations) == 0 && mmListKnowledgeBaseFiles.defaultExpectation == nil && mmListKnowledgeBaseFiles.mock.funcListKnowledgeBaseFiles == nil { +func (mmHardDeleteEmbeddingsByKbFileUID *mRepositoryIMockHardDeleteEmbeddingsByKbFileUID) invocationsDone() bool { + if len(mmHardDeleteEmbeddingsByKbFileUID.expectations) == 0 && mmHardDeleteEmbeddingsByKbFileUID.defaultExpectation == nil && mmHardDeleteEmbeddingsByKbFileUID.mock.funcHardDeleteEmbeddingsByKbFileUID == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmListKnowledgeBaseFiles.mock.afterListKnowledgeBaseFilesCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmListKnowledgeBaseFiles.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmHardDeleteEmbeddingsByKbFileUID.mock.afterHardDeleteEmbeddingsByKbFileUIDCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmHardDeleteEmbeddingsByKbFileUID.expectedInvocations) return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) } -// ListKnowledgeBaseFiles implements repository.RepositoryI -func (mmListKnowledgeBaseFiles *RepositoryIMock) ListKnowledgeBaseFiles(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) { - mm_atomic.AddUint64(&mmListKnowledgeBaseFiles.beforeListKnowledgeBaseFilesCounter, 1) - defer mm_atomic.AddUint64(&mmListKnowledgeBaseFiles.afterListKnowledgeBaseFilesCounter, 1) +// 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 mmListKnowledgeBaseFiles.inspectFuncListKnowledgeBaseFiles != nil { - mmListKnowledgeBaseFiles.inspectFuncListKnowledgeBaseFiles(ctx, uid, ownerUID, kbUID, pageSize, nextPageToken, filesUID) + if mmHardDeleteEmbeddingsByKbFileUID.inspectFuncHardDeleteEmbeddingsByKbFileUID != nil { + mmHardDeleteEmbeddingsByKbFileUID.inspectFuncHardDeleteEmbeddingsByKbFileUID(ctx, kbFileUID) } - mm_params := RepositoryIMockListKnowledgeBaseFilesParams{ctx, uid, ownerUID, kbUID, pageSize, nextPageToken, filesUID} + mm_params := RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParams{ctx, kbFileUID} // Record call args - mmListKnowledgeBaseFiles.ListKnowledgeBaseFilesMock.mutex.Lock() - mmListKnowledgeBaseFiles.ListKnowledgeBaseFilesMock.callArgs = append(mmListKnowledgeBaseFiles.ListKnowledgeBaseFilesMock.callArgs, &mm_params) - mmListKnowledgeBaseFiles.ListKnowledgeBaseFilesMock.mutex.Unlock() + mmHardDeleteEmbeddingsByKbFileUID.HardDeleteEmbeddingsByKbFileUIDMock.mutex.Lock() + mmHardDeleteEmbeddingsByKbFileUID.HardDeleteEmbeddingsByKbFileUIDMock.callArgs = append(mmHardDeleteEmbeddingsByKbFileUID.HardDeleteEmbeddingsByKbFileUIDMock.callArgs, &mm_params) + mmHardDeleteEmbeddingsByKbFileUID.HardDeleteEmbeddingsByKbFileUIDMock.mutex.Unlock() - for _, e := range mmListKnowledgeBaseFiles.ListKnowledgeBaseFilesMock.expectations { + for _, e := range mmHardDeleteEmbeddingsByKbFileUID.HardDeleteEmbeddingsByKbFileUIDMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.ka1, e.results.i1, e.results.s1, e.results.err + return e.results.err } } - if mmListKnowledgeBaseFiles.ListKnowledgeBaseFilesMock.defaultExpectation != nil { - mm_atomic.AddUint64(&mmListKnowledgeBaseFiles.ListKnowledgeBaseFilesMock.defaultExpectation.Counter, 1) - mm_want := mmListKnowledgeBaseFiles.ListKnowledgeBaseFilesMock.defaultExpectation.params - mm_want_ptrs := mmListKnowledgeBaseFiles.ListKnowledgeBaseFilesMock.defaultExpectation.paramPtrs + 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 := RepositoryIMockListKnowledgeBaseFilesParams{ctx, uid, ownerUID, kbUID, pageSize, nextPageToken, filesUID} + 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) { - mmListKnowledgeBaseFiles.t.Errorf("RepositoryIMock.ListKnowledgeBaseFiles 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) { - mmListKnowledgeBaseFiles.t.Errorf("RepositoryIMock.ListKnowledgeBaseFiles 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.ownerUID != nil && !minimock.Equal(*mm_want_ptrs.ownerUID, mm_got.ownerUID) { - mmListKnowledgeBaseFiles.t.Errorf("RepositoryIMock.ListKnowledgeBaseFiles 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.kbUID != nil && !minimock.Equal(*mm_want_ptrs.kbUID, mm_got.kbUID) { - mmListKnowledgeBaseFiles.t.Errorf("RepositoryIMock.ListKnowledgeBaseFiles 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.pageSize != nil && !minimock.Equal(*mm_want_ptrs.pageSize, mm_got.pageSize) { - mmListKnowledgeBaseFiles.t.Errorf("RepositoryIMock.ListKnowledgeBaseFiles got unexpected parameter pageSize, want: %#v, got: %#v%s\n", *mm_want_ptrs.pageSize, mm_got.pageSize, minimock.Diff(*mm_want_ptrs.pageSize, mm_got.pageSize)) - } - - if mm_want_ptrs.nextPageToken != nil && !minimock.Equal(*mm_want_ptrs.nextPageToken, mm_got.nextPageToken) { - mmListKnowledgeBaseFiles.t.Errorf("RepositoryIMock.ListKnowledgeBaseFiles got unexpected parameter nextPageToken, want: %#v, got: %#v%s\n", *mm_want_ptrs.nextPageToken, mm_got.nextPageToken, minimock.Diff(*mm_want_ptrs.nextPageToken, mm_got.nextPageToken)) + 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.filesUID != nil && !minimock.Equal(*mm_want_ptrs.filesUID, mm_got.filesUID) { - mmListKnowledgeBaseFiles.t.Errorf("RepositoryIMock.ListKnowledgeBaseFiles got unexpected parameter filesUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.filesUID, mm_got.filesUID, minimock.Diff(*mm_want_ptrs.filesUID, mm_got.filesUID)) + 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) { - mmListKnowledgeBaseFiles.t.Errorf("RepositoryIMock.ListKnowledgeBaseFiles got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*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 := mmListKnowledgeBaseFiles.ListKnowledgeBaseFilesMock.defaultExpectation.results + mm_results := mmHardDeleteEmbeddingsByKbFileUID.HardDeleteEmbeddingsByKbFileUIDMock.defaultExpectation.results if mm_results == nil { - mmListKnowledgeBaseFiles.t.Fatal("No results are set for the RepositoryIMock.ListKnowledgeBaseFiles") + mmHardDeleteEmbeddingsByKbFileUID.t.Fatal("No results are set for the RepositoryIMock.HardDeleteEmbeddingsByKbFileUID") } - return (*mm_results).ka1, (*mm_results).i1, (*mm_results).s1, (*mm_results).err + return (*mm_results).err } - if mmListKnowledgeBaseFiles.funcListKnowledgeBaseFiles != nil { - return mmListKnowledgeBaseFiles.funcListKnowledgeBaseFiles(ctx, uid, ownerUID, kbUID, pageSize, nextPageToken, filesUID) + if mmHardDeleteEmbeddingsByKbFileUID.funcHardDeleteEmbeddingsByKbFileUID != nil { + return mmHardDeleteEmbeddingsByKbFileUID.funcHardDeleteEmbeddingsByKbFileUID(ctx, kbFileUID) } - mmListKnowledgeBaseFiles.t.Fatalf("Unexpected call to RepositoryIMock.ListKnowledgeBaseFiles. %v %v %v %v %v %v %v", ctx, uid, ownerUID, kbUID, pageSize, nextPageToken, filesUID) + mmHardDeleteEmbeddingsByKbFileUID.t.Fatalf("Unexpected call to RepositoryIMock.HardDeleteEmbeddingsByKbFileUID. %v %v", ctx, kbFileUID) return } -// ListKnowledgeBaseFilesAfterCounter returns a count of finished RepositoryIMock.ListKnowledgeBaseFiles invocations -func (mmListKnowledgeBaseFiles *RepositoryIMock) ListKnowledgeBaseFilesAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmListKnowledgeBaseFiles.afterListKnowledgeBaseFilesCounter) +// HardDeleteEmbeddingsByKbFileUIDAfterCounter returns a count of finished RepositoryIMock.HardDeleteEmbeddingsByKbFileUID invocations +func (mmHardDeleteEmbeddingsByKbFileUID *RepositoryIMock) HardDeleteEmbeddingsByKbFileUIDAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmHardDeleteEmbeddingsByKbFileUID.afterHardDeleteEmbeddingsByKbFileUIDCounter) } -// ListKnowledgeBaseFilesBeforeCounter returns a count of RepositoryIMock.ListKnowledgeBaseFiles invocations -func (mmListKnowledgeBaseFiles *RepositoryIMock) ListKnowledgeBaseFilesBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmListKnowledgeBaseFiles.beforeListKnowledgeBaseFilesCounter) +// 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.ListKnowledgeBaseFiles. +// 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 (mmListKnowledgeBaseFiles *mRepositoryIMockListKnowledgeBaseFiles) Calls() []*RepositoryIMockListKnowledgeBaseFilesParams { - mmListKnowledgeBaseFiles.mutex.RLock() +func (mmHardDeleteEmbeddingsByKbFileUID *mRepositoryIMockHardDeleteEmbeddingsByKbFileUID) Calls() []*RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParams { + mmHardDeleteEmbeddingsByKbFileUID.mutex.RLock() - argCopy := make([]*RepositoryIMockListKnowledgeBaseFilesParams, len(mmListKnowledgeBaseFiles.callArgs)) - copy(argCopy, mmListKnowledgeBaseFiles.callArgs) + argCopy := make([]*RepositoryIMockHardDeleteEmbeddingsByKbFileUIDParams, len(mmHardDeleteEmbeddingsByKbFileUID.callArgs)) + copy(argCopy, mmHardDeleteEmbeddingsByKbFileUID.callArgs) - mmListKnowledgeBaseFiles.mutex.RUnlock() + mmHardDeleteEmbeddingsByKbFileUID.mutex.RUnlock() return argCopy } -// MinimockListKnowledgeBaseFilesDone returns true if the count of the ListKnowledgeBaseFiles invocations corresponds +// MinimockHardDeleteEmbeddingsByKbFileUIDDone returns true if the count of the HardDeleteEmbeddingsByKbFileUID invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockListKnowledgeBaseFilesDone() bool { - for _, e := range m.ListKnowledgeBaseFilesMock.expectations { +func (m *RepositoryIMock) MinimockHardDeleteEmbeddingsByKbFileUIDDone() bool { + for _, e := range m.HardDeleteEmbeddingsByKbFileUIDMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.ListKnowledgeBaseFilesMock.invocationsDone() + return m.HardDeleteEmbeddingsByKbFileUIDMock.invocationsDone() } -// MinimockListKnowledgeBaseFilesInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockListKnowledgeBaseFilesInspect() { - for _, e := range m.ListKnowledgeBaseFilesMock.expectations { +// 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.ListKnowledgeBaseFiles with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.HardDeleteEmbeddingsByKbFileUID with params: %#v", *e.params) } } - afterListKnowledgeBaseFilesCounter := mm_atomic.LoadUint64(&m.afterListKnowledgeBaseFilesCounter) + afterHardDeleteEmbeddingsByKbFileUIDCounter := mm_atomic.LoadUint64(&m.afterHardDeleteEmbeddingsByKbFileUIDCounter) // if default expectation was set then invocations count should be greater than zero - if m.ListKnowledgeBaseFilesMock.defaultExpectation != nil && afterListKnowledgeBaseFilesCounter < 1 { - if m.ListKnowledgeBaseFilesMock.defaultExpectation.params == nil { - m.t.Error("Expected call to RepositoryIMock.ListKnowledgeBaseFiles") + 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.ListKnowledgeBaseFiles with params: %#v", *m.ListKnowledgeBaseFilesMock.defaultExpectation.params) + 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.funcListKnowledgeBaseFiles != nil && afterListKnowledgeBaseFilesCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.ListKnowledgeBaseFiles") + if m.funcHardDeleteEmbeddingsByKbFileUID != nil && afterHardDeleteEmbeddingsByKbFileUIDCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.HardDeleteEmbeddingsByKbFileUID") } - if !m.ListKnowledgeBaseFilesMock.invocationsDone() && afterListKnowledgeBaseFilesCounter > 0 { - m.t.Errorf("Expected %d calls to RepositoryIMock.ListKnowledgeBaseFiles but found %d calls", - mm_atomic.LoadUint64(&m.ListKnowledgeBaseFilesMock.expectedInvocations), afterListKnowledgeBaseFilesCounter) + 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 mRepositoryIMockListKnowledgeBases struct { +type mRepositoryIMockHardDeleteEmbeddingsByKbUID struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockListKnowledgeBasesExpectation - expectations []*RepositoryIMockListKnowledgeBasesExpectation + defaultExpectation *RepositoryIMockHardDeleteEmbeddingsByKbUIDExpectation + expectations []*RepositoryIMockHardDeleteEmbeddingsByKbUIDExpectation - callArgs []*RepositoryIMockListKnowledgeBasesParams + callArgs []*RepositoryIMockHardDeleteEmbeddingsByKbUIDParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockListKnowledgeBasesExpectation specifies expectation struct of the RepositoryI.ListKnowledgeBases -type RepositoryIMockListKnowledgeBasesExpectation struct { +// RepositoryIMockHardDeleteEmbeddingsByKbUIDExpectation specifies expectation struct of the RepositoryI.HardDeleteEmbeddingsByKbUID +type RepositoryIMockHardDeleteEmbeddingsByKbUIDExpectation struct { mock *RepositoryIMock - params *RepositoryIMockListKnowledgeBasesParams - paramPtrs *RepositoryIMockListKnowledgeBasesParamPtrs - results *RepositoryIMockListKnowledgeBasesResults + params *RepositoryIMockHardDeleteEmbeddingsByKbUIDParams + paramPtrs *RepositoryIMockHardDeleteEmbeddingsByKbUIDParamPtrs + results *RepositoryIMockHardDeleteEmbeddingsByKbUIDResults Counter uint64 } -// RepositoryIMockListKnowledgeBasesParams contains parameters of the RepositoryI.ListKnowledgeBases -type RepositoryIMockListKnowledgeBasesParams struct { - ctx context.Context - ownerUID string +// RepositoryIMockHardDeleteEmbeddingsByKbUIDParams contains parameters of the RepositoryI.HardDeleteEmbeddingsByKbUID +type RepositoryIMockHardDeleteEmbeddingsByKbUIDParams struct { + ctx context.Context + kbUID uuid.UUID } -// RepositoryIMockListKnowledgeBasesParamPtrs contains pointers to parameters of the RepositoryI.ListKnowledgeBases -type RepositoryIMockListKnowledgeBasesParamPtrs struct { - ctx *context.Context - ownerUID *string +// RepositoryIMockHardDeleteEmbeddingsByKbUIDParamPtrs contains pointers to parameters of the RepositoryI.HardDeleteEmbeddingsByKbUID +type RepositoryIMockHardDeleteEmbeddingsByKbUIDParamPtrs struct { + ctx *context.Context + kbUID *uuid.UUID } -// RepositoryIMockListKnowledgeBasesResults contains results of the RepositoryI.ListKnowledgeBases -type RepositoryIMockListKnowledgeBasesResults struct { - ka1 []mm_repository.KnowledgeBase +// RepositoryIMockHardDeleteEmbeddingsByKbUIDResults contains results of the RepositoryI.HardDeleteEmbeddingsByKbUID +type RepositoryIMockHardDeleteEmbeddingsByKbUIDResults struct { err error } -// Expect sets up expected params for RepositoryI.ListKnowledgeBases -func (mmListKnowledgeBases *mRepositoryIMockListKnowledgeBases) Expect(ctx context.Context, ownerUID string) *mRepositoryIMockListKnowledgeBases { - if mmListKnowledgeBases.mock.funcListKnowledgeBases != nil { - mmListKnowledgeBases.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBases mock is already set by Set") +// 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 mmListKnowledgeBases.defaultExpectation == nil { - mmListKnowledgeBases.defaultExpectation = &RepositoryIMockListKnowledgeBasesExpectation{} + if mmHardDeleteEmbeddingsByKbUID.defaultExpectation == nil { + mmHardDeleteEmbeddingsByKbUID.defaultExpectation = &RepositoryIMockHardDeleteEmbeddingsByKbUIDExpectation{} } - if mmListKnowledgeBases.defaultExpectation.paramPtrs != nil { - mmListKnowledgeBases.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBases mock is already set by ExpectParams functions") + if mmHardDeleteEmbeddingsByKbUID.defaultExpectation.paramPtrs != nil { + mmHardDeleteEmbeddingsByKbUID.mock.t.Fatalf("RepositoryIMock.HardDeleteEmbeddingsByKbUID mock is already set by ExpectParams functions") } - mmListKnowledgeBases.defaultExpectation.params = &RepositoryIMockListKnowledgeBasesParams{ctx, ownerUID} - for _, e := range mmListKnowledgeBases.expectations { - if minimock.Equal(e.params, mmListKnowledgeBases.defaultExpectation.params) { - mmListKnowledgeBases.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmListKnowledgeBases.defaultExpectation.params) + 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 mmListKnowledgeBases + return mmHardDeleteEmbeddingsByKbUID } -// ExpectCtxParam1 sets up expected param ctx for RepositoryI.ListKnowledgeBases -func (mmListKnowledgeBases *mRepositoryIMockListKnowledgeBases) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockListKnowledgeBases { - if mmListKnowledgeBases.mock.funcListKnowledgeBases != nil { - mmListKnowledgeBases.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBases mock is already set by Set") +// 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 mmListKnowledgeBases.defaultExpectation == nil { - mmListKnowledgeBases.defaultExpectation = &RepositoryIMockListKnowledgeBasesExpectation{} + if mmHardDeleteEmbeddingsByKbUID.defaultExpectation == nil { + mmHardDeleteEmbeddingsByKbUID.defaultExpectation = &RepositoryIMockHardDeleteEmbeddingsByKbUIDExpectation{} } - if mmListKnowledgeBases.defaultExpectation.params != nil { - mmListKnowledgeBases.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBases mock is already set by Expect") + if mmHardDeleteEmbeddingsByKbUID.defaultExpectation.params != nil { + mmHardDeleteEmbeddingsByKbUID.mock.t.Fatalf("RepositoryIMock.HardDeleteEmbeddingsByKbUID mock is already set by Expect") } - if mmListKnowledgeBases.defaultExpectation.paramPtrs == nil { - mmListKnowledgeBases.defaultExpectation.paramPtrs = &RepositoryIMockListKnowledgeBasesParamPtrs{} + if mmHardDeleteEmbeddingsByKbUID.defaultExpectation.paramPtrs == nil { + mmHardDeleteEmbeddingsByKbUID.defaultExpectation.paramPtrs = &RepositoryIMockHardDeleteEmbeddingsByKbUIDParamPtrs{} } - mmListKnowledgeBases.defaultExpectation.paramPtrs.ctx = &ctx + mmHardDeleteEmbeddingsByKbUID.defaultExpectation.paramPtrs.ctx = &ctx - return mmListKnowledgeBases + return mmHardDeleteEmbeddingsByKbUID } -// ExpectOwnerUIDParam2 sets up expected param ownerUID for RepositoryI.ListKnowledgeBases -func (mmListKnowledgeBases *mRepositoryIMockListKnowledgeBases) ExpectOwnerUIDParam2(ownerUID string) *mRepositoryIMockListKnowledgeBases { - if mmListKnowledgeBases.mock.funcListKnowledgeBases != nil { - mmListKnowledgeBases.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBases mock is already set by Set") +// 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 mmListKnowledgeBases.defaultExpectation == nil { - mmListKnowledgeBases.defaultExpectation = &RepositoryIMockListKnowledgeBasesExpectation{} + if mmHardDeleteEmbeddingsByKbUID.defaultExpectation == nil { + mmHardDeleteEmbeddingsByKbUID.defaultExpectation = &RepositoryIMockHardDeleteEmbeddingsByKbUIDExpectation{} } - if mmListKnowledgeBases.defaultExpectation.params != nil { - mmListKnowledgeBases.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBases mock is already set by Expect") + if mmHardDeleteEmbeddingsByKbUID.defaultExpectation.params != nil { + mmHardDeleteEmbeddingsByKbUID.mock.t.Fatalf("RepositoryIMock.HardDeleteEmbeddingsByKbUID mock is already set by Expect") } - if mmListKnowledgeBases.defaultExpectation.paramPtrs == nil { - mmListKnowledgeBases.defaultExpectation.paramPtrs = &RepositoryIMockListKnowledgeBasesParamPtrs{} + if mmHardDeleteEmbeddingsByKbUID.defaultExpectation.paramPtrs == nil { + mmHardDeleteEmbeddingsByKbUID.defaultExpectation.paramPtrs = &RepositoryIMockHardDeleteEmbeddingsByKbUIDParamPtrs{} } - mmListKnowledgeBases.defaultExpectation.paramPtrs.ownerUID = &ownerUID + mmHardDeleteEmbeddingsByKbUID.defaultExpectation.paramPtrs.kbUID = &kbUID - return mmListKnowledgeBases + return mmHardDeleteEmbeddingsByKbUID } -// Inspect accepts an inspector function that has same arguments as the RepositoryI.ListKnowledgeBases -func (mmListKnowledgeBases *mRepositoryIMockListKnowledgeBases) Inspect(f func(ctx context.Context, ownerUID string)) *mRepositoryIMockListKnowledgeBases { - if mmListKnowledgeBases.mock.inspectFuncListKnowledgeBases != nil { - mmListKnowledgeBases.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.ListKnowledgeBases") +// 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") } - mmListKnowledgeBases.mock.inspectFuncListKnowledgeBases = f + mmHardDeleteEmbeddingsByKbUID.mock.inspectFuncHardDeleteEmbeddingsByKbUID = f - return mmListKnowledgeBases + return mmHardDeleteEmbeddingsByKbUID } -// Return sets up results that will be returned by RepositoryI.ListKnowledgeBases -func (mmListKnowledgeBases *mRepositoryIMockListKnowledgeBases) Return(ka1 []mm_repository.KnowledgeBase, err error) *RepositoryIMock { - if mmListKnowledgeBases.mock.funcListKnowledgeBases != nil { - mmListKnowledgeBases.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBases mock is already set by Set") +// 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 mmListKnowledgeBases.defaultExpectation == nil { - mmListKnowledgeBases.defaultExpectation = &RepositoryIMockListKnowledgeBasesExpectation{mock: mmListKnowledgeBases.mock} + if mmHardDeleteEmbeddingsByKbUID.defaultExpectation == nil { + mmHardDeleteEmbeddingsByKbUID.defaultExpectation = &RepositoryIMockHardDeleteEmbeddingsByKbUIDExpectation{mock: mmHardDeleteEmbeddingsByKbUID.mock} } - mmListKnowledgeBases.defaultExpectation.results = &RepositoryIMockListKnowledgeBasesResults{ka1, err} - return mmListKnowledgeBases.mock + mmHardDeleteEmbeddingsByKbUID.defaultExpectation.results = &RepositoryIMockHardDeleteEmbeddingsByKbUIDResults{err} + return mmHardDeleteEmbeddingsByKbUID.mock } -// Set uses given function f to mock the RepositoryI.ListKnowledgeBases method -func (mmListKnowledgeBases *mRepositoryIMockListKnowledgeBases) Set(f func(ctx context.Context, ownerUID string) (ka1 []mm_repository.KnowledgeBase, err error)) *RepositoryIMock { - if mmListKnowledgeBases.defaultExpectation != nil { - mmListKnowledgeBases.mock.t.Fatalf("Default expectation is already set for the RepositoryI.ListKnowledgeBases method") +// 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(mmListKnowledgeBases.expectations) > 0 { - mmListKnowledgeBases.mock.t.Fatalf("Some expectations are already set for the RepositoryI.ListKnowledgeBases method") + if len(mmHardDeleteEmbeddingsByKbUID.expectations) > 0 { + mmHardDeleteEmbeddingsByKbUID.mock.t.Fatalf("Some expectations are already set for the RepositoryI.HardDeleteEmbeddingsByKbUID method") } - mmListKnowledgeBases.mock.funcListKnowledgeBases = f - return mmListKnowledgeBases.mock + mmHardDeleteEmbeddingsByKbUID.mock.funcHardDeleteEmbeddingsByKbUID = f + return mmHardDeleteEmbeddingsByKbUID.mock } -// When sets expectation for the RepositoryI.ListKnowledgeBases which will trigger the result defined by the following +// When sets expectation for the RepositoryI.HardDeleteEmbeddingsByKbUID which will trigger the result defined by the following // Then helper -func (mmListKnowledgeBases *mRepositoryIMockListKnowledgeBases) When(ctx context.Context, ownerUID string) *RepositoryIMockListKnowledgeBasesExpectation { - if mmListKnowledgeBases.mock.funcListKnowledgeBases != nil { - mmListKnowledgeBases.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBases mock is already set by Set") +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 := &RepositoryIMockListKnowledgeBasesExpectation{ - mock: mmListKnowledgeBases.mock, - params: &RepositoryIMockListKnowledgeBasesParams{ctx, ownerUID}, + expectation := &RepositoryIMockHardDeleteEmbeddingsByKbUIDExpectation{ + mock: mmHardDeleteEmbeddingsByKbUID.mock, + params: &RepositoryIMockHardDeleteEmbeddingsByKbUIDParams{ctx, kbUID}, } - mmListKnowledgeBases.expectations = append(mmListKnowledgeBases.expectations, expectation) + mmHardDeleteEmbeddingsByKbUID.expectations = append(mmHardDeleteEmbeddingsByKbUID.expectations, expectation) return expectation } -// Then sets up RepositoryI.ListKnowledgeBases return parameters for the expectation previously defined by the When method -func (e *RepositoryIMockListKnowledgeBasesExpectation) Then(ka1 []mm_repository.KnowledgeBase, err error) *RepositoryIMock { - e.results = &RepositoryIMockListKnowledgeBasesResults{ka1, err} +// 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.ListKnowledgeBases should be invoked -func (mmListKnowledgeBases *mRepositoryIMockListKnowledgeBases) Times(n uint64) *mRepositoryIMockListKnowledgeBases { +// Times sets number of times RepositoryI.HardDeleteEmbeddingsByKbUID should be invoked +func (mmHardDeleteEmbeddingsByKbUID *mRepositoryIMockHardDeleteEmbeddingsByKbUID) Times(n uint64) *mRepositoryIMockHardDeleteEmbeddingsByKbUID { if n == 0 { - mmListKnowledgeBases.mock.t.Fatalf("Times of RepositoryIMock.ListKnowledgeBases mock can not be zero") + mmHardDeleteEmbeddingsByKbUID.mock.t.Fatalf("Times of RepositoryIMock.HardDeleteEmbeddingsByKbUID mock can not be zero") } - mm_atomic.StoreUint64(&mmListKnowledgeBases.expectedInvocations, n) - return mmListKnowledgeBases + mm_atomic.StoreUint64(&mmHardDeleteEmbeddingsByKbUID.expectedInvocations, n) + return mmHardDeleteEmbeddingsByKbUID } -func (mmListKnowledgeBases *mRepositoryIMockListKnowledgeBases) invocationsDone() bool { - if len(mmListKnowledgeBases.expectations) == 0 && mmListKnowledgeBases.defaultExpectation == nil && mmListKnowledgeBases.mock.funcListKnowledgeBases == nil { +func (mmHardDeleteEmbeddingsByKbUID *mRepositoryIMockHardDeleteEmbeddingsByKbUID) invocationsDone() bool { + if len(mmHardDeleteEmbeddingsByKbUID.expectations) == 0 && mmHardDeleteEmbeddingsByKbUID.defaultExpectation == nil && mmHardDeleteEmbeddingsByKbUID.mock.funcHardDeleteEmbeddingsByKbUID == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmListKnowledgeBases.mock.afterListKnowledgeBasesCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmListKnowledgeBases.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmHardDeleteEmbeddingsByKbUID.mock.afterHardDeleteEmbeddingsByKbUIDCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmHardDeleteEmbeddingsByKbUID.expectedInvocations) return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) } -// ListKnowledgeBases implements repository.RepositoryI -func (mmListKnowledgeBases *RepositoryIMock) ListKnowledgeBases(ctx context.Context, ownerUID string) (ka1 []mm_repository.KnowledgeBase, err error) { - mm_atomic.AddUint64(&mmListKnowledgeBases.beforeListKnowledgeBasesCounter, 1) - defer mm_atomic.AddUint64(&mmListKnowledgeBases.afterListKnowledgeBasesCounter, 1) +// 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 mmListKnowledgeBases.inspectFuncListKnowledgeBases != nil { - mmListKnowledgeBases.inspectFuncListKnowledgeBases(ctx, ownerUID) + if mmHardDeleteEmbeddingsByKbUID.inspectFuncHardDeleteEmbeddingsByKbUID != nil { + mmHardDeleteEmbeddingsByKbUID.inspectFuncHardDeleteEmbeddingsByKbUID(ctx, kbUID) } - mm_params := RepositoryIMockListKnowledgeBasesParams{ctx, ownerUID} + mm_params := RepositoryIMockHardDeleteEmbeddingsByKbUIDParams{ctx, kbUID} // Record call args - mmListKnowledgeBases.ListKnowledgeBasesMock.mutex.Lock() - mmListKnowledgeBases.ListKnowledgeBasesMock.callArgs = append(mmListKnowledgeBases.ListKnowledgeBasesMock.callArgs, &mm_params) - mmListKnowledgeBases.ListKnowledgeBasesMock.mutex.Unlock() + mmHardDeleteEmbeddingsByKbUID.HardDeleteEmbeddingsByKbUIDMock.mutex.Lock() + mmHardDeleteEmbeddingsByKbUID.HardDeleteEmbeddingsByKbUIDMock.callArgs = append(mmHardDeleteEmbeddingsByKbUID.HardDeleteEmbeddingsByKbUIDMock.callArgs, &mm_params) + mmHardDeleteEmbeddingsByKbUID.HardDeleteEmbeddingsByKbUIDMock.mutex.Unlock() - for _, e := range mmListKnowledgeBases.ListKnowledgeBasesMock.expectations { + for _, e := range mmHardDeleteEmbeddingsByKbUID.HardDeleteEmbeddingsByKbUIDMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.ka1, e.results.err + return e.results.err } } - if mmListKnowledgeBases.ListKnowledgeBasesMock.defaultExpectation != nil { - mm_atomic.AddUint64(&mmListKnowledgeBases.ListKnowledgeBasesMock.defaultExpectation.Counter, 1) - mm_want := mmListKnowledgeBases.ListKnowledgeBasesMock.defaultExpectation.params - mm_want_ptrs := mmListKnowledgeBases.ListKnowledgeBasesMock.defaultExpectation.paramPtrs + 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 := RepositoryIMockListKnowledgeBasesParams{ctx, ownerUID} + 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) { - mmListKnowledgeBases.t.Errorf("RepositoryIMock.ListKnowledgeBases 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)) + 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.ownerUID != nil && !minimock.Equal(*mm_want_ptrs.ownerUID, mm_got.ownerUID) { - mmListKnowledgeBases.t.Errorf("RepositoryIMock.ListKnowledgeBases 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.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) { - mmListKnowledgeBases.t.Errorf("RepositoryIMock.ListKnowledgeBases got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*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 := mmListKnowledgeBases.ListKnowledgeBasesMock.defaultExpectation.results + mm_results := mmHardDeleteEmbeddingsByKbUID.HardDeleteEmbeddingsByKbUIDMock.defaultExpectation.results if mm_results == nil { - mmListKnowledgeBases.t.Fatal("No results are set for the RepositoryIMock.ListKnowledgeBases") + mmHardDeleteEmbeddingsByKbUID.t.Fatal("No results are set for the RepositoryIMock.HardDeleteEmbeddingsByKbUID") } - return (*mm_results).ka1, (*mm_results).err + return (*mm_results).err } - if mmListKnowledgeBases.funcListKnowledgeBases != nil { - return mmListKnowledgeBases.funcListKnowledgeBases(ctx, ownerUID) + if mmHardDeleteEmbeddingsByKbUID.funcHardDeleteEmbeddingsByKbUID != nil { + return mmHardDeleteEmbeddingsByKbUID.funcHardDeleteEmbeddingsByKbUID(ctx, kbUID) } - mmListKnowledgeBases.t.Fatalf("Unexpected call to RepositoryIMock.ListKnowledgeBases. %v %v", ctx, ownerUID) + mmHardDeleteEmbeddingsByKbUID.t.Fatalf("Unexpected call to RepositoryIMock.HardDeleteEmbeddingsByKbUID. %v %v", ctx, kbUID) return } -// ListKnowledgeBasesAfterCounter returns a count of finished RepositoryIMock.ListKnowledgeBases invocations -func (mmListKnowledgeBases *RepositoryIMock) ListKnowledgeBasesAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmListKnowledgeBases.afterListKnowledgeBasesCounter) +// HardDeleteEmbeddingsByKbUIDAfterCounter returns a count of finished RepositoryIMock.HardDeleteEmbeddingsByKbUID invocations +func (mmHardDeleteEmbeddingsByKbUID *RepositoryIMock) HardDeleteEmbeddingsByKbUIDAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmHardDeleteEmbeddingsByKbUID.afterHardDeleteEmbeddingsByKbUIDCounter) } -// ListKnowledgeBasesBeforeCounter returns a count of RepositoryIMock.ListKnowledgeBases invocations -func (mmListKnowledgeBases *RepositoryIMock) ListKnowledgeBasesBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmListKnowledgeBases.beforeListKnowledgeBasesCounter) +// 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.ListKnowledgeBases. +// 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 (mmListKnowledgeBases *mRepositoryIMockListKnowledgeBases) Calls() []*RepositoryIMockListKnowledgeBasesParams { - mmListKnowledgeBases.mutex.RLock() +func (mmHardDeleteEmbeddingsByKbUID *mRepositoryIMockHardDeleteEmbeddingsByKbUID) Calls() []*RepositoryIMockHardDeleteEmbeddingsByKbUIDParams { + mmHardDeleteEmbeddingsByKbUID.mutex.RLock() - argCopy := make([]*RepositoryIMockListKnowledgeBasesParams, len(mmListKnowledgeBases.callArgs)) - copy(argCopy, mmListKnowledgeBases.callArgs) + argCopy := make([]*RepositoryIMockHardDeleteEmbeddingsByKbUIDParams, len(mmHardDeleteEmbeddingsByKbUID.callArgs)) + copy(argCopy, mmHardDeleteEmbeddingsByKbUID.callArgs) - mmListKnowledgeBases.mutex.RUnlock() + mmHardDeleteEmbeddingsByKbUID.mutex.RUnlock() return argCopy } -// MinimockListKnowledgeBasesDone returns true if the count of the ListKnowledgeBases invocations corresponds +// MinimockHardDeleteEmbeddingsByKbUIDDone returns true if the count of the HardDeleteEmbeddingsByKbUID invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockListKnowledgeBasesDone() bool { - for _, e := range m.ListKnowledgeBasesMock.expectations { +func (m *RepositoryIMock) MinimockHardDeleteEmbeddingsByKbUIDDone() bool { + for _, e := range m.HardDeleteEmbeddingsByKbUIDMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.ListKnowledgeBasesMock.invocationsDone() + return m.HardDeleteEmbeddingsByKbUIDMock.invocationsDone() } -// MinimockListKnowledgeBasesInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockListKnowledgeBasesInspect() { - for _, e := range m.ListKnowledgeBasesMock.expectations { +// 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.ListKnowledgeBases with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.HardDeleteEmbeddingsByKbUID with params: %#v", *e.params) } } - afterListKnowledgeBasesCounter := mm_atomic.LoadUint64(&m.afterListKnowledgeBasesCounter) + afterHardDeleteEmbeddingsByKbUIDCounter := mm_atomic.LoadUint64(&m.afterHardDeleteEmbeddingsByKbUIDCounter) // if default expectation was set then invocations count should be greater than zero - if m.ListKnowledgeBasesMock.defaultExpectation != nil && afterListKnowledgeBasesCounter < 1 { - if m.ListKnowledgeBasesMock.defaultExpectation.params == nil { - m.t.Error("Expected call to RepositoryIMock.ListKnowledgeBases") + 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.ListKnowledgeBases with params: %#v", *m.ListKnowledgeBasesMock.defaultExpectation.params) + 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.funcListKnowledgeBases != nil && afterListKnowledgeBasesCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.ListKnowledgeBases") + if m.funcHardDeleteEmbeddingsByKbUID != nil && afterHardDeleteEmbeddingsByKbUIDCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.HardDeleteEmbeddingsByKbUID") } - if !m.ListKnowledgeBasesMock.invocationsDone() && afterListKnowledgeBasesCounter > 0 { - m.t.Errorf("Expected %d calls to RepositoryIMock.ListKnowledgeBases but found %d calls", - mm_atomic.LoadUint64(&m.ListKnowledgeBasesMock.expectedInvocations), afterListKnowledgeBasesCounter) + 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 mRepositoryIMockProcessKnowledgeBaseFiles struct { +type mRepositoryIMockIncreaseKnowledgeBaseUsage struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockProcessKnowledgeBaseFilesExpectation - expectations []*RepositoryIMockProcessKnowledgeBaseFilesExpectation + defaultExpectation *RepositoryIMockIncreaseKnowledgeBaseUsageExpectation + expectations []*RepositoryIMockIncreaseKnowledgeBaseUsageExpectation - callArgs []*RepositoryIMockProcessKnowledgeBaseFilesParams + callArgs []*RepositoryIMockIncreaseKnowledgeBaseUsageParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockProcessKnowledgeBaseFilesExpectation specifies expectation struct of the RepositoryI.ProcessKnowledgeBaseFiles -type RepositoryIMockProcessKnowledgeBaseFilesExpectation struct { +// RepositoryIMockIncreaseKnowledgeBaseUsageExpectation specifies expectation struct of the RepositoryI.IncreaseKnowledgeBaseUsage +type RepositoryIMockIncreaseKnowledgeBaseUsageExpectation struct { mock *RepositoryIMock - params *RepositoryIMockProcessKnowledgeBaseFilesParams - paramPtrs *RepositoryIMockProcessKnowledgeBaseFilesParamPtrs - results *RepositoryIMockProcessKnowledgeBaseFilesResults + params *RepositoryIMockIncreaseKnowledgeBaseUsageParams + paramPtrs *RepositoryIMockIncreaseKnowledgeBaseUsageParamPtrs + results *RepositoryIMockIncreaseKnowledgeBaseUsageResults Counter uint64 } -// RepositoryIMockProcessKnowledgeBaseFilesParams contains parameters of the RepositoryI.ProcessKnowledgeBaseFiles -type RepositoryIMockProcessKnowledgeBaseFilesParams struct { - ctx context.Context - fileUIDs []string - requester uuid.UUID +// RepositoryIMockIncreaseKnowledgeBaseUsageParams contains parameters of the RepositoryI.IncreaseKnowledgeBaseUsage +type RepositoryIMockIncreaseKnowledgeBaseUsageParams struct { + ctx context.Context + kbUID string + amount int } -// RepositoryIMockProcessKnowledgeBaseFilesParamPtrs contains pointers to parameters of the RepositoryI.ProcessKnowledgeBaseFiles -type RepositoryIMockProcessKnowledgeBaseFilesParamPtrs struct { - ctx *context.Context - fileUIDs *[]string - requester *uuid.UUID +// RepositoryIMockIncreaseKnowledgeBaseUsageParamPtrs contains pointers to parameters of the RepositoryI.IncreaseKnowledgeBaseUsage +type RepositoryIMockIncreaseKnowledgeBaseUsageParamPtrs struct { + ctx *context.Context + kbUID *string + amount *int } -// RepositoryIMockProcessKnowledgeBaseFilesResults contains results of the RepositoryI.ProcessKnowledgeBaseFiles -type RepositoryIMockProcessKnowledgeBaseFilesResults struct { - ka1 []mm_repository.KnowledgeBaseFile +// RepositoryIMockIncreaseKnowledgeBaseUsageResults contains results of the RepositoryI.IncreaseKnowledgeBaseUsage +type RepositoryIMockIncreaseKnowledgeBaseUsageResults struct { err error } -// Expect sets up expected params for RepositoryI.ProcessKnowledgeBaseFiles -func (mmProcessKnowledgeBaseFiles *mRepositoryIMockProcessKnowledgeBaseFiles) Expect(ctx context.Context, fileUIDs []string, requester uuid.UUID) *mRepositoryIMockProcessKnowledgeBaseFiles { - if mmProcessKnowledgeBaseFiles.mock.funcProcessKnowledgeBaseFiles != nil { - mmProcessKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ProcessKnowledgeBaseFiles mock is already set by Set") +// 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 mmProcessKnowledgeBaseFiles.defaultExpectation == nil { - mmProcessKnowledgeBaseFiles.defaultExpectation = &RepositoryIMockProcessKnowledgeBaseFilesExpectation{} + if mmIncreaseKnowledgeBaseUsage.defaultExpectation == nil { + mmIncreaseKnowledgeBaseUsage.defaultExpectation = &RepositoryIMockIncreaseKnowledgeBaseUsageExpectation{} } - if mmProcessKnowledgeBaseFiles.defaultExpectation.paramPtrs != nil { - mmProcessKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ProcessKnowledgeBaseFiles mock is already set by ExpectParams functions") + if mmIncreaseKnowledgeBaseUsage.defaultExpectation.paramPtrs != nil { + mmIncreaseKnowledgeBaseUsage.mock.t.Fatalf("RepositoryIMock.IncreaseKnowledgeBaseUsage mock is already set by ExpectParams functions") } - mmProcessKnowledgeBaseFiles.defaultExpectation.params = &RepositoryIMockProcessKnowledgeBaseFilesParams{ctx, fileUIDs, requester} - for _, e := range mmProcessKnowledgeBaseFiles.expectations { - if minimock.Equal(e.params, mmProcessKnowledgeBaseFiles.defaultExpectation.params) { - mmProcessKnowledgeBaseFiles.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmProcessKnowledgeBaseFiles.defaultExpectation.params) + 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 mmProcessKnowledgeBaseFiles + return mmIncreaseKnowledgeBaseUsage } -// ExpectCtxParam1 sets up expected param ctx for RepositoryI.ProcessKnowledgeBaseFiles -func (mmProcessKnowledgeBaseFiles *mRepositoryIMockProcessKnowledgeBaseFiles) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockProcessKnowledgeBaseFiles { - if mmProcessKnowledgeBaseFiles.mock.funcProcessKnowledgeBaseFiles != nil { - mmProcessKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ProcessKnowledgeBaseFiles mock is already set by Set") +// 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 mmProcessKnowledgeBaseFiles.defaultExpectation == nil { - mmProcessKnowledgeBaseFiles.defaultExpectation = &RepositoryIMockProcessKnowledgeBaseFilesExpectation{} + if mmIncreaseKnowledgeBaseUsage.defaultExpectation == nil { + mmIncreaseKnowledgeBaseUsage.defaultExpectation = &RepositoryIMockIncreaseKnowledgeBaseUsageExpectation{} } - if mmProcessKnowledgeBaseFiles.defaultExpectation.params != nil { - mmProcessKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ProcessKnowledgeBaseFiles mock is already set by Expect") + if mmIncreaseKnowledgeBaseUsage.defaultExpectation.params != nil { + mmIncreaseKnowledgeBaseUsage.mock.t.Fatalf("RepositoryIMock.IncreaseKnowledgeBaseUsage mock is already set by Expect") } - if mmProcessKnowledgeBaseFiles.defaultExpectation.paramPtrs == nil { - mmProcessKnowledgeBaseFiles.defaultExpectation.paramPtrs = &RepositoryIMockProcessKnowledgeBaseFilesParamPtrs{} + if mmIncreaseKnowledgeBaseUsage.defaultExpectation.paramPtrs == nil { + mmIncreaseKnowledgeBaseUsage.defaultExpectation.paramPtrs = &RepositoryIMockIncreaseKnowledgeBaseUsageParamPtrs{} } - mmProcessKnowledgeBaseFiles.defaultExpectation.paramPtrs.ctx = &ctx + mmIncreaseKnowledgeBaseUsage.defaultExpectation.paramPtrs.ctx = &ctx - return mmProcessKnowledgeBaseFiles + return mmIncreaseKnowledgeBaseUsage } -// ExpectFileUIDsParam2 sets up expected param fileUIDs for RepositoryI.ProcessKnowledgeBaseFiles -func (mmProcessKnowledgeBaseFiles *mRepositoryIMockProcessKnowledgeBaseFiles) ExpectFileUIDsParam2(fileUIDs []string) *mRepositoryIMockProcessKnowledgeBaseFiles { - if mmProcessKnowledgeBaseFiles.mock.funcProcessKnowledgeBaseFiles != nil { - mmProcessKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ProcessKnowledgeBaseFiles mock is already set by Set") +// 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 mmProcessKnowledgeBaseFiles.defaultExpectation == nil { - mmProcessKnowledgeBaseFiles.defaultExpectation = &RepositoryIMockProcessKnowledgeBaseFilesExpectation{} + if mmIncreaseKnowledgeBaseUsage.defaultExpectation == nil { + mmIncreaseKnowledgeBaseUsage.defaultExpectation = &RepositoryIMockIncreaseKnowledgeBaseUsageExpectation{} } - if mmProcessKnowledgeBaseFiles.defaultExpectation.params != nil { - mmProcessKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ProcessKnowledgeBaseFiles mock is already set by Expect") + if mmIncreaseKnowledgeBaseUsage.defaultExpectation.params != nil { + mmIncreaseKnowledgeBaseUsage.mock.t.Fatalf("RepositoryIMock.IncreaseKnowledgeBaseUsage mock is already set by Expect") } - if mmProcessKnowledgeBaseFiles.defaultExpectation.paramPtrs == nil { - mmProcessKnowledgeBaseFiles.defaultExpectation.paramPtrs = &RepositoryIMockProcessKnowledgeBaseFilesParamPtrs{} + if mmIncreaseKnowledgeBaseUsage.defaultExpectation.paramPtrs == nil { + mmIncreaseKnowledgeBaseUsage.defaultExpectation.paramPtrs = &RepositoryIMockIncreaseKnowledgeBaseUsageParamPtrs{} } - mmProcessKnowledgeBaseFiles.defaultExpectation.paramPtrs.fileUIDs = &fileUIDs + mmIncreaseKnowledgeBaseUsage.defaultExpectation.paramPtrs.kbUID = &kbUID - return mmProcessKnowledgeBaseFiles + return mmIncreaseKnowledgeBaseUsage } -// ExpectRequesterParam3 sets up expected param requester for RepositoryI.ProcessKnowledgeBaseFiles -func (mmProcessKnowledgeBaseFiles *mRepositoryIMockProcessKnowledgeBaseFiles) ExpectRequesterParam3(requester uuid.UUID) *mRepositoryIMockProcessKnowledgeBaseFiles { - if mmProcessKnowledgeBaseFiles.mock.funcProcessKnowledgeBaseFiles != nil { - mmProcessKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ProcessKnowledgeBaseFiles mock is already set by Set") +// 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 mmProcessKnowledgeBaseFiles.defaultExpectation == nil { - mmProcessKnowledgeBaseFiles.defaultExpectation = &RepositoryIMockProcessKnowledgeBaseFilesExpectation{} + if mmIncreaseKnowledgeBaseUsage.defaultExpectation == nil { + mmIncreaseKnowledgeBaseUsage.defaultExpectation = &RepositoryIMockIncreaseKnowledgeBaseUsageExpectation{} } - if mmProcessKnowledgeBaseFiles.defaultExpectation.params != nil { - mmProcessKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ProcessKnowledgeBaseFiles mock is already set by Expect") + if mmIncreaseKnowledgeBaseUsage.defaultExpectation.params != nil { + mmIncreaseKnowledgeBaseUsage.mock.t.Fatalf("RepositoryIMock.IncreaseKnowledgeBaseUsage mock is already set by Expect") } - if mmProcessKnowledgeBaseFiles.defaultExpectation.paramPtrs == nil { - mmProcessKnowledgeBaseFiles.defaultExpectation.paramPtrs = &RepositoryIMockProcessKnowledgeBaseFilesParamPtrs{} + if mmIncreaseKnowledgeBaseUsage.defaultExpectation.paramPtrs == nil { + mmIncreaseKnowledgeBaseUsage.defaultExpectation.paramPtrs = &RepositoryIMockIncreaseKnowledgeBaseUsageParamPtrs{} } - mmProcessKnowledgeBaseFiles.defaultExpectation.paramPtrs.requester = &requester + mmIncreaseKnowledgeBaseUsage.defaultExpectation.paramPtrs.amount = &amount - return mmProcessKnowledgeBaseFiles + return mmIncreaseKnowledgeBaseUsage } -// Inspect accepts an inspector function that has same arguments as the RepositoryI.ProcessKnowledgeBaseFiles -func (mmProcessKnowledgeBaseFiles *mRepositoryIMockProcessKnowledgeBaseFiles) Inspect(f func(ctx context.Context, fileUIDs []string, requester uuid.UUID)) *mRepositoryIMockProcessKnowledgeBaseFiles { - if mmProcessKnowledgeBaseFiles.mock.inspectFuncProcessKnowledgeBaseFiles != nil { - mmProcessKnowledgeBaseFiles.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.ProcessKnowledgeBaseFiles") +// 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") } - mmProcessKnowledgeBaseFiles.mock.inspectFuncProcessKnowledgeBaseFiles = f + mmIncreaseKnowledgeBaseUsage.mock.inspectFuncIncreaseKnowledgeBaseUsage = f - return mmProcessKnowledgeBaseFiles + return mmIncreaseKnowledgeBaseUsage } -// Return sets up results that will be returned by RepositoryI.ProcessKnowledgeBaseFiles -func (mmProcessKnowledgeBaseFiles *mRepositoryIMockProcessKnowledgeBaseFiles) Return(ka1 []mm_repository.KnowledgeBaseFile, err error) *RepositoryIMock { - if mmProcessKnowledgeBaseFiles.mock.funcProcessKnowledgeBaseFiles != nil { - mmProcessKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ProcessKnowledgeBaseFiles mock is already set by Set") +// 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 mmProcessKnowledgeBaseFiles.defaultExpectation == nil { - mmProcessKnowledgeBaseFiles.defaultExpectation = &RepositoryIMockProcessKnowledgeBaseFilesExpectation{mock: mmProcessKnowledgeBaseFiles.mock} + if mmIncreaseKnowledgeBaseUsage.defaultExpectation == nil { + mmIncreaseKnowledgeBaseUsage.defaultExpectation = &RepositoryIMockIncreaseKnowledgeBaseUsageExpectation{mock: mmIncreaseKnowledgeBaseUsage.mock} } - mmProcessKnowledgeBaseFiles.defaultExpectation.results = &RepositoryIMockProcessKnowledgeBaseFilesResults{ka1, err} - return mmProcessKnowledgeBaseFiles.mock + mmIncreaseKnowledgeBaseUsage.defaultExpectation.results = &RepositoryIMockIncreaseKnowledgeBaseUsageResults{err} + return mmIncreaseKnowledgeBaseUsage.mock } -// Set uses given function f to mock the RepositoryI.ProcessKnowledgeBaseFiles method -func (mmProcessKnowledgeBaseFiles *mRepositoryIMockProcessKnowledgeBaseFiles) Set(f func(ctx context.Context, fileUIDs []string, requester uuid.UUID) (ka1 []mm_repository.KnowledgeBaseFile, err error)) *RepositoryIMock { - if mmProcessKnowledgeBaseFiles.defaultExpectation != nil { - mmProcessKnowledgeBaseFiles.mock.t.Fatalf("Default expectation is already set for the RepositoryI.ProcessKnowledgeBaseFiles method") +// 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(mmProcessKnowledgeBaseFiles.expectations) > 0 { - mmProcessKnowledgeBaseFiles.mock.t.Fatalf("Some expectations are already set for the RepositoryI.ProcessKnowledgeBaseFiles method") + if len(mmIncreaseKnowledgeBaseUsage.expectations) > 0 { + mmIncreaseKnowledgeBaseUsage.mock.t.Fatalf("Some expectations are already set for the RepositoryI.IncreaseKnowledgeBaseUsage method") } - mmProcessKnowledgeBaseFiles.mock.funcProcessKnowledgeBaseFiles = f - return mmProcessKnowledgeBaseFiles.mock + mmIncreaseKnowledgeBaseUsage.mock.funcIncreaseKnowledgeBaseUsage = f + return mmIncreaseKnowledgeBaseUsage.mock } -// When sets expectation for the RepositoryI.ProcessKnowledgeBaseFiles which will trigger the result defined by the following +// When sets expectation for the RepositoryI.IncreaseKnowledgeBaseUsage which will trigger the result defined by the following // Then helper -func (mmProcessKnowledgeBaseFiles *mRepositoryIMockProcessKnowledgeBaseFiles) When(ctx context.Context, fileUIDs []string, requester uuid.UUID) *RepositoryIMockProcessKnowledgeBaseFilesExpectation { - if mmProcessKnowledgeBaseFiles.mock.funcProcessKnowledgeBaseFiles != nil { - mmProcessKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ProcessKnowledgeBaseFiles mock is already set by Set") +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 := &RepositoryIMockProcessKnowledgeBaseFilesExpectation{ - mock: mmProcessKnowledgeBaseFiles.mock, - params: &RepositoryIMockProcessKnowledgeBaseFilesParams{ctx, fileUIDs, requester}, + expectation := &RepositoryIMockIncreaseKnowledgeBaseUsageExpectation{ + mock: mmIncreaseKnowledgeBaseUsage.mock, + params: &RepositoryIMockIncreaseKnowledgeBaseUsageParams{ctx, kbUID, amount}, } - mmProcessKnowledgeBaseFiles.expectations = append(mmProcessKnowledgeBaseFiles.expectations, expectation) + mmIncreaseKnowledgeBaseUsage.expectations = append(mmIncreaseKnowledgeBaseUsage.expectations, expectation) return expectation } -// Then sets up RepositoryI.ProcessKnowledgeBaseFiles return parameters for the expectation previously defined by the When method -func (e *RepositoryIMockProcessKnowledgeBaseFilesExpectation) Then(ka1 []mm_repository.KnowledgeBaseFile, err error) *RepositoryIMock { - e.results = &RepositoryIMockProcessKnowledgeBaseFilesResults{ka1, err} +// 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.ProcessKnowledgeBaseFiles should be invoked -func (mmProcessKnowledgeBaseFiles *mRepositoryIMockProcessKnowledgeBaseFiles) Times(n uint64) *mRepositoryIMockProcessKnowledgeBaseFiles { +// Times sets number of times RepositoryI.IncreaseKnowledgeBaseUsage should be invoked +func (mmIncreaseKnowledgeBaseUsage *mRepositoryIMockIncreaseKnowledgeBaseUsage) Times(n uint64) *mRepositoryIMockIncreaseKnowledgeBaseUsage { if n == 0 { - mmProcessKnowledgeBaseFiles.mock.t.Fatalf("Times of RepositoryIMock.ProcessKnowledgeBaseFiles mock can not be zero") + mmIncreaseKnowledgeBaseUsage.mock.t.Fatalf("Times of RepositoryIMock.IncreaseKnowledgeBaseUsage mock can not be zero") } - mm_atomic.StoreUint64(&mmProcessKnowledgeBaseFiles.expectedInvocations, n) - return mmProcessKnowledgeBaseFiles + mm_atomic.StoreUint64(&mmIncreaseKnowledgeBaseUsage.expectedInvocations, n) + return mmIncreaseKnowledgeBaseUsage } -func (mmProcessKnowledgeBaseFiles *mRepositoryIMockProcessKnowledgeBaseFiles) invocationsDone() bool { - if len(mmProcessKnowledgeBaseFiles.expectations) == 0 && mmProcessKnowledgeBaseFiles.defaultExpectation == nil && mmProcessKnowledgeBaseFiles.mock.funcProcessKnowledgeBaseFiles == nil { +func (mmIncreaseKnowledgeBaseUsage *mRepositoryIMockIncreaseKnowledgeBaseUsage) invocationsDone() bool { + if len(mmIncreaseKnowledgeBaseUsage.expectations) == 0 && mmIncreaseKnowledgeBaseUsage.defaultExpectation == nil && mmIncreaseKnowledgeBaseUsage.mock.funcIncreaseKnowledgeBaseUsage == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmProcessKnowledgeBaseFiles.mock.afterProcessKnowledgeBaseFilesCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmProcessKnowledgeBaseFiles.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmIncreaseKnowledgeBaseUsage.mock.afterIncreaseKnowledgeBaseUsageCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmIncreaseKnowledgeBaseUsage.expectedInvocations) return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) } -// ProcessKnowledgeBaseFiles implements repository.RepositoryI -func (mmProcessKnowledgeBaseFiles *RepositoryIMock) ProcessKnowledgeBaseFiles(ctx context.Context, fileUIDs []string, requester uuid.UUID) (ka1 []mm_repository.KnowledgeBaseFile, err error) { - mm_atomic.AddUint64(&mmProcessKnowledgeBaseFiles.beforeProcessKnowledgeBaseFilesCounter, 1) - defer mm_atomic.AddUint64(&mmProcessKnowledgeBaseFiles.afterProcessKnowledgeBaseFilesCounter, 1) +// 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 mmProcessKnowledgeBaseFiles.inspectFuncProcessKnowledgeBaseFiles != nil { - mmProcessKnowledgeBaseFiles.inspectFuncProcessKnowledgeBaseFiles(ctx, fileUIDs, requester) + if mmIncreaseKnowledgeBaseUsage.inspectFuncIncreaseKnowledgeBaseUsage != nil { + mmIncreaseKnowledgeBaseUsage.inspectFuncIncreaseKnowledgeBaseUsage(ctx, kbUID, amount) } - mm_params := RepositoryIMockProcessKnowledgeBaseFilesParams{ctx, fileUIDs, requester} + mm_params := RepositoryIMockIncreaseKnowledgeBaseUsageParams{ctx, kbUID, amount} // Record call args - mmProcessKnowledgeBaseFiles.ProcessKnowledgeBaseFilesMock.mutex.Lock() - mmProcessKnowledgeBaseFiles.ProcessKnowledgeBaseFilesMock.callArgs = append(mmProcessKnowledgeBaseFiles.ProcessKnowledgeBaseFilesMock.callArgs, &mm_params) - mmProcessKnowledgeBaseFiles.ProcessKnowledgeBaseFilesMock.mutex.Unlock() + mmIncreaseKnowledgeBaseUsage.IncreaseKnowledgeBaseUsageMock.mutex.Lock() + mmIncreaseKnowledgeBaseUsage.IncreaseKnowledgeBaseUsageMock.callArgs = append(mmIncreaseKnowledgeBaseUsage.IncreaseKnowledgeBaseUsageMock.callArgs, &mm_params) + mmIncreaseKnowledgeBaseUsage.IncreaseKnowledgeBaseUsageMock.mutex.Unlock() - for _, e := range mmProcessKnowledgeBaseFiles.ProcessKnowledgeBaseFilesMock.expectations { + for _, e := range mmIncreaseKnowledgeBaseUsage.IncreaseKnowledgeBaseUsageMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.ka1, e.results.err + return e.results.err } } - if mmProcessKnowledgeBaseFiles.ProcessKnowledgeBaseFilesMock.defaultExpectation != nil { - mm_atomic.AddUint64(&mmProcessKnowledgeBaseFiles.ProcessKnowledgeBaseFilesMock.defaultExpectation.Counter, 1) - mm_want := mmProcessKnowledgeBaseFiles.ProcessKnowledgeBaseFilesMock.defaultExpectation.params - mm_want_ptrs := mmProcessKnowledgeBaseFiles.ProcessKnowledgeBaseFilesMock.defaultExpectation.paramPtrs + 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 := RepositoryIMockProcessKnowledgeBaseFilesParams{ctx, fileUIDs, requester} + 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) { - mmProcessKnowledgeBaseFiles.t.Errorf("RepositoryIMock.ProcessKnowledgeBaseFiles 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)) + 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.fileUIDs != nil && !minimock.Equal(*mm_want_ptrs.fileUIDs, mm_got.fileUIDs) { - mmProcessKnowledgeBaseFiles.t.Errorf("RepositoryIMock.ProcessKnowledgeBaseFiles 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.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.requester != nil && !minimock.Equal(*mm_want_ptrs.requester, mm_got.requester) { - mmProcessKnowledgeBaseFiles.t.Errorf("RepositoryIMock.ProcessKnowledgeBaseFiles got unexpected parameter requester, want: %#v, got: %#v%s\n", *mm_want_ptrs.requester, mm_got.requester, minimock.Diff(*mm_want_ptrs.requester, mm_got.requester)) + 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) { - mmProcessKnowledgeBaseFiles.t.Errorf("RepositoryIMock.ProcessKnowledgeBaseFiles got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*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 := mmProcessKnowledgeBaseFiles.ProcessKnowledgeBaseFilesMock.defaultExpectation.results + mm_results := mmIncreaseKnowledgeBaseUsage.IncreaseKnowledgeBaseUsageMock.defaultExpectation.results if mm_results == nil { - mmProcessKnowledgeBaseFiles.t.Fatal("No results are set for the RepositoryIMock.ProcessKnowledgeBaseFiles") + mmIncreaseKnowledgeBaseUsage.t.Fatal("No results are set for the RepositoryIMock.IncreaseKnowledgeBaseUsage") } - return (*mm_results).ka1, (*mm_results).err + return (*mm_results).err } - if mmProcessKnowledgeBaseFiles.funcProcessKnowledgeBaseFiles != nil { - return mmProcessKnowledgeBaseFiles.funcProcessKnowledgeBaseFiles(ctx, fileUIDs, requester) + if mmIncreaseKnowledgeBaseUsage.funcIncreaseKnowledgeBaseUsage != nil { + return mmIncreaseKnowledgeBaseUsage.funcIncreaseKnowledgeBaseUsage(ctx, kbUID, amount) } - mmProcessKnowledgeBaseFiles.t.Fatalf("Unexpected call to RepositoryIMock.ProcessKnowledgeBaseFiles. %v %v %v", ctx, fileUIDs, requester) + mmIncreaseKnowledgeBaseUsage.t.Fatalf("Unexpected call to RepositoryIMock.IncreaseKnowledgeBaseUsage. %v %v %v", ctx, kbUID, amount) return } -// ProcessKnowledgeBaseFilesAfterCounter returns a count of finished RepositoryIMock.ProcessKnowledgeBaseFiles invocations -func (mmProcessKnowledgeBaseFiles *RepositoryIMock) ProcessKnowledgeBaseFilesAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmProcessKnowledgeBaseFiles.afterProcessKnowledgeBaseFilesCounter) +// IncreaseKnowledgeBaseUsageAfterCounter returns a count of finished RepositoryIMock.IncreaseKnowledgeBaseUsage invocations +func (mmIncreaseKnowledgeBaseUsage *RepositoryIMock) IncreaseKnowledgeBaseUsageAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmIncreaseKnowledgeBaseUsage.afterIncreaseKnowledgeBaseUsageCounter) } -// ProcessKnowledgeBaseFilesBeforeCounter returns a count of RepositoryIMock.ProcessKnowledgeBaseFiles invocations -func (mmProcessKnowledgeBaseFiles *RepositoryIMock) ProcessKnowledgeBaseFilesBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmProcessKnowledgeBaseFiles.beforeProcessKnowledgeBaseFilesCounter) +// 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.ProcessKnowledgeBaseFiles. +// 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 (mmProcessKnowledgeBaseFiles *mRepositoryIMockProcessKnowledgeBaseFiles) Calls() []*RepositoryIMockProcessKnowledgeBaseFilesParams { - mmProcessKnowledgeBaseFiles.mutex.RLock() +func (mmIncreaseKnowledgeBaseUsage *mRepositoryIMockIncreaseKnowledgeBaseUsage) Calls() []*RepositoryIMockIncreaseKnowledgeBaseUsageParams { + mmIncreaseKnowledgeBaseUsage.mutex.RLock() - argCopy := make([]*RepositoryIMockProcessKnowledgeBaseFilesParams, len(mmProcessKnowledgeBaseFiles.callArgs)) - copy(argCopy, mmProcessKnowledgeBaseFiles.callArgs) + argCopy := make([]*RepositoryIMockIncreaseKnowledgeBaseUsageParams, len(mmIncreaseKnowledgeBaseUsage.callArgs)) + copy(argCopy, mmIncreaseKnowledgeBaseUsage.callArgs) - mmProcessKnowledgeBaseFiles.mutex.RUnlock() + mmIncreaseKnowledgeBaseUsage.mutex.RUnlock() return argCopy } -// MinimockProcessKnowledgeBaseFilesDone returns true if the count of the ProcessKnowledgeBaseFiles invocations corresponds +// MinimockIncreaseKnowledgeBaseUsageDone returns true if the count of the IncreaseKnowledgeBaseUsage invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockProcessKnowledgeBaseFilesDone() bool { - for _, e := range m.ProcessKnowledgeBaseFilesMock.expectations { +func (m *RepositoryIMock) MinimockIncreaseKnowledgeBaseUsageDone() bool { + for _, e := range m.IncreaseKnowledgeBaseUsageMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.ProcessKnowledgeBaseFilesMock.invocationsDone() + return m.IncreaseKnowledgeBaseUsageMock.invocationsDone() } -// MinimockProcessKnowledgeBaseFilesInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockProcessKnowledgeBaseFilesInspect() { - for _, e := range m.ProcessKnowledgeBaseFilesMock.expectations { +// 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.ProcessKnowledgeBaseFiles with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.IncreaseKnowledgeBaseUsage with params: %#v", *e.params) } } - afterProcessKnowledgeBaseFilesCounter := mm_atomic.LoadUint64(&m.afterProcessKnowledgeBaseFilesCounter) + afterIncreaseKnowledgeBaseUsageCounter := mm_atomic.LoadUint64(&m.afterIncreaseKnowledgeBaseUsageCounter) // if default expectation was set then invocations count should be greater than zero - if m.ProcessKnowledgeBaseFilesMock.defaultExpectation != nil && afterProcessKnowledgeBaseFilesCounter < 1 { - if m.ProcessKnowledgeBaseFilesMock.defaultExpectation.params == nil { - m.t.Error("Expected call to RepositoryIMock.ProcessKnowledgeBaseFiles") + 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.ProcessKnowledgeBaseFiles with params: %#v", *m.ProcessKnowledgeBaseFilesMock.defaultExpectation.params) + 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.funcProcessKnowledgeBaseFiles != nil && afterProcessKnowledgeBaseFilesCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.ProcessKnowledgeBaseFiles") + if m.funcIncreaseKnowledgeBaseUsage != nil && afterIncreaseKnowledgeBaseUsageCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.IncreaseKnowledgeBaseUsage") } - if !m.ProcessKnowledgeBaseFilesMock.invocationsDone() && afterProcessKnowledgeBaseFilesCounter > 0 { - m.t.Errorf("Expected %d calls to RepositoryIMock.ProcessKnowledgeBaseFiles but found %d calls", - mm_atomic.LoadUint64(&m.ProcessKnowledgeBaseFilesMock.expectedInvocations), afterProcessKnowledgeBaseFilesCounter) + 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 mRepositoryIMockTextChunkTableName struct { +type mRepositoryIMockKnowledgeBaseFileTableName struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockTextChunkTableNameExpectation - expectations []*RepositoryIMockTextChunkTableNameExpectation + defaultExpectation *RepositoryIMockKnowledgeBaseFileTableNameExpectation + expectations []*RepositoryIMockKnowledgeBaseFileTableNameExpectation expectedInvocations uint64 } -// RepositoryIMockTextChunkTableNameExpectation specifies expectation struct of the RepositoryI.TextChunkTableName -type RepositoryIMockTextChunkTableNameExpectation struct { +// RepositoryIMockKnowledgeBaseFileTableNameExpectation specifies expectation struct of the RepositoryI.KnowledgeBaseFileTableName +type RepositoryIMockKnowledgeBaseFileTableNameExpectation struct { mock *RepositoryIMock - results *RepositoryIMockTextChunkTableNameResults + results *RepositoryIMockKnowledgeBaseFileTableNameResults Counter uint64 } -// RepositoryIMockTextChunkTableNameResults contains results of the RepositoryI.TextChunkTableName -type RepositoryIMockTextChunkTableNameResults struct { +// RepositoryIMockKnowledgeBaseFileTableNameResults contains results of the RepositoryI.KnowledgeBaseFileTableName +type RepositoryIMockKnowledgeBaseFileTableNameResults struct { s1 string } -// Expect sets up expected params for RepositoryI.TextChunkTableName -func (mmTextChunkTableName *mRepositoryIMockTextChunkTableName) Expect() *mRepositoryIMockTextChunkTableName { - if mmTextChunkTableName.mock.funcTextChunkTableName != nil { - mmTextChunkTableName.mock.t.Fatalf("RepositoryIMock.TextChunkTableName mock is already set by Set") +// 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 mmTextChunkTableName.defaultExpectation == nil { - mmTextChunkTableName.defaultExpectation = &RepositoryIMockTextChunkTableNameExpectation{} + if mmKnowledgeBaseFileTableName.defaultExpectation == nil { + mmKnowledgeBaseFileTableName.defaultExpectation = &RepositoryIMockKnowledgeBaseFileTableNameExpectation{} } - return mmTextChunkTableName + return mmKnowledgeBaseFileTableName } -// Inspect accepts an inspector function that has same arguments as the RepositoryI.TextChunkTableName -func (mmTextChunkTableName *mRepositoryIMockTextChunkTableName) Inspect(f func()) *mRepositoryIMockTextChunkTableName { - if mmTextChunkTableName.mock.inspectFuncTextChunkTableName != nil { - mmTextChunkTableName.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.TextChunkTableName") +// 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") } - mmTextChunkTableName.mock.inspectFuncTextChunkTableName = f + mmKnowledgeBaseFileTableName.mock.inspectFuncKnowledgeBaseFileTableName = f - return mmTextChunkTableName + return mmKnowledgeBaseFileTableName } -// Return sets up results that will be returned by RepositoryI.TextChunkTableName -func (mmTextChunkTableName *mRepositoryIMockTextChunkTableName) Return(s1 string) *RepositoryIMock { - if mmTextChunkTableName.mock.funcTextChunkTableName != nil { - mmTextChunkTableName.mock.t.Fatalf("RepositoryIMock.TextChunkTableName mock is already set by Set") +// 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 mmTextChunkTableName.defaultExpectation == nil { - mmTextChunkTableName.defaultExpectation = &RepositoryIMockTextChunkTableNameExpectation{mock: mmTextChunkTableName.mock} + if mmKnowledgeBaseFileTableName.defaultExpectation == nil { + mmKnowledgeBaseFileTableName.defaultExpectation = &RepositoryIMockKnowledgeBaseFileTableNameExpectation{mock: mmKnowledgeBaseFileTableName.mock} } - mmTextChunkTableName.defaultExpectation.results = &RepositoryIMockTextChunkTableNameResults{s1} - return mmTextChunkTableName.mock + mmKnowledgeBaseFileTableName.defaultExpectation.results = &RepositoryIMockKnowledgeBaseFileTableNameResults{s1} + return mmKnowledgeBaseFileTableName.mock } -// Set uses given function f to mock the RepositoryI.TextChunkTableName method -func (mmTextChunkTableName *mRepositoryIMockTextChunkTableName) Set(f func() (s1 string)) *RepositoryIMock { - if mmTextChunkTableName.defaultExpectation != nil { - mmTextChunkTableName.mock.t.Fatalf("Default expectation is already set for the RepositoryI.TextChunkTableName method") +// 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") } - if len(mmTextChunkTableName.expectations) > 0 { - mmTextChunkTableName.mock.t.Fatalf("Some expectations are already set for the RepositoryI.TextChunkTableName method") + 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.KnowledgeBaseFileTableName should be invoked +func (mmKnowledgeBaseFileTableName *mRepositoryIMockKnowledgeBaseFileTableName) Times(n uint64) *mRepositoryIMockKnowledgeBaseFileTableName { + if n == 0 { + mmKnowledgeBaseFileTableName.mock.t.Fatalf("Times of RepositoryIMock.KnowledgeBaseFileTableName mock can not be zero") + } + mm_atomic.StoreUint64(&mmKnowledgeBaseFileTableName.expectedInvocations, n) + return mmKnowledgeBaseFileTableName +} + +func (mmKnowledgeBaseFileTableName *mRepositoryIMockKnowledgeBaseFileTableName) invocationsDone() bool { + if len(mmKnowledgeBaseFileTableName.expectations) == 0 && mmKnowledgeBaseFileTableName.defaultExpectation == nil && mmKnowledgeBaseFileTableName.mock.funcKnowledgeBaseFileTableName == nil { + return true + } + + totalInvocations := mm_atomic.LoadUint64(&mmKnowledgeBaseFileTableName.mock.afterKnowledgeBaseFileTableNameCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmKnowledgeBaseFileTableName.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) + + if mmKnowledgeBaseFileTableName.inspectFuncKnowledgeBaseFileTableName != nil { + mmKnowledgeBaseFileTableName.inspectFuncKnowledgeBaseFileTableName() + } + + if mmKnowledgeBaseFileTableName.KnowledgeBaseFileTableNameMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmKnowledgeBaseFileTableName.KnowledgeBaseFileTableNameMock.defaultExpectation.Counter, 1) + + mm_results := mmKnowledgeBaseFileTableName.KnowledgeBaseFileTableNameMock.defaultExpectation.results + if mm_results == nil { + mmKnowledgeBaseFileTableName.t.Fatal("No results are set for the RepositoryIMock.KnowledgeBaseFileTableName") + } + return (*mm_results).s1 + } + if mmKnowledgeBaseFileTableName.funcKnowledgeBaseFileTableName != nil { + return mmKnowledgeBaseFileTableName.funcKnowledgeBaseFileTableName() + } + mmKnowledgeBaseFileTableName.t.Fatalf("Unexpected call to RepositoryIMock.KnowledgeBaseFileTableName.") + return +} + +// KnowledgeBaseFileTableNameAfterCounter returns a count of finished RepositoryIMock.KnowledgeBaseFileTableName invocations +func (mmKnowledgeBaseFileTableName *RepositoryIMock) KnowledgeBaseFileTableNameAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmKnowledgeBaseFileTableName.afterKnowledgeBaseFileTableNameCounter) +} + +// KnowledgeBaseFileTableNameBeforeCounter returns a count of RepositoryIMock.KnowledgeBaseFileTableName invocations +func (mmKnowledgeBaseFileTableName *RepositoryIMock) KnowledgeBaseFileTableNameBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmKnowledgeBaseFileTableName.beforeKnowledgeBaseFileTableNameCounter) +} + +// MinimockKnowledgeBaseFileTableNameDone returns true if the count of the KnowledgeBaseFileTableName invocations corresponds +// the number of defined expectations +func (m *RepositoryIMock) MinimockKnowledgeBaseFileTableNameDone() bool { + for _, e := range m.KnowledgeBaseFileTableNameMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + return false + } + } + + return m.KnowledgeBaseFileTableNameMock.invocationsDone() +} + +// MinimockKnowledgeBaseFileTableNameInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockKnowledgeBaseFileTableNameInspect() { + for _, e := range m.KnowledgeBaseFileTableNameMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + m.t.Error("Expected call to RepositoryIMock.KnowledgeBaseFileTableName") + } + } + + afterKnowledgeBaseFileTableNameCounter := mm_atomic.LoadUint64(&m.afterKnowledgeBaseFileTableNameCounter) + // 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 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.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 mRepositoryIMockListChunksByKbFileUID struct { + mock *RepositoryIMock + defaultExpectation *RepositoryIMockListChunksByKbFileUIDExpectation + expectations []*RepositoryIMockListChunksByKbFileUIDExpectation + + callArgs []*RepositoryIMockListChunksByKbFileUIDParams + mutex sync.RWMutex + + expectedInvocations uint64 +} + +// RepositoryIMockListChunksByKbFileUIDExpectation specifies expectation struct of the RepositoryI.ListChunksByKbFileUID +type RepositoryIMockListChunksByKbFileUIDExpectation struct { + mock *RepositoryIMock + params *RepositoryIMockListChunksByKbFileUIDParams + paramPtrs *RepositoryIMockListChunksByKbFileUIDParamPtrs + results *RepositoryIMockListChunksByKbFileUIDResults + Counter uint64 +} + +// RepositoryIMockListChunksByKbFileUIDParams contains parameters of the RepositoryI.ListChunksByKbFileUID +type RepositoryIMockListChunksByKbFileUIDParams struct { + ctx context.Context + kbFileUID uuid.UUID +} + +// RepositoryIMockListChunksByKbFileUIDParamPtrs contains pointers to parameters of the RepositoryI.ListChunksByKbFileUID +type RepositoryIMockListChunksByKbFileUIDParamPtrs struct { + ctx *context.Context + kbFileUID *uuid.UUID +} + +// RepositoryIMockListChunksByKbFileUIDResults contains results of the RepositoryI.ListChunksByKbFileUID +type RepositoryIMockListChunksByKbFileUIDResults struct { + ta1 []mm_repository.TextChunk + err error +} + +// 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 mmListChunksByKbFileUID.defaultExpectation == nil { + mmListChunksByKbFileUID.defaultExpectation = &RepositoryIMockListChunksByKbFileUIDExpectation{} + } + + if mmListChunksByKbFileUID.defaultExpectation.paramPtrs != nil { + mmListChunksByKbFileUID.mock.t.Fatalf("RepositoryIMock.ListChunksByKbFileUID mock is already set by ExpectParams functions") + } + + 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 mmListChunksByKbFileUID +} + +// 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 mmListChunksByKbFileUID.defaultExpectation == nil { + mmListChunksByKbFileUID.defaultExpectation = &RepositoryIMockListChunksByKbFileUIDExpectation{} + } + + if mmListChunksByKbFileUID.defaultExpectation.params != nil { + mmListChunksByKbFileUID.mock.t.Fatalf("RepositoryIMock.ListChunksByKbFileUID mock is already set by Expect") + } + + if mmListChunksByKbFileUID.defaultExpectation.paramPtrs == nil { + mmListChunksByKbFileUID.defaultExpectation.paramPtrs = &RepositoryIMockListChunksByKbFileUIDParamPtrs{} + } + mmListChunksByKbFileUID.defaultExpectation.paramPtrs.ctx = &ctx + + return mmListChunksByKbFileUID +} + +// 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 mmListChunksByKbFileUID.defaultExpectation == nil { + mmListChunksByKbFileUID.defaultExpectation = &RepositoryIMockListChunksByKbFileUIDExpectation{} + } + + if mmListChunksByKbFileUID.defaultExpectation.params != nil { + mmListChunksByKbFileUID.mock.t.Fatalf("RepositoryIMock.ListChunksByKbFileUID mock is already set by Expect") + } + + if mmListChunksByKbFileUID.defaultExpectation.paramPtrs == nil { + mmListChunksByKbFileUID.defaultExpectation.paramPtrs = &RepositoryIMockListChunksByKbFileUIDParamPtrs{} + } + mmListChunksByKbFileUID.defaultExpectation.paramPtrs.kbFileUID = &kbFileUID + + return mmListChunksByKbFileUID +} + +// 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") + } + + mmListChunksByKbFileUID.mock.inspectFuncListChunksByKbFileUID = f + + return mmListChunksByKbFileUID +} + +// 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 mmListChunksByKbFileUID.defaultExpectation == nil { + mmListChunksByKbFileUID.defaultExpectation = &RepositoryIMockListChunksByKbFileUIDExpectation{mock: mmListChunksByKbFileUID.mock} + } + mmListChunksByKbFileUID.defaultExpectation.results = &RepositoryIMockListChunksByKbFileUIDResults{ta1, err} + return mmListChunksByKbFileUID.mock +} + +// 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(mmListChunksByKbFileUID.expectations) > 0 { + mmListChunksByKbFileUID.mock.t.Fatalf("Some expectations are already set for the RepositoryI.ListChunksByKbFileUID method") + } + + mmListChunksByKbFileUID.mock.funcListChunksByKbFileUID = f + return mmListChunksByKbFileUID.mock +} + +// When sets expectation for the RepositoryI.ListChunksByKbFileUID which will trigger the result defined by the following +// Then helper +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 := &RepositoryIMockListChunksByKbFileUIDExpectation{ + mock: mmListChunksByKbFileUID.mock, + params: &RepositoryIMockListChunksByKbFileUIDParams{ctx, kbFileUID}, + } + mmListChunksByKbFileUID.expectations = append(mmListChunksByKbFileUID.expectations, expectation) + return expectation +} + +// 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.ListChunksByKbFileUID should be invoked +func (mmListChunksByKbFileUID *mRepositoryIMockListChunksByKbFileUID) Times(n uint64) *mRepositoryIMockListChunksByKbFileUID { + if n == 0 { + mmListChunksByKbFileUID.mock.t.Fatalf("Times of RepositoryIMock.ListChunksByKbFileUID mock can not be zero") + } + mm_atomic.StoreUint64(&mmListChunksByKbFileUID.expectedInvocations, n) + return mmListChunksByKbFileUID +} + +func (mmListChunksByKbFileUID *mRepositoryIMockListChunksByKbFileUID) invocationsDone() bool { + if len(mmListChunksByKbFileUID.expectations) == 0 && mmListChunksByKbFileUID.defaultExpectation == nil && mmListChunksByKbFileUID.mock.funcListChunksByKbFileUID == nil { + return true + } + + totalInvocations := mm_atomic.LoadUint64(&mmListChunksByKbFileUID.mock.afterListChunksByKbFileUIDCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmListChunksByKbFileUID.expectedInvocations) + + return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) +} + +// 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 mmListChunksByKbFileUID.inspectFuncListChunksByKbFileUID != nil { + mmListChunksByKbFileUID.inspectFuncListChunksByKbFileUID(ctx, kbFileUID) + } + + mm_params := RepositoryIMockListChunksByKbFileUIDParams{ctx, kbFileUID} + + // Record call args + mmListChunksByKbFileUID.ListChunksByKbFileUIDMock.mutex.Lock() + mmListChunksByKbFileUID.ListChunksByKbFileUIDMock.callArgs = append(mmListChunksByKbFileUID.ListChunksByKbFileUIDMock.callArgs, &mm_params) + mmListChunksByKbFileUID.ListChunksByKbFileUIDMock.mutex.Unlock() + + for _, e := range mmListChunksByKbFileUID.ListChunksByKbFileUIDMock.expectations { + if minimock.Equal(*e.params, mm_params) { + mm_atomic.AddUint64(&e.Counter, 1) + return e.results.ta1, e.results.err + } + } + + 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 := RepositoryIMockListChunksByKbFileUIDParams{ctx, kbFileUID} + + if mm_want_ptrs != nil { + + if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { + 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.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) { + 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 := mmListChunksByKbFileUID.ListChunksByKbFileUIDMock.defaultExpectation.results + if mm_results == nil { + mmListChunksByKbFileUID.t.Fatal("No results are set for the RepositoryIMock.ListChunksByKbFileUID") + } + return (*mm_results).ta1, (*mm_results).err + } + if mmListChunksByKbFileUID.funcListChunksByKbFileUID != nil { + return mmListChunksByKbFileUID.funcListChunksByKbFileUID(ctx, kbFileUID) + } + mmListChunksByKbFileUID.t.Fatalf("Unexpected call to RepositoryIMock.ListChunksByKbFileUID. %v %v", ctx, kbFileUID) + return +} + +// ListChunksByKbFileUIDAfterCounter returns a count of finished RepositoryIMock.ListChunksByKbFileUID invocations +func (mmListChunksByKbFileUID *RepositoryIMock) ListChunksByKbFileUIDAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmListChunksByKbFileUID.afterListChunksByKbFileUIDCounter) +} + +// 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.ListChunksByKbFileUID. +// The list is in the same order as the calls were made (i.e. recent calls have a higher index) +func (mmListChunksByKbFileUID *mRepositoryIMockListChunksByKbFileUID) Calls() []*RepositoryIMockListChunksByKbFileUIDParams { + mmListChunksByKbFileUID.mutex.RLock() + + argCopy := make([]*RepositoryIMockListChunksByKbFileUIDParams, len(mmListChunksByKbFileUID.callArgs)) + copy(argCopy, mmListChunksByKbFileUID.callArgs) + + mmListChunksByKbFileUID.mutex.RUnlock() + + return argCopy +} + +// MinimockListChunksByKbFileUIDDone returns true if the count of the ListChunksByKbFileUID invocations corresponds +// the number of defined expectations +func (m *RepositoryIMock) MinimockListChunksByKbFileUIDDone() bool { + for _, e := range m.ListChunksByKbFileUIDMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + return false + } + } + + return m.ListChunksByKbFileUIDMock.invocationsDone() +} + +// 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.ListChunksByKbFileUID with params: %#v", *e.params) + } + } + + afterListChunksByKbFileUIDCounter := mm_atomic.LoadUint64(&m.afterListChunksByKbFileUIDCounter) + // if default expectation was set then invocations count should be greater than zero + 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.ListChunksByKbFileUID with params: %#v", *m.ListChunksByKbFileUIDMock.defaultExpectation.params) + } + } + // if func was set then invocations count should be greater than zero + if m.funcListChunksByKbFileUID != nil && afterListChunksByKbFileUIDCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.ListChunksByKbFileUID") + } + + 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 mRepositoryIMockListConversations struct { + mock *RepositoryIMock + defaultExpectation *RepositoryIMockListConversationsExpectation + expectations []*RepositoryIMockListConversationsExpectation + + callArgs []*RepositoryIMockListConversationsParams + mutex sync.RWMutex + + expectedInvocations uint64 +} + +// RepositoryIMockListConversationsExpectation specifies expectation struct of the RepositoryI.ListConversations +type RepositoryIMockListConversationsExpectation struct { + mock *RepositoryIMock + params *RepositoryIMockListConversationsParams + paramPtrs *RepositoryIMockListConversationsParamPtrs + results *RepositoryIMockListConversationsResults + Counter uint64 +} + +// RepositoryIMockListConversationsParams contains parameters of the RepositoryI.ListConversations +type RepositoryIMockListConversationsParams struct { + ctx context.Context + namespaceUID uuid.UUID + catalogUID uuid.UUID + pageSize int32 + nextPageToken string +} + +// RepositoryIMockListConversationsParamPtrs contains pointers to parameters of the RepositoryI.ListConversations +type RepositoryIMockListConversationsParamPtrs struct { + ctx *context.Context + namespaceUID *uuid.UUID + catalogUID *uuid.UUID + pageSize *int32 + nextPageToken *string +} + +// RepositoryIMockListConversationsResults contains results of the RepositoryI.ListConversations +type RepositoryIMockListConversationsResults struct { + cpa1 []*mm_repository.Conversation + i1 int + s1 string + err error +} + +// Expect sets up expected params for RepositoryI.ListConversations +func (mmListConversations *mRepositoryIMockListConversations) Expect(ctx context.Context, namespaceUID uuid.UUID, catalogUID uuid.UUID, pageSize int32, nextPageToken string) *mRepositoryIMockListConversations { + if mmListConversations.mock.funcListConversations != nil { + mmListConversations.mock.t.Fatalf("RepositoryIMock.ListConversations mock is already set by Set") + } + + if mmListConversations.defaultExpectation == nil { + mmListConversations.defaultExpectation = &RepositoryIMockListConversationsExpectation{} + } + + if mmListConversations.defaultExpectation.paramPtrs != nil { + mmListConversations.mock.t.Fatalf("RepositoryIMock.ListConversations mock is already set by ExpectParams functions") + } + + mmListConversations.defaultExpectation.params = &RepositoryIMockListConversationsParams{ctx, namespaceUID, catalogUID, pageSize, nextPageToken} + for _, e := range mmListConversations.expectations { + if minimock.Equal(e.params, mmListConversations.defaultExpectation.params) { + mmListConversations.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmListConversations.defaultExpectation.params) + } + } + + return mmListConversations +} + +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.ListConversations +func (mmListConversations *mRepositoryIMockListConversations) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockListConversations { + if mmListConversations.mock.funcListConversations != nil { + mmListConversations.mock.t.Fatalf("RepositoryIMock.ListConversations mock is already set by Set") + } + + if mmListConversations.defaultExpectation == nil { + mmListConversations.defaultExpectation = &RepositoryIMockListConversationsExpectation{} + } + + if mmListConversations.defaultExpectation.params != nil { + mmListConversations.mock.t.Fatalf("RepositoryIMock.ListConversations mock is already set by Expect") + } + + if mmListConversations.defaultExpectation.paramPtrs == nil { + mmListConversations.defaultExpectation.paramPtrs = &RepositoryIMockListConversationsParamPtrs{} + } + mmListConversations.defaultExpectation.paramPtrs.ctx = &ctx + + return mmListConversations +} + +// ExpectNamespaceUIDParam2 sets up expected param namespaceUID for RepositoryI.ListConversations +func (mmListConversations *mRepositoryIMockListConversations) ExpectNamespaceUIDParam2(namespaceUID uuid.UUID) *mRepositoryIMockListConversations { + if mmListConversations.mock.funcListConversations != nil { + mmListConversations.mock.t.Fatalf("RepositoryIMock.ListConversations mock is already set by Set") + } + + if mmListConversations.defaultExpectation == nil { + mmListConversations.defaultExpectation = &RepositoryIMockListConversationsExpectation{} + } + + if mmListConversations.defaultExpectation.params != nil { + mmListConversations.mock.t.Fatalf("RepositoryIMock.ListConversations mock is already set by Expect") + } + + if mmListConversations.defaultExpectation.paramPtrs == nil { + mmListConversations.defaultExpectation.paramPtrs = &RepositoryIMockListConversationsParamPtrs{} + } + mmListConversations.defaultExpectation.paramPtrs.namespaceUID = &namespaceUID + + return mmListConversations +} + +// ExpectCatalogUIDParam3 sets up expected param catalogUID for RepositoryI.ListConversations +func (mmListConversations *mRepositoryIMockListConversations) ExpectCatalogUIDParam3(catalogUID uuid.UUID) *mRepositoryIMockListConversations { + if mmListConversations.mock.funcListConversations != nil { + mmListConversations.mock.t.Fatalf("RepositoryIMock.ListConversations mock is already set by Set") + } + + if mmListConversations.defaultExpectation == nil { + mmListConversations.defaultExpectation = &RepositoryIMockListConversationsExpectation{} + } + + if mmListConversations.defaultExpectation.params != nil { + mmListConversations.mock.t.Fatalf("RepositoryIMock.ListConversations mock is already set by Expect") + } + + if mmListConversations.defaultExpectation.paramPtrs == nil { + mmListConversations.defaultExpectation.paramPtrs = &RepositoryIMockListConversationsParamPtrs{} + } + mmListConversations.defaultExpectation.paramPtrs.catalogUID = &catalogUID + + return mmListConversations +} + +// ExpectPageSizeParam4 sets up expected param pageSize for RepositoryI.ListConversations +func (mmListConversations *mRepositoryIMockListConversations) ExpectPageSizeParam4(pageSize int32) *mRepositoryIMockListConversations { + if mmListConversations.mock.funcListConversations != nil { + mmListConversations.mock.t.Fatalf("RepositoryIMock.ListConversations mock is already set by Set") + } + + if mmListConversations.defaultExpectation == nil { + mmListConversations.defaultExpectation = &RepositoryIMockListConversationsExpectation{} + } + + if mmListConversations.defaultExpectation.params != nil { + mmListConversations.mock.t.Fatalf("RepositoryIMock.ListConversations mock is already set by Expect") + } + + if mmListConversations.defaultExpectation.paramPtrs == nil { + mmListConversations.defaultExpectation.paramPtrs = &RepositoryIMockListConversationsParamPtrs{} + } + mmListConversations.defaultExpectation.paramPtrs.pageSize = &pageSize + + return mmListConversations +} + +// ExpectNextPageTokenParam5 sets up expected param nextPageToken for RepositoryI.ListConversations +func (mmListConversations *mRepositoryIMockListConversations) ExpectNextPageTokenParam5(nextPageToken string) *mRepositoryIMockListConversations { + if mmListConversations.mock.funcListConversations != nil { + mmListConversations.mock.t.Fatalf("RepositoryIMock.ListConversations mock is already set by Set") + } + + if mmListConversations.defaultExpectation == nil { + mmListConversations.defaultExpectation = &RepositoryIMockListConversationsExpectation{} + } + + if mmListConversations.defaultExpectation.params != nil { + mmListConversations.mock.t.Fatalf("RepositoryIMock.ListConversations mock is already set by Expect") + } + + if mmListConversations.defaultExpectation.paramPtrs == nil { + mmListConversations.defaultExpectation.paramPtrs = &RepositoryIMockListConversationsParamPtrs{} + } + mmListConversations.defaultExpectation.paramPtrs.nextPageToken = &nextPageToken + + return mmListConversations +} + +// Inspect accepts an inspector function that has same arguments as the RepositoryI.ListConversations +func (mmListConversations *mRepositoryIMockListConversations) Inspect(f func(ctx context.Context, namespaceUID uuid.UUID, catalogUID uuid.UUID, pageSize int32, nextPageToken string)) *mRepositoryIMockListConversations { + if mmListConversations.mock.inspectFuncListConversations != nil { + mmListConversations.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.ListConversations") + } + + mmListConversations.mock.inspectFuncListConversations = f + + return mmListConversations +} + +// Return sets up results that will be returned by RepositoryI.ListConversations +func (mmListConversations *mRepositoryIMockListConversations) Return(cpa1 []*mm_repository.Conversation, i1 int, s1 string, err error) *RepositoryIMock { + if mmListConversations.mock.funcListConversations != nil { + mmListConversations.mock.t.Fatalf("RepositoryIMock.ListConversations mock is already set by Set") + } + + if mmListConversations.defaultExpectation == nil { + mmListConversations.defaultExpectation = &RepositoryIMockListConversationsExpectation{mock: mmListConversations.mock} + } + mmListConversations.defaultExpectation.results = &RepositoryIMockListConversationsResults{cpa1, i1, s1, err} + return mmListConversations.mock +} + +// Set uses given function f to mock the RepositoryI.ListConversations method +func (mmListConversations *mRepositoryIMockListConversations) Set(f func(ctx context.Context, namespaceUID uuid.UUID, catalogUID uuid.UUID, pageSize int32, nextPageToken string) (cpa1 []*mm_repository.Conversation, i1 int, s1 string, err error)) *RepositoryIMock { + if mmListConversations.defaultExpectation != nil { + mmListConversations.mock.t.Fatalf("Default expectation is already set for the RepositoryI.ListConversations method") + } + + if len(mmListConversations.expectations) > 0 { + mmListConversations.mock.t.Fatalf("Some expectations are already set for the RepositoryI.ListConversations method") + } + + mmListConversations.mock.funcListConversations = f + return mmListConversations.mock +} + +// When sets expectation for the RepositoryI.ListConversations which will trigger the result defined by the following +// Then helper +func (mmListConversations *mRepositoryIMockListConversations) When(ctx context.Context, namespaceUID uuid.UUID, catalogUID uuid.UUID, pageSize int32, nextPageToken string) *RepositoryIMockListConversationsExpectation { + if mmListConversations.mock.funcListConversations != nil { + mmListConversations.mock.t.Fatalf("RepositoryIMock.ListConversations mock is already set by Set") + } + + expectation := &RepositoryIMockListConversationsExpectation{ + mock: mmListConversations.mock, + params: &RepositoryIMockListConversationsParams{ctx, namespaceUID, catalogUID, pageSize, nextPageToken}, + } + mmListConversations.expectations = append(mmListConversations.expectations, expectation) + return expectation +} + +// Then sets up RepositoryI.ListConversations return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockListConversationsExpectation) Then(cpa1 []*mm_repository.Conversation, i1 int, s1 string, err error) *RepositoryIMock { + e.results = &RepositoryIMockListConversationsResults{cpa1, i1, s1, err} + return e.mock +} + +// Times sets number of times RepositoryI.ListConversations should be invoked +func (mmListConversations *mRepositoryIMockListConversations) Times(n uint64) *mRepositoryIMockListConversations { + if n == 0 { + mmListConversations.mock.t.Fatalf("Times of RepositoryIMock.ListConversations mock can not be zero") + } + mm_atomic.StoreUint64(&mmListConversations.expectedInvocations, n) + return mmListConversations +} + +func (mmListConversations *mRepositoryIMockListConversations) invocationsDone() bool { + if len(mmListConversations.expectations) == 0 && mmListConversations.defaultExpectation == nil && mmListConversations.mock.funcListConversations == nil { + return true + } + + totalInvocations := mm_atomic.LoadUint64(&mmListConversations.mock.afterListConversationsCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmListConversations.expectedInvocations) + + return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) +} + +// ListConversations implements repository.RepositoryI +func (mmListConversations *RepositoryIMock) ListConversations(ctx context.Context, namespaceUID uuid.UUID, catalogUID uuid.UUID, pageSize int32, nextPageToken string) (cpa1 []*mm_repository.Conversation, i1 int, s1 string, err error) { + mm_atomic.AddUint64(&mmListConversations.beforeListConversationsCounter, 1) + defer mm_atomic.AddUint64(&mmListConversations.afterListConversationsCounter, 1) + + if mmListConversations.inspectFuncListConversations != nil { + mmListConversations.inspectFuncListConversations(ctx, namespaceUID, catalogUID, pageSize, nextPageToken) + } + + mm_params := RepositoryIMockListConversationsParams{ctx, namespaceUID, catalogUID, pageSize, nextPageToken} + + // Record call args + mmListConversations.ListConversationsMock.mutex.Lock() + mmListConversations.ListConversationsMock.callArgs = append(mmListConversations.ListConversationsMock.callArgs, &mm_params) + mmListConversations.ListConversationsMock.mutex.Unlock() + + for _, e := range mmListConversations.ListConversationsMock.expectations { + if minimock.Equal(*e.params, mm_params) { + mm_atomic.AddUint64(&e.Counter, 1) + return e.results.cpa1, e.results.i1, e.results.s1, e.results.err + } + } + + if mmListConversations.ListConversationsMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmListConversations.ListConversationsMock.defaultExpectation.Counter, 1) + mm_want := mmListConversations.ListConversationsMock.defaultExpectation.params + mm_want_ptrs := mmListConversations.ListConversationsMock.defaultExpectation.paramPtrs + + mm_got := RepositoryIMockListConversationsParams{ctx, namespaceUID, catalogUID, pageSize, nextPageToken} + + if mm_want_ptrs != nil { + + if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { + mmListConversations.t.Errorf("RepositoryIMock.ListConversations 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.namespaceUID != nil && !minimock.Equal(*mm_want_ptrs.namespaceUID, mm_got.namespaceUID) { + mmListConversations.t.Errorf("RepositoryIMock.ListConversations got unexpected parameter namespaceUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.namespaceUID, mm_got.namespaceUID, minimock.Diff(*mm_want_ptrs.namespaceUID, mm_got.namespaceUID)) + } + + if mm_want_ptrs.catalogUID != nil && !minimock.Equal(*mm_want_ptrs.catalogUID, mm_got.catalogUID) { + mmListConversations.t.Errorf("RepositoryIMock.ListConversations got unexpected parameter catalogUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.catalogUID, mm_got.catalogUID, minimock.Diff(*mm_want_ptrs.catalogUID, mm_got.catalogUID)) + } + + if mm_want_ptrs.pageSize != nil && !minimock.Equal(*mm_want_ptrs.pageSize, mm_got.pageSize) { + mmListConversations.t.Errorf("RepositoryIMock.ListConversations got unexpected parameter pageSize, want: %#v, got: %#v%s\n", *mm_want_ptrs.pageSize, mm_got.pageSize, minimock.Diff(*mm_want_ptrs.pageSize, mm_got.pageSize)) + } + + if mm_want_ptrs.nextPageToken != nil && !minimock.Equal(*mm_want_ptrs.nextPageToken, mm_got.nextPageToken) { + mmListConversations.t.Errorf("RepositoryIMock.ListConversations got unexpected parameter nextPageToken, want: %#v, got: %#v%s\n", *mm_want_ptrs.nextPageToken, mm_got.nextPageToken, minimock.Diff(*mm_want_ptrs.nextPageToken, mm_got.nextPageToken)) + } + + } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { + mmListConversations.t.Errorf("RepositoryIMock.ListConversations got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + } + + mm_results := mmListConversations.ListConversationsMock.defaultExpectation.results + if mm_results == nil { + mmListConversations.t.Fatal("No results are set for the RepositoryIMock.ListConversations") + } + return (*mm_results).cpa1, (*mm_results).i1, (*mm_results).s1, (*mm_results).err + } + if mmListConversations.funcListConversations != nil { + return mmListConversations.funcListConversations(ctx, namespaceUID, catalogUID, pageSize, nextPageToken) + } + mmListConversations.t.Fatalf("Unexpected call to RepositoryIMock.ListConversations. %v %v %v %v %v", ctx, namespaceUID, catalogUID, pageSize, nextPageToken) + return +} + +// ListConversationsAfterCounter returns a count of finished RepositoryIMock.ListConversations invocations +func (mmListConversations *RepositoryIMock) ListConversationsAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmListConversations.afterListConversationsCounter) +} + +// ListConversationsBeforeCounter returns a count of RepositoryIMock.ListConversations invocations +func (mmListConversations *RepositoryIMock) ListConversationsBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmListConversations.beforeListConversationsCounter) +} + +// Calls returns a list of arguments used in each call to RepositoryIMock.ListConversations. +// The list is in the same order as the calls were made (i.e. recent calls have a higher index) +func (mmListConversations *mRepositoryIMockListConversations) Calls() []*RepositoryIMockListConversationsParams { + mmListConversations.mutex.RLock() + + argCopy := make([]*RepositoryIMockListConversationsParams, len(mmListConversations.callArgs)) + copy(argCopy, mmListConversations.callArgs) + + mmListConversations.mutex.RUnlock() + + return argCopy +} + +// MinimockListConversationsDone returns true if the count of the ListConversations invocations corresponds +// the number of defined expectations +func (m *RepositoryIMock) MinimockListConversationsDone() bool { + for _, e := range m.ListConversationsMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + return false + } + } + + return m.ListConversationsMock.invocationsDone() +} + +// MinimockListConversationsInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockListConversationsInspect() { + for _, e := range m.ListConversationsMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + m.t.Errorf("Expected call to RepositoryIMock.ListConversations with params: %#v", *e.params) + } + } + + afterListConversationsCounter := mm_atomic.LoadUint64(&m.afterListConversationsCounter) + // if default expectation was set then invocations count should be greater than zero + if m.ListConversationsMock.defaultExpectation != nil && afterListConversationsCounter < 1 { + if m.ListConversationsMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.ListConversations") + } else { + m.t.Errorf("Expected call to RepositoryIMock.ListConversations with params: %#v", *m.ListConversationsMock.defaultExpectation.params) + } + } + // if func was set then invocations count should be greater than zero + if m.funcListConversations != nil && afterListConversationsCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.ListConversations") + } + + if !m.ListConversationsMock.invocationsDone() && afterListConversationsCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.ListConversations but found %d calls", + mm_atomic.LoadUint64(&m.ListConversationsMock.expectedInvocations), afterListConversationsCounter) + } +} + +type mRepositoryIMockListEmbeddingsByKbFileUID struct { + mock *RepositoryIMock + defaultExpectation *RepositoryIMockListEmbeddingsByKbFileUIDExpectation + expectations []*RepositoryIMockListEmbeddingsByKbFileUIDExpectation + + callArgs []*RepositoryIMockListEmbeddingsByKbFileUIDParams + mutex sync.RWMutex + + expectedInvocations uint64 +} + +// RepositoryIMockListEmbeddingsByKbFileUIDExpectation specifies expectation struct of the RepositoryI.ListEmbeddingsByKbFileUID +type RepositoryIMockListEmbeddingsByKbFileUIDExpectation struct { + mock *RepositoryIMock + params *RepositoryIMockListEmbeddingsByKbFileUIDParams + paramPtrs *RepositoryIMockListEmbeddingsByKbFileUIDParamPtrs + results *RepositoryIMockListEmbeddingsByKbFileUIDResults + Counter uint64 +} + +// RepositoryIMockListEmbeddingsByKbFileUIDParams contains parameters of the RepositoryI.ListEmbeddingsByKbFileUID +type RepositoryIMockListEmbeddingsByKbFileUIDParams struct { + ctx context.Context + kbFileUID uuid.UUID +} + +// RepositoryIMockListEmbeddingsByKbFileUIDParamPtrs contains pointers to parameters of the RepositoryI.ListEmbeddingsByKbFileUID +type RepositoryIMockListEmbeddingsByKbFileUIDParamPtrs struct { + ctx *context.Context + kbFileUID *uuid.UUID +} + +// 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 mmListEmbeddingsByKbFileUID.defaultExpectation == nil { + mmListEmbeddingsByKbFileUID.defaultExpectation = &RepositoryIMockListEmbeddingsByKbFileUIDExpectation{} + } + + 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 +} + +// 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") + } + + if mmListEmbeddingsByKbFileUID.defaultExpectation == nil { + mmListEmbeddingsByKbFileUID.defaultExpectation = &RepositoryIMockListEmbeddingsByKbFileUIDExpectation{} + } + + 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 +} + +// 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 mmListEmbeddingsByKbFileUID.defaultExpectation == nil { + mmListEmbeddingsByKbFileUID.defaultExpectation = &RepositoryIMockListEmbeddingsByKbFileUIDExpectation{} + } + + 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 +} + +// 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") + } + + 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") + } + + if mmListEmbeddingsByKbFileUID.defaultExpectation == nil { + mmListEmbeddingsByKbFileUID.defaultExpectation = &RepositoryIMockListEmbeddingsByKbFileUIDExpectation{mock: mmListEmbeddingsByKbFileUID.mock} + } + mmListEmbeddingsByKbFileUID.defaultExpectation.results = &RepositoryIMockListEmbeddingsByKbFileUIDResults{ea1, err} + return mmListEmbeddingsByKbFileUID.mock +} + +// 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 { + mmListEmbeddingsByKbFileUID.mock.t.Fatalf("Times of RepositoryIMock.ListEmbeddingsByKbFileUID mock can not be zero") + } + mm_atomic.StoreUint64(&mmListEmbeddingsByKbFileUID.expectedInvocations, n) + return mmListEmbeddingsByKbFileUID +} + +func (mmListEmbeddingsByKbFileUID *mRepositoryIMockListEmbeddingsByKbFileUID) invocationsDone() bool { + if len(mmListEmbeddingsByKbFileUID.expectations) == 0 && mmListEmbeddingsByKbFileUID.defaultExpectation == nil && mmListEmbeddingsByKbFileUID.mock.funcListEmbeddingsByKbFileUID == nil { + return true + } + + totalInvocations := mm_atomic.LoadUint64(&mmListEmbeddingsByKbFileUID.mock.afterListEmbeddingsByKbFileUIDCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmListEmbeddingsByKbFileUID.expectedInvocations) + + return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) +} + +// 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 mmListEmbeddingsByKbFileUID.inspectFuncListEmbeddingsByKbFileUID != nil { + mmListEmbeddingsByKbFileUID.inspectFuncListEmbeddingsByKbFileUID(ctx, kbFileUID) + } + + mm_params := RepositoryIMockListEmbeddingsByKbFileUIDParams{ctx, kbFileUID} + + // 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 { + mmListEmbeddingsByKbFileUID.t.Fatal("No results are set for the RepositoryIMock.ListEmbeddingsByKbFileUID") + } + return (*mm_results).ea1, (*mm_results).err + } + if mmListEmbeddingsByKbFileUID.funcListEmbeddingsByKbFileUID != nil { + return mmListEmbeddingsByKbFileUID.funcListEmbeddingsByKbFileUID(ctx, kbFileUID) + } + mmListEmbeddingsByKbFileUID.t.Fatalf("Unexpected call to RepositoryIMock.ListEmbeddingsByKbFileUID. %v %v", ctx, kbFileUID) + return +} + +// ListEmbeddingsByKbFileUIDAfterCounter returns a count of finished RepositoryIMock.ListEmbeddingsByKbFileUID invocations +func (mmListEmbeddingsByKbFileUID *RepositoryIMock) ListEmbeddingsByKbFileUIDAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmListEmbeddingsByKbFileUID.afterListEmbeddingsByKbFileUIDCounter) +} + +// ListEmbeddingsByKbFileUIDBeforeCounter returns a count of RepositoryIMock.ListEmbeddingsByKbFileUID invocations +func (mmListEmbeddingsByKbFileUID *RepositoryIMock) ListEmbeddingsByKbFileUIDBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmListEmbeddingsByKbFileUID.beforeListEmbeddingsByKbFileUIDCounter) +} + +// 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) MinimockListEmbeddingsByKbFileUIDDone() bool { + for _, e := range m.ListEmbeddingsByKbFileUIDMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + return false + } + } + + return m.ListEmbeddingsByKbFileUIDMock.invocationsDone() +} + +// MinimockListEmbeddingsByKbFileUIDInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockListEmbeddingsByKbFileUIDInspect() { + for _, e := range m.ListEmbeddingsByKbFileUIDMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + m.t.Errorf("Expected call to RepositoryIMock.ListEmbeddingsByKbFileUID with params: %#v", *e.params) + } + } + + afterListEmbeddingsByKbFileUIDCounter := mm_atomic.LoadUint64(&m.afterListEmbeddingsByKbFileUIDCounter) + // if default expectation was set then invocations count should be greater than zero + 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.funcListEmbeddingsByKbFileUID != nil && afterListEmbeddingsByKbFileUIDCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.ListEmbeddingsByKbFileUID") + } + + 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) + } +} + +type mRepositoryIMockListKnowledgeBaseFiles struct { + mock *RepositoryIMock + defaultExpectation *RepositoryIMockListKnowledgeBaseFilesExpectation + expectations []*RepositoryIMockListKnowledgeBaseFilesExpectation + + callArgs []*RepositoryIMockListKnowledgeBaseFilesParams + mutex sync.RWMutex + + expectedInvocations uint64 +} + +// RepositoryIMockListKnowledgeBaseFilesExpectation specifies expectation struct of the RepositoryI.ListKnowledgeBaseFiles +type RepositoryIMockListKnowledgeBaseFilesExpectation struct { + mock *RepositoryIMock + params *RepositoryIMockListKnowledgeBaseFilesParams + paramPtrs *RepositoryIMockListKnowledgeBaseFilesParamPtrs + results *RepositoryIMockListKnowledgeBaseFilesResults + Counter uint64 +} + +// RepositoryIMockListKnowledgeBaseFilesParams contains parameters of the RepositoryI.ListKnowledgeBaseFiles +type RepositoryIMockListKnowledgeBaseFilesParams struct { + ctx context.Context + uid string + ownerUID string + kbUID string + pageSize int32 + nextPageToken string + filesUID []string +} + +// RepositoryIMockListKnowledgeBaseFilesParamPtrs contains pointers to parameters of the RepositoryI.ListKnowledgeBaseFiles +type RepositoryIMockListKnowledgeBaseFilesParamPtrs struct { + ctx *context.Context + uid *string + ownerUID *string + kbUID *string + pageSize *int32 + nextPageToken *string + filesUID *[]string +} + +// RepositoryIMockListKnowledgeBaseFilesResults contains results of the RepositoryI.ListKnowledgeBaseFiles +type RepositoryIMockListKnowledgeBaseFilesResults struct { + ka1 []mm_repository.KnowledgeBaseFile + i1 int + s1 string + err error +} + +// Expect sets up expected params for RepositoryI.ListKnowledgeBaseFiles +func (mmListKnowledgeBaseFiles *mRepositoryIMockListKnowledgeBaseFiles) Expect(ctx context.Context, uid string, ownerUID string, kbUID string, pageSize int32, nextPageToken string, filesUID []string) *mRepositoryIMockListKnowledgeBaseFiles { + if mmListKnowledgeBaseFiles.mock.funcListKnowledgeBaseFiles != nil { + mmListKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBaseFiles mock is already set by Set") + } + + if mmListKnowledgeBaseFiles.defaultExpectation == nil { + mmListKnowledgeBaseFiles.defaultExpectation = &RepositoryIMockListKnowledgeBaseFilesExpectation{} + } + + if mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs != nil { + mmListKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBaseFiles mock is already set by ExpectParams functions") + } + + mmListKnowledgeBaseFiles.defaultExpectation.params = &RepositoryIMockListKnowledgeBaseFilesParams{ctx, uid, ownerUID, kbUID, pageSize, nextPageToken, filesUID} + for _, e := range mmListKnowledgeBaseFiles.expectations { + if minimock.Equal(e.params, mmListKnowledgeBaseFiles.defaultExpectation.params) { + mmListKnowledgeBaseFiles.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmListKnowledgeBaseFiles.defaultExpectation.params) + } + } + + return mmListKnowledgeBaseFiles +} + +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.ListKnowledgeBaseFiles +func (mmListKnowledgeBaseFiles *mRepositoryIMockListKnowledgeBaseFiles) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockListKnowledgeBaseFiles { + if mmListKnowledgeBaseFiles.mock.funcListKnowledgeBaseFiles != nil { + mmListKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBaseFiles mock is already set by Set") + } + + if mmListKnowledgeBaseFiles.defaultExpectation == nil { + mmListKnowledgeBaseFiles.defaultExpectation = &RepositoryIMockListKnowledgeBaseFilesExpectation{} + } + + if mmListKnowledgeBaseFiles.defaultExpectation.params != nil { + mmListKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBaseFiles mock is already set by Expect") + } + + if mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs == nil { + mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs = &RepositoryIMockListKnowledgeBaseFilesParamPtrs{} + } + mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs.ctx = &ctx + + return mmListKnowledgeBaseFiles +} + +// ExpectUidParam2 sets up expected param uid for RepositoryI.ListKnowledgeBaseFiles +func (mmListKnowledgeBaseFiles *mRepositoryIMockListKnowledgeBaseFiles) ExpectUidParam2(uid string) *mRepositoryIMockListKnowledgeBaseFiles { + if mmListKnowledgeBaseFiles.mock.funcListKnowledgeBaseFiles != nil { + mmListKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBaseFiles mock is already set by Set") + } + + if mmListKnowledgeBaseFiles.defaultExpectation == nil { + mmListKnowledgeBaseFiles.defaultExpectation = &RepositoryIMockListKnowledgeBaseFilesExpectation{} + } + + if mmListKnowledgeBaseFiles.defaultExpectation.params != nil { + mmListKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBaseFiles mock is already set by Expect") + } + + if mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs == nil { + mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs = &RepositoryIMockListKnowledgeBaseFilesParamPtrs{} + } + mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs.uid = &uid + + return mmListKnowledgeBaseFiles +} + +// ExpectOwnerUIDParam3 sets up expected param ownerUID for RepositoryI.ListKnowledgeBaseFiles +func (mmListKnowledgeBaseFiles *mRepositoryIMockListKnowledgeBaseFiles) ExpectOwnerUIDParam3(ownerUID string) *mRepositoryIMockListKnowledgeBaseFiles { + if mmListKnowledgeBaseFiles.mock.funcListKnowledgeBaseFiles != nil { + mmListKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBaseFiles mock is already set by Set") + } + + if mmListKnowledgeBaseFiles.defaultExpectation == nil { + mmListKnowledgeBaseFiles.defaultExpectation = &RepositoryIMockListKnowledgeBaseFilesExpectation{} + } + + if mmListKnowledgeBaseFiles.defaultExpectation.params != nil { + mmListKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBaseFiles mock is already set by Expect") + } + + if mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs == nil { + mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs = &RepositoryIMockListKnowledgeBaseFilesParamPtrs{} + } + mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs.ownerUID = &ownerUID + + return mmListKnowledgeBaseFiles +} + +// ExpectKbUIDParam4 sets up expected param kbUID for RepositoryI.ListKnowledgeBaseFiles +func (mmListKnowledgeBaseFiles *mRepositoryIMockListKnowledgeBaseFiles) ExpectKbUIDParam4(kbUID string) *mRepositoryIMockListKnowledgeBaseFiles { + if mmListKnowledgeBaseFiles.mock.funcListKnowledgeBaseFiles != nil { + mmListKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBaseFiles mock is already set by Set") + } + + if mmListKnowledgeBaseFiles.defaultExpectation == nil { + mmListKnowledgeBaseFiles.defaultExpectation = &RepositoryIMockListKnowledgeBaseFilesExpectation{} + } + + if mmListKnowledgeBaseFiles.defaultExpectation.params != nil { + mmListKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBaseFiles mock is already set by Expect") + } + + if mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs == nil { + mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs = &RepositoryIMockListKnowledgeBaseFilesParamPtrs{} + } + mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs.kbUID = &kbUID + + return mmListKnowledgeBaseFiles +} + +// ExpectPageSizeParam5 sets up expected param pageSize for RepositoryI.ListKnowledgeBaseFiles +func (mmListKnowledgeBaseFiles *mRepositoryIMockListKnowledgeBaseFiles) ExpectPageSizeParam5(pageSize int32) *mRepositoryIMockListKnowledgeBaseFiles { + if mmListKnowledgeBaseFiles.mock.funcListKnowledgeBaseFiles != nil { + mmListKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBaseFiles mock is already set by Set") + } + + if mmListKnowledgeBaseFiles.defaultExpectation == nil { + mmListKnowledgeBaseFiles.defaultExpectation = &RepositoryIMockListKnowledgeBaseFilesExpectation{} + } + + if mmListKnowledgeBaseFiles.defaultExpectation.params != nil { + mmListKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBaseFiles mock is already set by Expect") + } + + if mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs == nil { + mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs = &RepositoryIMockListKnowledgeBaseFilesParamPtrs{} + } + mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs.pageSize = &pageSize + + return mmListKnowledgeBaseFiles +} + +// ExpectNextPageTokenParam6 sets up expected param nextPageToken for RepositoryI.ListKnowledgeBaseFiles +func (mmListKnowledgeBaseFiles *mRepositoryIMockListKnowledgeBaseFiles) ExpectNextPageTokenParam6(nextPageToken string) *mRepositoryIMockListKnowledgeBaseFiles { + if mmListKnowledgeBaseFiles.mock.funcListKnowledgeBaseFiles != nil { + mmListKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBaseFiles mock is already set by Set") + } + + if mmListKnowledgeBaseFiles.defaultExpectation == nil { + mmListKnowledgeBaseFiles.defaultExpectation = &RepositoryIMockListKnowledgeBaseFilesExpectation{} + } + + if mmListKnowledgeBaseFiles.defaultExpectation.params != nil { + mmListKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBaseFiles mock is already set by Expect") + } + + if mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs == nil { + mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs = &RepositoryIMockListKnowledgeBaseFilesParamPtrs{} + } + mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs.nextPageToken = &nextPageToken + + return mmListKnowledgeBaseFiles +} + +// ExpectFilesUIDParam7 sets up expected param filesUID for RepositoryI.ListKnowledgeBaseFiles +func (mmListKnowledgeBaseFiles *mRepositoryIMockListKnowledgeBaseFiles) ExpectFilesUIDParam7(filesUID []string) *mRepositoryIMockListKnowledgeBaseFiles { + if mmListKnowledgeBaseFiles.mock.funcListKnowledgeBaseFiles != nil { + mmListKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBaseFiles mock is already set by Set") + } + + if mmListKnowledgeBaseFiles.defaultExpectation == nil { + mmListKnowledgeBaseFiles.defaultExpectation = &RepositoryIMockListKnowledgeBaseFilesExpectation{} + } + + if mmListKnowledgeBaseFiles.defaultExpectation.params != nil { + mmListKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBaseFiles mock is already set by Expect") + } + + if mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs == nil { + mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs = &RepositoryIMockListKnowledgeBaseFilesParamPtrs{} + } + mmListKnowledgeBaseFiles.defaultExpectation.paramPtrs.filesUID = &filesUID + + return mmListKnowledgeBaseFiles +} + +// Inspect accepts an inspector function that has same arguments as the RepositoryI.ListKnowledgeBaseFiles +func (mmListKnowledgeBaseFiles *mRepositoryIMockListKnowledgeBaseFiles) Inspect(f func(ctx context.Context, uid string, ownerUID string, kbUID string, pageSize int32, nextPageToken string, filesUID []string)) *mRepositoryIMockListKnowledgeBaseFiles { + if mmListKnowledgeBaseFiles.mock.inspectFuncListKnowledgeBaseFiles != nil { + mmListKnowledgeBaseFiles.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.ListKnowledgeBaseFiles") + } + + mmListKnowledgeBaseFiles.mock.inspectFuncListKnowledgeBaseFiles = f + + return mmListKnowledgeBaseFiles +} + +// Return sets up results that will be returned by RepositoryI.ListKnowledgeBaseFiles +func (mmListKnowledgeBaseFiles *mRepositoryIMockListKnowledgeBaseFiles) Return(ka1 []mm_repository.KnowledgeBaseFile, i1 int, s1 string, err error) *RepositoryIMock { + if mmListKnowledgeBaseFiles.mock.funcListKnowledgeBaseFiles != nil { + mmListKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBaseFiles mock is already set by Set") + } + + if mmListKnowledgeBaseFiles.defaultExpectation == nil { + mmListKnowledgeBaseFiles.defaultExpectation = &RepositoryIMockListKnowledgeBaseFilesExpectation{mock: mmListKnowledgeBaseFiles.mock} + } + mmListKnowledgeBaseFiles.defaultExpectation.results = &RepositoryIMockListKnowledgeBaseFilesResults{ka1, i1, s1, err} + return mmListKnowledgeBaseFiles.mock +} + +// Set uses given function f to mock the RepositoryI.ListKnowledgeBaseFiles method +func (mmListKnowledgeBaseFiles *mRepositoryIMockListKnowledgeBaseFiles) Set(f 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)) *RepositoryIMock { + if mmListKnowledgeBaseFiles.defaultExpectation != nil { + mmListKnowledgeBaseFiles.mock.t.Fatalf("Default expectation is already set for the RepositoryI.ListKnowledgeBaseFiles method") + } + + if len(mmListKnowledgeBaseFiles.expectations) > 0 { + mmListKnowledgeBaseFiles.mock.t.Fatalf("Some expectations are already set for the RepositoryI.ListKnowledgeBaseFiles method") + } + + mmListKnowledgeBaseFiles.mock.funcListKnowledgeBaseFiles = f + return mmListKnowledgeBaseFiles.mock +} + +// When sets expectation for the RepositoryI.ListKnowledgeBaseFiles which will trigger the result defined by the following +// Then helper +func (mmListKnowledgeBaseFiles *mRepositoryIMockListKnowledgeBaseFiles) When(ctx context.Context, uid string, ownerUID string, kbUID string, pageSize int32, nextPageToken string, filesUID []string) *RepositoryIMockListKnowledgeBaseFilesExpectation { + if mmListKnowledgeBaseFiles.mock.funcListKnowledgeBaseFiles != nil { + mmListKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBaseFiles mock is already set by Set") + } + + expectation := &RepositoryIMockListKnowledgeBaseFilesExpectation{ + mock: mmListKnowledgeBaseFiles.mock, + params: &RepositoryIMockListKnowledgeBaseFilesParams{ctx, uid, ownerUID, kbUID, pageSize, nextPageToken, filesUID}, + } + mmListKnowledgeBaseFiles.expectations = append(mmListKnowledgeBaseFiles.expectations, expectation) + return expectation +} + +// Then sets up RepositoryI.ListKnowledgeBaseFiles return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockListKnowledgeBaseFilesExpectation) Then(ka1 []mm_repository.KnowledgeBaseFile, i1 int, s1 string, err error) *RepositoryIMock { + e.results = &RepositoryIMockListKnowledgeBaseFilesResults{ka1, i1, s1, err} + return e.mock +} + +// Times sets number of times RepositoryI.ListKnowledgeBaseFiles should be invoked +func (mmListKnowledgeBaseFiles *mRepositoryIMockListKnowledgeBaseFiles) Times(n uint64) *mRepositoryIMockListKnowledgeBaseFiles { + if n == 0 { + mmListKnowledgeBaseFiles.mock.t.Fatalf("Times of RepositoryIMock.ListKnowledgeBaseFiles mock can not be zero") + } + mm_atomic.StoreUint64(&mmListKnowledgeBaseFiles.expectedInvocations, n) + return mmListKnowledgeBaseFiles +} + +func (mmListKnowledgeBaseFiles *mRepositoryIMockListKnowledgeBaseFiles) invocationsDone() bool { + if len(mmListKnowledgeBaseFiles.expectations) == 0 && mmListKnowledgeBaseFiles.defaultExpectation == nil && mmListKnowledgeBaseFiles.mock.funcListKnowledgeBaseFiles == nil { + return true + } + + totalInvocations := mm_atomic.LoadUint64(&mmListKnowledgeBaseFiles.mock.afterListKnowledgeBaseFilesCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmListKnowledgeBaseFiles.expectedInvocations) + + return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) +} + +// ListKnowledgeBaseFiles implements repository.RepositoryI +func (mmListKnowledgeBaseFiles *RepositoryIMock) ListKnowledgeBaseFiles(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) { + mm_atomic.AddUint64(&mmListKnowledgeBaseFiles.beforeListKnowledgeBaseFilesCounter, 1) + defer mm_atomic.AddUint64(&mmListKnowledgeBaseFiles.afterListKnowledgeBaseFilesCounter, 1) + + if mmListKnowledgeBaseFiles.inspectFuncListKnowledgeBaseFiles != nil { + mmListKnowledgeBaseFiles.inspectFuncListKnowledgeBaseFiles(ctx, uid, ownerUID, kbUID, pageSize, nextPageToken, filesUID) + } + + mm_params := RepositoryIMockListKnowledgeBaseFilesParams{ctx, uid, ownerUID, kbUID, pageSize, nextPageToken, filesUID} + + // Record call args + mmListKnowledgeBaseFiles.ListKnowledgeBaseFilesMock.mutex.Lock() + mmListKnowledgeBaseFiles.ListKnowledgeBaseFilesMock.callArgs = append(mmListKnowledgeBaseFiles.ListKnowledgeBaseFilesMock.callArgs, &mm_params) + mmListKnowledgeBaseFiles.ListKnowledgeBaseFilesMock.mutex.Unlock() + + for _, e := range mmListKnowledgeBaseFiles.ListKnowledgeBaseFilesMock.expectations { + if minimock.Equal(*e.params, mm_params) { + mm_atomic.AddUint64(&e.Counter, 1) + return e.results.ka1, e.results.i1, e.results.s1, e.results.err + } + } + + if mmListKnowledgeBaseFiles.ListKnowledgeBaseFilesMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmListKnowledgeBaseFiles.ListKnowledgeBaseFilesMock.defaultExpectation.Counter, 1) + mm_want := mmListKnowledgeBaseFiles.ListKnowledgeBaseFilesMock.defaultExpectation.params + mm_want_ptrs := mmListKnowledgeBaseFiles.ListKnowledgeBaseFilesMock.defaultExpectation.paramPtrs + + mm_got := RepositoryIMockListKnowledgeBaseFilesParams{ctx, uid, ownerUID, kbUID, pageSize, nextPageToken, filesUID} + + if mm_want_ptrs != nil { + + if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { + mmListKnowledgeBaseFiles.t.Errorf("RepositoryIMock.ListKnowledgeBaseFiles 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) { + mmListKnowledgeBaseFiles.t.Errorf("RepositoryIMock.ListKnowledgeBaseFiles 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.ownerUID != nil && !minimock.Equal(*mm_want_ptrs.ownerUID, mm_got.ownerUID) { + mmListKnowledgeBaseFiles.t.Errorf("RepositoryIMock.ListKnowledgeBaseFiles 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.kbUID != nil && !minimock.Equal(*mm_want_ptrs.kbUID, mm_got.kbUID) { + mmListKnowledgeBaseFiles.t.Errorf("RepositoryIMock.ListKnowledgeBaseFiles 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.pageSize != nil && !minimock.Equal(*mm_want_ptrs.pageSize, mm_got.pageSize) { + mmListKnowledgeBaseFiles.t.Errorf("RepositoryIMock.ListKnowledgeBaseFiles got unexpected parameter pageSize, want: %#v, got: %#v%s\n", *mm_want_ptrs.pageSize, mm_got.pageSize, minimock.Diff(*mm_want_ptrs.pageSize, mm_got.pageSize)) + } + + if mm_want_ptrs.nextPageToken != nil && !minimock.Equal(*mm_want_ptrs.nextPageToken, mm_got.nextPageToken) { + mmListKnowledgeBaseFiles.t.Errorf("RepositoryIMock.ListKnowledgeBaseFiles got unexpected parameter nextPageToken, want: %#v, got: %#v%s\n", *mm_want_ptrs.nextPageToken, mm_got.nextPageToken, minimock.Diff(*mm_want_ptrs.nextPageToken, mm_got.nextPageToken)) + } + + if mm_want_ptrs.filesUID != nil && !minimock.Equal(*mm_want_ptrs.filesUID, mm_got.filesUID) { + mmListKnowledgeBaseFiles.t.Errorf("RepositoryIMock.ListKnowledgeBaseFiles got unexpected parameter filesUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.filesUID, mm_got.filesUID, minimock.Diff(*mm_want_ptrs.filesUID, mm_got.filesUID)) + } + + } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { + mmListKnowledgeBaseFiles.t.Errorf("RepositoryIMock.ListKnowledgeBaseFiles got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + } + + mm_results := mmListKnowledgeBaseFiles.ListKnowledgeBaseFilesMock.defaultExpectation.results + if mm_results == nil { + mmListKnowledgeBaseFiles.t.Fatal("No results are set for the RepositoryIMock.ListKnowledgeBaseFiles") + } + return (*mm_results).ka1, (*mm_results).i1, (*mm_results).s1, (*mm_results).err + } + if mmListKnowledgeBaseFiles.funcListKnowledgeBaseFiles != nil { + return mmListKnowledgeBaseFiles.funcListKnowledgeBaseFiles(ctx, uid, ownerUID, kbUID, pageSize, nextPageToken, filesUID) + } + mmListKnowledgeBaseFiles.t.Fatalf("Unexpected call to RepositoryIMock.ListKnowledgeBaseFiles. %v %v %v %v %v %v %v", ctx, uid, ownerUID, kbUID, pageSize, nextPageToken, filesUID) + return +} + +// ListKnowledgeBaseFilesAfterCounter returns a count of finished RepositoryIMock.ListKnowledgeBaseFiles invocations +func (mmListKnowledgeBaseFiles *RepositoryIMock) ListKnowledgeBaseFilesAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmListKnowledgeBaseFiles.afterListKnowledgeBaseFilesCounter) +} + +// ListKnowledgeBaseFilesBeforeCounter returns a count of RepositoryIMock.ListKnowledgeBaseFiles invocations +func (mmListKnowledgeBaseFiles *RepositoryIMock) ListKnowledgeBaseFilesBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmListKnowledgeBaseFiles.beforeListKnowledgeBaseFilesCounter) +} + +// Calls returns a list of arguments used in each call to RepositoryIMock.ListKnowledgeBaseFiles. +// The list is in the same order as the calls were made (i.e. recent calls have a higher index) +func (mmListKnowledgeBaseFiles *mRepositoryIMockListKnowledgeBaseFiles) Calls() []*RepositoryIMockListKnowledgeBaseFilesParams { + mmListKnowledgeBaseFiles.mutex.RLock() + + argCopy := make([]*RepositoryIMockListKnowledgeBaseFilesParams, len(mmListKnowledgeBaseFiles.callArgs)) + copy(argCopy, mmListKnowledgeBaseFiles.callArgs) + + mmListKnowledgeBaseFiles.mutex.RUnlock() + + return argCopy +} + +// MinimockListKnowledgeBaseFilesDone returns true if the count of the ListKnowledgeBaseFiles invocations corresponds +// the number of defined expectations +func (m *RepositoryIMock) MinimockListKnowledgeBaseFilesDone() bool { + for _, e := range m.ListKnowledgeBaseFilesMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + return false + } + } + + return m.ListKnowledgeBaseFilesMock.invocationsDone() +} + +// MinimockListKnowledgeBaseFilesInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockListKnowledgeBaseFilesInspect() { + for _, e := range m.ListKnowledgeBaseFilesMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + m.t.Errorf("Expected call to RepositoryIMock.ListKnowledgeBaseFiles with params: %#v", *e.params) + } + } + + afterListKnowledgeBaseFilesCounter := mm_atomic.LoadUint64(&m.afterListKnowledgeBaseFilesCounter) + // if default expectation was set then invocations count should be greater than zero + if m.ListKnowledgeBaseFilesMock.defaultExpectation != nil && afterListKnowledgeBaseFilesCounter < 1 { + if m.ListKnowledgeBaseFilesMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.ListKnowledgeBaseFiles") + } else { + m.t.Errorf("Expected call to RepositoryIMock.ListKnowledgeBaseFiles with params: %#v", *m.ListKnowledgeBaseFilesMock.defaultExpectation.params) + } + } + // if func was set then invocations count should be greater than zero + if m.funcListKnowledgeBaseFiles != nil && afterListKnowledgeBaseFilesCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.ListKnowledgeBaseFiles") + } + + if !m.ListKnowledgeBaseFilesMock.invocationsDone() && afterListKnowledgeBaseFilesCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.ListKnowledgeBaseFiles but found %d calls", + mm_atomic.LoadUint64(&m.ListKnowledgeBaseFilesMock.expectedInvocations), afterListKnowledgeBaseFilesCounter) + } +} + +type mRepositoryIMockListKnowledgeBases struct { + mock *RepositoryIMock + defaultExpectation *RepositoryIMockListKnowledgeBasesExpectation + expectations []*RepositoryIMockListKnowledgeBasesExpectation + + callArgs []*RepositoryIMockListKnowledgeBasesParams + mutex sync.RWMutex + + expectedInvocations uint64 +} + +// RepositoryIMockListKnowledgeBasesExpectation specifies expectation struct of the RepositoryI.ListKnowledgeBases +type RepositoryIMockListKnowledgeBasesExpectation struct { + mock *RepositoryIMock + params *RepositoryIMockListKnowledgeBasesParams + paramPtrs *RepositoryIMockListKnowledgeBasesParamPtrs + results *RepositoryIMockListKnowledgeBasesResults + Counter uint64 +} + +// RepositoryIMockListKnowledgeBasesParams contains parameters of the RepositoryI.ListKnowledgeBases +type RepositoryIMockListKnowledgeBasesParams struct { + ctx context.Context + ownerUID string +} + +// RepositoryIMockListKnowledgeBasesParamPtrs contains pointers to parameters of the RepositoryI.ListKnowledgeBases +type RepositoryIMockListKnowledgeBasesParamPtrs struct { + ctx *context.Context + ownerUID *string +} + +// RepositoryIMockListKnowledgeBasesResults contains results of the RepositoryI.ListKnowledgeBases +type RepositoryIMockListKnowledgeBasesResults struct { + ka1 []mm_repository.KnowledgeBase + err error +} + +// Expect sets up expected params for RepositoryI.ListKnowledgeBases +func (mmListKnowledgeBases *mRepositoryIMockListKnowledgeBases) Expect(ctx context.Context, ownerUID string) *mRepositoryIMockListKnowledgeBases { + if mmListKnowledgeBases.mock.funcListKnowledgeBases != nil { + mmListKnowledgeBases.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBases mock is already set by Set") + } + + if mmListKnowledgeBases.defaultExpectation == nil { + mmListKnowledgeBases.defaultExpectation = &RepositoryIMockListKnowledgeBasesExpectation{} + } + + if mmListKnowledgeBases.defaultExpectation.paramPtrs != nil { + mmListKnowledgeBases.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBases mock is already set by ExpectParams functions") + } + + mmListKnowledgeBases.defaultExpectation.params = &RepositoryIMockListKnowledgeBasesParams{ctx, ownerUID} + for _, e := range mmListKnowledgeBases.expectations { + if minimock.Equal(e.params, mmListKnowledgeBases.defaultExpectation.params) { + mmListKnowledgeBases.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmListKnowledgeBases.defaultExpectation.params) + } + } + + return mmListKnowledgeBases +} + +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.ListKnowledgeBases +func (mmListKnowledgeBases *mRepositoryIMockListKnowledgeBases) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockListKnowledgeBases { + if mmListKnowledgeBases.mock.funcListKnowledgeBases != nil { + mmListKnowledgeBases.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBases mock is already set by Set") + } + + if mmListKnowledgeBases.defaultExpectation == nil { + mmListKnowledgeBases.defaultExpectation = &RepositoryIMockListKnowledgeBasesExpectation{} + } + + if mmListKnowledgeBases.defaultExpectation.params != nil { + mmListKnowledgeBases.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBases mock is already set by Expect") + } + + if mmListKnowledgeBases.defaultExpectation.paramPtrs == nil { + mmListKnowledgeBases.defaultExpectation.paramPtrs = &RepositoryIMockListKnowledgeBasesParamPtrs{} + } + mmListKnowledgeBases.defaultExpectation.paramPtrs.ctx = &ctx + + return mmListKnowledgeBases +} + +// ExpectOwnerUIDParam2 sets up expected param ownerUID for RepositoryI.ListKnowledgeBases +func (mmListKnowledgeBases *mRepositoryIMockListKnowledgeBases) ExpectOwnerUIDParam2(ownerUID string) *mRepositoryIMockListKnowledgeBases { + if mmListKnowledgeBases.mock.funcListKnowledgeBases != nil { + mmListKnowledgeBases.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBases mock is already set by Set") + } + + if mmListKnowledgeBases.defaultExpectation == nil { + mmListKnowledgeBases.defaultExpectation = &RepositoryIMockListKnowledgeBasesExpectation{} + } + + if mmListKnowledgeBases.defaultExpectation.params != nil { + mmListKnowledgeBases.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBases mock is already set by Expect") + } + + if mmListKnowledgeBases.defaultExpectation.paramPtrs == nil { + mmListKnowledgeBases.defaultExpectation.paramPtrs = &RepositoryIMockListKnowledgeBasesParamPtrs{} + } + mmListKnowledgeBases.defaultExpectation.paramPtrs.ownerUID = &ownerUID + + return mmListKnowledgeBases +} + +// Inspect accepts an inspector function that has same arguments as the RepositoryI.ListKnowledgeBases +func (mmListKnowledgeBases *mRepositoryIMockListKnowledgeBases) Inspect(f func(ctx context.Context, ownerUID string)) *mRepositoryIMockListKnowledgeBases { + if mmListKnowledgeBases.mock.inspectFuncListKnowledgeBases != nil { + mmListKnowledgeBases.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.ListKnowledgeBases") + } + + mmListKnowledgeBases.mock.inspectFuncListKnowledgeBases = f + + return mmListKnowledgeBases +} + +// Return sets up results that will be returned by RepositoryI.ListKnowledgeBases +func (mmListKnowledgeBases *mRepositoryIMockListKnowledgeBases) Return(ka1 []mm_repository.KnowledgeBase, err error) *RepositoryIMock { + if mmListKnowledgeBases.mock.funcListKnowledgeBases != nil { + mmListKnowledgeBases.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBases mock is already set by Set") + } + + if mmListKnowledgeBases.defaultExpectation == nil { + mmListKnowledgeBases.defaultExpectation = &RepositoryIMockListKnowledgeBasesExpectation{mock: mmListKnowledgeBases.mock} + } + mmListKnowledgeBases.defaultExpectation.results = &RepositoryIMockListKnowledgeBasesResults{ka1, err} + return mmListKnowledgeBases.mock +} + +// Set uses given function f to mock the RepositoryI.ListKnowledgeBases method +func (mmListKnowledgeBases *mRepositoryIMockListKnowledgeBases) Set(f func(ctx context.Context, ownerUID string) (ka1 []mm_repository.KnowledgeBase, err error)) *RepositoryIMock { + if mmListKnowledgeBases.defaultExpectation != nil { + mmListKnowledgeBases.mock.t.Fatalf("Default expectation is already set for the RepositoryI.ListKnowledgeBases method") + } + + if len(mmListKnowledgeBases.expectations) > 0 { + mmListKnowledgeBases.mock.t.Fatalf("Some expectations are already set for the RepositoryI.ListKnowledgeBases method") + } + + mmListKnowledgeBases.mock.funcListKnowledgeBases = f + return mmListKnowledgeBases.mock +} + +// When sets expectation for the RepositoryI.ListKnowledgeBases which will trigger the result defined by the following +// Then helper +func (mmListKnowledgeBases *mRepositoryIMockListKnowledgeBases) When(ctx context.Context, ownerUID string) *RepositoryIMockListKnowledgeBasesExpectation { + if mmListKnowledgeBases.mock.funcListKnowledgeBases != nil { + mmListKnowledgeBases.mock.t.Fatalf("RepositoryIMock.ListKnowledgeBases mock is already set by Set") + } + + expectation := &RepositoryIMockListKnowledgeBasesExpectation{ + mock: mmListKnowledgeBases.mock, + params: &RepositoryIMockListKnowledgeBasesParams{ctx, ownerUID}, + } + mmListKnowledgeBases.expectations = append(mmListKnowledgeBases.expectations, expectation) + return expectation +} + +// Then sets up RepositoryI.ListKnowledgeBases return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockListKnowledgeBasesExpectation) Then(ka1 []mm_repository.KnowledgeBase, err error) *RepositoryIMock { + e.results = &RepositoryIMockListKnowledgeBasesResults{ka1, err} + return e.mock +} + +// Times sets number of times RepositoryI.ListKnowledgeBases should be invoked +func (mmListKnowledgeBases *mRepositoryIMockListKnowledgeBases) Times(n uint64) *mRepositoryIMockListKnowledgeBases { + if n == 0 { + mmListKnowledgeBases.mock.t.Fatalf("Times of RepositoryIMock.ListKnowledgeBases mock can not be zero") + } + mm_atomic.StoreUint64(&mmListKnowledgeBases.expectedInvocations, n) + return mmListKnowledgeBases +} + +func (mmListKnowledgeBases *mRepositoryIMockListKnowledgeBases) invocationsDone() bool { + if len(mmListKnowledgeBases.expectations) == 0 && mmListKnowledgeBases.defaultExpectation == nil && mmListKnowledgeBases.mock.funcListKnowledgeBases == nil { + return true + } + + totalInvocations := mm_atomic.LoadUint64(&mmListKnowledgeBases.mock.afterListKnowledgeBasesCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmListKnowledgeBases.expectedInvocations) + + return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) +} + +// ListKnowledgeBases implements repository.RepositoryI +func (mmListKnowledgeBases *RepositoryIMock) ListKnowledgeBases(ctx context.Context, ownerUID string) (ka1 []mm_repository.KnowledgeBase, err error) { + mm_atomic.AddUint64(&mmListKnowledgeBases.beforeListKnowledgeBasesCounter, 1) + defer mm_atomic.AddUint64(&mmListKnowledgeBases.afterListKnowledgeBasesCounter, 1) + + if mmListKnowledgeBases.inspectFuncListKnowledgeBases != nil { + mmListKnowledgeBases.inspectFuncListKnowledgeBases(ctx, ownerUID) + } + + mm_params := RepositoryIMockListKnowledgeBasesParams{ctx, ownerUID} + + // Record call args + mmListKnowledgeBases.ListKnowledgeBasesMock.mutex.Lock() + mmListKnowledgeBases.ListKnowledgeBasesMock.callArgs = append(mmListKnowledgeBases.ListKnowledgeBasesMock.callArgs, &mm_params) + mmListKnowledgeBases.ListKnowledgeBasesMock.mutex.Unlock() + + for _, e := range mmListKnowledgeBases.ListKnowledgeBasesMock.expectations { + if minimock.Equal(*e.params, mm_params) { + mm_atomic.AddUint64(&e.Counter, 1) + return e.results.ka1, e.results.err + } + } + + if mmListKnowledgeBases.ListKnowledgeBasesMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmListKnowledgeBases.ListKnowledgeBasesMock.defaultExpectation.Counter, 1) + mm_want := mmListKnowledgeBases.ListKnowledgeBasesMock.defaultExpectation.params + mm_want_ptrs := mmListKnowledgeBases.ListKnowledgeBasesMock.defaultExpectation.paramPtrs + + mm_got := RepositoryIMockListKnowledgeBasesParams{ctx, ownerUID} + + if mm_want_ptrs != nil { + + if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { + mmListKnowledgeBases.t.Errorf("RepositoryIMock.ListKnowledgeBases 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) { + mmListKnowledgeBases.t.Errorf("RepositoryIMock.ListKnowledgeBases 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) { + mmListKnowledgeBases.t.Errorf("RepositoryIMock.ListKnowledgeBases got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + } + + mm_results := mmListKnowledgeBases.ListKnowledgeBasesMock.defaultExpectation.results + if mm_results == nil { + mmListKnowledgeBases.t.Fatal("No results are set for the RepositoryIMock.ListKnowledgeBases") + } + return (*mm_results).ka1, (*mm_results).err + } + if mmListKnowledgeBases.funcListKnowledgeBases != nil { + return mmListKnowledgeBases.funcListKnowledgeBases(ctx, ownerUID) + } + mmListKnowledgeBases.t.Fatalf("Unexpected call to RepositoryIMock.ListKnowledgeBases. %v %v", ctx, ownerUID) + return +} + +// ListKnowledgeBasesAfterCounter returns a count of finished RepositoryIMock.ListKnowledgeBases invocations +func (mmListKnowledgeBases *RepositoryIMock) ListKnowledgeBasesAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmListKnowledgeBases.afterListKnowledgeBasesCounter) +} + +// ListKnowledgeBasesBeforeCounter returns a count of RepositoryIMock.ListKnowledgeBases invocations +func (mmListKnowledgeBases *RepositoryIMock) ListKnowledgeBasesBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmListKnowledgeBases.beforeListKnowledgeBasesCounter) +} + +// Calls returns a list of arguments used in each call to RepositoryIMock.ListKnowledgeBases. +// The list is in the same order as the calls were made (i.e. recent calls have a higher index) +func (mmListKnowledgeBases *mRepositoryIMockListKnowledgeBases) Calls() []*RepositoryIMockListKnowledgeBasesParams { + mmListKnowledgeBases.mutex.RLock() + + argCopy := make([]*RepositoryIMockListKnowledgeBasesParams, len(mmListKnowledgeBases.callArgs)) + copy(argCopy, mmListKnowledgeBases.callArgs) + + mmListKnowledgeBases.mutex.RUnlock() + + return argCopy +} + +// MinimockListKnowledgeBasesDone returns true if the count of the ListKnowledgeBases invocations corresponds +// the number of defined expectations +func (m *RepositoryIMock) MinimockListKnowledgeBasesDone() bool { + for _, e := range m.ListKnowledgeBasesMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + return false + } + } + + return m.ListKnowledgeBasesMock.invocationsDone() +} + +// MinimockListKnowledgeBasesInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockListKnowledgeBasesInspect() { + for _, e := range m.ListKnowledgeBasesMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + m.t.Errorf("Expected call to RepositoryIMock.ListKnowledgeBases with params: %#v", *e.params) + } + } + + afterListKnowledgeBasesCounter := mm_atomic.LoadUint64(&m.afterListKnowledgeBasesCounter) + // if default expectation was set then invocations count should be greater than zero + if m.ListKnowledgeBasesMock.defaultExpectation != nil && afterListKnowledgeBasesCounter < 1 { + if m.ListKnowledgeBasesMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.ListKnowledgeBases") + } else { + m.t.Errorf("Expected call to RepositoryIMock.ListKnowledgeBases with params: %#v", *m.ListKnowledgeBasesMock.defaultExpectation.params) + } + } + // if func was set then invocations count should be greater than zero + if m.funcListKnowledgeBases != nil && afterListKnowledgeBasesCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.ListKnowledgeBases") + } + + if !m.ListKnowledgeBasesMock.invocationsDone() && afterListKnowledgeBasesCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.ListKnowledgeBases but found %d calls", + mm_atomic.LoadUint64(&m.ListKnowledgeBasesMock.expectedInvocations), afterListKnowledgeBasesCounter) + } +} + +type mRepositoryIMockListMessages struct { + mock *RepositoryIMock + defaultExpectation *RepositoryIMockListMessagesExpectation + expectations []*RepositoryIMockListMessagesExpectation + + callArgs []*RepositoryIMockListMessagesParams + mutex sync.RWMutex + + expectedInvocations uint64 +} + +// RepositoryIMockListMessagesExpectation specifies expectation struct of the RepositoryI.ListMessages +type RepositoryIMockListMessagesExpectation struct { + mock *RepositoryIMock + params *RepositoryIMockListMessagesParams + paramPtrs *RepositoryIMockListMessagesParamPtrs + results *RepositoryIMockListMessagesResults + Counter uint64 +} + +// RepositoryIMockListMessagesParams contains parameters of the RepositoryI.ListMessages +type RepositoryIMockListMessagesParams struct { + ctx context.Context + namespaceUID uuid.UUID + catalogUID uuid.UUID + conversationUID uuid.UUID + latestK int32 + pageSize int32 + pageToken string + includeSystemMessages bool +} + +// RepositoryIMockListMessagesParamPtrs contains pointers to parameters of the RepositoryI.ListMessages +type RepositoryIMockListMessagesParamPtrs struct { + ctx *context.Context + namespaceUID *uuid.UUID + catalogUID *uuid.UUID + conversationUID *uuid.UUID + latestK *int32 + pageSize *int32 + pageToken *string + includeSystemMessages *bool +} + +// RepositoryIMockListMessagesResults contains results of the RepositoryI.ListMessages +type RepositoryIMockListMessagesResults struct { + mpa1 []*mm_repository.Message + s1 string + i1 int64 + err error +} + +// Expect sets up expected params for RepositoryI.ListMessages +func (mmListMessages *mRepositoryIMockListMessages) Expect(ctx context.Context, namespaceUID uuid.UUID, catalogUID uuid.UUID, conversationUID uuid.UUID, latestK int32, pageSize int32, pageToken string, includeSystemMessages bool) *mRepositoryIMockListMessages { + if mmListMessages.mock.funcListMessages != nil { + mmListMessages.mock.t.Fatalf("RepositoryIMock.ListMessages mock is already set by Set") + } + + if mmListMessages.defaultExpectation == nil { + mmListMessages.defaultExpectation = &RepositoryIMockListMessagesExpectation{} + } + + if mmListMessages.defaultExpectation.paramPtrs != nil { + mmListMessages.mock.t.Fatalf("RepositoryIMock.ListMessages mock is already set by ExpectParams functions") + } + + mmListMessages.defaultExpectation.params = &RepositoryIMockListMessagesParams{ctx, namespaceUID, catalogUID, conversationUID, latestK, pageSize, pageToken, includeSystemMessages} + for _, e := range mmListMessages.expectations { + if minimock.Equal(e.params, mmListMessages.defaultExpectation.params) { + mmListMessages.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmListMessages.defaultExpectation.params) + } + } + + return mmListMessages +} + +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.ListMessages +func (mmListMessages *mRepositoryIMockListMessages) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockListMessages { + if mmListMessages.mock.funcListMessages != nil { + mmListMessages.mock.t.Fatalf("RepositoryIMock.ListMessages mock is already set by Set") + } + + if mmListMessages.defaultExpectation == nil { + mmListMessages.defaultExpectation = &RepositoryIMockListMessagesExpectation{} + } + + if mmListMessages.defaultExpectation.params != nil { + mmListMessages.mock.t.Fatalf("RepositoryIMock.ListMessages mock is already set by Expect") + } + + if mmListMessages.defaultExpectation.paramPtrs == nil { + mmListMessages.defaultExpectation.paramPtrs = &RepositoryIMockListMessagesParamPtrs{} + } + mmListMessages.defaultExpectation.paramPtrs.ctx = &ctx + + return mmListMessages +} + +// ExpectNamespaceUIDParam2 sets up expected param namespaceUID for RepositoryI.ListMessages +func (mmListMessages *mRepositoryIMockListMessages) ExpectNamespaceUIDParam2(namespaceUID uuid.UUID) *mRepositoryIMockListMessages { + if mmListMessages.mock.funcListMessages != nil { + mmListMessages.mock.t.Fatalf("RepositoryIMock.ListMessages mock is already set by Set") + } + + if mmListMessages.defaultExpectation == nil { + mmListMessages.defaultExpectation = &RepositoryIMockListMessagesExpectation{} + } + + if mmListMessages.defaultExpectation.params != nil { + mmListMessages.mock.t.Fatalf("RepositoryIMock.ListMessages mock is already set by Expect") + } + + if mmListMessages.defaultExpectation.paramPtrs == nil { + mmListMessages.defaultExpectation.paramPtrs = &RepositoryIMockListMessagesParamPtrs{} + } + mmListMessages.defaultExpectation.paramPtrs.namespaceUID = &namespaceUID + + return mmListMessages +} + +// ExpectCatalogUIDParam3 sets up expected param catalogUID for RepositoryI.ListMessages +func (mmListMessages *mRepositoryIMockListMessages) ExpectCatalogUIDParam3(catalogUID uuid.UUID) *mRepositoryIMockListMessages { + if mmListMessages.mock.funcListMessages != nil { + mmListMessages.mock.t.Fatalf("RepositoryIMock.ListMessages mock is already set by Set") + } + + if mmListMessages.defaultExpectation == nil { + mmListMessages.defaultExpectation = &RepositoryIMockListMessagesExpectation{} + } + + if mmListMessages.defaultExpectation.params != nil { + mmListMessages.mock.t.Fatalf("RepositoryIMock.ListMessages mock is already set by Expect") + } + + if mmListMessages.defaultExpectation.paramPtrs == nil { + mmListMessages.defaultExpectation.paramPtrs = &RepositoryIMockListMessagesParamPtrs{} + } + mmListMessages.defaultExpectation.paramPtrs.catalogUID = &catalogUID + + return mmListMessages +} + +// ExpectConversationUIDParam4 sets up expected param conversationUID for RepositoryI.ListMessages +func (mmListMessages *mRepositoryIMockListMessages) ExpectConversationUIDParam4(conversationUID uuid.UUID) *mRepositoryIMockListMessages { + if mmListMessages.mock.funcListMessages != nil { + mmListMessages.mock.t.Fatalf("RepositoryIMock.ListMessages mock is already set by Set") + } + + if mmListMessages.defaultExpectation == nil { + mmListMessages.defaultExpectation = &RepositoryIMockListMessagesExpectation{} + } + + if mmListMessages.defaultExpectation.params != nil { + mmListMessages.mock.t.Fatalf("RepositoryIMock.ListMessages mock is already set by Expect") + } + + if mmListMessages.defaultExpectation.paramPtrs == nil { + mmListMessages.defaultExpectation.paramPtrs = &RepositoryIMockListMessagesParamPtrs{} + } + mmListMessages.defaultExpectation.paramPtrs.conversationUID = &conversationUID + + return mmListMessages +} + +// ExpectLatestKParam5 sets up expected param latestK for RepositoryI.ListMessages +func (mmListMessages *mRepositoryIMockListMessages) ExpectLatestKParam5(latestK int32) *mRepositoryIMockListMessages { + if mmListMessages.mock.funcListMessages != nil { + mmListMessages.mock.t.Fatalf("RepositoryIMock.ListMessages mock is already set by Set") + } + + if mmListMessages.defaultExpectation == nil { + mmListMessages.defaultExpectation = &RepositoryIMockListMessagesExpectation{} + } + + if mmListMessages.defaultExpectation.params != nil { + mmListMessages.mock.t.Fatalf("RepositoryIMock.ListMessages mock is already set by Expect") + } + + if mmListMessages.defaultExpectation.paramPtrs == nil { + mmListMessages.defaultExpectation.paramPtrs = &RepositoryIMockListMessagesParamPtrs{} + } + mmListMessages.defaultExpectation.paramPtrs.latestK = &latestK + + return mmListMessages +} + +// ExpectPageSizeParam6 sets up expected param pageSize for RepositoryI.ListMessages +func (mmListMessages *mRepositoryIMockListMessages) ExpectPageSizeParam6(pageSize int32) *mRepositoryIMockListMessages { + if mmListMessages.mock.funcListMessages != nil { + mmListMessages.mock.t.Fatalf("RepositoryIMock.ListMessages mock is already set by Set") + } + + if mmListMessages.defaultExpectation == nil { + mmListMessages.defaultExpectation = &RepositoryIMockListMessagesExpectation{} + } + + if mmListMessages.defaultExpectation.params != nil { + mmListMessages.mock.t.Fatalf("RepositoryIMock.ListMessages mock is already set by Expect") + } + + if mmListMessages.defaultExpectation.paramPtrs == nil { + mmListMessages.defaultExpectation.paramPtrs = &RepositoryIMockListMessagesParamPtrs{} + } + mmListMessages.defaultExpectation.paramPtrs.pageSize = &pageSize + + return mmListMessages +} + +// ExpectPageTokenParam7 sets up expected param pageToken for RepositoryI.ListMessages +func (mmListMessages *mRepositoryIMockListMessages) ExpectPageTokenParam7(pageToken string) *mRepositoryIMockListMessages { + if mmListMessages.mock.funcListMessages != nil { + mmListMessages.mock.t.Fatalf("RepositoryIMock.ListMessages mock is already set by Set") + } + + if mmListMessages.defaultExpectation == nil { + mmListMessages.defaultExpectation = &RepositoryIMockListMessagesExpectation{} + } + + if mmListMessages.defaultExpectation.params != nil { + mmListMessages.mock.t.Fatalf("RepositoryIMock.ListMessages mock is already set by Expect") + } + + if mmListMessages.defaultExpectation.paramPtrs == nil { + mmListMessages.defaultExpectation.paramPtrs = &RepositoryIMockListMessagesParamPtrs{} + } + mmListMessages.defaultExpectation.paramPtrs.pageToken = &pageToken + + return mmListMessages +} + +// ExpectIncludeSystemMessagesParam8 sets up expected param includeSystemMessages for RepositoryI.ListMessages +func (mmListMessages *mRepositoryIMockListMessages) ExpectIncludeSystemMessagesParam8(includeSystemMessages bool) *mRepositoryIMockListMessages { + if mmListMessages.mock.funcListMessages != nil { + mmListMessages.mock.t.Fatalf("RepositoryIMock.ListMessages mock is already set by Set") + } + + if mmListMessages.defaultExpectation == nil { + mmListMessages.defaultExpectation = &RepositoryIMockListMessagesExpectation{} + } + + if mmListMessages.defaultExpectation.params != nil { + mmListMessages.mock.t.Fatalf("RepositoryIMock.ListMessages mock is already set by Expect") + } + + if mmListMessages.defaultExpectation.paramPtrs == nil { + mmListMessages.defaultExpectation.paramPtrs = &RepositoryIMockListMessagesParamPtrs{} + } + mmListMessages.defaultExpectation.paramPtrs.includeSystemMessages = &includeSystemMessages + + return mmListMessages +} + +// Inspect accepts an inspector function that has same arguments as the RepositoryI.ListMessages +func (mmListMessages *mRepositoryIMockListMessages) Inspect(f func(ctx context.Context, namespaceUID uuid.UUID, catalogUID uuid.UUID, conversationUID uuid.UUID, latestK int32, pageSize int32, pageToken string, includeSystemMessages bool)) *mRepositoryIMockListMessages { + if mmListMessages.mock.inspectFuncListMessages != nil { + mmListMessages.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.ListMessages") + } + + mmListMessages.mock.inspectFuncListMessages = f + + return mmListMessages +} + +// Return sets up results that will be returned by RepositoryI.ListMessages +func (mmListMessages *mRepositoryIMockListMessages) Return(mpa1 []*mm_repository.Message, s1 string, i1 int64, err error) *RepositoryIMock { + if mmListMessages.mock.funcListMessages != nil { + mmListMessages.mock.t.Fatalf("RepositoryIMock.ListMessages mock is already set by Set") + } + + if mmListMessages.defaultExpectation == nil { + mmListMessages.defaultExpectation = &RepositoryIMockListMessagesExpectation{mock: mmListMessages.mock} + } + mmListMessages.defaultExpectation.results = &RepositoryIMockListMessagesResults{mpa1, s1, i1, err} + return mmListMessages.mock +} + +// Set uses given function f to mock the RepositoryI.ListMessages method +func (mmListMessages *mRepositoryIMockListMessages) Set(f func(ctx context.Context, namespaceUID uuid.UUID, catalogUID uuid.UUID, conversationUID uuid.UUID, latestK int32, pageSize int32, pageToken string, includeSystemMessages bool) (mpa1 []*mm_repository.Message, s1 string, i1 int64, err error)) *RepositoryIMock { + if mmListMessages.defaultExpectation != nil { + mmListMessages.mock.t.Fatalf("Default expectation is already set for the RepositoryI.ListMessages method") + } + + if len(mmListMessages.expectations) > 0 { + mmListMessages.mock.t.Fatalf("Some expectations are already set for the RepositoryI.ListMessages method") + } + + mmListMessages.mock.funcListMessages = f + return mmListMessages.mock +} + +// When sets expectation for the RepositoryI.ListMessages which will trigger the result defined by the following +// Then helper +func (mmListMessages *mRepositoryIMockListMessages) When(ctx context.Context, namespaceUID uuid.UUID, catalogUID uuid.UUID, conversationUID uuid.UUID, latestK int32, pageSize int32, pageToken string, includeSystemMessages bool) *RepositoryIMockListMessagesExpectation { + if mmListMessages.mock.funcListMessages != nil { + mmListMessages.mock.t.Fatalf("RepositoryIMock.ListMessages mock is already set by Set") + } + + expectation := &RepositoryIMockListMessagesExpectation{ + mock: mmListMessages.mock, + params: &RepositoryIMockListMessagesParams{ctx, namespaceUID, catalogUID, conversationUID, latestK, pageSize, pageToken, includeSystemMessages}, + } + mmListMessages.expectations = append(mmListMessages.expectations, expectation) + return expectation +} + +// Then sets up RepositoryI.ListMessages return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockListMessagesExpectation) Then(mpa1 []*mm_repository.Message, s1 string, i1 int64, err error) *RepositoryIMock { + e.results = &RepositoryIMockListMessagesResults{mpa1, s1, i1, err} + return e.mock +} + +// Times sets number of times RepositoryI.ListMessages should be invoked +func (mmListMessages *mRepositoryIMockListMessages) Times(n uint64) *mRepositoryIMockListMessages { + if n == 0 { + mmListMessages.mock.t.Fatalf("Times of RepositoryIMock.ListMessages mock can not be zero") + } + mm_atomic.StoreUint64(&mmListMessages.expectedInvocations, n) + return mmListMessages +} + +func (mmListMessages *mRepositoryIMockListMessages) invocationsDone() bool { + if len(mmListMessages.expectations) == 0 && mmListMessages.defaultExpectation == nil && mmListMessages.mock.funcListMessages == nil { + return true + } + + totalInvocations := mm_atomic.LoadUint64(&mmListMessages.mock.afterListMessagesCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmListMessages.expectedInvocations) + + return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) +} + +// ListMessages implements repository.RepositoryI +func (mmListMessages *RepositoryIMock) ListMessages(ctx context.Context, namespaceUID uuid.UUID, catalogUID uuid.UUID, conversationUID uuid.UUID, latestK int32, pageSize int32, pageToken string, includeSystemMessages bool) (mpa1 []*mm_repository.Message, s1 string, i1 int64, err error) { + mm_atomic.AddUint64(&mmListMessages.beforeListMessagesCounter, 1) + defer mm_atomic.AddUint64(&mmListMessages.afterListMessagesCounter, 1) + + if mmListMessages.inspectFuncListMessages != nil { + mmListMessages.inspectFuncListMessages(ctx, namespaceUID, catalogUID, conversationUID, latestK, pageSize, pageToken, includeSystemMessages) + } + + mm_params := RepositoryIMockListMessagesParams{ctx, namespaceUID, catalogUID, conversationUID, latestK, pageSize, pageToken, includeSystemMessages} + + // Record call args + mmListMessages.ListMessagesMock.mutex.Lock() + mmListMessages.ListMessagesMock.callArgs = append(mmListMessages.ListMessagesMock.callArgs, &mm_params) + mmListMessages.ListMessagesMock.mutex.Unlock() + + for _, e := range mmListMessages.ListMessagesMock.expectations { + if minimock.Equal(*e.params, mm_params) { + mm_atomic.AddUint64(&e.Counter, 1) + return e.results.mpa1, e.results.s1, e.results.i1, e.results.err + } + } + + if mmListMessages.ListMessagesMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmListMessages.ListMessagesMock.defaultExpectation.Counter, 1) + mm_want := mmListMessages.ListMessagesMock.defaultExpectation.params + mm_want_ptrs := mmListMessages.ListMessagesMock.defaultExpectation.paramPtrs + + mm_got := RepositoryIMockListMessagesParams{ctx, namespaceUID, catalogUID, conversationUID, latestK, pageSize, pageToken, includeSystemMessages} + + if mm_want_ptrs != nil { + + if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { + mmListMessages.t.Errorf("RepositoryIMock.ListMessages 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.namespaceUID != nil && !minimock.Equal(*mm_want_ptrs.namespaceUID, mm_got.namespaceUID) { + mmListMessages.t.Errorf("RepositoryIMock.ListMessages got unexpected parameter namespaceUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.namespaceUID, mm_got.namespaceUID, minimock.Diff(*mm_want_ptrs.namespaceUID, mm_got.namespaceUID)) + } + + if mm_want_ptrs.catalogUID != nil && !minimock.Equal(*mm_want_ptrs.catalogUID, mm_got.catalogUID) { + mmListMessages.t.Errorf("RepositoryIMock.ListMessages got unexpected parameter catalogUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.catalogUID, mm_got.catalogUID, minimock.Diff(*mm_want_ptrs.catalogUID, mm_got.catalogUID)) + } + + if mm_want_ptrs.conversationUID != nil && !minimock.Equal(*mm_want_ptrs.conversationUID, mm_got.conversationUID) { + mmListMessages.t.Errorf("RepositoryIMock.ListMessages got unexpected parameter conversationUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.conversationUID, mm_got.conversationUID, minimock.Diff(*mm_want_ptrs.conversationUID, mm_got.conversationUID)) + } + + if mm_want_ptrs.latestK != nil && !minimock.Equal(*mm_want_ptrs.latestK, mm_got.latestK) { + mmListMessages.t.Errorf("RepositoryIMock.ListMessages got unexpected parameter latestK, want: %#v, got: %#v%s\n", *mm_want_ptrs.latestK, mm_got.latestK, minimock.Diff(*mm_want_ptrs.latestK, mm_got.latestK)) + } + + if mm_want_ptrs.pageSize != nil && !minimock.Equal(*mm_want_ptrs.pageSize, mm_got.pageSize) { + mmListMessages.t.Errorf("RepositoryIMock.ListMessages got unexpected parameter pageSize, want: %#v, got: %#v%s\n", *mm_want_ptrs.pageSize, mm_got.pageSize, minimock.Diff(*mm_want_ptrs.pageSize, mm_got.pageSize)) + } + + if mm_want_ptrs.pageToken != nil && !minimock.Equal(*mm_want_ptrs.pageToken, mm_got.pageToken) { + mmListMessages.t.Errorf("RepositoryIMock.ListMessages got unexpected parameter pageToken, want: %#v, got: %#v%s\n", *mm_want_ptrs.pageToken, mm_got.pageToken, minimock.Diff(*mm_want_ptrs.pageToken, mm_got.pageToken)) + } + + if mm_want_ptrs.includeSystemMessages != nil && !minimock.Equal(*mm_want_ptrs.includeSystemMessages, mm_got.includeSystemMessages) { + mmListMessages.t.Errorf("RepositoryIMock.ListMessages got unexpected parameter includeSystemMessages, want: %#v, got: %#v%s\n", *mm_want_ptrs.includeSystemMessages, mm_got.includeSystemMessages, minimock.Diff(*mm_want_ptrs.includeSystemMessages, mm_got.includeSystemMessages)) + } + + } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { + mmListMessages.t.Errorf("RepositoryIMock.ListMessages got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + } + + mm_results := mmListMessages.ListMessagesMock.defaultExpectation.results + if mm_results == nil { + mmListMessages.t.Fatal("No results are set for the RepositoryIMock.ListMessages") + } + return (*mm_results).mpa1, (*mm_results).s1, (*mm_results).i1, (*mm_results).err + } + if mmListMessages.funcListMessages != nil { + return mmListMessages.funcListMessages(ctx, namespaceUID, catalogUID, conversationUID, latestK, pageSize, pageToken, includeSystemMessages) + } + mmListMessages.t.Fatalf("Unexpected call to RepositoryIMock.ListMessages. %v %v %v %v %v %v %v %v", ctx, namespaceUID, catalogUID, conversationUID, latestK, pageSize, pageToken, includeSystemMessages) + return +} + +// ListMessagesAfterCounter returns a count of finished RepositoryIMock.ListMessages invocations +func (mmListMessages *RepositoryIMock) ListMessagesAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmListMessages.afterListMessagesCounter) +} + +// ListMessagesBeforeCounter returns a count of RepositoryIMock.ListMessages invocations +func (mmListMessages *RepositoryIMock) ListMessagesBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmListMessages.beforeListMessagesCounter) +} + +// Calls returns a list of arguments used in each call to RepositoryIMock.ListMessages. +// The list is in the same order as the calls were made (i.e. recent calls have a higher index) +func (mmListMessages *mRepositoryIMockListMessages) Calls() []*RepositoryIMockListMessagesParams { + mmListMessages.mutex.RLock() + + argCopy := make([]*RepositoryIMockListMessagesParams, len(mmListMessages.callArgs)) + copy(argCopy, mmListMessages.callArgs) + + mmListMessages.mutex.RUnlock() + + return argCopy +} + +// MinimockListMessagesDone returns true if the count of the ListMessages invocations corresponds +// the number of defined expectations +func (m *RepositoryIMock) MinimockListMessagesDone() bool { + for _, e := range m.ListMessagesMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + return false + } + } + + return m.ListMessagesMock.invocationsDone() +} + +// MinimockListMessagesInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockListMessagesInspect() { + for _, e := range m.ListMessagesMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + m.t.Errorf("Expected call to RepositoryIMock.ListMessages with params: %#v", *e.params) + } + } + + afterListMessagesCounter := mm_atomic.LoadUint64(&m.afterListMessagesCounter) + // if default expectation was set then invocations count should be greater than zero + if m.ListMessagesMock.defaultExpectation != nil && afterListMessagesCounter < 1 { + if m.ListMessagesMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.ListMessages") + } else { + m.t.Errorf("Expected call to RepositoryIMock.ListMessages with params: %#v", *m.ListMessagesMock.defaultExpectation.params) + } + } + // if func was set then invocations count should be greater than zero + if m.funcListMessages != nil && afterListMessagesCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.ListMessages") + } + + if !m.ListMessagesMock.invocationsDone() && afterListMessagesCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.ListMessages but found %d calls", + mm_atomic.LoadUint64(&m.ListMessagesMock.expectedInvocations), afterListMessagesCounter) + } +} + +type mRepositoryIMockMessageTableName struct { + mock *RepositoryIMock + defaultExpectation *RepositoryIMockMessageTableNameExpectation + expectations []*RepositoryIMockMessageTableNameExpectation + + expectedInvocations uint64 +} + +// RepositoryIMockMessageTableNameExpectation specifies expectation struct of the RepositoryI.MessageTableName +type RepositoryIMockMessageTableNameExpectation struct { + mock *RepositoryIMock + + results *RepositoryIMockMessageTableNameResults + Counter uint64 +} + +// RepositoryIMockMessageTableNameResults contains results of the RepositoryI.MessageTableName +type RepositoryIMockMessageTableNameResults struct { + s1 string +} + +// Expect sets up expected params for RepositoryI.MessageTableName +func (mmMessageTableName *mRepositoryIMockMessageTableName) Expect() *mRepositoryIMockMessageTableName { + if mmMessageTableName.mock.funcMessageTableName != nil { + mmMessageTableName.mock.t.Fatalf("RepositoryIMock.MessageTableName mock is already set by Set") + } + + if mmMessageTableName.defaultExpectation == nil { + mmMessageTableName.defaultExpectation = &RepositoryIMockMessageTableNameExpectation{} + } + + return mmMessageTableName +} + +// Inspect accepts an inspector function that has same arguments as the RepositoryI.MessageTableName +func (mmMessageTableName *mRepositoryIMockMessageTableName) Inspect(f func()) *mRepositoryIMockMessageTableName { + if mmMessageTableName.mock.inspectFuncMessageTableName != nil { + mmMessageTableName.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.MessageTableName") + } + + mmMessageTableName.mock.inspectFuncMessageTableName = f + + return mmMessageTableName +} + +// Return sets up results that will be returned by RepositoryI.MessageTableName +func (mmMessageTableName *mRepositoryIMockMessageTableName) Return(s1 string) *RepositoryIMock { + if mmMessageTableName.mock.funcMessageTableName != nil { + mmMessageTableName.mock.t.Fatalf("RepositoryIMock.MessageTableName mock is already set by Set") + } + + if mmMessageTableName.defaultExpectation == nil { + mmMessageTableName.defaultExpectation = &RepositoryIMockMessageTableNameExpectation{mock: mmMessageTableName.mock} + } + mmMessageTableName.defaultExpectation.results = &RepositoryIMockMessageTableNameResults{s1} + return mmMessageTableName.mock +} + +// Set uses given function f to mock the RepositoryI.MessageTableName method +func (mmMessageTableName *mRepositoryIMockMessageTableName) Set(f func() (s1 string)) *RepositoryIMock { + if mmMessageTableName.defaultExpectation != nil { + mmMessageTableName.mock.t.Fatalf("Default expectation is already set for the RepositoryI.MessageTableName method") + } + + if len(mmMessageTableName.expectations) > 0 { + mmMessageTableName.mock.t.Fatalf("Some expectations are already set for the RepositoryI.MessageTableName method") + } + + mmMessageTableName.mock.funcMessageTableName = f + return mmMessageTableName.mock +} + +// Times sets number of times RepositoryI.MessageTableName should be invoked +func (mmMessageTableName *mRepositoryIMockMessageTableName) Times(n uint64) *mRepositoryIMockMessageTableName { + if n == 0 { + mmMessageTableName.mock.t.Fatalf("Times of RepositoryIMock.MessageTableName mock can not be zero") + } + mm_atomic.StoreUint64(&mmMessageTableName.expectedInvocations, n) + return mmMessageTableName +} + +func (mmMessageTableName *mRepositoryIMockMessageTableName) invocationsDone() bool { + if len(mmMessageTableName.expectations) == 0 && mmMessageTableName.defaultExpectation == nil && mmMessageTableName.mock.funcMessageTableName == nil { + return true + } + + totalInvocations := mm_atomic.LoadUint64(&mmMessageTableName.mock.afterMessageTableNameCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmMessageTableName.expectedInvocations) + + return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) +} + +// MessageTableName implements repository.RepositoryI +func (mmMessageTableName *RepositoryIMock) MessageTableName() (s1 string) { + mm_atomic.AddUint64(&mmMessageTableName.beforeMessageTableNameCounter, 1) + defer mm_atomic.AddUint64(&mmMessageTableName.afterMessageTableNameCounter, 1) + + if mmMessageTableName.inspectFuncMessageTableName != nil { + mmMessageTableName.inspectFuncMessageTableName() + } + + if mmMessageTableName.MessageTableNameMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmMessageTableName.MessageTableNameMock.defaultExpectation.Counter, 1) + + mm_results := mmMessageTableName.MessageTableNameMock.defaultExpectation.results + if mm_results == nil { + mmMessageTableName.t.Fatal("No results are set for the RepositoryIMock.MessageTableName") + } + return (*mm_results).s1 + } + if mmMessageTableName.funcMessageTableName != nil { + return mmMessageTableName.funcMessageTableName() + } + mmMessageTableName.t.Fatalf("Unexpected call to RepositoryIMock.MessageTableName.") + return +} + +// MessageTableNameAfterCounter returns a count of finished RepositoryIMock.MessageTableName invocations +func (mmMessageTableName *RepositoryIMock) MessageTableNameAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmMessageTableName.afterMessageTableNameCounter) +} + +// MessageTableNameBeforeCounter returns a count of RepositoryIMock.MessageTableName invocations +func (mmMessageTableName *RepositoryIMock) MessageTableNameBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmMessageTableName.beforeMessageTableNameCounter) +} + +// MinimockMessageTableNameDone returns true if the count of the MessageTableName invocations corresponds +// the number of defined expectations +func (m *RepositoryIMock) MinimockMessageTableNameDone() bool { + for _, e := range m.MessageTableNameMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + return false + } + } + + return m.MessageTableNameMock.invocationsDone() +} + +// MinimockMessageTableNameInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockMessageTableNameInspect() { + for _, e := range m.MessageTableNameMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + m.t.Error("Expected call to RepositoryIMock.MessageTableName") + } + } + + afterMessageTableNameCounter := mm_atomic.LoadUint64(&m.afterMessageTableNameCounter) + // if default expectation was set then invocations count should be greater than zero + if m.MessageTableNameMock.defaultExpectation != nil && afterMessageTableNameCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.MessageTableName") + } + // if func was set then invocations count should be greater than zero + if m.funcMessageTableName != nil && afterMessageTableNameCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.MessageTableName") + } + + if !m.MessageTableNameMock.invocationsDone() && afterMessageTableNameCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.MessageTableName but found %d calls", + mm_atomic.LoadUint64(&m.MessageTableNameMock.expectedInvocations), afterMessageTableNameCounter) + } +} + +type mRepositoryIMockProcessKnowledgeBaseFiles struct { + mock *RepositoryIMock + defaultExpectation *RepositoryIMockProcessKnowledgeBaseFilesExpectation + expectations []*RepositoryIMockProcessKnowledgeBaseFilesExpectation + + callArgs []*RepositoryIMockProcessKnowledgeBaseFilesParams + mutex sync.RWMutex + + expectedInvocations uint64 +} + +// RepositoryIMockProcessKnowledgeBaseFilesExpectation specifies expectation struct of the RepositoryI.ProcessKnowledgeBaseFiles +type RepositoryIMockProcessKnowledgeBaseFilesExpectation struct { + mock *RepositoryIMock + params *RepositoryIMockProcessKnowledgeBaseFilesParams + paramPtrs *RepositoryIMockProcessKnowledgeBaseFilesParamPtrs + results *RepositoryIMockProcessKnowledgeBaseFilesResults + Counter uint64 +} + +// RepositoryIMockProcessKnowledgeBaseFilesParams contains parameters of the RepositoryI.ProcessKnowledgeBaseFiles +type RepositoryIMockProcessKnowledgeBaseFilesParams struct { + ctx context.Context + fileUIDs []string + requester uuid.UUID +} + +// RepositoryIMockProcessKnowledgeBaseFilesParamPtrs contains pointers to parameters of the RepositoryI.ProcessKnowledgeBaseFiles +type RepositoryIMockProcessKnowledgeBaseFilesParamPtrs struct { + ctx *context.Context + fileUIDs *[]string + requester *uuid.UUID +} + +// RepositoryIMockProcessKnowledgeBaseFilesResults contains results of the RepositoryI.ProcessKnowledgeBaseFiles +type RepositoryIMockProcessKnowledgeBaseFilesResults struct { + ka1 []mm_repository.KnowledgeBaseFile + err error +} + +// Expect sets up expected params for RepositoryI.ProcessKnowledgeBaseFiles +func (mmProcessKnowledgeBaseFiles *mRepositoryIMockProcessKnowledgeBaseFiles) Expect(ctx context.Context, fileUIDs []string, requester uuid.UUID) *mRepositoryIMockProcessKnowledgeBaseFiles { + if mmProcessKnowledgeBaseFiles.mock.funcProcessKnowledgeBaseFiles != nil { + mmProcessKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ProcessKnowledgeBaseFiles mock is already set by Set") + } + + if mmProcessKnowledgeBaseFiles.defaultExpectation == nil { + mmProcessKnowledgeBaseFiles.defaultExpectation = &RepositoryIMockProcessKnowledgeBaseFilesExpectation{} + } + + if mmProcessKnowledgeBaseFiles.defaultExpectation.paramPtrs != nil { + mmProcessKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ProcessKnowledgeBaseFiles mock is already set by ExpectParams functions") + } + + mmProcessKnowledgeBaseFiles.defaultExpectation.params = &RepositoryIMockProcessKnowledgeBaseFilesParams{ctx, fileUIDs, requester} + for _, e := range mmProcessKnowledgeBaseFiles.expectations { + if minimock.Equal(e.params, mmProcessKnowledgeBaseFiles.defaultExpectation.params) { + mmProcessKnowledgeBaseFiles.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmProcessKnowledgeBaseFiles.defaultExpectation.params) + } + } + + return mmProcessKnowledgeBaseFiles +} + +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.ProcessKnowledgeBaseFiles +func (mmProcessKnowledgeBaseFiles *mRepositoryIMockProcessKnowledgeBaseFiles) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockProcessKnowledgeBaseFiles { + if mmProcessKnowledgeBaseFiles.mock.funcProcessKnowledgeBaseFiles != nil { + mmProcessKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ProcessKnowledgeBaseFiles mock is already set by Set") + } + + if mmProcessKnowledgeBaseFiles.defaultExpectation == nil { + mmProcessKnowledgeBaseFiles.defaultExpectation = &RepositoryIMockProcessKnowledgeBaseFilesExpectation{} + } + + if mmProcessKnowledgeBaseFiles.defaultExpectation.params != nil { + mmProcessKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ProcessKnowledgeBaseFiles mock is already set by Expect") + } + + if mmProcessKnowledgeBaseFiles.defaultExpectation.paramPtrs == nil { + mmProcessKnowledgeBaseFiles.defaultExpectation.paramPtrs = &RepositoryIMockProcessKnowledgeBaseFilesParamPtrs{} + } + mmProcessKnowledgeBaseFiles.defaultExpectation.paramPtrs.ctx = &ctx + + return mmProcessKnowledgeBaseFiles +} + +// ExpectFileUIDsParam2 sets up expected param fileUIDs for RepositoryI.ProcessKnowledgeBaseFiles +func (mmProcessKnowledgeBaseFiles *mRepositoryIMockProcessKnowledgeBaseFiles) ExpectFileUIDsParam2(fileUIDs []string) *mRepositoryIMockProcessKnowledgeBaseFiles { + if mmProcessKnowledgeBaseFiles.mock.funcProcessKnowledgeBaseFiles != nil { + mmProcessKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ProcessKnowledgeBaseFiles mock is already set by Set") + } + + if mmProcessKnowledgeBaseFiles.defaultExpectation == nil { + mmProcessKnowledgeBaseFiles.defaultExpectation = &RepositoryIMockProcessKnowledgeBaseFilesExpectation{} + } + + if mmProcessKnowledgeBaseFiles.defaultExpectation.params != nil { + mmProcessKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ProcessKnowledgeBaseFiles mock is already set by Expect") + } + + if mmProcessKnowledgeBaseFiles.defaultExpectation.paramPtrs == nil { + mmProcessKnowledgeBaseFiles.defaultExpectation.paramPtrs = &RepositoryIMockProcessKnowledgeBaseFilesParamPtrs{} + } + mmProcessKnowledgeBaseFiles.defaultExpectation.paramPtrs.fileUIDs = &fileUIDs + + return mmProcessKnowledgeBaseFiles +} + +// ExpectRequesterParam3 sets up expected param requester for RepositoryI.ProcessKnowledgeBaseFiles +func (mmProcessKnowledgeBaseFiles *mRepositoryIMockProcessKnowledgeBaseFiles) ExpectRequesterParam3(requester uuid.UUID) *mRepositoryIMockProcessKnowledgeBaseFiles { + if mmProcessKnowledgeBaseFiles.mock.funcProcessKnowledgeBaseFiles != nil { + mmProcessKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ProcessKnowledgeBaseFiles mock is already set by Set") + } + + if mmProcessKnowledgeBaseFiles.defaultExpectation == nil { + mmProcessKnowledgeBaseFiles.defaultExpectation = &RepositoryIMockProcessKnowledgeBaseFilesExpectation{} + } + + if mmProcessKnowledgeBaseFiles.defaultExpectation.params != nil { + mmProcessKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ProcessKnowledgeBaseFiles mock is already set by Expect") + } + + if mmProcessKnowledgeBaseFiles.defaultExpectation.paramPtrs == nil { + mmProcessKnowledgeBaseFiles.defaultExpectation.paramPtrs = &RepositoryIMockProcessKnowledgeBaseFilesParamPtrs{} + } + mmProcessKnowledgeBaseFiles.defaultExpectation.paramPtrs.requester = &requester + + return mmProcessKnowledgeBaseFiles +} + +// Inspect accepts an inspector function that has same arguments as the RepositoryI.ProcessKnowledgeBaseFiles +func (mmProcessKnowledgeBaseFiles *mRepositoryIMockProcessKnowledgeBaseFiles) Inspect(f func(ctx context.Context, fileUIDs []string, requester uuid.UUID)) *mRepositoryIMockProcessKnowledgeBaseFiles { + if mmProcessKnowledgeBaseFiles.mock.inspectFuncProcessKnowledgeBaseFiles != nil { + mmProcessKnowledgeBaseFiles.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.ProcessKnowledgeBaseFiles") + } + + mmProcessKnowledgeBaseFiles.mock.inspectFuncProcessKnowledgeBaseFiles = f + + return mmProcessKnowledgeBaseFiles +} + +// Return sets up results that will be returned by RepositoryI.ProcessKnowledgeBaseFiles +func (mmProcessKnowledgeBaseFiles *mRepositoryIMockProcessKnowledgeBaseFiles) Return(ka1 []mm_repository.KnowledgeBaseFile, err error) *RepositoryIMock { + if mmProcessKnowledgeBaseFiles.mock.funcProcessKnowledgeBaseFiles != nil { + mmProcessKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ProcessKnowledgeBaseFiles mock is already set by Set") + } + + if mmProcessKnowledgeBaseFiles.defaultExpectation == nil { + mmProcessKnowledgeBaseFiles.defaultExpectation = &RepositoryIMockProcessKnowledgeBaseFilesExpectation{mock: mmProcessKnowledgeBaseFiles.mock} + } + mmProcessKnowledgeBaseFiles.defaultExpectation.results = &RepositoryIMockProcessKnowledgeBaseFilesResults{ka1, err} + return mmProcessKnowledgeBaseFiles.mock +} + +// Set uses given function f to mock the RepositoryI.ProcessKnowledgeBaseFiles method +func (mmProcessKnowledgeBaseFiles *mRepositoryIMockProcessKnowledgeBaseFiles) Set(f func(ctx context.Context, fileUIDs []string, requester uuid.UUID) (ka1 []mm_repository.KnowledgeBaseFile, err error)) *RepositoryIMock { + if mmProcessKnowledgeBaseFiles.defaultExpectation != nil { + mmProcessKnowledgeBaseFiles.mock.t.Fatalf("Default expectation is already set for the RepositoryI.ProcessKnowledgeBaseFiles method") + } + + if len(mmProcessKnowledgeBaseFiles.expectations) > 0 { + mmProcessKnowledgeBaseFiles.mock.t.Fatalf("Some expectations are already set for the RepositoryI.ProcessKnowledgeBaseFiles method") + } + + mmProcessKnowledgeBaseFiles.mock.funcProcessKnowledgeBaseFiles = f + return mmProcessKnowledgeBaseFiles.mock +} + +// When sets expectation for the RepositoryI.ProcessKnowledgeBaseFiles which will trigger the result defined by the following +// Then helper +func (mmProcessKnowledgeBaseFiles *mRepositoryIMockProcessKnowledgeBaseFiles) When(ctx context.Context, fileUIDs []string, requester uuid.UUID) *RepositoryIMockProcessKnowledgeBaseFilesExpectation { + if mmProcessKnowledgeBaseFiles.mock.funcProcessKnowledgeBaseFiles != nil { + mmProcessKnowledgeBaseFiles.mock.t.Fatalf("RepositoryIMock.ProcessKnowledgeBaseFiles mock is already set by Set") + } + + expectation := &RepositoryIMockProcessKnowledgeBaseFilesExpectation{ + mock: mmProcessKnowledgeBaseFiles.mock, + params: &RepositoryIMockProcessKnowledgeBaseFilesParams{ctx, fileUIDs, requester}, + } + mmProcessKnowledgeBaseFiles.expectations = append(mmProcessKnowledgeBaseFiles.expectations, expectation) + return expectation +} + +// Then sets up RepositoryI.ProcessKnowledgeBaseFiles return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockProcessKnowledgeBaseFilesExpectation) Then(ka1 []mm_repository.KnowledgeBaseFile, err error) *RepositoryIMock { + e.results = &RepositoryIMockProcessKnowledgeBaseFilesResults{ka1, err} + return e.mock +} + +// Times sets number of times RepositoryI.ProcessKnowledgeBaseFiles should be invoked +func (mmProcessKnowledgeBaseFiles *mRepositoryIMockProcessKnowledgeBaseFiles) Times(n uint64) *mRepositoryIMockProcessKnowledgeBaseFiles { + if n == 0 { + mmProcessKnowledgeBaseFiles.mock.t.Fatalf("Times of RepositoryIMock.ProcessKnowledgeBaseFiles mock can not be zero") + } + mm_atomic.StoreUint64(&mmProcessKnowledgeBaseFiles.expectedInvocations, n) + return mmProcessKnowledgeBaseFiles +} + +func (mmProcessKnowledgeBaseFiles *mRepositoryIMockProcessKnowledgeBaseFiles) invocationsDone() bool { + if len(mmProcessKnowledgeBaseFiles.expectations) == 0 && mmProcessKnowledgeBaseFiles.defaultExpectation == nil && mmProcessKnowledgeBaseFiles.mock.funcProcessKnowledgeBaseFiles == nil { + return true + } + + totalInvocations := mm_atomic.LoadUint64(&mmProcessKnowledgeBaseFiles.mock.afterProcessKnowledgeBaseFilesCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmProcessKnowledgeBaseFiles.expectedInvocations) + + return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) +} + +// ProcessKnowledgeBaseFiles implements repository.RepositoryI +func (mmProcessKnowledgeBaseFiles *RepositoryIMock) ProcessKnowledgeBaseFiles(ctx context.Context, fileUIDs []string, requester uuid.UUID) (ka1 []mm_repository.KnowledgeBaseFile, err error) { + mm_atomic.AddUint64(&mmProcessKnowledgeBaseFiles.beforeProcessKnowledgeBaseFilesCounter, 1) + defer mm_atomic.AddUint64(&mmProcessKnowledgeBaseFiles.afterProcessKnowledgeBaseFilesCounter, 1) + + if mmProcessKnowledgeBaseFiles.inspectFuncProcessKnowledgeBaseFiles != nil { + mmProcessKnowledgeBaseFiles.inspectFuncProcessKnowledgeBaseFiles(ctx, fileUIDs, requester) + } + + mm_params := RepositoryIMockProcessKnowledgeBaseFilesParams{ctx, fileUIDs, requester} + + // Record call args + mmProcessKnowledgeBaseFiles.ProcessKnowledgeBaseFilesMock.mutex.Lock() + mmProcessKnowledgeBaseFiles.ProcessKnowledgeBaseFilesMock.callArgs = append(mmProcessKnowledgeBaseFiles.ProcessKnowledgeBaseFilesMock.callArgs, &mm_params) + mmProcessKnowledgeBaseFiles.ProcessKnowledgeBaseFilesMock.mutex.Unlock() + + for _, e := range mmProcessKnowledgeBaseFiles.ProcessKnowledgeBaseFilesMock.expectations { + if minimock.Equal(*e.params, mm_params) { + mm_atomic.AddUint64(&e.Counter, 1) + return e.results.ka1, e.results.err + } + } + + if mmProcessKnowledgeBaseFiles.ProcessKnowledgeBaseFilesMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmProcessKnowledgeBaseFiles.ProcessKnowledgeBaseFilesMock.defaultExpectation.Counter, 1) + mm_want := mmProcessKnowledgeBaseFiles.ProcessKnowledgeBaseFilesMock.defaultExpectation.params + mm_want_ptrs := mmProcessKnowledgeBaseFiles.ProcessKnowledgeBaseFilesMock.defaultExpectation.paramPtrs + + mm_got := RepositoryIMockProcessKnowledgeBaseFilesParams{ctx, fileUIDs, requester} + + if mm_want_ptrs != nil { + + if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { + mmProcessKnowledgeBaseFiles.t.Errorf("RepositoryIMock.ProcessKnowledgeBaseFiles 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) { + mmProcessKnowledgeBaseFiles.t.Errorf("RepositoryIMock.ProcessKnowledgeBaseFiles 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.requester != nil && !minimock.Equal(*mm_want_ptrs.requester, mm_got.requester) { + mmProcessKnowledgeBaseFiles.t.Errorf("RepositoryIMock.ProcessKnowledgeBaseFiles got unexpected parameter requester, want: %#v, got: %#v%s\n", *mm_want_ptrs.requester, mm_got.requester, minimock.Diff(*mm_want_ptrs.requester, mm_got.requester)) + } + + } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { + mmProcessKnowledgeBaseFiles.t.Errorf("RepositoryIMock.ProcessKnowledgeBaseFiles got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + } + + mm_results := mmProcessKnowledgeBaseFiles.ProcessKnowledgeBaseFilesMock.defaultExpectation.results + if mm_results == nil { + mmProcessKnowledgeBaseFiles.t.Fatal("No results are set for the RepositoryIMock.ProcessKnowledgeBaseFiles") + } + return (*mm_results).ka1, (*mm_results).err + } + if mmProcessKnowledgeBaseFiles.funcProcessKnowledgeBaseFiles != nil { + return mmProcessKnowledgeBaseFiles.funcProcessKnowledgeBaseFiles(ctx, fileUIDs, requester) + } + mmProcessKnowledgeBaseFiles.t.Fatalf("Unexpected call to RepositoryIMock.ProcessKnowledgeBaseFiles. %v %v %v", ctx, fileUIDs, requester) + return +} + +// ProcessKnowledgeBaseFilesAfterCounter returns a count of finished RepositoryIMock.ProcessKnowledgeBaseFiles invocations +func (mmProcessKnowledgeBaseFiles *RepositoryIMock) ProcessKnowledgeBaseFilesAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmProcessKnowledgeBaseFiles.afterProcessKnowledgeBaseFilesCounter) +} + +// ProcessKnowledgeBaseFilesBeforeCounter returns a count of RepositoryIMock.ProcessKnowledgeBaseFiles invocations +func (mmProcessKnowledgeBaseFiles *RepositoryIMock) ProcessKnowledgeBaseFilesBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmProcessKnowledgeBaseFiles.beforeProcessKnowledgeBaseFilesCounter) +} + +// Calls returns a list of arguments used in each call to RepositoryIMock.ProcessKnowledgeBaseFiles. +// The list is in the same order as the calls were made (i.e. recent calls have a higher index) +func (mmProcessKnowledgeBaseFiles *mRepositoryIMockProcessKnowledgeBaseFiles) Calls() []*RepositoryIMockProcessKnowledgeBaseFilesParams { + mmProcessKnowledgeBaseFiles.mutex.RLock() + + argCopy := make([]*RepositoryIMockProcessKnowledgeBaseFilesParams, len(mmProcessKnowledgeBaseFiles.callArgs)) + copy(argCopy, mmProcessKnowledgeBaseFiles.callArgs) + + mmProcessKnowledgeBaseFiles.mutex.RUnlock() + + return argCopy +} + +// MinimockProcessKnowledgeBaseFilesDone returns true if the count of the ProcessKnowledgeBaseFiles invocations corresponds +// the number of defined expectations +func (m *RepositoryIMock) MinimockProcessKnowledgeBaseFilesDone() bool { + for _, e := range m.ProcessKnowledgeBaseFilesMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + return false + } + } + + return m.ProcessKnowledgeBaseFilesMock.invocationsDone() +} + +// MinimockProcessKnowledgeBaseFilesInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockProcessKnowledgeBaseFilesInspect() { + for _, e := range m.ProcessKnowledgeBaseFilesMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + m.t.Errorf("Expected call to RepositoryIMock.ProcessKnowledgeBaseFiles with params: %#v", *e.params) + } + } + + afterProcessKnowledgeBaseFilesCounter := mm_atomic.LoadUint64(&m.afterProcessKnowledgeBaseFilesCounter) + // if default expectation was set then invocations count should be greater than zero + if m.ProcessKnowledgeBaseFilesMock.defaultExpectation != nil && afterProcessKnowledgeBaseFilesCounter < 1 { + if m.ProcessKnowledgeBaseFilesMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.ProcessKnowledgeBaseFiles") + } else { + m.t.Errorf("Expected call to RepositoryIMock.ProcessKnowledgeBaseFiles with params: %#v", *m.ProcessKnowledgeBaseFilesMock.defaultExpectation.params) + } + } + // if func was set then invocations count should be greater than zero + if m.funcProcessKnowledgeBaseFiles != nil && afterProcessKnowledgeBaseFilesCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.ProcessKnowledgeBaseFiles") + } + + if !m.ProcessKnowledgeBaseFilesMock.invocationsDone() && afterProcessKnowledgeBaseFilesCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.ProcessKnowledgeBaseFiles but found %d calls", + mm_atomic.LoadUint64(&m.ProcessKnowledgeBaseFilesMock.expectedInvocations), afterProcessKnowledgeBaseFilesCounter) + } +} + +type mRepositoryIMockSoftDeleteConversation struct { + mock *RepositoryIMock + defaultExpectation *RepositoryIMockSoftDeleteConversationExpectation + expectations []*RepositoryIMockSoftDeleteConversationExpectation + + callArgs []*RepositoryIMockSoftDeleteConversationParams + mutex sync.RWMutex + + expectedInvocations uint64 +} + +// RepositoryIMockSoftDeleteConversationExpectation specifies expectation struct of the RepositoryI.SoftDeleteConversation +type RepositoryIMockSoftDeleteConversationExpectation struct { + mock *RepositoryIMock + params *RepositoryIMockSoftDeleteConversationParams + paramPtrs *RepositoryIMockSoftDeleteConversationParamPtrs + results *RepositoryIMockSoftDeleteConversationResults + Counter uint64 +} + +// RepositoryIMockSoftDeleteConversationParams contains parameters of the RepositoryI.SoftDeleteConversation +type RepositoryIMockSoftDeleteConversationParams struct { + ctx context.Context + namespaceUID uuid.UUID + catalogUID uuid.UUID + conversationID string +} + +// RepositoryIMockSoftDeleteConversationParamPtrs contains pointers to parameters of the RepositoryI.SoftDeleteConversation +type RepositoryIMockSoftDeleteConversationParamPtrs struct { + ctx *context.Context + namespaceUID *uuid.UUID + catalogUID *uuid.UUID + conversationID *string +} + +// RepositoryIMockSoftDeleteConversationResults contains results of the RepositoryI.SoftDeleteConversation +type RepositoryIMockSoftDeleteConversationResults struct { + err error +} + +// Expect sets up expected params for RepositoryI.SoftDeleteConversation +func (mmSoftDeleteConversation *mRepositoryIMockSoftDeleteConversation) Expect(ctx context.Context, namespaceUID uuid.UUID, catalogUID uuid.UUID, conversationID string) *mRepositoryIMockSoftDeleteConversation { + if mmSoftDeleteConversation.mock.funcSoftDeleteConversation != nil { + mmSoftDeleteConversation.mock.t.Fatalf("RepositoryIMock.SoftDeleteConversation mock is already set by Set") + } + + if mmSoftDeleteConversation.defaultExpectation == nil { + mmSoftDeleteConversation.defaultExpectation = &RepositoryIMockSoftDeleteConversationExpectation{} + } + + if mmSoftDeleteConversation.defaultExpectation.paramPtrs != nil { + mmSoftDeleteConversation.mock.t.Fatalf("RepositoryIMock.SoftDeleteConversation mock is already set by ExpectParams functions") + } + + mmSoftDeleteConversation.defaultExpectation.params = &RepositoryIMockSoftDeleteConversationParams{ctx, namespaceUID, catalogUID, conversationID} + for _, e := range mmSoftDeleteConversation.expectations { + if minimock.Equal(e.params, mmSoftDeleteConversation.defaultExpectation.params) { + mmSoftDeleteConversation.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmSoftDeleteConversation.defaultExpectation.params) + } + } + + return mmSoftDeleteConversation +} + +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.SoftDeleteConversation +func (mmSoftDeleteConversation *mRepositoryIMockSoftDeleteConversation) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockSoftDeleteConversation { + if mmSoftDeleteConversation.mock.funcSoftDeleteConversation != nil { + mmSoftDeleteConversation.mock.t.Fatalf("RepositoryIMock.SoftDeleteConversation mock is already set by Set") + } + + if mmSoftDeleteConversation.defaultExpectation == nil { + mmSoftDeleteConversation.defaultExpectation = &RepositoryIMockSoftDeleteConversationExpectation{} + } + + if mmSoftDeleteConversation.defaultExpectation.params != nil { + mmSoftDeleteConversation.mock.t.Fatalf("RepositoryIMock.SoftDeleteConversation mock is already set by Expect") + } + + if mmSoftDeleteConversation.defaultExpectation.paramPtrs == nil { + mmSoftDeleteConversation.defaultExpectation.paramPtrs = &RepositoryIMockSoftDeleteConversationParamPtrs{} + } + mmSoftDeleteConversation.defaultExpectation.paramPtrs.ctx = &ctx + + return mmSoftDeleteConversation +} + +// ExpectNamespaceUIDParam2 sets up expected param namespaceUID for RepositoryI.SoftDeleteConversation +func (mmSoftDeleteConversation *mRepositoryIMockSoftDeleteConversation) ExpectNamespaceUIDParam2(namespaceUID uuid.UUID) *mRepositoryIMockSoftDeleteConversation { + if mmSoftDeleteConversation.mock.funcSoftDeleteConversation != nil { + mmSoftDeleteConversation.mock.t.Fatalf("RepositoryIMock.SoftDeleteConversation mock is already set by Set") + } + + if mmSoftDeleteConversation.defaultExpectation == nil { + mmSoftDeleteConversation.defaultExpectation = &RepositoryIMockSoftDeleteConversationExpectation{} + } + + if mmSoftDeleteConversation.defaultExpectation.params != nil { + mmSoftDeleteConversation.mock.t.Fatalf("RepositoryIMock.SoftDeleteConversation mock is already set by Expect") + } + + if mmSoftDeleteConversation.defaultExpectation.paramPtrs == nil { + mmSoftDeleteConversation.defaultExpectation.paramPtrs = &RepositoryIMockSoftDeleteConversationParamPtrs{} + } + mmSoftDeleteConversation.defaultExpectation.paramPtrs.namespaceUID = &namespaceUID + + return mmSoftDeleteConversation +} + +// ExpectCatalogUIDParam3 sets up expected param catalogUID for RepositoryI.SoftDeleteConversation +func (mmSoftDeleteConversation *mRepositoryIMockSoftDeleteConversation) ExpectCatalogUIDParam3(catalogUID uuid.UUID) *mRepositoryIMockSoftDeleteConversation { + if mmSoftDeleteConversation.mock.funcSoftDeleteConversation != nil { + mmSoftDeleteConversation.mock.t.Fatalf("RepositoryIMock.SoftDeleteConversation mock is already set by Set") + } + + if mmSoftDeleteConversation.defaultExpectation == nil { + mmSoftDeleteConversation.defaultExpectation = &RepositoryIMockSoftDeleteConversationExpectation{} + } + + if mmSoftDeleteConversation.defaultExpectation.params != nil { + mmSoftDeleteConversation.mock.t.Fatalf("RepositoryIMock.SoftDeleteConversation mock is already set by Expect") + } + + if mmSoftDeleteConversation.defaultExpectation.paramPtrs == nil { + mmSoftDeleteConversation.defaultExpectation.paramPtrs = &RepositoryIMockSoftDeleteConversationParamPtrs{} + } + mmSoftDeleteConversation.defaultExpectation.paramPtrs.catalogUID = &catalogUID + + return mmSoftDeleteConversation +} + +// ExpectConversationIDParam4 sets up expected param conversationID for RepositoryI.SoftDeleteConversation +func (mmSoftDeleteConversation *mRepositoryIMockSoftDeleteConversation) ExpectConversationIDParam4(conversationID string) *mRepositoryIMockSoftDeleteConversation { + if mmSoftDeleteConversation.mock.funcSoftDeleteConversation != nil { + mmSoftDeleteConversation.mock.t.Fatalf("RepositoryIMock.SoftDeleteConversation mock is already set by Set") + } + + if mmSoftDeleteConversation.defaultExpectation == nil { + mmSoftDeleteConversation.defaultExpectation = &RepositoryIMockSoftDeleteConversationExpectation{} + } + + if mmSoftDeleteConversation.defaultExpectation.params != nil { + mmSoftDeleteConversation.mock.t.Fatalf("RepositoryIMock.SoftDeleteConversation mock is already set by Expect") + } + + if mmSoftDeleteConversation.defaultExpectation.paramPtrs == nil { + mmSoftDeleteConversation.defaultExpectation.paramPtrs = &RepositoryIMockSoftDeleteConversationParamPtrs{} + } + mmSoftDeleteConversation.defaultExpectation.paramPtrs.conversationID = &conversationID + + return mmSoftDeleteConversation +} + +// Inspect accepts an inspector function that has same arguments as the RepositoryI.SoftDeleteConversation +func (mmSoftDeleteConversation *mRepositoryIMockSoftDeleteConversation) Inspect(f func(ctx context.Context, namespaceUID uuid.UUID, catalogUID uuid.UUID, conversationID string)) *mRepositoryIMockSoftDeleteConversation { + if mmSoftDeleteConversation.mock.inspectFuncSoftDeleteConversation != nil { + mmSoftDeleteConversation.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.SoftDeleteConversation") + } + + mmSoftDeleteConversation.mock.inspectFuncSoftDeleteConversation = f + + return mmSoftDeleteConversation +} + +// Return sets up results that will be returned by RepositoryI.SoftDeleteConversation +func (mmSoftDeleteConversation *mRepositoryIMockSoftDeleteConversation) Return(err error) *RepositoryIMock { + if mmSoftDeleteConversation.mock.funcSoftDeleteConversation != nil { + mmSoftDeleteConversation.mock.t.Fatalf("RepositoryIMock.SoftDeleteConversation mock is already set by Set") + } + + if mmSoftDeleteConversation.defaultExpectation == nil { + mmSoftDeleteConversation.defaultExpectation = &RepositoryIMockSoftDeleteConversationExpectation{mock: mmSoftDeleteConversation.mock} + } + mmSoftDeleteConversation.defaultExpectation.results = &RepositoryIMockSoftDeleteConversationResults{err} + return mmSoftDeleteConversation.mock +} + +// Set uses given function f to mock the RepositoryI.SoftDeleteConversation method +func (mmSoftDeleteConversation *mRepositoryIMockSoftDeleteConversation) Set(f func(ctx context.Context, namespaceUID uuid.UUID, catalogUID uuid.UUID, conversationID string) (err error)) *RepositoryIMock { + if mmSoftDeleteConversation.defaultExpectation != nil { + mmSoftDeleteConversation.mock.t.Fatalf("Default expectation is already set for the RepositoryI.SoftDeleteConversation method") + } + + if len(mmSoftDeleteConversation.expectations) > 0 { + mmSoftDeleteConversation.mock.t.Fatalf("Some expectations are already set for the RepositoryI.SoftDeleteConversation method") + } + + mmSoftDeleteConversation.mock.funcSoftDeleteConversation = f + return mmSoftDeleteConversation.mock +} + +// When sets expectation for the RepositoryI.SoftDeleteConversation which will trigger the result defined by the following +// Then helper +func (mmSoftDeleteConversation *mRepositoryIMockSoftDeleteConversation) When(ctx context.Context, namespaceUID uuid.UUID, catalogUID uuid.UUID, conversationID string) *RepositoryIMockSoftDeleteConversationExpectation { + if mmSoftDeleteConversation.mock.funcSoftDeleteConversation != nil { + mmSoftDeleteConversation.mock.t.Fatalf("RepositoryIMock.SoftDeleteConversation mock is already set by Set") + } + + expectation := &RepositoryIMockSoftDeleteConversationExpectation{ + mock: mmSoftDeleteConversation.mock, + params: &RepositoryIMockSoftDeleteConversationParams{ctx, namespaceUID, catalogUID, conversationID}, + } + mmSoftDeleteConversation.expectations = append(mmSoftDeleteConversation.expectations, expectation) + return expectation +} + +// Then sets up RepositoryI.SoftDeleteConversation return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockSoftDeleteConversationExpectation) Then(err error) *RepositoryIMock { + e.results = &RepositoryIMockSoftDeleteConversationResults{err} + return e.mock +} + +// Times sets number of times RepositoryI.SoftDeleteConversation should be invoked +func (mmSoftDeleteConversation *mRepositoryIMockSoftDeleteConversation) Times(n uint64) *mRepositoryIMockSoftDeleteConversation { + if n == 0 { + mmSoftDeleteConversation.mock.t.Fatalf("Times of RepositoryIMock.SoftDeleteConversation mock can not be zero") + } + mm_atomic.StoreUint64(&mmSoftDeleteConversation.expectedInvocations, n) + return mmSoftDeleteConversation +} + +func (mmSoftDeleteConversation *mRepositoryIMockSoftDeleteConversation) invocationsDone() bool { + if len(mmSoftDeleteConversation.expectations) == 0 && mmSoftDeleteConversation.defaultExpectation == nil && mmSoftDeleteConversation.mock.funcSoftDeleteConversation == nil { + return true + } + + totalInvocations := mm_atomic.LoadUint64(&mmSoftDeleteConversation.mock.afterSoftDeleteConversationCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmSoftDeleteConversation.expectedInvocations) + + return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) +} + +// SoftDeleteConversation implements repository.RepositoryI +func (mmSoftDeleteConversation *RepositoryIMock) SoftDeleteConversation(ctx context.Context, namespaceUID uuid.UUID, catalogUID uuid.UUID, conversationID string) (err error) { + mm_atomic.AddUint64(&mmSoftDeleteConversation.beforeSoftDeleteConversationCounter, 1) + defer mm_atomic.AddUint64(&mmSoftDeleteConversation.afterSoftDeleteConversationCounter, 1) + + if mmSoftDeleteConversation.inspectFuncSoftDeleteConversation != nil { + mmSoftDeleteConversation.inspectFuncSoftDeleteConversation(ctx, namespaceUID, catalogUID, conversationID) + } + + mm_params := RepositoryIMockSoftDeleteConversationParams{ctx, namespaceUID, catalogUID, conversationID} + + // Record call args + mmSoftDeleteConversation.SoftDeleteConversationMock.mutex.Lock() + mmSoftDeleteConversation.SoftDeleteConversationMock.callArgs = append(mmSoftDeleteConversation.SoftDeleteConversationMock.callArgs, &mm_params) + mmSoftDeleteConversation.SoftDeleteConversationMock.mutex.Unlock() + + for _, e := range mmSoftDeleteConversation.SoftDeleteConversationMock.expectations { + if minimock.Equal(*e.params, mm_params) { + mm_atomic.AddUint64(&e.Counter, 1) + return e.results.err + } + } + + if mmSoftDeleteConversation.SoftDeleteConversationMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmSoftDeleteConversation.SoftDeleteConversationMock.defaultExpectation.Counter, 1) + mm_want := mmSoftDeleteConversation.SoftDeleteConversationMock.defaultExpectation.params + mm_want_ptrs := mmSoftDeleteConversation.SoftDeleteConversationMock.defaultExpectation.paramPtrs + + mm_got := RepositoryIMockSoftDeleteConversationParams{ctx, namespaceUID, catalogUID, conversationID} + + if mm_want_ptrs != nil { + + if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { + mmSoftDeleteConversation.t.Errorf("RepositoryIMock.SoftDeleteConversation 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.namespaceUID != nil && !minimock.Equal(*mm_want_ptrs.namespaceUID, mm_got.namespaceUID) { + mmSoftDeleteConversation.t.Errorf("RepositoryIMock.SoftDeleteConversation got unexpected parameter namespaceUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.namespaceUID, mm_got.namespaceUID, minimock.Diff(*mm_want_ptrs.namespaceUID, mm_got.namespaceUID)) + } + + if mm_want_ptrs.catalogUID != nil && !minimock.Equal(*mm_want_ptrs.catalogUID, mm_got.catalogUID) { + mmSoftDeleteConversation.t.Errorf("RepositoryIMock.SoftDeleteConversation got unexpected parameter catalogUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.catalogUID, mm_got.catalogUID, minimock.Diff(*mm_want_ptrs.catalogUID, mm_got.catalogUID)) + } + + if mm_want_ptrs.conversationID != nil && !minimock.Equal(*mm_want_ptrs.conversationID, mm_got.conversationID) { + mmSoftDeleteConversation.t.Errorf("RepositoryIMock.SoftDeleteConversation got unexpected parameter conversationID, want: %#v, got: %#v%s\n", *mm_want_ptrs.conversationID, mm_got.conversationID, minimock.Diff(*mm_want_ptrs.conversationID, mm_got.conversationID)) + } + + } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { + mmSoftDeleteConversation.t.Errorf("RepositoryIMock.SoftDeleteConversation got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + } + + mm_results := mmSoftDeleteConversation.SoftDeleteConversationMock.defaultExpectation.results + if mm_results == nil { + mmSoftDeleteConversation.t.Fatal("No results are set for the RepositoryIMock.SoftDeleteConversation") + } + return (*mm_results).err + } + if mmSoftDeleteConversation.funcSoftDeleteConversation != nil { + return mmSoftDeleteConversation.funcSoftDeleteConversation(ctx, namespaceUID, catalogUID, conversationID) + } + mmSoftDeleteConversation.t.Fatalf("Unexpected call to RepositoryIMock.SoftDeleteConversation. %v %v %v %v", ctx, namespaceUID, catalogUID, conversationID) + return +} + +// SoftDeleteConversationAfterCounter returns a count of finished RepositoryIMock.SoftDeleteConversation invocations +func (mmSoftDeleteConversation *RepositoryIMock) SoftDeleteConversationAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmSoftDeleteConversation.afterSoftDeleteConversationCounter) +} + +// SoftDeleteConversationBeforeCounter returns a count of RepositoryIMock.SoftDeleteConversation invocations +func (mmSoftDeleteConversation *RepositoryIMock) SoftDeleteConversationBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmSoftDeleteConversation.beforeSoftDeleteConversationCounter) +} + +// Calls returns a list of arguments used in each call to RepositoryIMock.SoftDeleteConversation. +// The list is in the same order as the calls were made (i.e. recent calls have a higher index) +func (mmSoftDeleteConversation *mRepositoryIMockSoftDeleteConversation) Calls() []*RepositoryIMockSoftDeleteConversationParams { + mmSoftDeleteConversation.mutex.RLock() + + argCopy := make([]*RepositoryIMockSoftDeleteConversationParams, len(mmSoftDeleteConversation.callArgs)) + copy(argCopy, mmSoftDeleteConversation.callArgs) + + mmSoftDeleteConversation.mutex.RUnlock() + + return argCopy +} + +// MinimockSoftDeleteConversationDone returns true if the count of the SoftDeleteConversation invocations corresponds +// the number of defined expectations +func (m *RepositoryIMock) MinimockSoftDeleteConversationDone() bool { + for _, e := range m.SoftDeleteConversationMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + return false + } + } + + return m.SoftDeleteConversationMock.invocationsDone() +} + +// MinimockSoftDeleteConversationInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockSoftDeleteConversationInspect() { + for _, e := range m.SoftDeleteConversationMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + m.t.Errorf("Expected call to RepositoryIMock.SoftDeleteConversation with params: %#v", *e.params) + } + } + + afterSoftDeleteConversationCounter := mm_atomic.LoadUint64(&m.afterSoftDeleteConversationCounter) + // if default expectation was set then invocations count should be greater than zero + if m.SoftDeleteConversationMock.defaultExpectation != nil && afterSoftDeleteConversationCounter < 1 { + if m.SoftDeleteConversationMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.SoftDeleteConversation") + } else { + m.t.Errorf("Expected call to RepositoryIMock.SoftDeleteConversation with params: %#v", *m.SoftDeleteConversationMock.defaultExpectation.params) + } + } + // if func was set then invocations count should be greater than zero + if m.funcSoftDeleteConversation != nil && afterSoftDeleteConversationCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.SoftDeleteConversation") + } + + if !m.SoftDeleteConversationMock.invocationsDone() && afterSoftDeleteConversationCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.SoftDeleteConversation but found %d calls", + mm_atomic.LoadUint64(&m.SoftDeleteConversationMock.expectedInvocations), afterSoftDeleteConversationCounter) + } +} + +type mRepositoryIMockTextChunkTableName struct { + mock *RepositoryIMock + defaultExpectation *RepositoryIMockTextChunkTableNameExpectation + expectations []*RepositoryIMockTextChunkTableNameExpectation + + expectedInvocations uint64 +} + +// RepositoryIMockTextChunkTableNameExpectation specifies expectation struct of the RepositoryI.TextChunkTableName +type RepositoryIMockTextChunkTableNameExpectation struct { + mock *RepositoryIMock + + results *RepositoryIMockTextChunkTableNameResults + Counter uint64 +} + +// RepositoryIMockTextChunkTableNameResults contains results of the RepositoryI.TextChunkTableName +type RepositoryIMockTextChunkTableNameResults struct { + s1 string +} + +// Expect sets up expected params for RepositoryI.TextChunkTableName +func (mmTextChunkTableName *mRepositoryIMockTextChunkTableName) Expect() *mRepositoryIMockTextChunkTableName { + if mmTextChunkTableName.mock.funcTextChunkTableName != nil { + mmTextChunkTableName.mock.t.Fatalf("RepositoryIMock.TextChunkTableName mock is already set by Set") + } + + if mmTextChunkTableName.defaultExpectation == nil { + mmTextChunkTableName.defaultExpectation = &RepositoryIMockTextChunkTableNameExpectation{} + } + + return mmTextChunkTableName +} + +// Inspect accepts an inspector function that has same arguments as the RepositoryI.TextChunkTableName +func (mmTextChunkTableName *mRepositoryIMockTextChunkTableName) Inspect(f func()) *mRepositoryIMockTextChunkTableName { + if mmTextChunkTableName.mock.inspectFuncTextChunkTableName != nil { + mmTextChunkTableName.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.TextChunkTableName") + } + + mmTextChunkTableName.mock.inspectFuncTextChunkTableName = f + + return mmTextChunkTableName +} + +// Return sets up results that will be returned by RepositoryI.TextChunkTableName +func (mmTextChunkTableName *mRepositoryIMockTextChunkTableName) Return(s1 string) *RepositoryIMock { + if mmTextChunkTableName.mock.funcTextChunkTableName != nil { + mmTextChunkTableName.mock.t.Fatalf("RepositoryIMock.TextChunkTableName mock is already set by Set") + } + + if mmTextChunkTableName.defaultExpectation == nil { + mmTextChunkTableName.defaultExpectation = &RepositoryIMockTextChunkTableNameExpectation{mock: mmTextChunkTableName.mock} + } + mmTextChunkTableName.defaultExpectation.results = &RepositoryIMockTextChunkTableNameResults{s1} + return mmTextChunkTableName.mock +} + +// Set uses given function f to mock the RepositoryI.TextChunkTableName method +func (mmTextChunkTableName *mRepositoryIMockTextChunkTableName) Set(f func() (s1 string)) *RepositoryIMock { + if mmTextChunkTableName.defaultExpectation != nil { + mmTextChunkTableName.mock.t.Fatalf("Default expectation is already set for the RepositoryI.TextChunkTableName method") + } + + if len(mmTextChunkTableName.expectations) > 0 { + mmTextChunkTableName.mock.t.Fatalf("Some expectations are already set for the RepositoryI.TextChunkTableName method") + } + + mmTextChunkTableName.mock.funcTextChunkTableName = f + return mmTextChunkTableName.mock +} + +// Times sets number of times RepositoryI.TextChunkTableName should be invoked +func (mmTextChunkTableName *mRepositoryIMockTextChunkTableName) Times(n uint64) *mRepositoryIMockTextChunkTableName { + if n == 0 { + mmTextChunkTableName.mock.t.Fatalf("Times of RepositoryIMock.TextChunkTableName mock can not be zero") + } + mm_atomic.StoreUint64(&mmTextChunkTableName.expectedInvocations, n) + return mmTextChunkTableName +} + +func (mmTextChunkTableName *mRepositoryIMockTextChunkTableName) invocationsDone() bool { + if len(mmTextChunkTableName.expectations) == 0 && mmTextChunkTableName.defaultExpectation == nil && mmTextChunkTableName.mock.funcTextChunkTableName == nil { + return true + } + + totalInvocations := mm_atomic.LoadUint64(&mmTextChunkTableName.mock.afterTextChunkTableNameCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmTextChunkTableName.expectedInvocations) + + return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) +} + +// TextChunkTableName implements repository.RepositoryI +func (mmTextChunkTableName *RepositoryIMock) TextChunkTableName() (s1 string) { + mm_atomic.AddUint64(&mmTextChunkTableName.beforeTextChunkTableNameCounter, 1) + defer mm_atomic.AddUint64(&mmTextChunkTableName.afterTextChunkTableNameCounter, 1) + + if mmTextChunkTableName.inspectFuncTextChunkTableName != nil { + mmTextChunkTableName.inspectFuncTextChunkTableName() + } + + if mmTextChunkTableName.TextChunkTableNameMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmTextChunkTableName.TextChunkTableNameMock.defaultExpectation.Counter, 1) + + mm_results := mmTextChunkTableName.TextChunkTableNameMock.defaultExpectation.results + if mm_results == nil { + mmTextChunkTableName.t.Fatal("No results are set for the RepositoryIMock.TextChunkTableName") + } + return (*mm_results).s1 + } + if mmTextChunkTableName.funcTextChunkTableName != nil { + return mmTextChunkTableName.funcTextChunkTableName() + } + mmTextChunkTableName.t.Fatalf("Unexpected call to RepositoryIMock.TextChunkTableName.") + return +} + +// TextChunkTableNameAfterCounter returns a count of finished RepositoryIMock.TextChunkTableName invocations +func (mmTextChunkTableName *RepositoryIMock) TextChunkTableNameAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmTextChunkTableName.afterTextChunkTableNameCounter) +} + +// TextChunkTableNameBeforeCounter returns a count of RepositoryIMock.TextChunkTableName invocations +func (mmTextChunkTableName *RepositoryIMock) TextChunkTableNameBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmTextChunkTableName.beforeTextChunkTableNameCounter) +} + +// MinimockTextChunkTableNameDone returns true if the count of the TextChunkTableName invocations corresponds +// the number of defined expectations +func (m *RepositoryIMock) MinimockTextChunkTableNameDone() bool { + for _, e := range m.TextChunkTableNameMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + return false + } + } + + return m.TextChunkTableNameMock.invocationsDone() +} + +// MinimockTextChunkTableNameInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockTextChunkTableNameInspect() { + for _, e := range m.TextChunkTableNameMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + m.t.Error("Expected call to RepositoryIMock.TextChunkTableName") + } + } + + afterTextChunkTableNameCounter := mm_atomic.LoadUint64(&m.afterTextChunkTableNameCounter) + // if default expectation was set then invocations count should be greater than zero + if m.TextChunkTableNameMock.defaultExpectation != nil && afterTextChunkTableNameCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.TextChunkTableName") + } + // if func was set then invocations count should be greater than zero + if m.funcTextChunkTableName != nil && afterTextChunkTableNameCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.TextChunkTableName") + } + + if !m.TextChunkTableNameMock.invocationsDone() && afterTextChunkTableNameCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.TextChunkTableName but found %d calls", + mm_atomic.LoadUint64(&m.TextChunkTableNameMock.expectedInvocations), afterTextChunkTableNameCounter) + } +} + +type mRepositoryIMockUpdateChunk struct { + mock *RepositoryIMock + defaultExpectation *RepositoryIMockUpdateChunkExpectation + expectations []*RepositoryIMockUpdateChunkExpectation + + callArgs []*RepositoryIMockUpdateChunkParams + mutex sync.RWMutex + + expectedInvocations uint64 +} + +// RepositoryIMockUpdateChunkExpectation specifies expectation struct of the RepositoryI.UpdateChunk +type RepositoryIMockUpdateChunkExpectation struct { + mock *RepositoryIMock + params *RepositoryIMockUpdateChunkParams + paramPtrs *RepositoryIMockUpdateChunkParamPtrs + results *RepositoryIMockUpdateChunkResults + Counter uint64 +} + +// RepositoryIMockUpdateChunkParams contains parameters of the RepositoryI.UpdateChunk +type RepositoryIMockUpdateChunkParams struct { + ctx context.Context + chunkUID string + updates map[string]interface{} +} + +// RepositoryIMockUpdateChunkParamPtrs contains pointers to parameters of the RepositoryI.UpdateChunk +type RepositoryIMockUpdateChunkParamPtrs struct { + ctx *context.Context + chunkUID *string + updates *map[string]interface{} +} + +// RepositoryIMockUpdateChunkResults contains results of the RepositoryI.UpdateChunk +type RepositoryIMockUpdateChunkResults struct { + tp1 *mm_repository.TextChunk + err error +} + +// Expect sets up expected params for RepositoryI.UpdateChunk +func (mmUpdateChunk *mRepositoryIMockUpdateChunk) Expect(ctx context.Context, chunkUID string, updates map[string]interface{}) *mRepositoryIMockUpdateChunk { + if mmUpdateChunk.mock.funcUpdateChunk != nil { + mmUpdateChunk.mock.t.Fatalf("RepositoryIMock.UpdateChunk mock is already set by Set") + } + + if mmUpdateChunk.defaultExpectation == nil { + mmUpdateChunk.defaultExpectation = &RepositoryIMockUpdateChunkExpectation{} + } + + if mmUpdateChunk.defaultExpectation.paramPtrs != nil { + mmUpdateChunk.mock.t.Fatalf("RepositoryIMock.UpdateChunk mock is already set by ExpectParams functions") + } + + mmUpdateChunk.defaultExpectation.params = &RepositoryIMockUpdateChunkParams{ctx, chunkUID, updates} + for _, e := range mmUpdateChunk.expectations { + if minimock.Equal(e.params, mmUpdateChunk.defaultExpectation.params) { + mmUpdateChunk.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmUpdateChunk.defaultExpectation.params) + } + } + + return mmUpdateChunk +} + +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.UpdateChunk +func (mmUpdateChunk *mRepositoryIMockUpdateChunk) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockUpdateChunk { + if mmUpdateChunk.mock.funcUpdateChunk != nil { + mmUpdateChunk.mock.t.Fatalf("RepositoryIMock.UpdateChunk mock is already set by Set") + } + + if mmUpdateChunk.defaultExpectation == nil { + mmUpdateChunk.defaultExpectation = &RepositoryIMockUpdateChunkExpectation{} + } + + if mmUpdateChunk.defaultExpectation.params != nil { + mmUpdateChunk.mock.t.Fatalf("RepositoryIMock.UpdateChunk mock is already set by Expect") + } + + if mmUpdateChunk.defaultExpectation.paramPtrs == nil { + mmUpdateChunk.defaultExpectation.paramPtrs = &RepositoryIMockUpdateChunkParamPtrs{} + } + mmUpdateChunk.defaultExpectation.paramPtrs.ctx = &ctx + + return mmUpdateChunk +} + +// ExpectChunkUIDParam2 sets up expected param chunkUID for RepositoryI.UpdateChunk +func (mmUpdateChunk *mRepositoryIMockUpdateChunk) ExpectChunkUIDParam2(chunkUID string) *mRepositoryIMockUpdateChunk { + if mmUpdateChunk.mock.funcUpdateChunk != nil { + mmUpdateChunk.mock.t.Fatalf("RepositoryIMock.UpdateChunk mock is already set by Set") + } + + if mmUpdateChunk.defaultExpectation == nil { + mmUpdateChunk.defaultExpectation = &RepositoryIMockUpdateChunkExpectation{} + } + + if mmUpdateChunk.defaultExpectation.params != nil { + mmUpdateChunk.mock.t.Fatalf("RepositoryIMock.UpdateChunk mock is already set by Expect") + } + + if mmUpdateChunk.defaultExpectation.paramPtrs == nil { + mmUpdateChunk.defaultExpectation.paramPtrs = &RepositoryIMockUpdateChunkParamPtrs{} + } + mmUpdateChunk.defaultExpectation.paramPtrs.chunkUID = &chunkUID + + return mmUpdateChunk +} + +// ExpectUpdatesParam3 sets up expected param updates for RepositoryI.UpdateChunk +func (mmUpdateChunk *mRepositoryIMockUpdateChunk) ExpectUpdatesParam3(updates map[string]interface{}) *mRepositoryIMockUpdateChunk { + if mmUpdateChunk.mock.funcUpdateChunk != nil { + mmUpdateChunk.mock.t.Fatalf("RepositoryIMock.UpdateChunk mock is already set by Set") + } + + if mmUpdateChunk.defaultExpectation == nil { + mmUpdateChunk.defaultExpectation = &RepositoryIMockUpdateChunkExpectation{} + } + + if mmUpdateChunk.defaultExpectation.params != nil { + mmUpdateChunk.mock.t.Fatalf("RepositoryIMock.UpdateChunk mock is already set by Expect") + } + + if mmUpdateChunk.defaultExpectation.paramPtrs == nil { + mmUpdateChunk.defaultExpectation.paramPtrs = &RepositoryIMockUpdateChunkParamPtrs{} + } + mmUpdateChunk.defaultExpectation.paramPtrs.updates = &updates + + return mmUpdateChunk +} + +// Inspect accepts an inspector function that has same arguments as the RepositoryI.UpdateChunk +func (mmUpdateChunk *mRepositoryIMockUpdateChunk) Inspect(f func(ctx context.Context, chunkUID string, updates map[string]interface{})) *mRepositoryIMockUpdateChunk { + if mmUpdateChunk.mock.inspectFuncUpdateChunk != nil { + mmUpdateChunk.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.UpdateChunk") + } + + mmUpdateChunk.mock.inspectFuncUpdateChunk = f + + return mmUpdateChunk +} + +// Return sets up results that will be returned by RepositoryI.UpdateChunk +func (mmUpdateChunk *mRepositoryIMockUpdateChunk) Return(tp1 *mm_repository.TextChunk, err error) *RepositoryIMock { + if mmUpdateChunk.mock.funcUpdateChunk != nil { + mmUpdateChunk.mock.t.Fatalf("RepositoryIMock.UpdateChunk mock is already set by Set") + } + + if mmUpdateChunk.defaultExpectation == nil { + mmUpdateChunk.defaultExpectation = &RepositoryIMockUpdateChunkExpectation{mock: mmUpdateChunk.mock} + } + mmUpdateChunk.defaultExpectation.results = &RepositoryIMockUpdateChunkResults{tp1, err} + return mmUpdateChunk.mock +} + +// Set uses given function f to mock the RepositoryI.UpdateChunk method +func (mmUpdateChunk *mRepositoryIMockUpdateChunk) Set(f func(ctx context.Context, chunkUID string, updates map[string]interface{}) (tp1 *mm_repository.TextChunk, err error)) *RepositoryIMock { + if mmUpdateChunk.defaultExpectation != nil { + mmUpdateChunk.mock.t.Fatalf("Default expectation is already set for the RepositoryI.UpdateChunk method") + } + + if len(mmUpdateChunk.expectations) > 0 { + mmUpdateChunk.mock.t.Fatalf("Some expectations are already set for the RepositoryI.UpdateChunk method") + } + + mmUpdateChunk.mock.funcUpdateChunk = f + return mmUpdateChunk.mock +} + +// When sets expectation for the RepositoryI.UpdateChunk which will trigger the result defined by the following +// Then helper +func (mmUpdateChunk *mRepositoryIMockUpdateChunk) When(ctx context.Context, chunkUID string, updates map[string]interface{}) *RepositoryIMockUpdateChunkExpectation { + if mmUpdateChunk.mock.funcUpdateChunk != nil { + mmUpdateChunk.mock.t.Fatalf("RepositoryIMock.UpdateChunk mock is already set by Set") + } + + expectation := &RepositoryIMockUpdateChunkExpectation{ + mock: mmUpdateChunk.mock, + params: &RepositoryIMockUpdateChunkParams{ctx, chunkUID, updates}, + } + mmUpdateChunk.expectations = append(mmUpdateChunk.expectations, expectation) + return expectation +} + +// Then sets up RepositoryI.UpdateChunk return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockUpdateChunkExpectation) Then(tp1 *mm_repository.TextChunk, err error) *RepositoryIMock { + e.results = &RepositoryIMockUpdateChunkResults{tp1, err} + return e.mock +} + +// Times sets number of times RepositoryI.UpdateChunk should be invoked +func (mmUpdateChunk *mRepositoryIMockUpdateChunk) Times(n uint64) *mRepositoryIMockUpdateChunk { + if n == 0 { + mmUpdateChunk.mock.t.Fatalf("Times of RepositoryIMock.UpdateChunk mock can not be zero") + } + mm_atomic.StoreUint64(&mmUpdateChunk.expectedInvocations, n) + return mmUpdateChunk +} + +func (mmUpdateChunk *mRepositoryIMockUpdateChunk) invocationsDone() bool { + if len(mmUpdateChunk.expectations) == 0 && mmUpdateChunk.defaultExpectation == nil && mmUpdateChunk.mock.funcUpdateChunk == nil { + return true + } + + totalInvocations := mm_atomic.LoadUint64(&mmUpdateChunk.mock.afterUpdateChunkCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmUpdateChunk.expectedInvocations) + + return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) +} + +// UpdateChunk implements repository.RepositoryI +func (mmUpdateChunk *RepositoryIMock) UpdateChunk(ctx context.Context, chunkUID string, updates map[string]interface{}) (tp1 *mm_repository.TextChunk, err error) { + mm_atomic.AddUint64(&mmUpdateChunk.beforeUpdateChunkCounter, 1) + defer mm_atomic.AddUint64(&mmUpdateChunk.afterUpdateChunkCounter, 1) + + if mmUpdateChunk.inspectFuncUpdateChunk != nil { + mmUpdateChunk.inspectFuncUpdateChunk(ctx, chunkUID, updates) + } + + mm_params := RepositoryIMockUpdateChunkParams{ctx, chunkUID, updates} + + // Record call args + mmUpdateChunk.UpdateChunkMock.mutex.Lock() + mmUpdateChunk.UpdateChunkMock.callArgs = append(mmUpdateChunk.UpdateChunkMock.callArgs, &mm_params) + mmUpdateChunk.UpdateChunkMock.mutex.Unlock() + + for _, e := range mmUpdateChunk.UpdateChunkMock.expectations { + if minimock.Equal(*e.params, mm_params) { + mm_atomic.AddUint64(&e.Counter, 1) + return e.results.tp1, e.results.err + } + } + + if mmUpdateChunk.UpdateChunkMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmUpdateChunk.UpdateChunkMock.defaultExpectation.Counter, 1) + mm_want := mmUpdateChunk.UpdateChunkMock.defaultExpectation.params + mm_want_ptrs := mmUpdateChunk.UpdateChunkMock.defaultExpectation.paramPtrs + + mm_got := RepositoryIMockUpdateChunkParams{ctx, chunkUID, updates} + + if mm_want_ptrs != nil { + + if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { + mmUpdateChunk.t.Errorf("RepositoryIMock.UpdateChunk 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.chunkUID != nil && !minimock.Equal(*mm_want_ptrs.chunkUID, mm_got.chunkUID) { + mmUpdateChunk.t.Errorf("RepositoryIMock.UpdateChunk got unexpected parameter chunkUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.chunkUID, mm_got.chunkUID, minimock.Diff(*mm_want_ptrs.chunkUID, mm_got.chunkUID)) + } + + if mm_want_ptrs.updates != nil && !minimock.Equal(*mm_want_ptrs.updates, mm_got.updates) { + mmUpdateChunk.t.Errorf("RepositoryIMock.UpdateChunk got unexpected parameter updates, want: %#v, got: %#v%s\n", *mm_want_ptrs.updates, mm_got.updates, minimock.Diff(*mm_want_ptrs.updates, mm_got.updates)) + } + + } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { + mmUpdateChunk.t.Errorf("RepositoryIMock.UpdateChunk got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + } + + mm_results := mmUpdateChunk.UpdateChunkMock.defaultExpectation.results + if mm_results == nil { + mmUpdateChunk.t.Fatal("No results are set for the RepositoryIMock.UpdateChunk") + } + return (*mm_results).tp1, (*mm_results).err + } + if mmUpdateChunk.funcUpdateChunk != nil { + return mmUpdateChunk.funcUpdateChunk(ctx, chunkUID, updates) + } + mmUpdateChunk.t.Fatalf("Unexpected call to RepositoryIMock.UpdateChunk. %v %v %v", ctx, chunkUID, updates) + return +} + +// UpdateChunkAfterCounter returns a count of finished RepositoryIMock.UpdateChunk invocations +func (mmUpdateChunk *RepositoryIMock) UpdateChunkAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmUpdateChunk.afterUpdateChunkCounter) +} + +// UpdateChunkBeforeCounter returns a count of RepositoryIMock.UpdateChunk invocations +func (mmUpdateChunk *RepositoryIMock) UpdateChunkBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmUpdateChunk.beforeUpdateChunkCounter) +} + +// Calls returns a list of arguments used in each call to RepositoryIMock.UpdateChunk. +// The list is in the same order as the calls were made (i.e. recent calls have a higher index) +func (mmUpdateChunk *mRepositoryIMockUpdateChunk) Calls() []*RepositoryIMockUpdateChunkParams { + mmUpdateChunk.mutex.RLock() + + argCopy := make([]*RepositoryIMockUpdateChunkParams, len(mmUpdateChunk.callArgs)) + copy(argCopy, mmUpdateChunk.callArgs) + + mmUpdateChunk.mutex.RUnlock() + + return argCopy +} + +// MinimockUpdateChunkDone returns true if the count of the UpdateChunk invocations corresponds +// the number of defined expectations +func (m *RepositoryIMock) MinimockUpdateChunkDone() bool { + for _, e := range m.UpdateChunkMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + return false + } + } + + return m.UpdateChunkMock.invocationsDone() +} + +// MinimockUpdateChunkInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockUpdateChunkInspect() { + for _, e := range m.UpdateChunkMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + m.t.Errorf("Expected call to RepositoryIMock.UpdateChunk with params: %#v", *e.params) + } + } + + afterUpdateChunkCounter := mm_atomic.LoadUint64(&m.afterUpdateChunkCounter) + // if default expectation was set then invocations count should be greater than zero + if m.UpdateChunkMock.defaultExpectation != nil && afterUpdateChunkCounter < 1 { + if m.UpdateChunkMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.UpdateChunk") + } else { + m.t.Errorf("Expected call to RepositoryIMock.UpdateChunk with params: %#v", *m.UpdateChunkMock.defaultExpectation.params) + } + } + // if func was set then invocations count should be greater than zero + if m.funcUpdateChunk != nil && afterUpdateChunkCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.UpdateChunk") + } + + if !m.UpdateChunkMock.invocationsDone() && afterUpdateChunkCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.UpdateChunk but found %d calls", + mm_atomic.LoadUint64(&m.UpdateChunkMock.expectedInvocations), afterUpdateChunkCounter) + } +} + +type mRepositoryIMockUpdateConversationByUpdateMap struct { + mock *RepositoryIMock + defaultExpectation *RepositoryIMockUpdateConversationByUpdateMapExpectation + expectations []*RepositoryIMockUpdateConversationByUpdateMapExpectation + + callArgs []*RepositoryIMockUpdateConversationByUpdateMapParams + mutex sync.RWMutex + + expectedInvocations uint64 +} + +// RepositoryIMockUpdateConversationByUpdateMapExpectation specifies expectation struct of the RepositoryI.UpdateConversationByUpdateMap +type RepositoryIMockUpdateConversationByUpdateMapExpectation struct { + mock *RepositoryIMock + params *RepositoryIMockUpdateConversationByUpdateMapParams + paramPtrs *RepositoryIMockUpdateConversationByUpdateMapParamPtrs + results *RepositoryIMockUpdateConversationByUpdateMapResults + Counter uint64 +} + +// RepositoryIMockUpdateConversationByUpdateMapParams contains parameters of the RepositoryI.UpdateConversationByUpdateMap +type RepositoryIMockUpdateConversationByUpdateMapParams struct { + ctx context.Context + convUID uuid.UUID + updateMap map[string]interface{} +} + +// RepositoryIMockUpdateConversationByUpdateMapParamPtrs contains pointers to parameters of the RepositoryI.UpdateConversationByUpdateMap +type RepositoryIMockUpdateConversationByUpdateMapParamPtrs struct { + ctx *context.Context + convUID *uuid.UUID + updateMap *map[string]interface{} +} + +// RepositoryIMockUpdateConversationByUpdateMapResults contains results of the RepositoryI.UpdateConversationByUpdateMap +type RepositoryIMockUpdateConversationByUpdateMapResults struct { + cp1 *mm_repository.Conversation + err error +} + +// Expect sets up expected params for RepositoryI.UpdateConversationByUpdateMap +func (mmUpdateConversationByUpdateMap *mRepositoryIMockUpdateConversationByUpdateMap) Expect(ctx context.Context, convUID uuid.UUID, updateMap map[string]interface{}) *mRepositoryIMockUpdateConversationByUpdateMap { + if mmUpdateConversationByUpdateMap.mock.funcUpdateConversationByUpdateMap != nil { + mmUpdateConversationByUpdateMap.mock.t.Fatalf("RepositoryIMock.UpdateConversationByUpdateMap mock is already set by Set") + } + + if mmUpdateConversationByUpdateMap.defaultExpectation == nil { + mmUpdateConversationByUpdateMap.defaultExpectation = &RepositoryIMockUpdateConversationByUpdateMapExpectation{} + } + + if mmUpdateConversationByUpdateMap.defaultExpectation.paramPtrs != nil { + mmUpdateConversationByUpdateMap.mock.t.Fatalf("RepositoryIMock.UpdateConversationByUpdateMap mock is already set by ExpectParams functions") + } + + mmUpdateConversationByUpdateMap.defaultExpectation.params = &RepositoryIMockUpdateConversationByUpdateMapParams{ctx, convUID, updateMap} + for _, e := range mmUpdateConversationByUpdateMap.expectations { + if minimock.Equal(e.params, mmUpdateConversationByUpdateMap.defaultExpectation.params) { + mmUpdateConversationByUpdateMap.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmUpdateConversationByUpdateMap.defaultExpectation.params) + } + } + + return mmUpdateConversationByUpdateMap +} + +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.UpdateConversationByUpdateMap +func (mmUpdateConversationByUpdateMap *mRepositoryIMockUpdateConversationByUpdateMap) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockUpdateConversationByUpdateMap { + if mmUpdateConversationByUpdateMap.mock.funcUpdateConversationByUpdateMap != nil { + mmUpdateConversationByUpdateMap.mock.t.Fatalf("RepositoryIMock.UpdateConversationByUpdateMap mock is already set by Set") + } + + if mmUpdateConversationByUpdateMap.defaultExpectation == nil { + mmUpdateConversationByUpdateMap.defaultExpectation = &RepositoryIMockUpdateConversationByUpdateMapExpectation{} + } + + if mmUpdateConversationByUpdateMap.defaultExpectation.params != nil { + mmUpdateConversationByUpdateMap.mock.t.Fatalf("RepositoryIMock.UpdateConversationByUpdateMap mock is already set by Expect") + } + + if mmUpdateConversationByUpdateMap.defaultExpectation.paramPtrs == nil { + mmUpdateConversationByUpdateMap.defaultExpectation.paramPtrs = &RepositoryIMockUpdateConversationByUpdateMapParamPtrs{} + } + mmUpdateConversationByUpdateMap.defaultExpectation.paramPtrs.ctx = &ctx + + return mmUpdateConversationByUpdateMap +} + +// ExpectConvUIDParam2 sets up expected param convUID for RepositoryI.UpdateConversationByUpdateMap +func (mmUpdateConversationByUpdateMap *mRepositoryIMockUpdateConversationByUpdateMap) ExpectConvUIDParam2(convUID uuid.UUID) *mRepositoryIMockUpdateConversationByUpdateMap { + if mmUpdateConversationByUpdateMap.mock.funcUpdateConversationByUpdateMap != nil { + mmUpdateConversationByUpdateMap.mock.t.Fatalf("RepositoryIMock.UpdateConversationByUpdateMap mock is already set by Set") + } + + if mmUpdateConversationByUpdateMap.defaultExpectation == nil { + mmUpdateConversationByUpdateMap.defaultExpectation = &RepositoryIMockUpdateConversationByUpdateMapExpectation{} + } + + if mmUpdateConversationByUpdateMap.defaultExpectation.params != nil { + mmUpdateConversationByUpdateMap.mock.t.Fatalf("RepositoryIMock.UpdateConversationByUpdateMap mock is already set by Expect") + } + + if mmUpdateConversationByUpdateMap.defaultExpectation.paramPtrs == nil { + mmUpdateConversationByUpdateMap.defaultExpectation.paramPtrs = &RepositoryIMockUpdateConversationByUpdateMapParamPtrs{} + } + mmUpdateConversationByUpdateMap.defaultExpectation.paramPtrs.convUID = &convUID + + return mmUpdateConversationByUpdateMap +} + +// ExpectUpdateMapParam3 sets up expected param updateMap for RepositoryI.UpdateConversationByUpdateMap +func (mmUpdateConversationByUpdateMap *mRepositoryIMockUpdateConversationByUpdateMap) ExpectUpdateMapParam3(updateMap map[string]interface{}) *mRepositoryIMockUpdateConversationByUpdateMap { + if mmUpdateConversationByUpdateMap.mock.funcUpdateConversationByUpdateMap != nil { + mmUpdateConversationByUpdateMap.mock.t.Fatalf("RepositoryIMock.UpdateConversationByUpdateMap mock is already set by Set") + } + + if mmUpdateConversationByUpdateMap.defaultExpectation == nil { + mmUpdateConversationByUpdateMap.defaultExpectation = &RepositoryIMockUpdateConversationByUpdateMapExpectation{} + } + + if mmUpdateConversationByUpdateMap.defaultExpectation.params != nil { + mmUpdateConversationByUpdateMap.mock.t.Fatalf("RepositoryIMock.UpdateConversationByUpdateMap mock is already set by Expect") + } + + if mmUpdateConversationByUpdateMap.defaultExpectation.paramPtrs == nil { + mmUpdateConversationByUpdateMap.defaultExpectation.paramPtrs = &RepositoryIMockUpdateConversationByUpdateMapParamPtrs{} + } + mmUpdateConversationByUpdateMap.defaultExpectation.paramPtrs.updateMap = &updateMap + + return mmUpdateConversationByUpdateMap +} + +// Inspect accepts an inspector function that has same arguments as the RepositoryI.UpdateConversationByUpdateMap +func (mmUpdateConversationByUpdateMap *mRepositoryIMockUpdateConversationByUpdateMap) Inspect(f func(ctx context.Context, convUID uuid.UUID, updateMap map[string]interface{})) *mRepositoryIMockUpdateConversationByUpdateMap { + if mmUpdateConversationByUpdateMap.mock.inspectFuncUpdateConversationByUpdateMap != nil { + mmUpdateConversationByUpdateMap.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.UpdateConversationByUpdateMap") + } + + mmUpdateConversationByUpdateMap.mock.inspectFuncUpdateConversationByUpdateMap = f + + return mmUpdateConversationByUpdateMap +} + +// Return sets up results that will be returned by RepositoryI.UpdateConversationByUpdateMap +func (mmUpdateConversationByUpdateMap *mRepositoryIMockUpdateConversationByUpdateMap) Return(cp1 *mm_repository.Conversation, err error) *RepositoryIMock { + if mmUpdateConversationByUpdateMap.mock.funcUpdateConversationByUpdateMap != nil { + mmUpdateConversationByUpdateMap.mock.t.Fatalf("RepositoryIMock.UpdateConversationByUpdateMap mock is already set by Set") + } + + if mmUpdateConversationByUpdateMap.defaultExpectation == nil { + mmUpdateConversationByUpdateMap.defaultExpectation = &RepositoryIMockUpdateConversationByUpdateMapExpectation{mock: mmUpdateConversationByUpdateMap.mock} + } + mmUpdateConversationByUpdateMap.defaultExpectation.results = &RepositoryIMockUpdateConversationByUpdateMapResults{cp1, err} + return mmUpdateConversationByUpdateMap.mock +} + +// Set uses given function f to mock the RepositoryI.UpdateConversationByUpdateMap method +func (mmUpdateConversationByUpdateMap *mRepositoryIMockUpdateConversationByUpdateMap) Set(f func(ctx context.Context, convUID uuid.UUID, updateMap map[string]interface{}) (cp1 *mm_repository.Conversation, err error)) *RepositoryIMock { + if mmUpdateConversationByUpdateMap.defaultExpectation != nil { + mmUpdateConversationByUpdateMap.mock.t.Fatalf("Default expectation is already set for the RepositoryI.UpdateConversationByUpdateMap method") + } + + if len(mmUpdateConversationByUpdateMap.expectations) > 0 { + mmUpdateConversationByUpdateMap.mock.t.Fatalf("Some expectations are already set for the RepositoryI.UpdateConversationByUpdateMap method") + } + + mmUpdateConversationByUpdateMap.mock.funcUpdateConversationByUpdateMap = f + return mmUpdateConversationByUpdateMap.mock +} + +// When sets expectation for the RepositoryI.UpdateConversationByUpdateMap which will trigger the result defined by the following +// Then helper +func (mmUpdateConversationByUpdateMap *mRepositoryIMockUpdateConversationByUpdateMap) When(ctx context.Context, convUID uuid.UUID, updateMap map[string]interface{}) *RepositoryIMockUpdateConversationByUpdateMapExpectation { + if mmUpdateConversationByUpdateMap.mock.funcUpdateConversationByUpdateMap != nil { + mmUpdateConversationByUpdateMap.mock.t.Fatalf("RepositoryIMock.UpdateConversationByUpdateMap mock is already set by Set") + } + + expectation := &RepositoryIMockUpdateConversationByUpdateMapExpectation{ + mock: mmUpdateConversationByUpdateMap.mock, + params: &RepositoryIMockUpdateConversationByUpdateMapParams{ctx, convUID, updateMap}, + } + mmUpdateConversationByUpdateMap.expectations = append(mmUpdateConversationByUpdateMap.expectations, expectation) + return expectation +} + +// Then sets up RepositoryI.UpdateConversationByUpdateMap return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockUpdateConversationByUpdateMapExpectation) Then(cp1 *mm_repository.Conversation, err error) *RepositoryIMock { + e.results = &RepositoryIMockUpdateConversationByUpdateMapResults{cp1, err} + return e.mock +} + +// Times sets number of times RepositoryI.UpdateConversationByUpdateMap should be invoked +func (mmUpdateConversationByUpdateMap *mRepositoryIMockUpdateConversationByUpdateMap) Times(n uint64) *mRepositoryIMockUpdateConversationByUpdateMap { + if n == 0 { + mmUpdateConversationByUpdateMap.mock.t.Fatalf("Times of RepositoryIMock.UpdateConversationByUpdateMap mock can not be zero") + } + mm_atomic.StoreUint64(&mmUpdateConversationByUpdateMap.expectedInvocations, n) + return mmUpdateConversationByUpdateMap +} + +func (mmUpdateConversationByUpdateMap *mRepositoryIMockUpdateConversationByUpdateMap) invocationsDone() bool { + if len(mmUpdateConversationByUpdateMap.expectations) == 0 && mmUpdateConversationByUpdateMap.defaultExpectation == nil && mmUpdateConversationByUpdateMap.mock.funcUpdateConversationByUpdateMap == nil { + return true + } + + totalInvocations := mm_atomic.LoadUint64(&mmUpdateConversationByUpdateMap.mock.afterUpdateConversationByUpdateMapCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmUpdateConversationByUpdateMap.expectedInvocations) + + return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) +} + +// UpdateConversationByUpdateMap implements repository.RepositoryI +func (mmUpdateConversationByUpdateMap *RepositoryIMock) UpdateConversationByUpdateMap(ctx context.Context, convUID uuid.UUID, updateMap map[string]interface{}) (cp1 *mm_repository.Conversation, err error) { + mm_atomic.AddUint64(&mmUpdateConversationByUpdateMap.beforeUpdateConversationByUpdateMapCounter, 1) + defer mm_atomic.AddUint64(&mmUpdateConversationByUpdateMap.afterUpdateConversationByUpdateMapCounter, 1) + + if mmUpdateConversationByUpdateMap.inspectFuncUpdateConversationByUpdateMap != nil { + mmUpdateConversationByUpdateMap.inspectFuncUpdateConversationByUpdateMap(ctx, convUID, updateMap) + } + + mm_params := RepositoryIMockUpdateConversationByUpdateMapParams{ctx, convUID, updateMap} + + // Record call args + mmUpdateConversationByUpdateMap.UpdateConversationByUpdateMapMock.mutex.Lock() + mmUpdateConversationByUpdateMap.UpdateConversationByUpdateMapMock.callArgs = append(mmUpdateConversationByUpdateMap.UpdateConversationByUpdateMapMock.callArgs, &mm_params) + mmUpdateConversationByUpdateMap.UpdateConversationByUpdateMapMock.mutex.Unlock() + + for _, e := range mmUpdateConversationByUpdateMap.UpdateConversationByUpdateMapMock.expectations { + if minimock.Equal(*e.params, mm_params) { + mm_atomic.AddUint64(&e.Counter, 1) + return e.results.cp1, e.results.err + } + } + + if mmUpdateConversationByUpdateMap.UpdateConversationByUpdateMapMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmUpdateConversationByUpdateMap.UpdateConversationByUpdateMapMock.defaultExpectation.Counter, 1) + mm_want := mmUpdateConversationByUpdateMap.UpdateConversationByUpdateMapMock.defaultExpectation.params + mm_want_ptrs := mmUpdateConversationByUpdateMap.UpdateConversationByUpdateMapMock.defaultExpectation.paramPtrs + + mm_got := RepositoryIMockUpdateConversationByUpdateMapParams{ctx, convUID, updateMap} + + if mm_want_ptrs != nil { + + if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { + mmUpdateConversationByUpdateMap.t.Errorf("RepositoryIMock.UpdateConversationByUpdateMap 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.convUID != nil && !minimock.Equal(*mm_want_ptrs.convUID, mm_got.convUID) { + mmUpdateConversationByUpdateMap.t.Errorf("RepositoryIMock.UpdateConversationByUpdateMap got unexpected parameter convUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.convUID, mm_got.convUID, minimock.Diff(*mm_want_ptrs.convUID, mm_got.convUID)) + } + + if mm_want_ptrs.updateMap != nil && !minimock.Equal(*mm_want_ptrs.updateMap, mm_got.updateMap) { + mmUpdateConversationByUpdateMap.t.Errorf("RepositoryIMock.UpdateConversationByUpdateMap got unexpected parameter updateMap, want: %#v, got: %#v%s\n", *mm_want_ptrs.updateMap, mm_got.updateMap, minimock.Diff(*mm_want_ptrs.updateMap, mm_got.updateMap)) + } + + } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { + mmUpdateConversationByUpdateMap.t.Errorf("RepositoryIMock.UpdateConversationByUpdateMap got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + } + + mm_results := mmUpdateConversationByUpdateMap.UpdateConversationByUpdateMapMock.defaultExpectation.results + if mm_results == nil { + mmUpdateConversationByUpdateMap.t.Fatal("No results are set for the RepositoryIMock.UpdateConversationByUpdateMap") + } + return (*mm_results).cp1, (*mm_results).err + } + if mmUpdateConversationByUpdateMap.funcUpdateConversationByUpdateMap != nil { + return mmUpdateConversationByUpdateMap.funcUpdateConversationByUpdateMap(ctx, convUID, updateMap) + } + mmUpdateConversationByUpdateMap.t.Fatalf("Unexpected call to RepositoryIMock.UpdateConversationByUpdateMap. %v %v %v", ctx, convUID, updateMap) + return +} + +// UpdateConversationByUpdateMapAfterCounter returns a count of finished RepositoryIMock.UpdateConversationByUpdateMap invocations +func (mmUpdateConversationByUpdateMap *RepositoryIMock) UpdateConversationByUpdateMapAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmUpdateConversationByUpdateMap.afterUpdateConversationByUpdateMapCounter) +} + +// UpdateConversationByUpdateMapBeforeCounter returns a count of RepositoryIMock.UpdateConversationByUpdateMap invocations +func (mmUpdateConversationByUpdateMap *RepositoryIMock) UpdateConversationByUpdateMapBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmUpdateConversationByUpdateMap.beforeUpdateConversationByUpdateMapCounter) +} + +// Calls returns a list of arguments used in each call to RepositoryIMock.UpdateConversationByUpdateMap. +// The list is in the same order as the calls were made (i.e. recent calls have a higher index) +func (mmUpdateConversationByUpdateMap *mRepositoryIMockUpdateConversationByUpdateMap) Calls() []*RepositoryIMockUpdateConversationByUpdateMapParams { + mmUpdateConversationByUpdateMap.mutex.RLock() + + argCopy := make([]*RepositoryIMockUpdateConversationByUpdateMapParams, len(mmUpdateConversationByUpdateMap.callArgs)) + copy(argCopy, mmUpdateConversationByUpdateMap.callArgs) + + mmUpdateConversationByUpdateMap.mutex.RUnlock() + + return argCopy +} + +// MinimockUpdateConversationByUpdateMapDone returns true if the count of the UpdateConversationByUpdateMap invocations corresponds +// the number of defined expectations +func (m *RepositoryIMock) MinimockUpdateConversationByUpdateMapDone() bool { + for _, e := range m.UpdateConversationByUpdateMapMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + return false + } + } + + return m.UpdateConversationByUpdateMapMock.invocationsDone() +} + +// MinimockUpdateConversationByUpdateMapInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockUpdateConversationByUpdateMapInspect() { + for _, e := range m.UpdateConversationByUpdateMapMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + m.t.Errorf("Expected call to RepositoryIMock.UpdateConversationByUpdateMap with params: %#v", *e.params) + } + } + + afterUpdateConversationByUpdateMapCounter := mm_atomic.LoadUint64(&m.afterUpdateConversationByUpdateMapCounter) + // if default expectation was set then invocations count should be greater than zero + if m.UpdateConversationByUpdateMapMock.defaultExpectation != nil && afterUpdateConversationByUpdateMapCounter < 1 { + if m.UpdateConversationByUpdateMapMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.UpdateConversationByUpdateMap") + } else { + m.t.Errorf("Expected call to RepositoryIMock.UpdateConversationByUpdateMap with params: %#v", *m.UpdateConversationByUpdateMapMock.defaultExpectation.params) + } + } + // if func was set then invocations count should be greater than zero + if m.funcUpdateConversationByUpdateMap != nil && afterUpdateConversationByUpdateMapCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.UpdateConversationByUpdateMap") + } + + if !m.UpdateConversationByUpdateMapMock.invocationsDone() && afterUpdateConversationByUpdateMapCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.UpdateConversationByUpdateMap but found %d calls", + mm_atomic.LoadUint64(&m.UpdateConversationByUpdateMapMock.expectedInvocations), afterUpdateConversationByUpdateMapCounter) + } +} + +type mRepositoryIMockUpdateExtraMetaData struct { + mock *RepositoryIMock + defaultExpectation *RepositoryIMockUpdateExtraMetaDataExpectation + expectations []*RepositoryIMockUpdateExtraMetaDataExpectation + + callArgs []*RepositoryIMockUpdateExtraMetaDataParams + mutex sync.RWMutex + + expectedInvocations uint64 +} + +// RepositoryIMockUpdateExtraMetaDataExpectation specifies expectation struct of the RepositoryI.UpdateExtraMetaData +type RepositoryIMockUpdateExtraMetaDataExpectation struct { + mock *RepositoryIMock + params *RepositoryIMockUpdateExtraMetaDataParams + paramPtrs *RepositoryIMockUpdateExtraMetaDataParamPtrs + results *RepositoryIMockUpdateExtraMetaDataResults + Counter uint64 +} + +// RepositoryIMockUpdateExtraMetaDataParams contains parameters of the RepositoryI.UpdateExtraMetaData +type RepositoryIMockUpdateExtraMetaDataParams struct { + ctx context.Context + fileUID uuid.UUID + failureReason string + convertingPipe string + chunkingPipe string + embeddingPipe string +} + +// RepositoryIMockUpdateExtraMetaDataParamPtrs contains pointers to parameters of the RepositoryI.UpdateExtraMetaData +type RepositoryIMockUpdateExtraMetaDataParamPtrs struct { + ctx *context.Context + fileUID *uuid.UUID + failureReason *string + convertingPipe *string + chunkingPipe *string + embeddingPipe *string +} + +// RepositoryIMockUpdateExtraMetaDataResults contains results of the RepositoryI.UpdateExtraMetaData +type RepositoryIMockUpdateExtraMetaDataResults struct { + err error +} + +// Expect sets up expected params for RepositoryI.UpdateExtraMetaData +func (mmUpdateExtraMetaData *mRepositoryIMockUpdateExtraMetaData) Expect(ctx context.Context, fileUID uuid.UUID, failureReason string, convertingPipe string, chunkingPipe string, embeddingPipe string) *mRepositoryIMockUpdateExtraMetaData { + if mmUpdateExtraMetaData.mock.funcUpdateExtraMetaData != nil { + mmUpdateExtraMetaData.mock.t.Fatalf("RepositoryIMock.UpdateExtraMetaData mock is already set by Set") + } + + if mmUpdateExtraMetaData.defaultExpectation == nil { + mmUpdateExtraMetaData.defaultExpectation = &RepositoryIMockUpdateExtraMetaDataExpectation{} + } + + if mmUpdateExtraMetaData.defaultExpectation.paramPtrs != nil { + mmUpdateExtraMetaData.mock.t.Fatalf("RepositoryIMock.UpdateExtraMetaData mock is already set by ExpectParams functions") } - mmTextChunkTableName.mock.funcTextChunkTableName = f - return mmTextChunkTableName.mock + mmUpdateExtraMetaData.defaultExpectation.params = &RepositoryIMockUpdateExtraMetaDataParams{ctx, fileUID, failureReason, convertingPipe, chunkingPipe, embeddingPipe} + for _, e := range mmUpdateExtraMetaData.expectations { + if minimock.Equal(e.params, mmUpdateExtraMetaData.defaultExpectation.params) { + mmUpdateExtraMetaData.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmUpdateExtraMetaData.defaultExpectation.params) + } + } + + return mmUpdateExtraMetaData } -// Times sets number of times RepositoryI.TextChunkTableName should be invoked -func (mmTextChunkTableName *mRepositoryIMockTextChunkTableName) Times(n uint64) *mRepositoryIMockTextChunkTableName { +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.UpdateExtraMetaData +func (mmUpdateExtraMetaData *mRepositoryIMockUpdateExtraMetaData) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockUpdateExtraMetaData { + if mmUpdateExtraMetaData.mock.funcUpdateExtraMetaData != nil { + mmUpdateExtraMetaData.mock.t.Fatalf("RepositoryIMock.UpdateExtraMetaData mock is already set by Set") + } + + if mmUpdateExtraMetaData.defaultExpectation == nil { + mmUpdateExtraMetaData.defaultExpectation = &RepositoryIMockUpdateExtraMetaDataExpectation{} + } + + if mmUpdateExtraMetaData.defaultExpectation.params != nil { + mmUpdateExtraMetaData.mock.t.Fatalf("RepositoryIMock.UpdateExtraMetaData mock is already set by Expect") + } + + if mmUpdateExtraMetaData.defaultExpectation.paramPtrs == nil { + mmUpdateExtraMetaData.defaultExpectation.paramPtrs = &RepositoryIMockUpdateExtraMetaDataParamPtrs{} + } + mmUpdateExtraMetaData.defaultExpectation.paramPtrs.ctx = &ctx + + return mmUpdateExtraMetaData +} + +// ExpectFileUIDParam2 sets up expected param fileUID for RepositoryI.UpdateExtraMetaData +func (mmUpdateExtraMetaData *mRepositoryIMockUpdateExtraMetaData) ExpectFileUIDParam2(fileUID uuid.UUID) *mRepositoryIMockUpdateExtraMetaData { + if mmUpdateExtraMetaData.mock.funcUpdateExtraMetaData != nil { + mmUpdateExtraMetaData.mock.t.Fatalf("RepositoryIMock.UpdateExtraMetaData mock is already set by Set") + } + + if mmUpdateExtraMetaData.defaultExpectation == nil { + mmUpdateExtraMetaData.defaultExpectation = &RepositoryIMockUpdateExtraMetaDataExpectation{} + } + + if mmUpdateExtraMetaData.defaultExpectation.params != nil { + mmUpdateExtraMetaData.mock.t.Fatalf("RepositoryIMock.UpdateExtraMetaData mock is already set by Expect") + } + + if mmUpdateExtraMetaData.defaultExpectation.paramPtrs == nil { + mmUpdateExtraMetaData.defaultExpectation.paramPtrs = &RepositoryIMockUpdateExtraMetaDataParamPtrs{} + } + mmUpdateExtraMetaData.defaultExpectation.paramPtrs.fileUID = &fileUID + + return mmUpdateExtraMetaData +} + +// ExpectFailureReasonParam3 sets up expected param failureReason for RepositoryI.UpdateExtraMetaData +func (mmUpdateExtraMetaData *mRepositoryIMockUpdateExtraMetaData) ExpectFailureReasonParam3(failureReason string) *mRepositoryIMockUpdateExtraMetaData { + if mmUpdateExtraMetaData.mock.funcUpdateExtraMetaData != nil { + mmUpdateExtraMetaData.mock.t.Fatalf("RepositoryIMock.UpdateExtraMetaData mock is already set by Set") + } + + if mmUpdateExtraMetaData.defaultExpectation == nil { + mmUpdateExtraMetaData.defaultExpectation = &RepositoryIMockUpdateExtraMetaDataExpectation{} + } + + if mmUpdateExtraMetaData.defaultExpectation.params != nil { + mmUpdateExtraMetaData.mock.t.Fatalf("RepositoryIMock.UpdateExtraMetaData mock is already set by Expect") + } + + if mmUpdateExtraMetaData.defaultExpectation.paramPtrs == nil { + mmUpdateExtraMetaData.defaultExpectation.paramPtrs = &RepositoryIMockUpdateExtraMetaDataParamPtrs{} + } + mmUpdateExtraMetaData.defaultExpectation.paramPtrs.failureReason = &failureReason + + return mmUpdateExtraMetaData +} + +// ExpectConvertingPipeParam4 sets up expected param convertingPipe for RepositoryI.UpdateExtraMetaData +func (mmUpdateExtraMetaData *mRepositoryIMockUpdateExtraMetaData) ExpectConvertingPipeParam4(convertingPipe string) *mRepositoryIMockUpdateExtraMetaData { + if mmUpdateExtraMetaData.mock.funcUpdateExtraMetaData != nil { + mmUpdateExtraMetaData.mock.t.Fatalf("RepositoryIMock.UpdateExtraMetaData mock is already set by Set") + } + + if mmUpdateExtraMetaData.defaultExpectation == nil { + mmUpdateExtraMetaData.defaultExpectation = &RepositoryIMockUpdateExtraMetaDataExpectation{} + } + + if mmUpdateExtraMetaData.defaultExpectation.params != nil { + mmUpdateExtraMetaData.mock.t.Fatalf("RepositoryIMock.UpdateExtraMetaData mock is already set by Expect") + } + + if mmUpdateExtraMetaData.defaultExpectation.paramPtrs == nil { + mmUpdateExtraMetaData.defaultExpectation.paramPtrs = &RepositoryIMockUpdateExtraMetaDataParamPtrs{} + } + mmUpdateExtraMetaData.defaultExpectation.paramPtrs.convertingPipe = &convertingPipe + + return mmUpdateExtraMetaData +} + +// ExpectChunkingPipeParam5 sets up expected param chunkingPipe for RepositoryI.UpdateExtraMetaData +func (mmUpdateExtraMetaData *mRepositoryIMockUpdateExtraMetaData) ExpectChunkingPipeParam5(chunkingPipe string) *mRepositoryIMockUpdateExtraMetaData { + if mmUpdateExtraMetaData.mock.funcUpdateExtraMetaData != nil { + mmUpdateExtraMetaData.mock.t.Fatalf("RepositoryIMock.UpdateExtraMetaData mock is already set by Set") + } + + if mmUpdateExtraMetaData.defaultExpectation == nil { + mmUpdateExtraMetaData.defaultExpectation = &RepositoryIMockUpdateExtraMetaDataExpectation{} + } + + if mmUpdateExtraMetaData.defaultExpectation.params != nil { + mmUpdateExtraMetaData.mock.t.Fatalf("RepositoryIMock.UpdateExtraMetaData mock is already set by Expect") + } + + if mmUpdateExtraMetaData.defaultExpectation.paramPtrs == nil { + mmUpdateExtraMetaData.defaultExpectation.paramPtrs = &RepositoryIMockUpdateExtraMetaDataParamPtrs{} + } + mmUpdateExtraMetaData.defaultExpectation.paramPtrs.chunkingPipe = &chunkingPipe + + return mmUpdateExtraMetaData +} + +// ExpectEmbeddingPipeParam6 sets up expected param embeddingPipe for RepositoryI.UpdateExtraMetaData +func (mmUpdateExtraMetaData *mRepositoryIMockUpdateExtraMetaData) ExpectEmbeddingPipeParam6(embeddingPipe string) *mRepositoryIMockUpdateExtraMetaData { + if mmUpdateExtraMetaData.mock.funcUpdateExtraMetaData != nil { + mmUpdateExtraMetaData.mock.t.Fatalf("RepositoryIMock.UpdateExtraMetaData mock is already set by Set") + } + + if mmUpdateExtraMetaData.defaultExpectation == nil { + mmUpdateExtraMetaData.defaultExpectation = &RepositoryIMockUpdateExtraMetaDataExpectation{} + } + + if mmUpdateExtraMetaData.defaultExpectation.params != nil { + mmUpdateExtraMetaData.mock.t.Fatalf("RepositoryIMock.UpdateExtraMetaData mock is already set by Expect") + } + + if mmUpdateExtraMetaData.defaultExpectation.paramPtrs == nil { + mmUpdateExtraMetaData.defaultExpectation.paramPtrs = &RepositoryIMockUpdateExtraMetaDataParamPtrs{} + } + mmUpdateExtraMetaData.defaultExpectation.paramPtrs.embeddingPipe = &embeddingPipe + + return mmUpdateExtraMetaData +} + +// Inspect accepts an inspector function that has same arguments as the RepositoryI.UpdateExtraMetaData +func (mmUpdateExtraMetaData *mRepositoryIMockUpdateExtraMetaData) Inspect(f func(ctx context.Context, fileUID uuid.UUID, failureReason string, convertingPipe string, chunkingPipe string, embeddingPipe string)) *mRepositoryIMockUpdateExtraMetaData { + if mmUpdateExtraMetaData.mock.inspectFuncUpdateExtraMetaData != nil { + mmUpdateExtraMetaData.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.UpdateExtraMetaData") + } + + mmUpdateExtraMetaData.mock.inspectFuncUpdateExtraMetaData = f + + return mmUpdateExtraMetaData +} + +// Return sets up results that will be returned by RepositoryI.UpdateExtraMetaData +func (mmUpdateExtraMetaData *mRepositoryIMockUpdateExtraMetaData) Return(err error) *RepositoryIMock { + if mmUpdateExtraMetaData.mock.funcUpdateExtraMetaData != nil { + mmUpdateExtraMetaData.mock.t.Fatalf("RepositoryIMock.UpdateExtraMetaData mock is already set by Set") + } + + if mmUpdateExtraMetaData.defaultExpectation == nil { + mmUpdateExtraMetaData.defaultExpectation = &RepositoryIMockUpdateExtraMetaDataExpectation{mock: mmUpdateExtraMetaData.mock} + } + mmUpdateExtraMetaData.defaultExpectation.results = &RepositoryIMockUpdateExtraMetaDataResults{err} + return mmUpdateExtraMetaData.mock +} + +// Set uses given function f to mock the RepositoryI.UpdateExtraMetaData method +func (mmUpdateExtraMetaData *mRepositoryIMockUpdateExtraMetaData) Set(f func(ctx context.Context, fileUID uuid.UUID, failureReason string, convertingPipe string, chunkingPipe string, embeddingPipe string) (err error)) *RepositoryIMock { + if mmUpdateExtraMetaData.defaultExpectation != nil { + mmUpdateExtraMetaData.mock.t.Fatalf("Default expectation is already set for the RepositoryI.UpdateExtraMetaData method") + } + + if len(mmUpdateExtraMetaData.expectations) > 0 { + mmUpdateExtraMetaData.mock.t.Fatalf("Some expectations are already set for the RepositoryI.UpdateExtraMetaData method") + } + + mmUpdateExtraMetaData.mock.funcUpdateExtraMetaData = f + return mmUpdateExtraMetaData.mock +} + +// When sets expectation for the RepositoryI.UpdateExtraMetaData which will trigger the result defined by the following +// Then helper +func (mmUpdateExtraMetaData *mRepositoryIMockUpdateExtraMetaData) When(ctx context.Context, fileUID uuid.UUID, failureReason string, convertingPipe string, chunkingPipe string, embeddingPipe string) *RepositoryIMockUpdateExtraMetaDataExpectation { + if mmUpdateExtraMetaData.mock.funcUpdateExtraMetaData != nil { + mmUpdateExtraMetaData.mock.t.Fatalf("RepositoryIMock.UpdateExtraMetaData mock is already set by Set") + } + + expectation := &RepositoryIMockUpdateExtraMetaDataExpectation{ + mock: mmUpdateExtraMetaData.mock, + params: &RepositoryIMockUpdateExtraMetaDataParams{ctx, fileUID, failureReason, convertingPipe, chunkingPipe, embeddingPipe}, + } + mmUpdateExtraMetaData.expectations = append(mmUpdateExtraMetaData.expectations, expectation) + return expectation +} + +// Then sets up RepositoryI.UpdateExtraMetaData return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockUpdateExtraMetaDataExpectation) Then(err error) *RepositoryIMock { + e.results = &RepositoryIMockUpdateExtraMetaDataResults{err} + return e.mock +} + +// Times sets number of times RepositoryI.UpdateExtraMetaData should be invoked +func (mmUpdateExtraMetaData *mRepositoryIMockUpdateExtraMetaData) Times(n uint64) *mRepositoryIMockUpdateExtraMetaData { if n == 0 { - mmTextChunkTableName.mock.t.Fatalf("Times of RepositoryIMock.TextChunkTableName mock can not be zero") + mmUpdateExtraMetaData.mock.t.Fatalf("Times of RepositoryIMock.UpdateExtraMetaData mock can not be zero") } - mm_atomic.StoreUint64(&mmTextChunkTableName.expectedInvocations, n) - return mmTextChunkTableName + mm_atomic.StoreUint64(&mmUpdateExtraMetaData.expectedInvocations, n) + return mmUpdateExtraMetaData } -func (mmTextChunkTableName *mRepositoryIMockTextChunkTableName) invocationsDone() bool { - if len(mmTextChunkTableName.expectations) == 0 && mmTextChunkTableName.defaultExpectation == nil && mmTextChunkTableName.mock.funcTextChunkTableName == nil { +func (mmUpdateExtraMetaData *mRepositoryIMockUpdateExtraMetaData) invocationsDone() bool { + if len(mmUpdateExtraMetaData.expectations) == 0 && mmUpdateExtraMetaData.defaultExpectation == nil && mmUpdateExtraMetaData.mock.funcUpdateExtraMetaData == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmTextChunkTableName.mock.afterTextChunkTableNameCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmTextChunkTableName.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmUpdateExtraMetaData.mock.afterUpdateExtraMetaDataCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmUpdateExtraMetaData.expectedInvocations) + + return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) +} + +// UpdateExtraMetaData implements repository.RepositoryI +func (mmUpdateExtraMetaData *RepositoryIMock) UpdateExtraMetaData(ctx context.Context, fileUID uuid.UUID, failureReason string, convertingPipe string, chunkingPipe string, embeddingPipe string) (err error) { + mm_atomic.AddUint64(&mmUpdateExtraMetaData.beforeUpdateExtraMetaDataCounter, 1) + defer mm_atomic.AddUint64(&mmUpdateExtraMetaData.afterUpdateExtraMetaDataCounter, 1) + + if mmUpdateExtraMetaData.inspectFuncUpdateExtraMetaData != nil { + mmUpdateExtraMetaData.inspectFuncUpdateExtraMetaData(ctx, fileUID, failureReason, convertingPipe, chunkingPipe, embeddingPipe) + } + + mm_params := RepositoryIMockUpdateExtraMetaDataParams{ctx, fileUID, failureReason, convertingPipe, chunkingPipe, embeddingPipe} + + // Record call args + mmUpdateExtraMetaData.UpdateExtraMetaDataMock.mutex.Lock() + mmUpdateExtraMetaData.UpdateExtraMetaDataMock.callArgs = append(mmUpdateExtraMetaData.UpdateExtraMetaDataMock.callArgs, &mm_params) + mmUpdateExtraMetaData.UpdateExtraMetaDataMock.mutex.Unlock() + + for _, e := range mmUpdateExtraMetaData.UpdateExtraMetaDataMock.expectations { + if minimock.Equal(*e.params, mm_params) { + mm_atomic.AddUint64(&e.Counter, 1) + return e.results.err + } + } + + if mmUpdateExtraMetaData.UpdateExtraMetaDataMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmUpdateExtraMetaData.UpdateExtraMetaDataMock.defaultExpectation.Counter, 1) + mm_want := mmUpdateExtraMetaData.UpdateExtraMetaDataMock.defaultExpectation.params + mm_want_ptrs := mmUpdateExtraMetaData.UpdateExtraMetaDataMock.defaultExpectation.paramPtrs + + mm_got := RepositoryIMockUpdateExtraMetaDataParams{ctx, fileUID, failureReason, convertingPipe, chunkingPipe, embeddingPipe} + + if mm_want_ptrs != nil { + + if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { + mmUpdateExtraMetaData.t.Errorf("RepositoryIMock.UpdateExtraMetaData 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) { + mmUpdateExtraMetaData.t.Errorf("RepositoryIMock.UpdateExtraMetaData 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)) + } - return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) -} + if mm_want_ptrs.failureReason != nil && !minimock.Equal(*mm_want_ptrs.failureReason, mm_got.failureReason) { + mmUpdateExtraMetaData.t.Errorf("RepositoryIMock.UpdateExtraMetaData got unexpected parameter failureReason, want: %#v, got: %#v%s\n", *mm_want_ptrs.failureReason, mm_got.failureReason, minimock.Diff(*mm_want_ptrs.failureReason, mm_got.failureReason)) + } -// TextChunkTableName implements repository.RepositoryI -func (mmTextChunkTableName *RepositoryIMock) TextChunkTableName() (s1 string) { - mm_atomic.AddUint64(&mmTextChunkTableName.beforeTextChunkTableNameCounter, 1) - defer mm_atomic.AddUint64(&mmTextChunkTableName.afterTextChunkTableNameCounter, 1) + if mm_want_ptrs.convertingPipe != nil && !minimock.Equal(*mm_want_ptrs.convertingPipe, mm_got.convertingPipe) { + mmUpdateExtraMetaData.t.Errorf("RepositoryIMock.UpdateExtraMetaData got unexpected parameter convertingPipe, want: %#v, got: %#v%s\n", *mm_want_ptrs.convertingPipe, mm_got.convertingPipe, minimock.Diff(*mm_want_ptrs.convertingPipe, mm_got.convertingPipe)) + } - if mmTextChunkTableName.inspectFuncTextChunkTableName != nil { - mmTextChunkTableName.inspectFuncTextChunkTableName() - } + if mm_want_ptrs.chunkingPipe != nil && !minimock.Equal(*mm_want_ptrs.chunkingPipe, mm_got.chunkingPipe) { + mmUpdateExtraMetaData.t.Errorf("RepositoryIMock.UpdateExtraMetaData got unexpected parameter chunkingPipe, want: %#v, got: %#v%s\n", *mm_want_ptrs.chunkingPipe, mm_got.chunkingPipe, minimock.Diff(*mm_want_ptrs.chunkingPipe, mm_got.chunkingPipe)) + } - if mmTextChunkTableName.TextChunkTableNameMock.defaultExpectation != nil { - mm_atomic.AddUint64(&mmTextChunkTableName.TextChunkTableNameMock.defaultExpectation.Counter, 1) + if mm_want_ptrs.embeddingPipe != nil && !minimock.Equal(*mm_want_ptrs.embeddingPipe, mm_got.embeddingPipe) { + mmUpdateExtraMetaData.t.Errorf("RepositoryIMock.UpdateExtraMetaData got unexpected parameter embeddingPipe, want: %#v, got: %#v%s\n", *mm_want_ptrs.embeddingPipe, mm_got.embeddingPipe, minimock.Diff(*mm_want_ptrs.embeddingPipe, mm_got.embeddingPipe)) + } - mm_results := mmTextChunkTableName.TextChunkTableNameMock.defaultExpectation.results + } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { + mmUpdateExtraMetaData.t.Errorf("RepositoryIMock.UpdateExtraMetaData got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + } + + mm_results := mmUpdateExtraMetaData.UpdateExtraMetaDataMock.defaultExpectation.results if mm_results == nil { - mmTextChunkTableName.t.Fatal("No results are set for the RepositoryIMock.TextChunkTableName") + mmUpdateExtraMetaData.t.Fatal("No results are set for the RepositoryIMock.UpdateExtraMetaData") } - return (*mm_results).s1 + return (*mm_results).err } - if mmTextChunkTableName.funcTextChunkTableName != nil { - return mmTextChunkTableName.funcTextChunkTableName() + if mmUpdateExtraMetaData.funcUpdateExtraMetaData != nil { + return mmUpdateExtraMetaData.funcUpdateExtraMetaData(ctx, fileUID, failureReason, convertingPipe, chunkingPipe, embeddingPipe) } - mmTextChunkTableName.t.Fatalf("Unexpected call to RepositoryIMock.TextChunkTableName.") + mmUpdateExtraMetaData.t.Fatalf("Unexpected call to RepositoryIMock.UpdateExtraMetaData. %v %v %v %v %v %v", ctx, fileUID, failureReason, convertingPipe, chunkingPipe, embeddingPipe) return } -// TextChunkTableNameAfterCounter returns a count of finished RepositoryIMock.TextChunkTableName invocations -func (mmTextChunkTableName *RepositoryIMock) TextChunkTableNameAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmTextChunkTableName.afterTextChunkTableNameCounter) +// UpdateExtraMetaDataAfterCounter returns a count of finished RepositoryIMock.UpdateExtraMetaData invocations +func (mmUpdateExtraMetaData *RepositoryIMock) UpdateExtraMetaDataAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmUpdateExtraMetaData.afterUpdateExtraMetaDataCounter) } -// TextChunkTableNameBeforeCounter returns a count of RepositoryIMock.TextChunkTableName invocations -func (mmTextChunkTableName *RepositoryIMock) TextChunkTableNameBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmTextChunkTableName.beforeTextChunkTableNameCounter) +// UpdateExtraMetaDataBeforeCounter returns a count of RepositoryIMock.UpdateExtraMetaData invocations +func (mmUpdateExtraMetaData *RepositoryIMock) UpdateExtraMetaDataBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmUpdateExtraMetaData.beforeUpdateExtraMetaDataCounter) } -// MinimockTextChunkTableNameDone returns true if the count of the TextChunkTableName invocations corresponds +// Calls returns a list of arguments used in each call to RepositoryIMock.UpdateExtraMetaData. +// The list is in the same order as the calls were made (i.e. recent calls have a higher index) +func (mmUpdateExtraMetaData *mRepositoryIMockUpdateExtraMetaData) Calls() []*RepositoryIMockUpdateExtraMetaDataParams { + mmUpdateExtraMetaData.mutex.RLock() + + argCopy := make([]*RepositoryIMockUpdateExtraMetaDataParams, len(mmUpdateExtraMetaData.callArgs)) + copy(argCopy, mmUpdateExtraMetaData.callArgs) + + mmUpdateExtraMetaData.mutex.RUnlock() + + return argCopy +} + +// MinimockUpdateExtraMetaDataDone returns true if the count of the UpdateExtraMetaData invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockTextChunkTableNameDone() bool { - for _, e := range m.TextChunkTableNameMock.expectations { +func (m *RepositoryIMock) MinimockUpdateExtraMetaDataDone() bool { + for _, e := range m.UpdateExtraMetaDataMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.TextChunkTableNameMock.invocationsDone() + return m.UpdateExtraMetaDataMock.invocationsDone() } -// MinimockTextChunkTableNameInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockTextChunkTableNameInspect() { - for _, e := range m.TextChunkTableNameMock.expectations { +// MinimockUpdateExtraMetaDataInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockUpdateExtraMetaDataInspect() { + for _, e := range m.UpdateExtraMetaDataMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { - m.t.Error("Expected call to RepositoryIMock.TextChunkTableName") + m.t.Errorf("Expected call to RepositoryIMock.UpdateExtraMetaData with params: %#v", *e.params) } } - afterTextChunkTableNameCounter := mm_atomic.LoadUint64(&m.afterTextChunkTableNameCounter) + afterUpdateExtraMetaDataCounter := mm_atomic.LoadUint64(&m.afterUpdateExtraMetaDataCounter) // if default expectation was set then invocations count should be greater than zero - if m.TextChunkTableNameMock.defaultExpectation != nil && afterTextChunkTableNameCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.TextChunkTableName") + if m.UpdateExtraMetaDataMock.defaultExpectation != nil && afterUpdateExtraMetaDataCounter < 1 { + if m.UpdateExtraMetaDataMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.UpdateExtraMetaData") + } else { + m.t.Errorf("Expected call to RepositoryIMock.UpdateExtraMetaData with params: %#v", *m.UpdateExtraMetaDataMock.defaultExpectation.params) + } } // if func was set then invocations count should be greater than zero - if m.funcTextChunkTableName != nil && afterTextChunkTableNameCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.TextChunkTableName") + if m.funcUpdateExtraMetaData != nil && afterUpdateExtraMetaDataCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.UpdateExtraMetaData") } - if !m.TextChunkTableNameMock.invocationsDone() && afterTextChunkTableNameCounter > 0 { - m.t.Errorf("Expected %d calls to RepositoryIMock.TextChunkTableName but found %d calls", - mm_atomic.LoadUint64(&m.TextChunkTableNameMock.expectedInvocations), afterTextChunkTableNameCounter) + if !m.UpdateExtraMetaDataMock.invocationsDone() && afterUpdateExtraMetaDataCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.UpdateExtraMetaData but found %d calls", + mm_atomic.LoadUint64(&m.UpdateExtraMetaDataMock.expectedInvocations), afterUpdateExtraMetaDataCounter) } } -type mRepositoryIMockUpdateChunk struct { +type mRepositoryIMockUpdateKnowledgeBase struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockUpdateChunkExpectation - expectations []*RepositoryIMockUpdateChunkExpectation + defaultExpectation *RepositoryIMockUpdateKnowledgeBaseExpectation + expectations []*RepositoryIMockUpdateKnowledgeBaseExpectation - callArgs []*RepositoryIMockUpdateChunkParams + callArgs []*RepositoryIMockUpdateKnowledgeBaseParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockUpdateChunkExpectation specifies expectation struct of the RepositoryI.UpdateChunk -type RepositoryIMockUpdateChunkExpectation struct { +// RepositoryIMockUpdateKnowledgeBaseExpectation specifies expectation struct of the RepositoryI.UpdateKnowledgeBase +type RepositoryIMockUpdateKnowledgeBaseExpectation struct { mock *RepositoryIMock - params *RepositoryIMockUpdateChunkParams - paramPtrs *RepositoryIMockUpdateChunkParamPtrs - results *RepositoryIMockUpdateChunkResults + params *RepositoryIMockUpdateKnowledgeBaseParams + paramPtrs *RepositoryIMockUpdateKnowledgeBaseParamPtrs + results *RepositoryIMockUpdateKnowledgeBaseResults Counter uint64 } -// RepositoryIMockUpdateChunkParams contains parameters of the RepositoryI.UpdateChunk -type RepositoryIMockUpdateChunkParams struct { +// RepositoryIMockUpdateKnowledgeBaseParams contains parameters of the RepositoryI.UpdateKnowledgeBase +type RepositoryIMockUpdateKnowledgeBaseParams struct { ctx context.Context - chunkUID string - updates map[string]interface{} + ownerUID string + kb mm_repository.KnowledgeBase } -// RepositoryIMockUpdateChunkParamPtrs contains pointers to parameters of the RepositoryI.UpdateChunk -type RepositoryIMockUpdateChunkParamPtrs struct { +// RepositoryIMockUpdateKnowledgeBaseParamPtrs contains pointers to parameters of the RepositoryI.UpdateKnowledgeBase +type RepositoryIMockUpdateKnowledgeBaseParamPtrs struct { ctx *context.Context - chunkUID *string - updates *map[string]interface{} + ownerUID *string + kb *mm_repository.KnowledgeBase } -// RepositoryIMockUpdateChunkResults contains results of the RepositoryI.UpdateChunk -type RepositoryIMockUpdateChunkResults struct { - tp1 *mm_repository.TextChunk +// RepositoryIMockUpdateKnowledgeBaseResults contains results of the RepositoryI.UpdateKnowledgeBase +type RepositoryIMockUpdateKnowledgeBaseResults struct { + kp1 *mm_repository.KnowledgeBase err error } -// Expect sets up expected params for RepositoryI.UpdateChunk -func (mmUpdateChunk *mRepositoryIMockUpdateChunk) Expect(ctx context.Context, chunkUID string, updates map[string]interface{}) *mRepositoryIMockUpdateChunk { - if mmUpdateChunk.mock.funcUpdateChunk != nil { - mmUpdateChunk.mock.t.Fatalf("RepositoryIMock.UpdateChunk mock is already set by Set") +// Expect sets up expected params for RepositoryI.UpdateKnowledgeBase +func (mmUpdateKnowledgeBase *mRepositoryIMockUpdateKnowledgeBase) Expect(ctx context.Context, ownerUID string, kb mm_repository.KnowledgeBase) *mRepositoryIMockUpdateKnowledgeBase { + if mmUpdateKnowledgeBase.mock.funcUpdateKnowledgeBase != nil { + mmUpdateKnowledgeBase.mock.t.Fatalf("RepositoryIMock.UpdateKnowledgeBase mock is already set by Set") } - if mmUpdateChunk.defaultExpectation == nil { - mmUpdateChunk.defaultExpectation = &RepositoryIMockUpdateChunkExpectation{} + if mmUpdateKnowledgeBase.defaultExpectation == nil { + mmUpdateKnowledgeBase.defaultExpectation = &RepositoryIMockUpdateKnowledgeBaseExpectation{} } - if mmUpdateChunk.defaultExpectation.paramPtrs != nil { - mmUpdateChunk.mock.t.Fatalf("RepositoryIMock.UpdateChunk mock is already set by ExpectParams functions") + if mmUpdateKnowledgeBase.defaultExpectation.paramPtrs != nil { + mmUpdateKnowledgeBase.mock.t.Fatalf("RepositoryIMock.UpdateKnowledgeBase mock is already set by ExpectParams functions") } - mmUpdateChunk.defaultExpectation.params = &RepositoryIMockUpdateChunkParams{ctx, chunkUID, updates} - for _, e := range mmUpdateChunk.expectations { - if minimock.Equal(e.params, mmUpdateChunk.defaultExpectation.params) { - mmUpdateChunk.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmUpdateChunk.defaultExpectation.params) + mmUpdateKnowledgeBase.defaultExpectation.params = &RepositoryIMockUpdateKnowledgeBaseParams{ctx, ownerUID, kb} + for _, e := range mmUpdateKnowledgeBase.expectations { + if minimock.Equal(e.params, mmUpdateKnowledgeBase.defaultExpectation.params) { + mmUpdateKnowledgeBase.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmUpdateKnowledgeBase.defaultExpectation.params) } } - return mmUpdateChunk + return mmUpdateKnowledgeBase } -// ExpectCtxParam1 sets up expected param ctx for RepositoryI.UpdateChunk -func (mmUpdateChunk *mRepositoryIMockUpdateChunk) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockUpdateChunk { - if mmUpdateChunk.mock.funcUpdateChunk != nil { - mmUpdateChunk.mock.t.Fatalf("RepositoryIMock.UpdateChunk mock is already set by Set") +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.UpdateKnowledgeBase +func (mmUpdateKnowledgeBase *mRepositoryIMockUpdateKnowledgeBase) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockUpdateKnowledgeBase { + if mmUpdateKnowledgeBase.mock.funcUpdateKnowledgeBase != nil { + mmUpdateKnowledgeBase.mock.t.Fatalf("RepositoryIMock.UpdateKnowledgeBase mock is already set by Set") } - if mmUpdateChunk.defaultExpectation == nil { - mmUpdateChunk.defaultExpectation = &RepositoryIMockUpdateChunkExpectation{} + if mmUpdateKnowledgeBase.defaultExpectation == nil { + mmUpdateKnowledgeBase.defaultExpectation = &RepositoryIMockUpdateKnowledgeBaseExpectation{} } - if mmUpdateChunk.defaultExpectation.params != nil { - mmUpdateChunk.mock.t.Fatalf("RepositoryIMock.UpdateChunk mock is already set by Expect") + if mmUpdateKnowledgeBase.defaultExpectation.params != nil { + mmUpdateKnowledgeBase.mock.t.Fatalf("RepositoryIMock.UpdateKnowledgeBase mock is already set by Expect") } - if mmUpdateChunk.defaultExpectation.paramPtrs == nil { - mmUpdateChunk.defaultExpectation.paramPtrs = &RepositoryIMockUpdateChunkParamPtrs{} + if mmUpdateKnowledgeBase.defaultExpectation.paramPtrs == nil { + mmUpdateKnowledgeBase.defaultExpectation.paramPtrs = &RepositoryIMockUpdateKnowledgeBaseParamPtrs{} } - mmUpdateChunk.defaultExpectation.paramPtrs.ctx = &ctx + mmUpdateKnowledgeBase.defaultExpectation.paramPtrs.ctx = &ctx - return mmUpdateChunk + return mmUpdateKnowledgeBase } -// ExpectChunkUIDParam2 sets up expected param chunkUID for RepositoryI.UpdateChunk -func (mmUpdateChunk *mRepositoryIMockUpdateChunk) ExpectChunkUIDParam2(chunkUID string) *mRepositoryIMockUpdateChunk { - if mmUpdateChunk.mock.funcUpdateChunk != nil { - mmUpdateChunk.mock.t.Fatalf("RepositoryIMock.UpdateChunk mock is already set by Set") +// ExpectOwnerUIDParam2 sets up expected param ownerUID for RepositoryI.UpdateKnowledgeBase +func (mmUpdateKnowledgeBase *mRepositoryIMockUpdateKnowledgeBase) ExpectOwnerUIDParam2(ownerUID string) *mRepositoryIMockUpdateKnowledgeBase { + if mmUpdateKnowledgeBase.mock.funcUpdateKnowledgeBase != nil { + mmUpdateKnowledgeBase.mock.t.Fatalf("RepositoryIMock.UpdateKnowledgeBase mock is already set by Set") } - if mmUpdateChunk.defaultExpectation == nil { - mmUpdateChunk.defaultExpectation = &RepositoryIMockUpdateChunkExpectation{} + if mmUpdateKnowledgeBase.defaultExpectation == nil { + mmUpdateKnowledgeBase.defaultExpectation = &RepositoryIMockUpdateKnowledgeBaseExpectation{} } - if mmUpdateChunk.defaultExpectation.params != nil { - mmUpdateChunk.mock.t.Fatalf("RepositoryIMock.UpdateChunk mock is already set by Expect") + if mmUpdateKnowledgeBase.defaultExpectation.params != nil { + mmUpdateKnowledgeBase.mock.t.Fatalf("RepositoryIMock.UpdateKnowledgeBase mock is already set by Expect") } - if mmUpdateChunk.defaultExpectation.paramPtrs == nil { - mmUpdateChunk.defaultExpectation.paramPtrs = &RepositoryIMockUpdateChunkParamPtrs{} + if mmUpdateKnowledgeBase.defaultExpectation.paramPtrs == nil { + mmUpdateKnowledgeBase.defaultExpectation.paramPtrs = &RepositoryIMockUpdateKnowledgeBaseParamPtrs{} } - mmUpdateChunk.defaultExpectation.paramPtrs.chunkUID = &chunkUID + mmUpdateKnowledgeBase.defaultExpectation.paramPtrs.ownerUID = &ownerUID - return mmUpdateChunk + return mmUpdateKnowledgeBase } -// ExpectUpdatesParam3 sets up expected param updates for RepositoryI.UpdateChunk -func (mmUpdateChunk *mRepositoryIMockUpdateChunk) ExpectUpdatesParam3(updates map[string]interface{}) *mRepositoryIMockUpdateChunk { - if mmUpdateChunk.mock.funcUpdateChunk != nil { - mmUpdateChunk.mock.t.Fatalf("RepositoryIMock.UpdateChunk mock is already set by Set") +// ExpectKbParam3 sets up expected param kb for RepositoryI.UpdateKnowledgeBase +func (mmUpdateKnowledgeBase *mRepositoryIMockUpdateKnowledgeBase) ExpectKbParam3(kb mm_repository.KnowledgeBase) *mRepositoryIMockUpdateKnowledgeBase { + if mmUpdateKnowledgeBase.mock.funcUpdateKnowledgeBase != nil { + mmUpdateKnowledgeBase.mock.t.Fatalf("RepositoryIMock.UpdateKnowledgeBase mock is already set by Set") } - if mmUpdateChunk.defaultExpectation == nil { - mmUpdateChunk.defaultExpectation = &RepositoryIMockUpdateChunkExpectation{} + if mmUpdateKnowledgeBase.defaultExpectation == nil { + mmUpdateKnowledgeBase.defaultExpectation = &RepositoryIMockUpdateKnowledgeBaseExpectation{} } - if mmUpdateChunk.defaultExpectation.params != nil { - mmUpdateChunk.mock.t.Fatalf("RepositoryIMock.UpdateChunk mock is already set by Expect") + if mmUpdateKnowledgeBase.defaultExpectation.params != nil { + mmUpdateKnowledgeBase.mock.t.Fatalf("RepositoryIMock.UpdateKnowledgeBase mock is already set by Expect") } - if mmUpdateChunk.defaultExpectation.paramPtrs == nil { - mmUpdateChunk.defaultExpectation.paramPtrs = &RepositoryIMockUpdateChunkParamPtrs{} + if mmUpdateKnowledgeBase.defaultExpectation.paramPtrs == nil { + mmUpdateKnowledgeBase.defaultExpectation.paramPtrs = &RepositoryIMockUpdateKnowledgeBaseParamPtrs{} } - mmUpdateChunk.defaultExpectation.paramPtrs.updates = &updates + mmUpdateKnowledgeBase.defaultExpectation.paramPtrs.kb = &kb - return mmUpdateChunk + return mmUpdateKnowledgeBase } -// Inspect accepts an inspector function that has same arguments as the RepositoryI.UpdateChunk -func (mmUpdateChunk *mRepositoryIMockUpdateChunk) Inspect(f func(ctx context.Context, chunkUID string, updates map[string]interface{})) *mRepositoryIMockUpdateChunk { - if mmUpdateChunk.mock.inspectFuncUpdateChunk != nil { - mmUpdateChunk.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.UpdateChunk") +// Inspect accepts an inspector function that has same arguments as the RepositoryI.UpdateKnowledgeBase +func (mmUpdateKnowledgeBase *mRepositoryIMockUpdateKnowledgeBase) Inspect(f func(ctx context.Context, ownerUID string, kb mm_repository.KnowledgeBase)) *mRepositoryIMockUpdateKnowledgeBase { + if mmUpdateKnowledgeBase.mock.inspectFuncUpdateKnowledgeBase != nil { + mmUpdateKnowledgeBase.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.UpdateKnowledgeBase") } - mmUpdateChunk.mock.inspectFuncUpdateChunk = f + mmUpdateKnowledgeBase.mock.inspectFuncUpdateKnowledgeBase = f - return mmUpdateChunk + return mmUpdateKnowledgeBase } -// Return sets up results that will be returned by RepositoryI.UpdateChunk -func (mmUpdateChunk *mRepositoryIMockUpdateChunk) Return(tp1 *mm_repository.TextChunk, err error) *RepositoryIMock { - if mmUpdateChunk.mock.funcUpdateChunk != nil { - mmUpdateChunk.mock.t.Fatalf("RepositoryIMock.UpdateChunk mock is already set by Set") +// Return sets up results that will be returned by RepositoryI.UpdateKnowledgeBase +func (mmUpdateKnowledgeBase *mRepositoryIMockUpdateKnowledgeBase) Return(kp1 *mm_repository.KnowledgeBase, err error) *RepositoryIMock { + if mmUpdateKnowledgeBase.mock.funcUpdateKnowledgeBase != nil { + mmUpdateKnowledgeBase.mock.t.Fatalf("RepositoryIMock.UpdateKnowledgeBase mock is already set by Set") } - if mmUpdateChunk.defaultExpectation == nil { - mmUpdateChunk.defaultExpectation = &RepositoryIMockUpdateChunkExpectation{mock: mmUpdateChunk.mock} + if mmUpdateKnowledgeBase.defaultExpectation == nil { + mmUpdateKnowledgeBase.defaultExpectation = &RepositoryIMockUpdateKnowledgeBaseExpectation{mock: mmUpdateKnowledgeBase.mock} } - mmUpdateChunk.defaultExpectation.results = &RepositoryIMockUpdateChunkResults{tp1, err} - return mmUpdateChunk.mock + mmUpdateKnowledgeBase.defaultExpectation.results = &RepositoryIMockUpdateKnowledgeBaseResults{kp1, err} + return mmUpdateKnowledgeBase.mock } -// Set uses given function f to mock the RepositoryI.UpdateChunk method -func (mmUpdateChunk *mRepositoryIMockUpdateChunk) Set(f func(ctx context.Context, chunkUID string, updates map[string]interface{}) (tp1 *mm_repository.TextChunk, err error)) *RepositoryIMock { - if mmUpdateChunk.defaultExpectation != nil { - mmUpdateChunk.mock.t.Fatalf("Default expectation is already set for the RepositoryI.UpdateChunk method") +// Set uses given function f to mock the RepositoryI.UpdateKnowledgeBase method +func (mmUpdateKnowledgeBase *mRepositoryIMockUpdateKnowledgeBase) Set(f func(ctx context.Context, ownerUID string, kb mm_repository.KnowledgeBase) (kp1 *mm_repository.KnowledgeBase, err error)) *RepositoryIMock { + if mmUpdateKnowledgeBase.defaultExpectation != nil { + mmUpdateKnowledgeBase.mock.t.Fatalf("Default expectation is already set for the RepositoryI.UpdateKnowledgeBase method") } - if len(mmUpdateChunk.expectations) > 0 { - mmUpdateChunk.mock.t.Fatalf("Some expectations are already set for the RepositoryI.UpdateChunk method") + if len(mmUpdateKnowledgeBase.expectations) > 0 { + mmUpdateKnowledgeBase.mock.t.Fatalf("Some expectations are already set for the RepositoryI.UpdateKnowledgeBase method") } - mmUpdateChunk.mock.funcUpdateChunk = f - return mmUpdateChunk.mock + mmUpdateKnowledgeBase.mock.funcUpdateKnowledgeBase = f + return mmUpdateKnowledgeBase.mock } -// When sets expectation for the RepositoryI.UpdateChunk which will trigger the result defined by the following +// When sets expectation for the RepositoryI.UpdateKnowledgeBase which will trigger the result defined by the following // Then helper -func (mmUpdateChunk *mRepositoryIMockUpdateChunk) When(ctx context.Context, chunkUID string, updates map[string]interface{}) *RepositoryIMockUpdateChunkExpectation { - if mmUpdateChunk.mock.funcUpdateChunk != nil { - mmUpdateChunk.mock.t.Fatalf("RepositoryIMock.UpdateChunk mock is already set by Set") +func (mmUpdateKnowledgeBase *mRepositoryIMockUpdateKnowledgeBase) When(ctx context.Context, ownerUID string, kb mm_repository.KnowledgeBase) *RepositoryIMockUpdateKnowledgeBaseExpectation { + if mmUpdateKnowledgeBase.mock.funcUpdateKnowledgeBase != nil { + mmUpdateKnowledgeBase.mock.t.Fatalf("RepositoryIMock.UpdateKnowledgeBase mock is already set by Set") } - expectation := &RepositoryIMockUpdateChunkExpectation{ - mock: mmUpdateChunk.mock, - params: &RepositoryIMockUpdateChunkParams{ctx, chunkUID, updates}, + expectation := &RepositoryIMockUpdateKnowledgeBaseExpectation{ + mock: mmUpdateKnowledgeBase.mock, + params: &RepositoryIMockUpdateKnowledgeBaseParams{ctx, ownerUID, kb}, } - mmUpdateChunk.expectations = append(mmUpdateChunk.expectations, expectation) + mmUpdateKnowledgeBase.expectations = append(mmUpdateKnowledgeBase.expectations, expectation) return expectation } -// Then sets up RepositoryI.UpdateChunk return parameters for the expectation previously defined by the When method -func (e *RepositoryIMockUpdateChunkExpectation) Then(tp1 *mm_repository.TextChunk, err error) *RepositoryIMock { - e.results = &RepositoryIMockUpdateChunkResults{tp1, err} +// Then sets up RepositoryI.UpdateKnowledgeBase return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockUpdateKnowledgeBaseExpectation) Then(kp1 *mm_repository.KnowledgeBase, err error) *RepositoryIMock { + e.results = &RepositoryIMockUpdateKnowledgeBaseResults{kp1, err} return e.mock } -// Times sets number of times RepositoryI.UpdateChunk should be invoked -func (mmUpdateChunk *mRepositoryIMockUpdateChunk) Times(n uint64) *mRepositoryIMockUpdateChunk { +// Times sets number of times RepositoryI.UpdateKnowledgeBase should be invoked +func (mmUpdateKnowledgeBase *mRepositoryIMockUpdateKnowledgeBase) Times(n uint64) *mRepositoryIMockUpdateKnowledgeBase { if n == 0 { - mmUpdateChunk.mock.t.Fatalf("Times of RepositoryIMock.UpdateChunk mock can not be zero") + mmUpdateKnowledgeBase.mock.t.Fatalf("Times of RepositoryIMock.UpdateKnowledgeBase mock can not be zero") } - mm_atomic.StoreUint64(&mmUpdateChunk.expectedInvocations, n) - return mmUpdateChunk + mm_atomic.StoreUint64(&mmUpdateKnowledgeBase.expectedInvocations, n) + return mmUpdateKnowledgeBase } -func (mmUpdateChunk *mRepositoryIMockUpdateChunk) invocationsDone() bool { - if len(mmUpdateChunk.expectations) == 0 && mmUpdateChunk.defaultExpectation == nil && mmUpdateChunk.mock.funcUpdateChunk == nil { +func (mmUpdateKnowledgeBase *mRepositoryIMockUpdateKnowledgeBase) invocationsDone() bool { + if len(mmUpdateKnowledgeBase.expectations) == 0 && mmUpdateKnowledgeBase.defaultExpectation == nil && mmUpdateKnowledgeBase.mock.funcUpdateKnowledgeBase == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmUpdateChunk.mock.afterUpdateChunkCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmUpdateChunk.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmUpdateKnowledgeBase.mock.afterUpdateKnowledgeBaseCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmUpdateKnowledgeBase.expectedInvocations) return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) } -// UpdateChunk implements repository.RepositoryI -func (mmUpdateChunk *RepositoryIMock) UpdateChunk(ctx context.Context, chunkUID string, updates map[string]interface{}) (tp1 *mm_repository.TextChunk, err error) { - mm_atomic.AddUint64(&mmUpdateChunk.beforeUpdateChunkCounter, 1) - defer mm_atomic.AddUint64(&mmUpdateChunk.afterUpdateChunkCounter, 1) +// UpdateKnowledgeBase implements repository.RepositoryI +func (mmUpdateKnowledgeBase *RepositoryIMock) UpdateKnowledgeBase(ctx context.Context, ownerUID string, kb mm_repository.KnowledgeBase) (kp1 *mm_repository.KnowledgeBase, err error) { + mm_atomic.AddUint64(&mmUpdateKnowledgeBase.beforeUpdateKnowledgeBaseCounter, 1) + defer mm_atomic.AddUint64(&mmUpdateKnowledgeBase.afterUpdateKnowledgeBaseCounter, 1) - if mmUpdateChunk.inspectFuncUpdateChunk != nil { - mmUpdateChunk.inspectFuncUpdateChunk(ctx, chunkUID, updates) + if mmUpdateKnowledgeBase.inspectFuncUpdateKnowledgeBase != nil { + mmUpdateKnowledgeBase.inspectFuncUpdateKnowledgeBase(ctx, ownerUID, kb) } - mm_params := RepositoryIMockUpdateChunkParams{ctx, chunkUID, updates} + mm_params := RepositoryIMockUpdateKnowledgeBaseParams{ctx, ownerUID, kb} // Record call args - mmUpdateChunk.UpdateChunkMock.mutex.Lock() - mmUpdateChunk.UpdateChunkMock.callArgs = append(mmUpdateChunk.UpdateChunkMock.callArgs, &mm_params) - mmUpdateChunk.UpdateChunkMock.mutex.Unlock() + mmUpdateKnowledgeBase.UpdateKnowledgeBaseMock.mutex.Lock() + mmUpdateKnowledgeBase.UpdateKnowledgeBaseMock.callArgs = append(mmUpdateKnowledgeBase.UpdateKnowledgeBaseMock.callArgs, &mm_params) + mmUpdateKnowledgeBase.UpdateKnowledgeBaseMock.mutex.Unlock() - for _, e := range mmUpdateChunk.UpdateChunkMock.expectations { + for _, e := range mmUpdateKnowledgeBase.UpdateKnowledgeBaseMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.tp1, e.results.err + return e.results.kp1, e.results.err } } - if mmUpdateChunk.UpdateChunkMock.defaultExpectation != nil { - mm_atomic.AddUint64(&mmUpdateChunk.UpdateChunkMock.defaultExpectation.Counter, 1) - mm_want := mmUpdateChunk.UpdateChunkMock.defaultExpectation.params - mm_want_ptrs := mmUpdateChunk.UpdateChunkMock.defaultExpectation.paramPtrs + if mmUpdateKnowledgeBase.UpdateKnowledgeBaseMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmUpdateKnowledgeBase.UpdateKnowledgeBaseMock.defaultExpectation.Counter, 1) + mm_want := mmUpdateKnowledgeBase.UpdateKnowledgeBaseMock.defaultExpectation.params + mm_want_ptrs := mmUpdateKnowledgeBase.UpdateKnowledgeBaseMock.defaultExpectation.paramPtrs - mm_got := RepositoryIMockUpdateChunkParams{ctx, chunkUID, updates} + mm_got := RepositoryIMockUpdateKnowledgeBaseParams{ctx, ownerUID, kb} if mm_want_ptrs != nil { if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { - mmUpdateChunk.t.Errorf("RepositoryIMock.UpdateChunk 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)) + mmUpdateKnowledgeBase.t.Errorf("RepositoryIMock.UpdateKnowledgeBase 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.chunkUID != nil && !minimock.Equal(*mm_want_ptrs.chunkUID, mm_got.chunkUID) { - mmUpdateChunk.t.Errorf("RepositoryIMock.UpdateChunk got unexpected parameter chunkUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.chunkUID, mm_got.chunkUID, minimock.Diff(*mm_want_ptrs.chunkUID, mm_got.chunkUID)) + if mm_want_ptrs.ownerUID != nil && !minimock.Equal(*mm_want_ptrs.ownerUID, mm_got.ownerUID) { + mmUpdateKnowledgeBase.t.Errorf("RepositoryIMock.UpdateKnowledgeBase 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.updates != nil && !minimock.Equal(*mm_want_ptrs.updates, mm_got.updates) { - mmUpdateChunk.t.Errorf("RepositoryIMock.UpdateChunk got unexpected parameter updates, want: %#v, got: %#v%s\n", *mm_want_ptrs.updates, mm_got.updates, minimock.Diff(*mm_want_ptrs.updates, mm_got.updates)) + if mm_want_ptrs.kb != nil && !minimock.Equal(*mm_want_ptrs.kb, mm_got.kb) { + mmUpdateKnowledgeBase.t.Errorf("RepositoryIMock.UpdateKnowledgeBase got unexpected parameter kb, want: %#v, got: %#v%s\n", *mm_want_ptrs.kb, mm_got.kb, minimock.Diff(*mm_want_ptrs.kb, mm_got.kb)) } } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { - mmUpdateChunk.t.Errorf("RepositoryIMock.UpdateChunk got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + mmUpdateKnowledgeBase.t.Errorf("RepositoryIMock.UpdateKnowledgeBase got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) } - mm_results := mmUpdateChunk.UpdateChunkMock.defaultExpectation.results + mm_results := mmUpdateKnowledgeBase.UpdateKnowledgeBaseMock.defaultExpectation.results if mm_results == nil { - mmUpdateChunk.t.Fatal("No results are set for the RepositoryIMock.UpdateChunk") + mmUpdateKnowledgeBase.t.Fatal("No results are set for the RepositoryIMock.UpdateKnowledgeBase") } - return (*mm_results).tp1, (*mm_results).err + return (*mm_results).kp1, (*mm_results).err } - if mmUpdateChunk.funcUpdateChunk != nil { - return mmUpdateChunk.funcUpdateChunk(ctx, chunkUID, updates) + if mmUpdateKnowledgeBase.funcUpdateKnowledgeBase != nil { + return mmUpdateKnowledgeBase.funcUpdateKnowledgeBase(ctx, ownerUID, kb) } - mmUpdateChunk.t.Fatalf("Unexpected call to RepositoryIMock.UpdateChunk. %v %v %v", ctx, chunkUID, updates) + mmUpdateKnowledgeBase.t.Fatalf("Unexpected call to RepositoryIMock.UpdateKnowledgeBase. %v %v %v", ctx, ownerUID, kb) return } -// UpdateChunkAfterCounter returns a count of finished RepositoryIMock.UpdateChunk invocations -func (mmUpdateChunk *RepositoryIMock) UpdateChunkAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmUpdateChunk.afterUpdateChunkCounter) +// UpdateKnowledgeBaseAfterCounter returns a count of finished RepositoryIMock.UpdateKnowledgeBase invocations +func (mmUpdateKnowledgeBase *RepositoryIMock) UpdateKnowledgeBaseAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmUpdateKnowledgeBase.afterUpdateKnowledgeBaseCounter) } -// UpdateChunkBeforeCounter returns a count of RepositoryIMock.UpdateChunk invocations -func (mmUpdateChunk *RepositoryIMock) UpdateChunkBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmUpdateChunk.beforeUpdateChunkCounter) +// UpdateKnowledgeBaseBeforeCounter returns a count of RepositoryIMock.UpdateKnowledgeBase invocations +func (mmUpdateKnowledgeBase *RepositoryIMock) UpdateKnowledgeBaseBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmUpdateKnowledgeBase.beforeUpdateKnowledgeBaseCounter) } -// Calls returns a list of arguments used in each call to RepositoryIMock.UpdateChunk. +// Calls returns a list of arguments used in each call to RepositoryIMock.UpdateKnowledgeBase. // The list is in the same order as the calls were made (i.e. recent calls have a higher index) -func (mmUpdateChunk *mRepositoryIMockUpdateChunk) Calls() []*RepositoryIMockUpdateChunkParams { - mmUpdateChunk.mutex.RLock() +func (mmUpdateKnowledgeBase *mRepositoryIMockUpdateKnowledgeBase) Calls() []*RepositoryIMockUpdateKnowledgeBaseParams { + mmUpdateKnowledgeBase.mutex.RLock() - argCopy := make([]*RepositoryIMockUpdateChunkParams, len(mmUpdateChunk.callArgs)) - copy(argCopy, mmUpdateChunk.callArgs) + argCopy := make([]*RepositoryIMockUpdateKnowledgeBaseParams, len(mmUpdateKnowledgeBase.callArgs)) + copy(argCopy, mmUpdateKnowledgeBase.callArgs) - mmUpdateChunk.mutex.RUnlock() + mmUpdateKnowledgeBase.mutex.RUnlock() return argCopy } -// MinimockUpdateChunkDone returns true if the count of the UpdateChunk invocations corresponds +// MinimockUpdateKnowledgeBaseDone returns true if the count of the UpdateKnowledgeBase invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockUpdateChunkDone() bool { - for _, e := range m.UpdateChunkMock.expectations { +func (m *RepositoryIMock) MinimockUpdateKnowledgeBaseDone() bool { + for _, e := range m.UpdateKnowledgeBaseMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.UpdateChunkMock.invocationsDone() -} - -// MinimockUpdateChunkInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockUpdateChunkInspect() { - for _, e := range m.UpdateChunkMock.expectations { - if mm_atomic.LoadUint64(&e.Counter) < 1 { - m.t.Errorf("Expected call to RepositoryIMock.UpdateChunk with params: %#v", *e.params) - } - } - - afterUpdateChunkCounter := mm_atomic.LoadUint64(&m.afterUpdateChunkCounter) - // if default expectation was set then invocations count should be greater than zero - if m.UpdateChunkMock.defaultExpectation != nil && afterUpdateChunkCounter < 1 { - if m.UpdateChunkMock.defaultExpectation.params == nil { - m.t.Error("Expected call to RepositoryIMock.UpdateChunk") - } else { - m.t.Errorf("Expected call to RepositoryIMock.UpdateChunk with params: %#v", *m.UpdateChunkMock.defaultExpectation.params) - } - } - // if func was set then invocations count should be greater than zero - if m.funcUpdateChunk != nil && afterUpdateChunkCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.UpdateChunk") - } - - if !m.UpdateChunkMock.invocationsDone() && afterUpdateChunkCounter > 0 { - m.t.Errorf("Expected %d calls to RepositoryIMock.UpdateChunk but found %d calls", - mm_atomic.LoadUint64(&m.UpdateChunkMock.expectedInvocations), afterUpdateChunkCounter) - } -} - -type mRepositoryIMockUpdateExtraMetaData struct { - mock *RepositoryIMock - defaultExpectation *RepositoryIMockUpdateExtraMetaDataExpectation - expectations []*RepositoryIMockUpdateExtraMetaDataExpectation - - callArgs []*RepositoryIMockUpdateExtraMetaDataParams - mutex sync.RWMutex - - expectedInvocations uint64 -} - -// RepositoryIMockUpdateExtraMetaDataExpectation specifies expectation struct of the RepositoryI.UpdateExtraMetaData -type RepositoryIMockUpdateExtraMetaDataExpectation struct { - mock *RepositoryIMock - params *RepositoryIMockUpdateExtraMetaDataParams - paramPtrs *RepositoryIMockUpdateExtraMetaDataParamPtrs - results *RepositoryIMockUpdateExtraMetaDataResults - Counter uint64 -} - -// RepositoryIMockUpdateExtraMetaDataParams contains parameters of the RepositoryI.UpdateExtraMetaData -type RepositoryIMockUpdateExtraMetaDataParams struct { - ctx context.Context - fileUID uuid.UUID - failureReason string - convertingPipe string - chunkingPipe string - embeddingPipe string -} - -// RepositoryIMockUpdateExtraMetaDataParamPtrs contains pointers to parameters of the RepositoryI.UpdateExtraMetaData -type RepositoryIMockUpdateExtraMetaDataParamPtrs struct { - ctx *context.Context - fileUID *uuid.UUID - failureReason *string - convertingPipe *string - chunkingPipe *string - embeddingPipe *string -} - -// RepositoryIMockUpdateExtraMetaDataResults contains results of the RepositoryI.UpdateExtraMetaData -type RepositoryIMockUpdateExtraMetaDataResults struct { - err error + return m.UpdateKnowledgeBaseMock.invocationsDone() } -// Expect sets up expected params for RepositoryI.UpdateExtraMetaData -func (mmUpdateExtraMetaData *mRepositoryIMockUpdateExtraMetaData) Expect(ctx context.Context, fileUID uuid.UUID, failureReason string, convertingPipe string, chunkingPipe string, embeddingPipe string) *mRepositoryIMockUpdateExtraMetaData { - if mmUpdateExtraMetaData.mock.funcUpdateExtraMetaData != nil { - mmUpdateExtraMetaData.mock.t.Fatalf("RepositoryIMock.UpdateExtraMetaData mock is already set by Set") - } - - if mmUpdateExtraMetaData.defaultExpectation == nil { - mmUpdateExtraMetaData.defaultExpectation = &RepositoryIMockUpdateExtraMetaDataExpectation{} - } - - if mmUpdateExtraMetaData.defaultExpectation.paramPtrs != nil { - mmUpdateExtraMetaData.mock.t.Fatalf("RepositoryIMock.UpdateExtraMetaData mock is already set by ExpectParams functions") - } - - mmUpdateExtraMetaData.defaultExpectation.params = &RepositoryIMockUpdateExtraMetaDataParams{ctx, fileUID, failureReason, convertingPipe, chunkingPipe, embeddingPipe} - for _, e := range mmUpdateExtraMetaData.expectations { - if minimock.Equal(e.params, mmUpdateExtraMetaData.defaultExpectation.params) { - mmUpdateExtraMetaData.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmUpdateExtraMetaData.defaultExpectation.params) +// MinimockUpdateKnowledgeBaseInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockUpdateKnowledgeBaseInspect() { + for _, e := range m.UpdateKnowledgeBaseMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + m.t.Errorf("Expected call to RepositoryIMock.UpdateKnowledgeBase with params: %#v", *e.params) } } - return mmUpdateExtraMetaData -} - -// ExpectCtxParam1 sets up expected param ctx for RepositoryI.UpdateExtraMetaData -func (mmUpdateExtraMetaData *mRepositoryIMockUpdateExtraMetaData) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockUpdateExtraMetaData { - if mmUpdateExtraMetaData.mock.funcUpdateExtraMetaData != nil { - mmUpdateExtraMetaData.mock.t.Fatalf("RepositoryIMock.UpdateExtraMetaData mock is already set by Set") + afterUpdateKnowledgeBaseCounter := mm_atomic.LoadUint64(&m.afterUpdateKnowledgeBaseCounter) + // if default expectation was set then invocations count should be greater than zero + if m.UpdateKnowledgeBaseMock.defaultExpectation != nil && afterUpdateKnowledgeBaseCounter < 1 { + if m.UpdateKnowledgeBaseMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.UpdateKnowledgeBase") + } else { + m.t.Errorf("Expected call to RepositoryIMock.UpdateKnowledgeBase with params: %#v", *m.UpdateKnowledgeBaseMock.defaultExpectation.params) + } } - - if mmUpdateExtraMetaData.defaultExpectation == nil { - mmUpdateExtraMetaData.defaultExpectation = &RepositoryIMockUpdateExtraMetaDataExpectation{} + // if func was set then invocations count should be greater than zero + if m.funcUpdateKnowledgeBase != nil && afterUpdateKnowledgeBaseCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.UpdateKnowledgeBase") } - if mmUpdateExtraMetaData.defaultExpectation.params != nil { - mmUpdateExtraMetaData.mock.t.Fatalf("RepositoryIMock.UpdateExtraMetaData mock is already set by Expect") + if !m.UpdateKnowledgeBaseMock.invocationsDone() && afterUpdateKnowledgeBaseCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.UpdateKnowledgeBase but found %d calls", + mm_atomic.LoadUint64(&m.UpdateKnowledgeBaseMock.expectedInvocations), afterUpdateKnowledgeBaseCounter) } +} - if mmUpdateExtraMetaData.defaultExpectation.paramPtrs == nil { - mmUpdateExtraMetaData.defaultExpectation.paramPtrs = &RepositoryIMockUpdateExtraMetaDataParamPtrs{} - } - mmUpdateExtraMetaData.defaultExpectation.paramPtrs.ctx = &ctx +type mRepositoryIMockUpdateKnowledgeBaseFile struct { + mock *RepositoryIMock + defaultExpectation *RepositoryIMockUpdateKnowledgeBaseFileExpectation + expectations []*RepositoryIMockUpdateKnowledgeBaseFileExpectation - return mmUpdateExtraMetaData -} + callArgs []*RepositoryIMockUpdateKnowledgeBaseFileParams + mutex sync.RWMutex -// ExpectFileUIDParam2 sets up expected param fileUID for RepositoryI.UpdateExtraMetaData -func (mmUpdateExtraMetaData *mRepositoryIMockUpdateExtraMetaData) ExpectFileUIDParam2(fileUID uuid.UUID) *mRepositoryIMockUpdateExtraMetaData { - if mmUpdateExtraMetaData.mock.funcUpdateExtraMetaData != nil { - mmUpdateExtraMetaData.mock.t.Fatalf("RepositoryIMock.UpdateExtraMetaData mock is already set by Set") - } + expectedInvocations uint64 +} - if mmUpdateExtraMetaData.defaultExpectation == nil { - mmUpdateExtraMetaData.defaultExpectation = &RepositoryIMockUpdateExtraMetaDataExpectation{} - } +// RepositoryIMockUpdateKnowledgeBaseFileExpectation specifies expectation struct of the RepositoryI.UpdateKnowledgeBaseFile +type RepositoryIMockUpdateKnowledgeBaseFileExpectation struct { + mock *RepositoryIMock + params *RepositoryIMockUpdateKnowledgeBaseFileParams + paramPtrs *RepositoryIMockUpdateKnowledgeBaseFileParamPtrs + results *RepositoryIMockUpdateKnowledgeBaseFileResults + Counter uint64 +} - if mmUpdateExtraMetaData.defaultExpectation.params != nil { - mmUpdateExtraMetaData.mock.t.Fatalf("RepositoryIMock.UpdateExtraMetaData mock is already set by Expect") - } +// RepositoryIMockUpdateKnowledgeBaseFileParams contains parameters of the RepositoryI.UpdateKnowledgeBaseFile +type RepositoryIMockUpdateKnowledgeBaseFileParams struct { + ctx context.Context + fileUID string + updateMap map[string]interface{} +} - if mmUpdateExtraMetaData.defaultExpectation.paramPtrs == nil { - mmUpdateExtraMetaData.defaultExpectation.paramPtrs = &RepositoryIMockUpdateExtraMetaDataParamPtrs{} - } - mmUpdateExtraMetaData.defaultExpectation.paramPtrs.fileUID = &fileUID +// RepositoryIMockUpdateKnowledgeBaseFileParamPtrs contains pointers to parameters of the RepositoryI.UpdateKnowledgeBaseFile +type RepositoryIMockUpdateKnowledgeBaseFileParamPtrs struct { + ctx *context.Context + fileUID *string + updateMap *map[string]interface{} +} - return mmUpdateExtraMetaData +// RepositoryIMockUpdateKnowledgeBaseFileResults contains results of the RepositoryI.UpdateKnowledgeBaseFile +type RepositoryIMockUpdateKnowledgeBaseFileResults struct { + kp1 *mm_repository.KnowledgeBaseFile + err error } -// ExpectFailureReasonParam3 sets up expected param failureReason for RepositoryI.UpdateExtraMetaData -func (mmUpdateExtraMetaData *mRepositoryIMockUpdateExtraMetaData) ExpectFailureReasonParam3(failureReason string) *mRepositoryIMockUpdateExtraMetaData { - if mmUpdateExtraMetaData.mock.funcUpdateExtraMetaData != nil { - mmUpdateExtraMetaData.mock.t.Fatalf("RepositoryIMock.UpdateExtraMetaData mock is already set by Set") +// Expect sets up expected params for RepositoryI.UpdateKnowledgeBaseFile +func (mmUpdateKnowledgeBaseFile *mRepositoryIMockUpdateKnowledgeBaseFile) Expect(ctx context.Context, fileUID string, updateMap map[string]interface{}) *mRepositoryIMockUpdateKnowledgeBaseFile { + if mmUpdateKnowledgeBaseFile.mock.funcUpdateKnowledgeBaseFile != nil { + mmUpdateKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.UpdateKnowledgeBaseFile mock is already set by Set") } - if mmUpdateExtraMetaData.defaultExpectation == nil { - mmUpdateExtraMetaData.defaultExpectation = &RepositoryIMockUpdateExtraMetaDataExpectation{} + if mmUpdateKnowledgeBaseFile.defaultExpectation == nil { + mmUpdateKnowledgeBaseFile.defaultExpectation = &RepositoryIMockUpdateKnowledgeBaseFileExpectation{} } - if mmUpdateExtraMetaData.defaultExpectation.params != nil { - mmUpdateExtraMetaData.mock.t.Fatalf("RepositoryIMock.UpdateExtraMetaData mock is already set by Expect") + if mmUpdateKnowledgeBaseFile.defaultExpectation.paramPtrs != nil { + mmUpdateKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.UpdateKnowledgeBaseFile mock is already set by ExpectParams functions") } - if mmUpdateExtraMetaData.defaultExpectation.paramPtrs == nil { - mmUpdateExtraMetaData.defaultExpectation.paramPtrs = &RepositoryIMockUpdateExtraMetaDataParamPtrs{} + mmUpdateKnowledgeBaseFile.defaultExpectation.params = &RepositoryIMockUpdateKnowledgeBaseFileParams{ctx, fileUID, updateMap} + for _, e := range mmUpdateKnowledgeBaseFile.expectations { + if minimock.Equal(e.params, mmUpdateKnowledgeBaseFile.defaultExpectation.params) { + mmUpdateKnowledgeBaseFile.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmUpdateKnowledgeBaseFile.defaultExpectation.params) + } } - mmUpdateExtraMetaData.defaultExpectation.paramPtrs.failureReason = &failureReason - return mmUpdateExtraMetaData + return mmUpdateKnowledgeBaseFile } -// ExpectConvertingPipeParam4 sets up expected param convertingPipe for RepositoryI.UpdateExtraMetaData -func (mmUpdateExtraMetaData *mRepositoryIMockUpdateExtraMetaData) ExpectConvertingPipeParam4(convertingPipe string) *mRepositoryIMockUpdateExtraMetaData { - if mmUpdateExtraMetaData.mock.funcUpdateExtraMetaData != nil { - mmUpdateExtraMetaData.mock.t.Fatalf("RepositoryIMock.UpdateExtraMetaData mock is already set by Set") +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.UpdateKnowledgeBaseFile +func (mmUpdateKnowledgeBaseFile *mRepositoryIMockUpdateKnowledgeBaseFile) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockUpdateKnowledgeBaseFile { + if mmUpdateKnowledgeBaseFile.mock.funcUpdateKnowledgeBaseFile != nil { + mmUpdateKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.UpdateKnowledgeBaseFile mock is already set by Set") } - if mmUpdateExtraMetaData.defaultExpectation == nil { - mmUpdateExtraMetaData.defaultExpectation = &RepositoryIMockUpdateExtraMetaDataExpectation{} + if mmUpdateKnowledgeBaseFile.defaultExpectation == nil { + mmUpdateKnowledgeBaseFile.defaultExpectation = &RepositoryIMockUpdateKnowledgeBaseFileExpectation{} } - if mmUpdateExtraMetaData.defaultExpectation.params != nil { - mmUpdateExtraMetaData.mock.t.Fatalf("RepositoryIMock.UpdateExtraMetaData mock is already set by Expect") + if mmUpdateKnowledgeBaseFile.defaultExpectation.params != nil { + mmUpdateKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.UpdateKnowledgeBaseFile mock is already set by Expect") } - if mmUpdateExtraMetaData.defaultExpectation.paramPtrs == nil { - mmUpdateExtraMetaData.defaultExpectation.paramPtrs = &RepositoryIMockUpdateExtraMetaDataParamPtrs{} + if mmUpdateKnowledgeBaseFile.defaultExpectation.paramPtrs == nil { + mmUpdateKnowledgeBaseFile.defaultExpectation.paramPtrs = &RepositoryIMockUpdateKnowledgeBaseFileParamPtrs{} } - mmUpdateExtraMetaData.defaultExpectation.paramPtrs.convertingPipe = &convertingPipe + mmUpdateKnowledgeBaseFile.defaultExpectation.paramPtrs.ctx = &ctx - return mmUpdateExtraMetaData + return mmUpdateKnowledgeBaseFile } -// ExpectChunkingPipeParam5 sets up expected param chunkingPipe for RepositoryI.UpdateExtraMetaData -func (mmUpdateExtraMetaData *mRepositoryIMockUpdateExtraMetaData) ExpectChunkingPipeParam5(chunkingPipe string) *mRepositoryIMockUpdateExtraMetaData { - if mmUpdateExtraMetaData.mock.funcUpdateExtraMetaData != nil { - mmUpdateExtraMetaData.mock.t.Fatalf("RepositoryIMock.UpdateExtraMetaData mock is already set by Set") +// ExpectFileUIDParam2 sets up expected param fileUID for RepositoryI.UpdateKnowledgeBaseFile +func (mmUpdateKnowledgeBaseFile *mRepositoryIMockUpdateKnowledgeBaseFile) ExpectFileUIDParam2(fileUID string) *mRepositoryIMockUpdateKnowledgeBaseFile { + if mmUpdateKnowledgeBaseFile.mock.funcUpdateKnowledgeBaseFile != nil { + mmUpdateKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.UpdateKnowledgeBaseFile mock is already set by Set") } - if mmUpdateExtraMetaData.defaultExpectation == nil { - mmUpdateExtraMetaData.defaultExpectation = &RepositoryIMockUpdateExtraMetaDataExpectation{} + if mmUpdateKnowledgeBaseFile.defaultExpectation == nil { + mmUpdateKnowledgeBaseFile.defaultExpectation = &RepositoryIMockUpdateKnowledgeBaseFileExpectation{} } - if mmUpdateExtraMetaData.defaultExpectation.params != nil { - mmUpdateExtraMetaData.mock.t.Fatalf("RepositoryIMock.UpdateExtraMetaData mock is already set by Expect") + if mmUpdateKnowledgeBaseFile.defaultExpectation.params != nil { + mmUpdateKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.UpdateKnowledgeBaseFile mock is already set by Expect") } - if mmUpdateExtraMetaData.defaultExpectation.paramPtrs == nil { - mmUpdateExtraMetaData.defaultExpectation.paramPtrs = &RepositoryIMockUpdateExtraMetaDataParamPtrs{} + if mmUpdateKnowledgeBaseFile.defaultExpectation.paramPtrs == nil { + mmUpdateKnowledgeBaseFile.defaultExpectation.paramPtrs = &RepositoryIMockUpdateKnowledgeBaseFileParamPtrs{} } - mmUpdateExtraMetaData.defaultExpectation.paramPtrs.chunkingPipe = &chunkingPipe + mmUpdateKnowledgeBaseFile.defaultExpectation.paramPtrs.fileUID = &fileUID - return mmUpdateExtraMetaData + return mmUpdateKnowledgeBaseFile } -// ExpectEmbeddingPipeParam6 sets up expected param embeddingPipe for RepositoryI.UpdateExtraMetaData -func (mmUpdateExtraMetaData *mRepositoryIMockUpdateExtraMetaData) ExpectEmbeddingPipeParam6(embeddingPipe string) *mRepositoryIMockUpdateExtraMetaData { - if mmUpdateExtraMetaData.mock.funcUpdateExtraMetaData != nil { - mmUpdateExtraMetaData.mock.t.Fatalf("RepositoryIMock.UpdateExtraMetaData mock is already set by Set") +// ExpectUpdateMapParam3 sets up expected param updateMap for RepositoryI.UpdateKnowledgeBaseFile +func (mmUpdateKnowledgeBaseFile *mRepositoryIMockUpdateKnowledgeBaseFile) ExpectUpdateMapParam3(updateMap map[string]interface{}) *mRepositoryIMockUpdateKnowledgeBaseFile { + if mmUpdateKnowledgeBaseFile.mock.funcUpdateKnowledgeBaseFile != nil { + mmUpdateKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.UpdateKnowledgeBaseFile mock is already set by Set") } - if mmUpdateExtraMetaData.defaultExpectation == nil { - mmUpdateExtraMetaData.defaultExpectation = &RepositoryIMockUpdateExtraMetaDataExpectation{} + if mmUpdateKnowledgeBaseFile.defaultExpectation == nil { + mmUpdateKnowledgeBaseFile.defaultExpectation = &RepositoryIMockUpdateKnowledgeBaseFileExpectation{} } - if mmUpdateExtraMetaData.defaultExpectation.params != nil { - mmUpdateExtraMetaData.mock.t.Fatalf("RepositoryIMock.UpdateExtraMetaData mock is already set by Expect") + if mmUpdateKnowledgeBaseFile.defaultExpectation.params != nil { + mmUpdateKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.UpdateKnowledgeBaseFile mock is already set by Expect") } - if mmUpdateExtraMetaData.defaultExpectation.paramPtrs == nil { - mmUpdateExtraMetaData.defaultExpectation.paramPtrs = &RepositoryIMockUpdateExtraMetaDataParamPtrs{} + if mmUpdateKnowledgeBaseFile.defaultExpectation.paramPtrs == nil { + mmUpdateKnowledgeBaseFile.defaultExpectation.paramPtrs = &RepositoryIMockUpdateKnowledgeBaseFileParamPtrs{} } - mmUpdateExtraMetaData.defaultExpectation.paramPtrs.embeddingPipe = &embeddingPipe + mmUpdateKnowledgeBaseFile.defaultExpectation.paramPtrs.updateMap = &updateMap - return mmUpdateExtraMetaData + return mmUpdateKnowledgeBaseFile } -// Inspect accepts an inspector function that has same arguments as the RepositoryI.UpdateExtraMetaData -func (mmUpdateExtraMetaData *mRepositoryIMockUpdateExtraMetaData) Inspect(f func(ctx context.Context, fileUID uuid.UUID, failureReason string, convertingPipe string, chunkingPipe string, embeddingPipe string)) *mRepositoryIMockUpdateExtraMetaData { - if mmUpdateExtraMetaData.mock.inspectFuncUpdateExtraMetaData != nil { - mmUpdateExtraMetaData.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.UpdateExtraMetaData") +// Inspect accepts an inspector function that has same arguments as the RepositoryI.UpdateKnowledgeBaseFile +func (mmUpdateKnowledgeBaseFile *mRepositoryIMockUpdateKnowledgeBaseFile) Inspect(f func(ctx context.Context, fileUID string, updateMap map[string]interface{})) *mRepositoryIMockUpdateKnowledgeBaseFile { + if mmUpdateKnowledgeBaseFile.mock.inspectFuncUpdateKnowledgeBaseFile != nil { + mmUpdateKnowledgeBaseFile.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.UpdateKnowledgeBaseFile") } - mmUpdateExtraMetaData.mock.inspectFuncUpdateExtraMetaData = f + mmUpdateKnowledgeBaseFile.mock.inspectFuncUpdateKnowledgeBaseFile = f - return mmUpdateExtraMetaData + return mmUpdateKnowledgeBaseFile } -// Return sets up results that will be returned by RepositoryI.UpdateExtraMetaData -func (mmUpdateExtraMetaData *mRepositoryIMockUpdateExtraMetaData) Return(err error) *RepositoryIMock { - if mmUpdateExtraMetaData.mock.funcUpdateExtraMetaData != nil { - mmUpdateExtraMetaData.mock.t.Fatalf("RepositoryIMock.UpdateExtraMetaData mock is already set by Set") +// Return sets up results that will be returned by RepositoryI.UpdateKnowledgeBaseFile +func (mmUpdateKnowledgeBaseFile *mRepositoryIMockUpdateKnowledgeBaseFile) Return(kp1 *mm_repository.KnowledgeBaseFile, err error) *RepositoryIMock { + if mmUpdateKnowledgeBaseFile.mock.funcUpdateKnowledgeBaseFile != nil { + mmUpdateKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.UpdateKnowledgeBaseFile mock is already set by Set") } - if mmUpdateExtraMetaData.defaultExpectation == nil { - mmUpdateExtraMetaData.defaultExpectation = &RepositoryIMockUpdateExtraMetaDataExpectation{mock: mmUpdateExtraMetaData.mock} + if mmUpdateKnowledgeBaseFile.defaultExpectation == nil { + mmUpdateKnowledgeBaseFile.defaultExpectation = &RepositoryIMockUpdateKnowledgeBaseFileExpectation{mock: mmUpdateKnowledgeBaseFile.mock} } - mmUpdateExtraMetaData.defaultExpectation.results = &RepositoryIMockUpdateExtraMetaDataResults{err} - return mmUpdateExtraMetaData.mock + mmUpdateKnowledgeBaseFile.defaultExpectation.results = &RepositoryIMockUpdateKnowledgeBaseFileResults{kp1, err} + return mmUpdateKnowledgeBaseFile.mock } -// Set uses given function f to mock the RepositoryI.UpdateExtraMetaData method -func (mmUpdateExtraMetaData *mRepositoryIMockUpdateExtraMetaData) Set(f func(ctx context.Context, fileUID uuid.UUID, failureReason string, convertingPipe string, chunkingPipe string, embeddingPipe string) (err error)) *RepositoryIMock { - if mmUpdateExtraMetaData.defaultExpectation != nil { - mmUpdateExtraMetaData.mock.t.Fatalf("Default expectation is already set for the RepositoryI.UpdateExtraMetaData method") +// Set uses given function f to mock the RepositoryI.UpdateKnowledgeBaseFile method +func (mmUpdateKnowledgeBaseFile *mRepositoryIMockUpdateKnowledgeBaseFile) Set(f func(ctx context.Context, fileUID string, updateMap map[string]interface{}) (kp1 *mm_repository.KnowledgeBaseFile, err error)) *RepositoryIMock { + if mmUpdateKnowledgeBaseFile.defaultExpectation != nil { + mmUpdateKnowledgeBaseFile.mock.t.Fatalf("Default expectation is already set for the RepositoryI.UpdateKnowledgeBaseFile method") } - if len(mmUpdateExtraMetaData.expectations) > 0 { - mmUpdateExtraMetaData.mock.t.Fatalf("Some expectations are already set for the RepositoryI.UpdateExtraMetaData method") + if len(mmUpdateKnowledgeBaseFile.expectations) > 0 { + mmUpdateKnowledgeBaseFile.mock.t.Fatalf("Some expectations are already set for the RepositoryI.UpdateKnowledgeBaseFile method") } - mmUpdateExtraMetaData.mock.funcUpdateExtraMetaData = f - return mmUpdateExtraMetaData.mock + mmUpdateKnowledgeBaseFile.mock.funcUpdateKnowledgeBaseFile = f + return mmUpdateKnowledgeBaseFile.mock } -// When sets expectation for the RepositoryI.UpdateExtraMetaData which will trigger the result defined by the following +// When sets expectation for the RepositoryI.UpdateKnowledgeBaseFile which will trigger the result defined by the following // Then helper -func (mmUpdateExtraMetaData *mRepositoryIMockUpdateExtraMetaData) When(ctx context.Context, fileUID uuid.UUID, failureReason string, convertingPipe string, chunkingPipe string, embeddingPipe string) *RepositoryIMockUpdateExtraMetaDataExpectation { - if mmUpdateExtraMetaData.mock.funcUpdateExtraMetaData != nil { - mmUpdateExtraMetaData.mock.t.Fatalf("RepositoryIMock.UpdateExtraMetaData mock is already set by Set") +func (mmUpdateKnowledgeBaseFile *mRepositoryIMockUpdateKnowledgeBaseFile) When(ctx context.Context, fileUID string, updateMap map[string]interface{}) *RepositoryIMockUpdateKnowledgeBaseFileExpectation { + if mmUpdateKnowledgeBaseFile.mock.funcUpdateKnowledgeBaseFile != nil { + mmUpdateKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.UpdateKnowledgeBaseFile mock is already set by Set") } - expectation := &RepositoryIMockUpdateExtraMetaDataExpectation{ - mock: mmUpdateExtraMetaData.mock, - params: &RepositoryIMockUpdateExtraMetaDataParams{ctx, fileUID, failureReason, convertingPipe, chunkingPipe, embeddingPipe}, + expectation := &RepositoryIMockUpdateKnowledgeBaseFileExpectation{ + mock: mmUpdateKnowledgeBaseFile.mock, + params: &RepositoryIMockUpdateKnowledgeBaseFileParams{ctx, fileUID, updateMap}, } - mmUpdateExtraMetaData.expectations = append(mmUpdateExtraMetaData.expectations, expectation) + mmUpdateKnowledgeBaseFile.expectations = append(mmUpdateKnowledgeBaseFile.expectations, expectation) return expectation } -// Then sets up RepositoryI.UpdateExtraMetaData return parameters for the expectation previously defined by the When method -func (e *RepositoryIMockUpdateExtraMetaDataExpectation) Then(err error) *RepositoryIMock { - e.results = &RepositoryIMockUpdateExtraMetaDataResults{err} +// Then sets up RepositoryI.UpdateKnowledgeBaseFile return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockUpdateKnowledgeBaseFileExpectation) Then(kp1 *mm_repository.KnowledgeBaseFile, err error) *RepositoryIMock { + e.results = &RepositoryIMockUpdateKnowledgeBaseFileResults{kp1, err} return e.mock } -// Times sets number of times RepositoryI.UpdateExtraMetaData should be invoked -func (mmUpdateExtraMetaData *mRepositoryIMockUpdateExtraMetaData) Times(n uint64) *mRepositoryIMockUpdateExtraMetaData { +// Times sets number of times RepositoryI.UpdateKnowledgeBaseFile should be invoked +func (mmUpdateKnowledgeBaseFile *mRepositoryIMockUpdateKnowledgeBaseFile) Times(n uint64) *mRepositoryIMockUpdateKnowledgeBaseFile { if n == 0 { - mmUpdateExtraMetaData.mock.t.Fatalf("Times of RepositoryIMock.UpdateExtraMetaData mock can not be zero") - } - mm_atomic.StoreUint64(&mmUpdateExtraMetaData.expectedInvocations, n) - return mmUpdateExtraMetaData + mmUpdateKnowledgeBaseFile.mock.t.Fatalf("Times of RepositoryIMock.UpdateKnowledgeBaseFile mock can not be zero") + } + mm_atomic.StoreUint64(&mmUpdateKnowledgeBaseFile.expectedInvocations, n) + return mmUpdateKnowledgeBaseFile } -func (mmUpdateExtraMetaData *mRepositoryIMockUpdateExtraMetaData) invocationsDone() bool { - if len(mmUpdateExtraMetaData.expectations) == 0 && mmUpdateExtraMetaData.defaultExpectation == nil && mmUpdateExtraMetaData.mock.funcUpdateExtraMetaData == nil { +func (mmUpdateKnowledgeBaseFile *mRepositoryIMockUpdateKnowledgeBaseFile) invocationsDone() bool { + if len(mmUpdateKnowledgeBaseFile.expectations) == 0 && mmUpdateKnowledgeBaseFile.defaultExpectation == nil && mmUpdateKnowledgeBaseFile.mock.funcUpdateKnowledgeBaseFile == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmUpdateExtraMetaData.mock.afterUpdateExtraMetaDataCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmUpdateExtraMetaData.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmUpdateKnowledgeBaseFile.mock.afterUpdateKnowledgeBaseFileCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmUpdateKnowledgeBaseFile.expectedInvocations) return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) } -// UpdateExtraMetaData implements repository.RepositoryI -func (mmUpdateExtraMetaData *RepositoryIMock) UpdateExtraMetaData(ctx context.Context, fileUID uuid.UUID, failureReason string, convertingPipe string, chunkingPipe string, embeddingPipe string) (err error) { - mm_atomic.AddUint64(&mmUpdateExtraMetaData.beforeUpdateExtraMetaDataCounter, 1) - defer mm_atomic.AddUint64(&mmUpdateExtraMetaData.afterUpdateExtraMetaDataCounter, 1) +// UpdateKnowledgeBaseFile implements repository.RepositoryI +func (mmUpdateKnowledgeBaseFile *RepositoryIMock) UpdateKnowledgeBaseFile(ctx context.Context, fileUID string, updateMap map[string]interface{}) (kp1 *mm_repository.KnowledgeBaseFile, err error) { + mm_atomic.AddUint64(&mmUpdateKnowledgeBaseFile.beforeUpdateKnowledgeBaseFileCounter, 1) + defer mm_atomic.AddUint64(&mmUpdateKnowledgeBaseFile.afterUpdateKnowledgeBaseFileCounter, 1) - if mmUpdateExtraMetaData.inspectFuncUpdateExtraMetaData != nil { - mmUpdateExtraMetaData.inspectFuncUpdateExtraMetaData(ctx, fileUID, failureReason, convertingPipe, chunkingPipe, embeddingPipe) + if mmUpdateKnowledgeBaseFile.inspectFuncUpdateKnowledgeBaseFile != nil { + mmUpdateKnowledgeBaseFile.inspectFuncUpdateKnowledgeBaseFile(ctx, fileUID, updateMap) } - mm_params := RepositoryIMockUpdateExtraMetaDataParams{ctx, fileUID, failureReason, convertingPipe, chunkingPipe, embeddingPipe} + mm_params := RepositoryIMockUpdateKnowledgeBaseFileParams{ctx, fileUID, updateMap} // Record call args - mmUpdateExtraMetaData.UpdateExtraMetaDataMock.mutex.Lock() - mmUpdateExtraMetaData.UpdateExtraMetaDataMock.callArgs = append(mmUpdateExtraMetaData.UpdateExtraMetaDataMock.callArgs, &mm_params) - mmUpdateExtraMetaData.UpdateExtraMetaDataMock.mutex.Unlock() + mmUpdateKnowledgeBaseFile.UpdateKnowledgeBaseFileMock.mutex.Lock() + mmUpdateKnowledgeBaseFile.UpdateKnowledgeBaseFileMock.callArgs = append(mmUpdateKnowledgeBaseFile.UpdateKnowledgeBaseFileMock.callArgs, &mm_params) + mmUpdateKnowledgeBaseFile.UpdateKnowledgeBaseFileMock.mutex.Unlock() - for _, e := range mmUpdateExtraMetaData.UpdateExtraMetaDataMock.expectations { + for _, e := range mmUpdateKnowledgeBaseFile.UpdateKnowledgeBaseFileMock.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 mmUpdateExtraMetaData.UpdateExtraMetaDataMock.defaultExpectation != nil { - mm_atomic.AddUint64(&mmUpdateExtraMetaData.UpdateExtraMetaDataMock.defaultExpectation.Counter, 1) - mm_want := mmUpdateExtraMetaData.UpdateExtraMetaDataMock.defaultExpectation.params - mm_want_ptrs := mmUpdateExtraMetaData.UpdateExtraMetaDataMock.defaultExpectation.paramPtrs + if mmUpdateKnowledgeBaseFile.UpdateKnowledgeBaseFileMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmUpdateKnowledgeBaseFile.UpdateKnowledgeBaseFileMock.defaultExpectation.Counter, 1) + mm_want := mmUpdateKnowledgeBaseFile.UpdateKnowledgeBaseFileMock.defaultExpectation.params + mm_want_ptrs := mmUpdateKnowledgeBaseFile.UpdateKnowledgeBaseFileMock.defaultExpectation.paramPtrs - mm_got := RepositoryIMockUpdateExtraMetaDataParams{ctx, fileUID, failureReason, convertingPipe, chunkingPipe, embeddingPipe} + mm_got := RepositoryIMockUpdateKnowledgeBaseFileParams{ctx, fileUID, updateMap} if mm_want_ptrs != nil { if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { - mmUpdateExtraMetaData.t.Errorf("RepositoryIMock.UpdateExtraMetaData 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)) + mmUpdateKnowledgeBaseFile.t.Errorf("RepositoryIMock.UpdateKnowledgeBaseFile 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) { - mmUpdateExtraMetaData.t.Errorf("RepositoryIMock.UpdateExtraMetaData 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.failureReason != nil && !minimock.Equal(*mm_want_ptrs.failureReason, mm_got.failureReason) { - mmUpdateExtraMetaData.t.Errorf("RepositoryIMock.UpdateExtraMetaData got unexpected parameter failureReason, want: %#v, got: %#v%s\n", *mm_want_ptrs.failureReason, mm_got.failureReason, minimock.Diff(*mm_want_ptrs.failureReason, mm_got.failureReason)) - } - - if mm_want_ptrs.convertingPipe != nil && !minimock.Equal(*mm_want_ptrs.convertingPipe, mm_got.convertingPipe) { - mmUpdateExtraMetaData.t.Errorf("RepositoryIMock.UpdateExtraMetaData got unexpected parameter convertingPipe, want: %#v, got: %#v%s\n", *mm_want_ptrs.convertingPipe, mm_got.convertingPipe, minimock.Diff(*mm_want_ptrs.convertingPipe, mm_got.convertingPipe)) - } - - if mm_want_ptrs.chunkingPipe != nil && !minimock.Equal(*mm_want_ptrs.chunkingPipe, mm_got.chunkingPipe) { - mmUpdateExtraMetaData.t.Errorf("RepositoryIMock.UpdateExtraMetaData got unexpected parameter chunkingPipe, want: %#v, got: %#v%s\n", *mm_want_ptrs.chunkingPipe, mm_got.chunkingPipe, minimock.Diff(*mm_want_ptrs.chunkingPipe, mm_got.chunkingPipe)) + mmUpdateKnowledgeBaseFile.t.Errorf("RepositoryIMock.UpdateKnowledgeBaseFile 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.embeddingPipe != nil && !minimock.Equal(*mm_want_ptrs.embeddingPipe, mm_got.embeddingPipe) { - mmUpdateExtraMetaData.t.Errorf("RepositoryIMock.UpdateExtraMetaData got unexpected parameter embeddingPipe, want: %#v, got: %#v%s\n", *mm_want_ptrs.embeddingPipe, mm_got.embeddingPipe, minimock.Diff(*mm_want_ptrs.embeddingPipe, mm_got.embeddingPipe)) + if mm_want_ptrs.updateMap != nil && !minimock.Equal(*mm_want_ptrs.updateMap, mm_got.updateMap) { + mmUpdateKnowledgeBaseFile.t.Errorf("RepositoryIMock.UpdateKnowledgeBaseFile got unexpected parameter updateMap, want: %#v, got: %#v%s\n", *mm_want_ptrs.updateMap, mm_got.updateMap, minimock.Diff(*mm_want_ptrs.updateMap, mm_got.updateMap)) } } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { - mmUpdateExtraMetaData.t.Errorf("RepositoryIMock.UpdateExtraMetaData got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + mmUpdateKnowledgeBaseFile.t.Errorf("RepositoryIMock.UpdateKnowledgeBaseFile got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) } - mm_results := mmUpdateExtraMetaData.UpdateExtraMetaDataMock.defaultExpectation.results + mm_results := mmUpdateKnowledgeBaseFile.UpdateKnowledgeBaseFileMock.defaultExpectation.results if mm_results == nil { - mmUpdateExtraMetaData.t.Fatal("No results are set for the RepositoryIMock.UpdateExtraMetaData") + mmUpdateKnowledgeBaseFile.t.Fatal("No results are set for the RepositoryIMock.UpdateKnowledgeBaseFile") } - return (*mm_results).err + return (*mm_results).kp1, (*mm_results).err } - if mmUpdateExtraMetaData.funcUpdateExtraMetaData != nil { - return mmUpdateExtraMetaData.funcUpdateExtraMetaData(ctx, fileUID, failureReason, convertingPipe, chunkingPipe, embeddingPipe) + if mmUpdateKnowledgeBaseFile.funcUpdateKnowledgeBaseFile != nil { + return mmUpdateKnowledgeBaseFile.funcUpdateKnowledgeBaseFile(ctx, fileUID, updateMap) } - mmUpdateExtraMetaData.t.Fatalf("Unexpected call to RepositoryIMock.UpdateExtraMetaData. %v %v %v %v %v %v", ctx, fileUID, failureReason, convertingPipe, chunkingPipe, embeddingPipe) + mmUpdateKnowledgeBaseFile.t.Fatalf("Unexpected call to RepositoryIMock.UpdateKnowledgeBaseFile. %v %v %v", ctx, fileUID, updateMap) return } -// UpdateExtraMetaDataAfterCounter returns a count of finished RepositoryIMock.UpdateExtraMetaData invocations -func (mmUpdateExtraMetaData *RepositoryIMock) UpdateExtraMetaDataAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmUpdateExtraMetaData.afterUpdateExtraMetaDataCounter) +// UpdateKnowledgeBaseFileAfterCounter returns a count of finished RepositoryIMock.UpdateKnowledgeBaseFile invocations +func (mmUpdateKnowledgeBaseFile *RepositoryIMock) UpdateKnowledgeBaseFileAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmUpdateKnowledgeBaseFile.afterUpdateKnowledgeBaseFileCounter) } -// UpdateExtraMetaDataBeforeCounter returns a count of RepositoryIMock.UpdateExtraMetaData invocations -func (mmUpdateExtraMetaData *RepositoryIMock) UpdateExtraMetaDataBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmUpdateExtraMetaData.beforeUpdateExtraMetaDataCounter) +// UpdateKnowledgeBaseFileBeforeCounter returns a count of RepositoryIMock.UpdateKnowledgeBaseFile invocations +func (mmUpdateKnowledgeBaseFile *RepositoryIMock) UpdateKnowledgeBaseFileBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmUpdateKnowledgeBaseFile.beforeUpdateKnowledgeBaseFileCounter) } -// Calls returns a list of arguments used in each call to RepositoryIMock.UpdateExtraMetaData. +// Calls returns a list of arguments used in each call to RepositoryIMock.UpdateKnowledgeBaseFile. // The list is in the same order as the calls were made (i.e. recent calls have a higher index) -func (mmUpdateExtraMetaData *mRepositoryIMockUpdateExtraMetaData) Calls() []*RepositoryIMockUpdateExtraMetaDataParams { - mmUpdateExtraMetaData.mutex.RLock() +func (mmUpdateKnowledgeBaseFile *mRepositoryIMockUpdateKnowledgeBaseFile) Calls() []*RepositoryIMockUpdateKnowledgeBaseFileParams { + mmUpdateKnowledgeBaseFile.mutex.RLock() - argCopy := make([]*RepositoryIMockUpdateExtraMetaDataParams, len(mmUpdateExtraMetaData.callArgs)) - copy(argCopy, mmUpdateExtraMetaData.callArgs) + argCopy := make([]*RepositoryIMockUpdateKnowledgeBaseFileParams, len(mmUpdateKnowledgeBaseFile.callArgs)) + copy(argCopy, mmUpdateKnowledgeBaseFile.callArgs) - mmUpdateExtraMetaData.mutex.RUnlock() + mmUpdateKnowledgeBaseFile.mutex.RUnlock() return argCopy } -// MinimockUpdateExtraMetaDataDone returns true if the count of the UpdateExtraMetaData invocations corresponds +// MinimockUpdateKnowledgeBaseFileDone returns true if the count of the UpdateKnowledgeBaseFile invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockUpdateExtraMetaDataDone() bool { - for _, e := range m.UpdateExtraMetaDataMock.expectations { +func (m *RepositoryIMock) MinimockUpdateKnowledgeBaseFileDone() bool { + for _, e := range m.UpdateKnowledgeBaseFileMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.UpdateExtraMetaDataMock.invocationsDone() + return m.UpdateKnowledgeBaseFileMock.invocationsDone() } -// MinimockUpdateExtraMetaDataInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockUpdateExtraMetaDataInspect() { - for _, e := range m.UpdateExtraMetaDataMock.expectations { +// MinimockUpdateKnowledgeBaseFileInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockUpdateKnowledgeBaseFileInspect() { + for _, e := range m.UpdateKnowledgeBaseFileMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { - m.t.Errorf("Expected call to RepositoryIMock.UpdateExtraMetaData with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.UpdateKnowledgeBaseFile with params: %#v", *e.params) } } - afterUpdateExtraMetaDataCounter := mm_atomic.LoadUint64(&m.afterUpdateExtraMetaDataCounter) + afterUpdateKnowledgeBaseFileCounter := mm_atomic.LoadUint64(&m.afterUpdateKnowledgeBaseFileCounter) // if default expectation was set then invocations count should be greater than zero - if m.UpdateExtraMetaDataMock.defaultExpectation != nil && afterUpdateExtraMetaDataCounter < 1 { - if m.UpdateExtraMetaDataMock.defaultExpectation.params == nil { - m.t.Error("Expected call to RepositoryIMock.UpdateExtraMetaData") + if m.UpdateKnowledgeBaseFileMock.defaultExpectation != nil && afterUpdateKnowledgeBaseFileCounter < 1 { + if m.UpdateKnowledgeBaseFileMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.UpdateKnowledgeBaseFile") } else { - m.t.Errorf("Expected call to RepositoryIMock.UpdateExtraMetaData with params: %#v", *m.UpdateExtraMetaDataMock.defaultExpectation.params) + m.t.Errorf("Expected call to RepositoryIMock.UpdateKnowledgeBaseFile with params: %#v", *m.UpdateKnowledgeBaseFileMock.defaultExpectation.params) } } // if func was set then invocations count should be greater than zero - if m.funcUpdateExtraMetaData != nil && afterUpdateExtraMetaDataCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.UpdateExtraMetaData") + if m.funcUpdateKnowledgeBaseFile != nil && afterUpdateKnowledgeBaseFileCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.UpdateKnowledgeBaseFile") } - if !m.UpdateExtraMetaDataMock.invocationsDone() && afterUpdateExtraMetaDataCounter > 0 { - m.t.Errorf("Expected %d calls to RepositoryIMock.UpdateExtraMetaData but found %d calls", - mm_atomic.LoadUint64(&m.UpdateExtraMetaDataMock.expectedInvocations), afterUpdateExtraMetaDataCounter) + if !m.UpdateKnowledgeBaseFileMock.invocationsDone() && afterUpdateKnowledgeBaseFileCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.UpdateKnowledgeBaseFile but found %d calls", + mm_atomic.LoadUint64(&m.UpdateKnowledgeBaseFileMock.expectedInvocations), afterUpdateKnowledgeBaseFileCounter) } } -type mRepositoryIMockUpdateKnowledgeBase struct { +type mRepositoryIMockUpdateMessage struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockUpdateKnowledgeBaseExpectation - expectations []*RepositoryIMockUpdateKnowledgeBaseExpectation + defaultExpectation *RepositoryIMockUpdateMessageExpectation + expectations []*RepositoryIMockUpdateMessageExpectation - callArgs []*RepositoryIMockUpdateKnowledgeBaseParams + callArgs []*RepositoryIMockUpdateMessageParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockUpdateKnowledgeBaseExpectation specifies expectation struct of the RepositoryI.UpdateKnowledgeBase -type RepositoryIMockUpdateKnowledgeBaseExpectation struct { +// RepositoryIMockUpdateMessageExpectation specifies expectation struct of the RepositoryI.UpdateMessage +type RepositoryIMockUpdateMessageExpectation struct { mock *RepositoryIMock - params *RepositoryIMockUpdateKnowledgeBaseParams - paramPtrs *RepositoryIMockUpdateKnowledgeBaseParamPtrs - results *RepositoryIMockUpdateKnowledgeBaseResults + params *RepositoryIMockUpdateMessageParams + paramPtrs *RepositoryIMockUpdateMessageParamPtrs + results *RepositoryIMockUpdateMessageResults Counter uint64 } -// RepositoryIMockUpdateKnowledgeBaseParams contains parameters of the RepositoryI.UpdateKnowledgeBase -type RepositoryIMockUpdateKnowledgeBaseParams struct { - ctx context.Context - ownerUID string - kb mm_repository.KnowledgeBase +// RepositoryIMockUpdateMessageParams contains parameters of the RepositoryI.UpdateMessage +type RepositoryIMockUpdateMessageParams struct { + ctx context.Context + msg mm_repository.Message } -// RepositoryIMockUpdateKnowledgeBaseParamPtrs contains pointers to parameters of the RepositoryI.UpdateKnowledgeBase -type RepositoryIMockUpdateKnowledgeBaseParamPtrs struct { - ctx *context.Context - ownerUID *string - kb *mm_repository.KnowledgeBase +// RepositoryIMockUpdateMessageParamPtrs contains pointers to parameters of the RepositoryI.UpdateMessage +type RepositoryIMockUpdateMessageParamPtrs struct { + ctx *context.Context + msg *mm_repository.Message } -// RepositoryIMockUpdateKnowledgeBaseResults contains results of the RepositoryI.UpdateKnowledgeBase -type RepositoryIMockUpdateKnowledgeBaseResults struct { - kp1 *mm_repository.KnowledgeBase +// RepositoryIMockUpdateMessageResults contains results of the RepositoryI.UpdateMessage +type RepositoryIMockUpdateMessageResults struct { + mp1 *mm_repository.Message err error } -// Expect sets up expected params for RepositoryI.UpdateKnowledgeBase -func (mmUpdateKnowledgeBase *mRepositoryIMockUpdateKnowledgeBase) Expect(ctx context.Context, ownerUID string, kb mm_repository.KnowledgeBase) *mRepositoryIMockUpdateKnowledgeBase { - if mmUpdateKnowledgeBase.mock.funcUpdateKnowledgeBase != nil { - mmUpdateKnowledgeBase.mock.t.Fatalf("RepositoryIMock.UpdateKnowledgeBase mock is already set by Set") +// Expect sets up expected params for RepositoryI.UpdateMessage +func (mmUpdateMessage *mRepositoryIMockUpdateMessage) Expect(ctx context.Context, msg mm_repository.Message) *mRepositoryIMockUpdateMessage { + if mmUpdateMessage.mock.funcUpdateMessage != nil { + mmUpdateMessage.mock.t.Fatalf("RepositoryIMock.UpdateMessage mock is already set by Set") } - if mmUpdateKnowledgeBase.defaultExpectation == nil { - mmUpdateKnowledgeBase.defaultExpectation = &RepositoryIMockUpdateKnowledgeBaseExpectation{} + if mmUpdateMessage.defaultExpectation == nil { + mmUpdateMessage.defaultExpectation = &RepositoryIMockUpdateMessageExpectation{} } - if mmUpdateKnowledgeBase.defaultExpectation.paramPtrs != nil { - mmUpdateKnowledgeBase.mock.t.Fatalf("RepositoryIMock.UpdateKnowledgeBase mock is already set by ExpectParams functions") + if mmUpdateMessage.defaultExpectation.paramPtrs != nil { + mmUpdateMessage.mock.t.Fatalf("RepositoryIMock.UpdateMessage mock is already set by ExpectParams functions") } - mmUpdateKnowledgeBase.defaultExpectation.params = &RepositoryIMockUpdateKnowledgeBaseParams{ctx, ownerUID, kb} - for _, e := range mmUpdateKnowledgeBase.expectations { - if minimock.Equal(e.params, mmUpdateKnowledgeBase.defaultExpectation.params) { - mmUpdateKnowledgeBase.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmUpdateKnowledgeBase.defaultExpectation.params) + mmUpdateMessage.defaultExpectation.params = &RepositoryIMockUpdateMessageParams{ctx, msg} + for _, e := range mmUpdateMessage.expectations { + if minimock.Equal(e.params, mmUpdateMessage.defaultExpectation.params) { + mmUpdateMessage.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmUpdateMessage.defaultExpectation.params) } } - return mmUpdateKnowledgeBase -} - -// ExpectCtxParam1 sets up expected param ctx for RepositoryI.UpdateKnowledgeBase -func (mmUpdateKnowledgeBase *mRepositoryIMockUpdateKnowledgeBase) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockUpdateKnowledgeBase { - if mmUpdateKnowledgeBase.mock.funcUpdateKnowledgeBase != nil { - mmUpdateKnowledgeBase.mock.t.Fatalf("RepositoryIMock.UpdateKnowledgeBase mock is already set by Set") - } - - if mmUpdateKnowledgeBase.defaultExpectation == nil { - mmUpdateKnowledgeBase.defaultExpectation = &RepositoryIMockUpdateKnowledgeBaseExpectation{} - } - - if mmUpdateKnowledgeBase.defaultExpectation.params != nil { - mmUpdateKnowledgeBase.mock.t.Fatalf("RepositoryIMock.UpdateKnowledgeBase mock is already set by Expect") - } - - if mmUpdateKnowledgeBase.defaultExpectation.paramPtrs == nil { - mmUpdateKnowledgeBase.defaultExpectation.paramPtrs = &RepositoryIMockUpdateKnowledgeBaseParamPtrs{} - } - mmUpdateKnowledgeBase.defaultExpectation.paramPtrs.ctx = &ctx - - return mmUpdateKnowledgeBase + return mmUpdateMessage } -// ExpectOwnerUIDParam2 sets up expected param ownerUID for RepositoryI.UpdateKnowledgeBase -func (mmUpdateKnowledgeBase *mRepositoryIMockUpdateKnowledgeBase) ExpectOwnerUIDParam2(ownerUID string) *mRepositoryIMockUpdateKnowledgeBase { - if mmUpdateKnowledgeBase.mock.funcUpdateKnowledgeBase != nil { - mmUpdateKnowledgeBase.mock.t.Fatalf("RepositoryIMock.UpdateKnowledgeBase mock is already set by Set") +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.UpdateMessage +func (mmUpdateMessage *mRepositoryIMockUpdateMessage) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockUpdateMessage { + if mmUpdateMessage.mock.funcUpdateMessage != nil { + mmUpdateMessage.mock.t.Fatalf("RepositoryIMock.UpdateMessage mock is already set by Set") } - if mmUpdateKnowledgeBase.defaultExpectation == nil { - mmUpdateKnowledgeBase.defaultExpectation = &RepositoryIMockUpdateKnowledgeBaseExpectation{} + if mmUpdateMessage.defaultExpectation == nil { + mmUpdateMessage.defaultExpectation = &RepositoryIMockUpdateMessageExpectation{} } - if mmUpdateKnowledgeBase.defaultExpectation.params != nil { - mmUpdateKnowledgeBase.mock.t.Fatalf("RepositoryIMock.UpdateKnowledgeBase mock is already set by Expect") + if mmUpdateMessage.defaultExpectation.params != nil { + mmUpdateMessage.mock.t.Fatalf("RepositoryIMock.UpdateMessage mock is already set by Expect") } - if mmUpdateKnowledgeBase.defaultExpectation.paramPtrs == nil { - mmUpdateKnowledgeBase.defaultExpectation.paramPtrs = &RepositoryIMockUpdateKnowledgeBaseParamPtrs{} + if mmUpdateMessage.defaultExpectation.paramPtrs == nil { + mmUpdateMessage.defaultExpectation.paramPtrs = &RepositoryIMockUpdateMessageParamPtrs{} } - mmUpdateKnowledgeBase.defaultExpectation.paramPtrs.ownerUID = &ownerUID + mmUpdateMessage.defaultExpectation.paramPtrs.ctx = &ctx - return mmUpdateKnowledgeBase + return mmUpdateMessage } -// ExpectKbParam3 sets up expected param kb for RepositoryI.UpdateKnowledgeBase -func (mmUpdateKnowledgeBase *mRepositoryIMockUpdateKnowledgeBase) ExpectKbParam3(kb mm_repository.KnowledgeBase) *mRepositoryIMockUpdateKnowledgeBase { - if mmUpdateKnowledgeBase.mock.funcUpdateKnowledgeBase != nil { - mmUpdateKnowledgeBase.mock.t.Fatalf("RepositoryIMock.UpdateKnowledgeBase mock is already set by Set") +// ExpectMsgParam2 sets up expected param msg for RepositoryI.UpdateMessage +func (mmUpdateMessage *mRepositoryIMockUpdateMessage) ExpectMsgParam2(msg mm_repository.Message) *mRepositoryIMockUpdateMessage { + if mmUpdateMessage.mock.funcUpdateMessage != nil { + mmUpdateMessage.mock.t.Fatalf("RepositoryIMock.UpdateMessage mock is already set by Set") } - if mmUpdateKnowledgeBase.defaultExpectation == nil { - mmUpdateKnowledgeBase.defaultExpectation = &RepositoryIMockUpdateKnowledgeBaseExpectation{} + if mmUpdateMessage.defaultExpectation == nil { + mmUpdateMessage.defaultExpectation = &RepositoryIMockUpdateMessageExpectation{} } - if mmUpdateKnowledgeBase.defaultExpectation.params != nil { - mmUpdateKnowledgeBase.mock.t.Fatalf("RepositoryIMock.UpdateKnowledgeBase mock is already set by Expect") + if mmUpdateMessage.defaultExpectation.params != nil { + mmUpdateMessage.mock.t.Fatalf("RepositoryIMock.UpdateMessage mock is already set by Expect") } - if mmUpdateKnowledgeBase.defaultExpectation.paramPtrs == nil { - mmUpdateKnowledgeBase.defaultExpectation.paramPtrs = &RepositoryIMockUpdateKnowledgeBaseParamPtrs{} + if mmUpdateMessage.defaultExpectation.paramPtrs == nil { + mmUpdateMessage.defaultExpectation.paramPtrs = &RepositoryIMockUpdateMessageParamPtrs{} } - mmUpdateKnowledgeBase.defaultExpectation.paramPtrs.kb = &kb + mmUpdateMessage.defaultExpectation.paramPtrs.msg = &msg - return mmUpdateKnowledgeBase + return mmUpdateMessage } -// Inspect accepts an inspector function that has same arguments as the RepositoryI.UpdateKnowledgeBase -func (mmUpdateKnowledgeBase *mRepositoryIMockUpdateKnowledgeBase) Inspect(f func(ctx context.Context, ownerUID string, kb mm_repository.KnowledgeBase)) *mRepositoryIMockUpdateKnowledgeBase { - if mmUpdateKnowledgeBase.mock.inspectFuncUpdateKnowledgeBase != nil { - mmUpdateKnowledgeBase.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.UpdateKnowledgeBase") +// Inspect accepts an inspector function that has same arguments as the RepositoryI.UpdateMessage +func (mmUpdateMessage *mRepositoryIMockUpdateMessage) Inspect(f func(ctx context.Context, msg mm_repository.Message)) *mRepositoryIMockUpdateMessage { + if mmUpdateMessage.mock.inspectFuncUpdateMessage != nil { + mmUpdateMessage.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.UpdateMessage") } - mmUpdateKnowledgeBase.mock.inspectFuncUpdateKnowledgeBase = f + mmUpdateMessage.mock.inspectFuncUpdateMessage = f - return mmUpdateKnowledgeBase + return mmUpdateMessage } -// Return sets up results that will be returned by RepositoryI.UpdateKnowledgeBase -func (mmUpdateKnowledgeBase *mRepositoryIMockUpdateKnowledgeBase) Return(kp1 *mm_repository.KnowledgeBase, err error) *RepositoryIMock { - if mmUpdateKnowledgeBase.mock.funcUpdateKnowledgeBase != nil { - mmUpdateKnowledgeBase.mock.t.Fatalf("RepositoryIMock.UpdateKnowledgeBase mock is already set by Set") +// Return sets up results that will be returned by RepositoryI.UpdateMessage +func (mmUpdateMessage *mRepositoryIMockUpdateMessage) Return(mp1 *mm_repository.Message, err error) *RepositoryIMock { + if mmUpdateMessage.mock.funcUpdateMessage != nil { + mmUpdateMessage.mock.t.Fatalf("RepositoryIMock.UpdateMessage mock is already set by Set") } - if mmUpdateKnowledgeBase.defaultExpectation == nil { - mmUpdateKnowledgeBase.defaultExpectation = &RepositoryIMockUpdateKnowledgeBaseExpectation{mock: mmUpdateKnowledgeBase.mock} + if mmUpdateMessage.defaultExpectation == nil { + mmUpdateMessage.defaultExpectation = &RepositoryIMockUpdateMessageExpectation{mock: mmUpdateMessage.mock} } - mmUpdateKnowledgeBase.defaultExpectation.results = &RepositoryIMockUpdateKnowledgeBaseResults{kp1, err} - return mmUpdateKnowledgeBase.mock + mmUpdateMessage.defaultExpectation.results = &RepositoryIMockUpdateMessageResults{mp1, err} + return mmUpdateMessage.mock } -// Set uses given function f to mock the RepositoryI.UpdateKnowledgeBase method -func (mmUpdateKnowledgeBase *mRepositoryIMockUpdateKnowledgeBase) Set(f func(ctx context.Context, ownerUID string, kb mm_repository.KnowledgeBase) (kp1 *mm_repository.KnowledgeBase, err error)) *RepositoryIMock { - if mmUpdateKnowledgeBase.defaultExpectation != nil { - mmUpdateKnowledgeBase.mock.t.Fatalf("Default expectation is already set for the RepositoryI.UpdateKnowledgeBase method") +// Set uses given function f to mock the RepositoryI.UpdateMessage method +func (mmUpdateMessage *mRepositoryIMockUpdateMessage) Set(f func(ctx context.Context, msg mm_repository.Message) (mp1 *mm_repository.Message, err error)) *RepositoryIMock { + if mmUpdateMessage.defaultExpectation != nil { + mmUpdateMessage.mock.t.Fatalf("Default expectation is already set for the RepositoryI.UpdateMessage method") } - if len(mmUpdateKnowledgeBase.expectations) > 0 { - mmUpdateKnowledgeBase.mock.t.Fatalf("Some expectations are already set for the RepositoryI.UpdateKnowledgeBase method") + if len(mmUpdateMessage.expectations) > 0 { + mmUpdateMessage.mock.t.Fatalf("Some expectations are already set for the RepositoryI.UpdateMessage method") } - mmUpdateKnowledgeBase.mock.funcUpdateKnowledgeBase = f - return mmUpdateKnowledgeBase.mock + mmUpdateMessage.mock.funcUpdateMessage = f + return mmUpdateMessage.mock } -// When sets expectation for the RepositoryI.UpdateKnowledgeBase which will trigger the result defined by the following +// When sets expectation for the RepositoryI.UpdateMessage which will trigger the result defined by the following // Then helper -func (mmUpdateKnowledgeBase *mRepositoryIMockUpdateKnowledgeBase) When(ctx context.Context, ownerUID string, kb mm_repository.KnowledgeBase) *RepositoryIMockUpdateKnowledgeBaseExpectation { - if mmUpdateKnowledgeBase.mock.funcUpdateKnowledgeBase != nil { - mmUpdateKnowledgeBase.mock.t.Fatalf("RepositoryIMock.UpdateKnowledgeBase mock is already set by Set") +func (mmUpdateMessage *mRepositoryIMockUpdateMessage) When(ctx context.Context, msg mm_repository.Message) *RepositoryIMockUpdateMessageExpectation { + if mmUpdateMessage.mock.funcUpdateMessage != nil { + mmUpdateMessage.mock.t.Fatalf("RepositoryIMock.UpdateMessage mock is already set by Set") } - expectation := &RepositoryIMockUpdateKnowledgeBaseExpectation{ - mock: mmUpdateKnowledgeBase.mock, - params: &RepositoryIMockUpdateKnowledgeBaseParams{ctx, ownerUID, kb}, + expectation := &RepositoryIMockUpdateMessageExpectation{ + mock: mmUpdateMessage.mock, + params: &RepositoryIMockUpdateMessageParams{ctx, msg}, } - mmUpdateKnowledgeBase.expectations = append(mmUpdateKnowledgeBase.expectations, expectation) + mmUpdateMessage.expectations = append(mmUpdateMessage.expectations, expectation) return expectation } - -// Then sets up RepositoryI.UpdateKnowledgeBase return parameters for the expectation previously defined by the When method -func (e *RepositoryIMockUpdateKnowledgeBaseExpectation) Then(kp1 *mm_repository.KnowledgeBase, err error) *RepositoryIMock { - e.results = &RepositoryIMockUpdateKnowledgeBaseResults{kp1, err} + +// Then sets up RepositoryI.UpdateMessage return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockUpdateMessageExpectation) Then(mp1 *mm_repository.Message, err error) *RepositoryIMock { + e.results = &RepositoryIMockUpdateMessageResults{mp1, err} return e.mock } -// Times sets number of times RepositoryI.UpdateKnowledgeBase should be invoked -func (mmUpdateKnowledgeBase *mRepositoryIMockUpdateKnowledgeBase) Times(n uint64) *mRepositoryIMockUpdateKnowledgeBase { +// Times sets number of times RepositoryI.UpdateMessage should be invoked +func (mmUpdateMessage *mRepositoryIMockUpdateMessage) Times(n uint64) *mRepositoryIMockUpdateMessage { if n == 0 { - mmUpdateKnowledgeBase.mock.t.Fatalf("Times of RepositoryIMock.UpdateKnowledgeBase mock can not be zero") + mmUpdateMessage.mock.t.Fatalf("Times of RepositoryIMock.UpdateMessage mock can not be zero") } - mm_atomic.StoreUint64(&mmUpdateKnowledgeBase.expectedInvocations, n) - return mmUpdateKnowledgeBase + mm_atomic.StoreUint64(&mmUpdateMessage.expectedInvocations, n) + return mmUpdateMessage } -func (mmUpdateKnowledgeBase *mRepositoryIMockUpdateKnowledgeBase) invocationsDone() bool { - if len(mmUpdateKnowledgeBase.expectations) == 0 && mmUpdateKnowledgeBase.defaultExpectation == nil && mmUpdateKnowledgeBase.mock.funcUpdateKnowledgeBase == nil { +func (mmUpdateMessage *mRepositoryIMockUpdateMessage) invocationsDone() bool { + if len(mmUpdateMessage.expectations) == 0 && mmUpdateMessage.defaultExpectation == nil && mmUpdateMessage.mock.funcUpdateMessage == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmUpdateKnowledgeBase.mock.afterUpdateKnowledgeBaseCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmUpdateKnowledgeBase.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmUpdateMessage.mock.afterUpdateMessageCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmUpdateMessage.expectedInvocations) return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) } -// UpdateKnowledgeBase implements repository.RepositoryI -func (mmUpdateKnowledgeBase *RepositoryIMock) UpdateKnowledgeBase(ctx context.Context, ownerUID string, kb mm_repository.KnowledgeBase) (kp1 *mm_repository.KnowledgeBase, err error) { - mm_atomic.AddUint64(&mmUpdateKnowledgeBase.beforeUpdateKnowledgeBaseCounter, 1) - defer mm_atomic.AddUint64(&mmUpdateKnowledgeBase.afterUpdateKnowledgeBaseCounter, 1) +// UpdateMessage implements repository.RepositoryI +func (mmUpdateMessage *RepositoryIMock) UpdateMessage(ctx context.Context, msg mm_repository.Message) (mp1 *mm_repository.Message, err error) { + mm_atomic.AddUint64(&mmUpdateMessage.beforeUpdateMessageCounter, 1) + defer mm_atomic.AddUint64(&mmUpdateMessage.afterUpdateMessageCounter, 1) - if mmUpdateKnowledgeBase.inspectFuncUpdateKnowledgeBase != nil { - mmUpdateKnowledgeBase.inspectFuncUpdateKnowledgeBase(ctx, ownerUID, kb) + if mmUpdateMessage.inspectFuncUpdateMessage != nil { + mmUpdateMessage.inspectFuncUpdateMessage(ctx, msg) } - mm_params := RepositoryIMockUpdateKnowledgeBaseParams{ctx, ownerUID, kb} + mm_params := RepositoryIMockUpdateMessageParams{ctx, msg} // Record call args - mmUpdateKnowledgeBase.UpdateKnowledgeBaseMock.mutex.Lock() - mmUpdateKnowledgeBase.UpdateKnowledgeBaseMock.callArgs = append(mmUpdateKnowledgeBase.UpdateKnowledgeBaseMock.callArgs, &mm_params) - mmUpdateKnowledgeBase.UpdateKnowledgeBaseMock.mutex.Unlock() + mmUpdateMessage.UpdateMessageMock.mutex.Lock() + mmUpdateMessage.UpdateMessageMock.callArgs = append(mmUpdateMessage.UpdateMessageMock.callArgs, &mm_params) + mmUpdateMessage.UpdateMessageMock.mutex.Unlock() - for _, e := range mmUpdateKnowledgeBase.UpdateKnowledgeBaseMock.expectations { + for _, e := range mmUpdateMessage.UpdateMessageMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.kp1, e.results.err + return e.results.mp1, e.results.err } } - if mmUpdateKnowledgeBase.UpdateKnowledgeBaseMock.defaultExpectation != nil { - mm_atomic.AddUint64(&mmUpdateKnowledgeBase.UpdateKnowledgeBaseMock.defaultExpectation.Counter, 1) - mm_want := mmUpdateKnowledgeBase.UpdateKnowledgeBaseMock.defaultExpectation.params - mm_want_ptrs := mmUpdateKnowledgeBase.UpdateKnowledgeBaseMock.defaultExpectation.paramPtrs + if mmUpdateMessage.UpdateMessageMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmUpdateMessage.UpdateMessageMock.defaultExpectation.Counter, 1) + mm_want := mmUpdateMessage.UpdateMessageMock.defaultExpectation.params + mm_want_ptrs := mmUpdateMessage.UpdateMessageMock.defaultExpectation.paramPtrs - mm_got := RepositoryIMockUpdateKnowledgeBaseParams{ctx, ownerUID, kb} + mm_got := RepositoryIMockUpdateMessageParams{ctx, msg} if mm_want_ptrs != nil { if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { - mmUpdateKnowledgeBase.t.Errorf("RepositoryIMock.UpdateKnowledgeBase 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) { - mmUpdateKnowledgeBase.t.Errorf("RepositoryIMock.UpdateKnowledgeBase 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)) + mmUpdateMessage.t.Errorf("RepositoryIMock.UpdateMessage 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.kb != nil && !minimock.Equal(*mm_want_ptrs.kb, mm_got.kb) { - mmUpdateKnowledgeBase.t.Errorf("RepositoryIMock.UpdateKnowledgeBase got unexpected parameter kb, want: %#v, got: %#v%s\n", *mm_want_ptrs.kb, mm_got.kb, minimock.Diff(*mm_want_ptrs.kb, mm_got.kb)) + if mm_want_ptrs.msg != nil && !minimock.Equal(*mm_want_ptrs.msg, mm_got.msg) { + mmUpdateMessage.t.Errorf("RepositoryIMock.UpdateMessage got unexpected parameter msg, want: %#v, got: %#v%s\n", *mm_want_ptrs.msg, mm_got.msg, minimock.Diff(*mm_want_ptrs.msg, mm_got.msg)) } } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { - mmUpdateKnowledgeBase.t.Errorf("RepositoryIMock.UpdateKnowledgeBase got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + mmUpdateMessage.t.Errorf("RepositoryIMock.UpdateMessage got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) } - mm_results := mmUpdateKnowledgeBase.UpdateKnowledgeBaseMock.defaultExpectation.results + mm_results := mmUpdateMessage.UpdateMessageMock.defaultExpectation.results if mm_results == nil { - mmUpdateKnowledgeBase.t.Fatal("No results are set for the RepositoryIMock.UpdateKnowledgeBase") + mmUpdateMessage.t.Fatal("No results are set for the RepositoryIMock.UpdateMessage") } - return (*mm_results).kp1, (*mm_results).err + return (*mm_results).mp1, (*mm_results).err } - if mmUpdateKnowledgeBase.funcUpdateKnowledgeBase != nil { - return mmUpdateKnowledgeBase.funcUpdateKnowledgeBase(ctx, ownerUID, kb) + if mmUpdateMessage.funcUpdateMessage != nil { + return mmUpdateMessage.funcUpdateMessage(ctx, msg) } - mmUpdateKnowledgeBase.t.Fatalf("Unexpected call to RepositoryIMock.UpdateKnowledgeBase. %v %v %v", ctx, ownerUID, kb) + mmUpdateMessage.t.Fatalf("Unexpected call to RepositoryIMock.UpdateMessage. %v %v", ctx, msg) return } -// UpdateKnowledgeBaseAfterCounter returns a count of finished RepositoryIMock.UpdateKnowledgeBase invocations -func (mmUpdateKnowledgeBase *RepositoryIMock) UpdateKnowledgeBaseAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmUpdateKnowledgeBase.afterUpdateKnowledgeBaseCounter) +// UpdateMessageAfterCounter returns a count of finished RepositoryIMock.UpdateMessage invocations +func (mmUpdateMessage *RepositoryIMock) UpdateMessageAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmUpdateMessage.afterUpdateMessageCounter) } -// UpdateKnowledgeBaseBeforeCounter returns a count of RepositoryIMock.UpdateKnowledgeBase invocations -func (mmUpdateKnowledgeBase *RepositoryIMock) UpdateKnowledgeBaseBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmUpdateKnowledgeBase.beforeUpdateKnowledgeBaseCounter) +// UpdateMessageBeforeCounter returns a count of RepositoryIMock.UpdateMessage invocations +func (mmUpdateMessage *RepositoryIMock) UpdateMessageBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmUpdateMessage.beforeUpdateMessageCounter) } -// Calls returns a list of arguments used in each call to RepositoryIMock.UpdateKnowledgeBase. +// Calls returns a list of arguments used in each call to RepositoryIMock.UpdateMessage. // The list is in the same order as the calls were made (i.e. recent calls have a higher index) -func (mmUpdateKnowledgeBase *mRepositoryIMockUpdateKnowledgeBase) Calls() []*RepositoryIMockUpdateKnowledgeBaseParams { - mmUpdateKnowledgeBase.mutex.RLock() +func (mmUpdateMessage *mRepositoryIMockUpdateMessage) Calls() []*RepositoryIMockUpdateMessageParams { + mmUpdateMessage.mutex.RLock() - argCopy := make([]*RepositoryIMockUpdateKnowledgeBaseParams, len(mmUpdateKnowledgeBase.callArgs)) - copy(argCopy, mmUpdateKnowledgeBase.callArgs) + argCopy := make([]*RepositoryIMockUpdateMessageParams, len(mmUpdateMessage.callArgs)) + copy(argCopy, mmUpdateMessage.callArgs) - mmUpdateKnowledgeBase.mutex.RUnlock() + mmUpdateMessage.mutex.RUnlock() return argCopy } -// MinimockUpdateKnowledgeBaseDone returns true if the count of the UpdateKnowledgeBase invocations corresponds +// MinimockUpdateMessageDone returns true if the count of the UpdateMessage invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockUpdateKnowledgeBaseDone() bool { - for _, e := range m.UpdateKnowledgeBaseMock.expectations { +func (m *RepositoryIMock) MinimockUpdateMessageDone() bool { + for _, e := range m.UpdateMessageMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.UpdateKnowledgeBaseMock.invocationsDone() + return m.UpdateMessageMock.invocationsDone() } -// MinimockUpdateKnowledgeBaseInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockUpdateKnowledgeBaseInspect() { - for _, e := range m.UpdateKnowledgeBaseMock.expectations { +// MinimockUpdateMessageInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockUpdateMessageInspect() { + for _, e := range m.UpdateMessageMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { - m.t.Errorf("Expected call to RepositoryIMock.UpdateKnowledgeBase with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.UpdateMessage with params: %#v", *e.params) } } - afterUpdateKnowledgeBaseCounter := mm_atomic.LoadUint64(&m.afterUpdateKnowledgeBaseCounter) + afterUpdateMessageCounter := mm_atomic.LoadUint64(&m.afterUpdateMessageCounter) // if default expectation was set then invocations count should be greater than zero - if m.UpdateKnowledgeBaseMock.defaultExpectation != nil && afterUpdateKnowledgeBaseCounter < 1 { - if m.UpdateKnowledgeBaseMock.defaultExpectation.params == nil { - m.t.Error("Expected call to RepositoryIMock.UpdateKnowledgeBase") + if m.UpdateMessageMock.defaultExpectation != nil && afterUpdateMessageCounter < 1 { + if m.UpdateMessageMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.UpdateMessage") } else { - m.t.Errorf("Expected call to RepositoryIMock.UpdateKnowledgeBase with params: %#v", *m.UpdateKnowledgeBaseMock.defaultExpectation.params) + m.t.Errorf("Expected call to RepositoryIMock.UpdateMessage with params: %#v", *m.UpdateMessageMock.defaultExpectation.params) } } // if func was set then invocations count should be greater than zero - if m.funcUpdateKnowledgeBase != nil && afterUpdateKnowledgeBaseCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.UpdateKnowledgeBase") + if m.funcUpdateMessage != nil && afterUpdateMessageCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.UpdateMessage") } - if !m.UpdateKnowledgeBaseMock.invocationsDone() && afterUpdateKnowledgeBaseCounter > 0 { - m.t.Errorf("Expected %d calls to RepositoryIMock.UpdateKnowledgeBase but found %d calls", - mm_atomic.LoadUint64(&m.UpdateKnowledgeBaseMock.expectedInvocations), afterUpdateKnowledgeBaseCounter) + if !m.UpdateMessageMock.invocationsDone() && afterUpdateMessageCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.UpdateMessage but found %d calls", + mm_atomic.LoadUint64(&m.UpdateMessageMock.expectedInvocations), afterUpdateMessageCounter) } } -type mRepositoryIMockUpdateKnowledgeBaseFile struct { +type mRepositoryIMockUpdateMessageByUpdateMap struct { mock *RepositoryIMock - defaultExpectation *RepositoryIMockUpdateKnowledgeBaseFileExpectation - expectations []*RepositoryIMockUpdateKnowledgeBaseFileExpectation + defaultExpectation *RepositoryIMockUpdateMessageByUpdateMapExpectation + expectations []*RepositoryIMockUpdateMessageByUpdateMapExpectation - callArgs []*RepositoryIMockUpdateKnowledgeBaseFileParams + callArgs []*RepositoryIMockUpdateMessageByUpdateMapParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockUpdateKnowledgeBaseFileExpectation specifies expectation struct of the RepositoryI.UpdateKnowledgeBaseFile -type RepositoryIMockUpdateKnowledgeBaseFileExpectation struct { +// RepositoryIMockUpdateMessageByUpdateMapExpectation specifies expectation struct of the RepositoryI.UpdateMessageByUpdateMap +type RepositoryIMockUpdateMessageByUpdateMapExpectation struct { mock *RepositoryIMock - params *RepositoryIMockUpdateKnowledgeBaseFileParams - paramPtrs *RepositoryIMockUpdateKnowledgeBaseFileParamPtrs - results *RepositoryIMockUpdateKnowledgeBaseFileResults + params *RepositoryIMockUpdateMessageByUpdateMapParams + paramPtrs *RepositoryIMockUpdateMessageByUpdateMapParamPtrs + results *RepositoryIMockUpdateMessageByUpdateMapResults Counter uint64 } -// RepositoryIMockUpdateKnowledgeBaseFileParams contains parameters of the RepositoryI.UpdateKnowledgeBaseFile -type RepositoryIMockUpdateKnowledgeBaseFileParams struct { - ctx context.Context - fileUID string - updateMap map[string]interface{} +// RepositoryIMockUpdateMessageByUpdateMapParams contains parameters of the RepositoryI.UpdateMessageByUpdateMap +type RepositoryIMockUpdateMessageByUpdateMapParams struct { + ctx context.Context + messageUID uuid.UUID + updateMap map[string]interface{} } -// RepositoryIMockUpdateKnowledgeBaseFileParamPtrs contains pointers to parameters of the RepositoryI.UpdateKnowledgeBaseFile -type RepositoryIMockUpdateKnowledgeBaseFileParamPtrs struct { - ctx *context.Context - fileUID *string - updateMap *map[string]interface{} +// RepositoryIMockUpdateMessageByUpdateMapParamPtrs contains pointers to parameters of the RepositoryI.UpdateMessageByUpdateMap +type RepositoryIMockUpdateMessageByUpdateMapParamPtrs struct { + ctx *context.Context + messageUID *uuid.UUID + updateMap *map[string]interface{} } -// RepositoryIMockUpdateKnowledgeBaseFileResults contains results of the RepositoryI.UpdateKnowledgeBaseFile -type RepositoryIMockUpdateKnowledgeBaseFileResults struct { - kp1 *mm_repository.KnowledgeBaseFile +// RepositoryIMockUpdateMessageByUpdateMapResults contains results of the RepositoryI.UpdateMessageByUpdateMap +type RepositoryIMockUpdateMessageByUpdateMapResults struct { + mp1 *mm_repository.Message err error } -// Expect sets up expected params for RepositoryI.UpdateKnowledgeBaseFile -func (mmUpdateKnowledgeBaseFile *mRepositoryIMockUpdateKnowledgeBaseFile) Expect(ctx context.Context, fileUID string, updateMap map[string]interface{}) *mRepositoryIMockUpdateKnowledgeBaseFile { - if mmUpdateKnowledgeBaseFile.mock.funcUpdateKnowledgeBaseFile != nil { - mmUpdateKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.UpdateKnowledgeBaseFile mock is already set by Set") +// Expect sets up expected params for RepositoryI.UpdateMessageByUpdateMap +func (mmUpdateMessageByUpdateMap *mRepositoryIMockUpdateMessageByUpdateMap) Expect(ctx context.Context, messageUID uuid.UUID, updateMap map[string]interface{}) *mRepositoryIMockUpdateMessageByUpdateMap { + if mmUpdateMessageByUpdateMap.mock.funcUpdateMessageByUpdateMap != nil { + mmUpdateMessageByUpdateMap.mock.t.Fatalf("RepositoryIMock.UpdateMessageByUpdateMap mock is already set by Set") } - if mmUpdateKnowledgeBaseFile.defaultExpectation == nil { - mmUpdateKnowledgeBaseFile.defaultExpectation = &RepositoryIMockUpdateKnowledgeBaseFileExpectation{} + if mmUpdateMessageByUpdateMap.defaultExpectation == nil { + mmUpdateMessageByUpdateMap.defaultExpectation = &RepositoryIMockUpdateMessageByUpdateMapExpectation{} } - if mmUpdateKnowledgeBaseFile.defaultExpectation.paramPtrs != nil { - mmUpdateKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.UpdateKnowledgeBaseFile mock is already set by ExpectParams functions") + if mmUpdateMessageByUpdateMap.defaultExpectation.paramPtrs != nil { + mmUpdateMessageByUpdateMap.mock.t.Fatalf("RepositoryIMock.UpdateMessageByUpdateMap mock is already set by ExpectParams functions") } - mmUpdateKnowledgeBaseFile.defaultExpectation.params = &RepositoryIMockUpdateKnowledgeBaseFileParams{ctx, fileUID, updateMap} - for _, e := range mmUpdateKnowledgeBaseFile.expectations { - if minimock.Equal(e.params, mmUpdateKnowledgeBaseFile.defaultExpectation.params) { - mmUpdateKnowledgeBaseFile.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmUpdateKnowledgeBaseFile.defaultExpectation.params) + mmUpdateMessageByUpdateMap.defaultExpectation.params = &RepositoryIMockUpdateMessageByUpdateMapParams{ctx, messageUID, updateMap} + for _, e := range mmUpdateMessageByUpdateMap.expectations { + if minimock.Equal(e.params, mmUpdateMessageByUpdateMap.defaultExpectation.params) { + mmUpdateMessageByUpdateMap.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmUpdateMessageByUpdateMap.defaultExpectation.params) } } - return mmUpdateKnowledgeBaseFile + return mmUpdateMessageByUpdateMap } -// ExpectCtxParam1 sets up expected param ctx for RepositoryI.UpdateKnowledgeBaseFile -func (mmUpdateKnowledgeBaseFile *mRepositoryIMockUpdateKnowledgeBaseFile) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockUpdateKnowledgeBaseFile { - if mmUpdateKnowledgeBaseFile.mock.funcUpdateKnowledgeBaseFile != nil { - mmUpdateKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.UpdateKnowledgeBaseFile mock is already set by Set") +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.UpdateMessageByUpdateMap +func (mmUpdateMessageByUpdateMap *mRepositoryIMockUpdateMessageByUpdateMap) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockUpdateMessageByUpdateMap { + if mmUpdateMessageByUpdateMap.mock.funcUpdateMessageByUpdateMap != nil { + mmUpdateMessageByUpdateMap.mock.t.Fatalf("RepositoryIMock.UpdateMessageByUpdateMap mock is already set by Set") } - if mmUpdateKnowledgeBaseFile.defaultExpectation == nil { - mmUpdateKnowledgeBaseFile.defaultExpectation = &RepositoryIMockUpdateKnowledgeBaseFileExpectation{} + if mmUpdateMessageByUpdateMap.defaultExpectation == nil { + mmUpdateMessageByUpdateMap.defaultExpectation = &RepositoryIMockUpdateMessageByUpdateMapExpectation{} } - if mmUpdateKnowledgeBaseFile.defaultExpectation.params != nil { - mmUpdateKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.UpdateKnowledgeBaseFile mock is already set by Expect") + if mmUpdateMessageByUpdateMap.defaultExpectation.params != nil { + mmUpdateMessageByUpdateMap.mock.t.Fatalf("RepositoryIMock.UpdateMessageByUpdateMap mock is already set by Expect") } - if mmUpdateKnowledgeBaseFile.defaultExpectation.paramPtrs == nil { - mmUpdateKnowledgeBaseFile.defaultExpectation.paramPtrs = &RepositoryIMockUpdateKnowledgeBaseFileParamPtrs{} + if mmUpdateMessageByUpdateMap.defaultExpectation.paramPtrs == nil { + mmUpdateMessageByUpdateMap.defaultExpectation.paramPtrs = &RepositoryIMockUpdateMessageByUpdateMapParamPtrs{} } - mmUpdateKnowledgeBaseFile.defaultExpectation.paramPtrs.ctx = &ctx + mmUpdateMessageByUpdateMap.defaultExpectation.paramPtrs.ctx = &ctx - return mmUpdateKnowledgeBaseFile + return mmUpdateMessageByUpdateMap } -// ExpectFileUIDParam2 sets up expected param fileUID for RepositoryI.UpdateKnowledgeBaseFile -func (mmUpdateKnowledgeBaseFile *mRepositoryIMockUpdateKnowledgeBaseFile) ExpectFileUIDParam2(fileUID string) *mRepositoryIMockUpdateKnowledgeBaseFile { - if mmUpdateKnowledgeBaseFile.mock.funcUpdateKnowledgeBaseFile != nil { - mmUpdateKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.UpdateKnowledgeBaseFile mock is already set by Set") +// ExpectMessageUIDParam2 sets up expected param messageUID for RepositoryI.UpdateMessageByUpdateMap +func (mmUpdateMessageByUpdateMap *mRepositoryIMockUpdateMessageByUpdateMap) ExpectMessageUIDParam2(messageUID uuid.UUID) *mRepositoryIMockUpdateMessageByUpdateMap { + if mmUpdateMessageByUpdateMap.mock.funcUpdateMessageByUpdateMap != nil { + mmUpdateMessageByUpdateMap.mock.t.Fatalf("RepositoryIMock.UpdateMessageByUpdateMap mock is already set by Set") } - if mmUpdateKnowledgeBaseFile.defaultExpectation == nil { - mmUpdateKnowledgeBaseFile.defaultExpectation = &RepositoryIMockUpdateKnowledgeBaseFileExpectation{} + if mmUpdateMessageByUpdateMap.defaultExpectation == nil { + mmUpdateMessageByUpdateMap.defaultExpectation = &RepositoryIMockUpdateMessageByUpdateMapExpectation{} } - if mmUpdateKnowledgeBaseFile.defaultExpectation.params != nil { - mmUpdateKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.UpdateKnowledgeBaseFile mock is already set by Expect") + if mmUpdateMessageByUpdateMap.defaultExpectation.params != nil { + mmUpdateMessageByUpdateMap.mock.t.Fatalf("RepositoryIMock.UpdateMessageByUpdateMap mock is already set by Expect") } - if mmUpdateKnowledgeBaseFile.defaultExpectation.paramPtrs == nil { - mmUpdateKnowledgeBaseFile.defaultExpectation.paramPtrs = &RepositoryIMockUpdateKnowledgeBaseFileParamPtrs{} + if mmUpdateMessageByUpdateMap.defaultExpectation.paramPtrs == nil { + mmUpdateMessageByUpdateMap.defaultExpectation.paramPtrs = &RepositoryIMockUpdateMessageByUpdateMapParamPtrs{} } - mmUpdateKnowledgeBaseFile.defaultExpectation.paramPtrs.fileUID = &fileUID + mmUpdateMessageByUpdateMap.defaultExpectation.paramPtrs.messageUID = &messageUID - return mmUpdateKnowledgeBaseFile + return mmUpdateMessageByUpdateMap } -// ExpectUpdateMapParam3 sets up expected param updateMap for RepositoryI.UpdateKnowledgeBaseFile -func (mmUpdateKnowledgeBaseFile *mRepositoryIMockUpdateKnowledgeBaseFile) ExpectUpdateMapParam3(updateMap map[string]interface{}) *mRepositoryIMockUpdateKnowledgeBaseFile { - if mmUpdateKnowledgeBaseFile.mock.funcUpdateKnowledgeBaseFile != nil { - mmUpdateKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.UpdateKnowledgeBaseFile mock is already set by Set") +// ExpectUpdateMapParam3 sets up expected param updateMap for RepositoryI.UpdateMessageByUpdateMap +func (mmUpdateMessageByUpdateMap *mRepositoryIMockUpdateMessageByUpdateMap) ExpectUpdateMapParam3(updateMap map[string]interface{}) *mRepositoryIMockUpdateMessageByUpdateMap { + if mmUpdateMessageByUpdateMap.mock.funcUpdateMessageByUpdateMap != nil { + mmUpdateMessageByUpdateMap.mock.t.Fatalf("RepositoryIMock.UpdateMessageByUpdateMap mock is already set by Set") } - if mmUpdateKnowledgeBaseFile.defaultExpectation == nil { - mmUpdateKnowledgeBaseFile.defaultExpectation = &RepositoryIMockUpdateKnowledgeBaseFileExpectation{} + if mmUpdateMessageByUpdateMap.defaultExpectation == nil { + mmUpdateMessageByUpdateMap.defaultExpectation = &RepositoryIMockUpdateMessageByUpdateMapExpectation{} } - if mmUpdateKnowledgeBaseFile.defaultExpectation.params != nil { - mmUpdateKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.UpdateKnowledgeBaseFile mock is already set by Expect") + if mmUpdateMessageByUpdateMap.defaultExpectation.params != nil { + mmUpdateMessageByUpdateMap.mock.t.Fatalf("RepositoryIMock.UpdateMessageByUpdateMap mock is already set by Expect") } - if mmUpdateKnowledgeBaseFile.defaultExpectation.paramPtrs == nil { - mmUpdateKnowledgeBaseFile.defaultExpectation.paramPtrs = &RepositoryIMockUpdateKnowledgeBaseFileParamPtrs{} + if mmUpdateMessageByUpdateMap.defaultExpectation.paramPtrs == nil { + mmUpdateMessageByUpdateMap.defaultExpectation.paramPtrs = &RepositoryIMockUpdateMessageByUpdateMapParamPtrs{} } - mmUpdateKnowledgeBaseFile.defaultExpectation.paramPtrs.updateMap = &updateMap + mmUpdateMessageByUpdateMap.defaultExpectation.paramPtrs.updateMap = &updateMap - return mmUpdateKnowledgeBaseFile + return mmUpdateMessageByUpdateMap } -// Inspect accepts an inspector function that has same arguments as the RepositoryI.UpdateKnowledgeBaseFile -func (mmUpdateKnowledgeBaseFile *mRepositoryIMockUpdateKnowledgeBaseFile) Inspect(f func(ctx context.Context, fileUID string, updateMap map[string]interface{})) *mRepositoryIMockUpdateKnowledgeBaseFile { - if mmUpdateKnowledgeBaseFile.mock.inspectFuncUpdateKnowledgeBaseFile != nil { - mmUpdateKnowledgeBaseFile.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.UpdateKnowledgeBaseFile") +// Inspect accepts an inspector function that has same arguments as the RepositoryI.UpdateMessageByUpdateMap +func (mmUpdateMessageByUpdateMap *mRepositoryIMockUpdateMessageByUpdateMap) Inspect(f func(ctx context.Context, messageUID uuid.UUID, updateMap map[string]interface{})) *mRepositoryIMockUpdateMessageByUpdateMap { + if mmUpdateMessageByUpdateMap.mock.inspectFuncUpdateMessageByUpdateMap != nil { + mmUpdateMessageByUpdateMap.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.UpdateMessageByUpdateMap") } - mmUpdateKnowledgeBaseFile.mock.inspectFuncUpdateKnowledgeBaseFile = f + mmUpdateMessageByUpdateMap.mock.inspectFuncUpdateMessageByUpdateMap = f - return mmUpdateKnowledgeBaseFile + return mmUpdateMessageByUpdateMap } -// Return sets up results that will be returned by RepositoryI.UpdateKnowledgeBaseFile -func (mmUpdateKnowledgeBaseFile *mRepositoryIMockUpdateKnowledgeBaseFile) Return(kp1 *mm_repository.KnowledgeBaseFile, err error) *RepositoryIMock { - if mmUpdateKnowledgeBaseFile.mock.funcUpdateKnowledgeBaseFile != nil { - mmUpdateKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.UpdateKnowledgeBaseFile mock is already set by Set") +// Return sets up results that will be returned by RepositoryI.UpdateMessageByUpdateMap +func (mmUpdateMessageByUpdateMap *mRepositoryIMockUpdateMessageByUpdateMap) Return(mp1 *mm_repository.Message, err error) *RepositoryIMock { + if mmUpdateMessageByUpdateMap.mock.funcUpdateMessageByUpdateMap != nil { + mmUpdateMessageByUpdateMap.mock.t.Fatalf("RepositoryIMock.UpdateMessageByUpdateMap mock is already set by Set") } - if mmUpdateKnowledgeBaseFile.defaultExpectation == nil { - mmUpdateKnowledgeBaseFile.defaultExpectation = &RepositoryIMockUpdateKnowledgeBaseFileExpectation{mock: mmUpdateKnowledgeBaseFile.mock} + if mmUpdateMessageByUpdateMap.defaultExpectation == nil { + mmUpdateMessageByUpdateMap.defaultExpectation = &RepositoryIMockUpdateMessageByUpdateMapExpectation{mock: mmUpdateMessageByUpdateMap.mock} } - mmUpdateKnowledgeBaseFile.defaultExpectation.results = &RepositoryIMockUpdateKnowledgeBaseFileResults{kp1, err} - return mmUpdateKnowledgeBaseFile.mock + mmUpdateMessageByUpdateMap.defaultExpectation.results = &RepositoryIMockUpdateMessageByUpdateMapResults{mp1, err} + return mmUpdateMessageByUpdateMap.mock } -// Set uses given function f to mock the RepositoryI.UpdateKnowledgeBaseFile method -func (mmUpdateKnowledgeBaseFile *mRepositoryIMockUpdateKnowledgeBaseFile) Set(f func(ctx context.Context, fileUID string, updateMap map[string]interface{}) (kp1 *mm_repository.KnowledgeBaseFile, err error)) *RepositoryIMock { - if mmUpdateKnowledgeBaseFile.defaultExpectation != nil { - mmUpdateKnowledgeBaseFile.mock.t.Fatalf("Default expectation is already set for the RepositoryI.UpdateKnowledgeBaseFile method") +// Set uses given function f to mock the RepositoryI.UpdateMessageByUpdateMap method +func (mmUpdateMessageByUpdateMap *mRepositoryIMockUpdateMessageByUpdateMap) Set(f func(ctx context.Context, messageUID uuid.UUID, updateMap map[string]interface{}) (mp1 *mm_repository.Message, err error)) *RepositoryIMock { + if mmUpdateMessageByUpdateMap.defaultExpectation != nil { + mmUpdateMessageByUpdateMap.mock.t.Fatalf("Default expectation is already set for the RepositoryI.UpdateMessageByUpdateMap method") } - if len(mmUpdateKnowledgeBaseFile.expectations) > 0 { - mmUpdateKnowledgeBaseFile.mock.t.Fatalf("Some expectations are already set for the RepositoryI.UpdateKnowledgeBaseFile method") + if len(mmUpdateMessageByUpdateMap.expectations) > 0 { + mmUpdateMessageByUpdateMap.mock.t.Fatalf("Some expectations are already set for the RepositoryI.UpdateMessageByUpdateMap method") } - mmUpdateKnowledgeBaseFile.mock.funcUpdateKnowledgeBaseFile = f - return mmUpdateKnowledgeBaseFile.mock + mmUpdateMessageByUpdateMap.mock.funcUpdateMessageByUpdateMap = f + return mmUpdateMessageByUpdateMap.mock } -// When sets expectation for the RepositoryI.UpdateKnowledgeBaseFile which will trigger the result defined by the following +// When sets expectation for the RepositoryI.UpdateMessageByUpdateMap which will trigger the result defined by the following // Then helper -func (mmUpdateKnowledgeBaseFile *mRepositoryIMockUpdateKnowledgeBaseFile) When(ctx context.Context, fileUID string, updateMap map[string]interface{}) *RepositoryIMockUpdateKnowledgeBaseFileExpectation { - if mmUpdateKnowledgeBaseFile.mock.funcUpdateKnowledgeBaseFile != nil { - mmUpdateKnowledgeBaseFile.mock.t.Fatalf("RepositoryIMock.UpdateKnowledgeBaseFile mock is already set by Set") +func (mmUpdateMessageByUpdateMap *mRepositoryIMockUpdateMessageByUpdateMap) When(ctx context.Context, messageUID uuid.UUID, updateMap map[string]interface{}) *RepositoryIMockUpdateMessageByUpdateMapExpectation { + if mmUpdateMessageByUpdateMap.mock.funcUpdateMessageByUpdateMap != nil { + mmUpdateMessageByUpdateMap.mock.t.Fatalf("RepositoryIMock.UpdateMessageByUpdateMap mock is already set by Set") } - expectation := &RepositoryIMockUpdateKnowledgeBaseFileExpectation{ - mock: mmUpdateKnowledgeBaseFile.mock, - params: &RepositoryIMockUpdateKnowledgeBaseFileParams{ctx, fileUID, updateMap}, + expectation := &RepositoryIMockUpdateMessageByUpdateMapExpectation{ + mock: mmUpdateMessageByUpdateMap.mock, + params: &RepositoryIMockUpdateMessageByUpdateMapParams{ctx, messageUID, updateMap}, } - mmUpdateKnowledgeBaseFile.expectations = append(mmUpdateKnowledgeBaseFile.expectations, expectation) + mmUpdateMessageByUpdateMap.expectations = append(mmUpdateMessageByUpdateMap.expectations, expectation) return expectation } -// Then sets up RepositoryI.UpdateKnowledgeBaseFile return parameters for the expectation previously defined by the When method -func (e *RepositoryIMockUpdateKnowledgeBaseFileExpectation) Then(kp1 *mm_repository.KnowledgeBaseFile, err error) *RepositoryIMock { - e.results = &RepositoryIMockUpdateKnowledgeBaseFileResults{kp1, err} +// Then sets up RepositoryI.UpdateMessageByUpdateMap return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockUpdateMessageByUpdateMapExpectation) Then(mp1 *mm_repository.Message, err error) *RepositoryIMock { + e.results = &RepositoryIMockUpdateMessageByUpdateMapResults{mp1, err} return e.mock } -// Times sets number of times RepositoryI.UpdateKnowledgeBaseFile should be invoked -func (mmUpdateKnowledgeBaseFile *mRepositoryIMockUpdateKnowledgeBaseFile) Times(n uint64) *mRepositoryIMockUpdateKnowledgeBaseFile { +// Times sets number of times RepositoryI.UpdateMessageByUpdateMap should be invoked +func (mmUpdateMessageByUpdateMap *mRepositoryIMockUpdateMessageByUpdateMap) Times(n uint64) *mRepositoryIMockUpdateMessageByUpdateMap { if n == 0 { - mmUpdateKnowledgeBaseFile.mock.t.Fatalf("Times of RepositoryIMock.UpdateKnowledgeBaseFile mock can not be zero") + mmUpdateMessageByUpdateMap.mock.t.Fatalf("Times of RepositoryIMock.UpdateMessageByUpdateMap mock can not be zero") } - mm_atomic.StoreUint64(&mmUpdateKnowledgeBaseFile.expectedInvocations, n) - return mmUpdateKnowledgeBaseFile + mm_atomic.StoreUint64(&mmUpdateMessageByUpdateMap.expectedInvocations, n) + return mmUpdateMessageByUpdateMap } -func (mmUpdateKnowledgeBaseFile *mRepositoryIMockUpdateKnowledgeBaseFile) invocationsDone() bool { - if len(mmUpdateKnowledgeBaseFile.expectations) == 0 && mmUpdateKnowledgeBaseFile.defaultExpectation == nil && mmUpdateKnowledgeBaseFile.mock.funcUpdateKnowledgeBaseFile == nil { +func (mmUpdateMessageByUpdateMap *mRepositoryIMockUpdateMessageByUpdateMap) invocationsDone() bool { + if len(mmUpdateMessageByUpdateMap.expectations) == 0 && mmUpdateMessageByUpdateMap.defaultExpectation == nil && mmUpdateMessageByUpdateMap.mock.funcUpdateMessageByUpdateMap == nil { return true } - totalInvocations := mm_atomic.LoadUint64(&mmUpdateKnowledgeBaseFile.mock.afterUpdateKnowledgeBaseFileCounter) - expectedInvocations := mm_atomic.LoadUint64(&mmUpdateKnowledgeBaseFile.expectedInvocations) + totalInvocations := mm_atomic.LoadUint64(&mmUpdateMessageByUpdateMap.mock.afterUpdateMessageByUpdateMapCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmUpdateMessageByUpdateMap.expectedInvocations) return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) } -// UpdateKnowledgeBaseFile implements repository.RepositoryI -func (mmUpdateKnowledgeBaseFile *RepositoryIMock) UpdateKnowledgeBaseFile(ctx context.Context, fileUID string, updateMap map[string]interface{}) (kp1 *mm_repository.KnowledgeBaseFile, err error) { - mm_atomic.AddUint64(&mmUpdateKnowledgeBaseFile.beforeUpdateKnowledgeBaseFileCounter, 1) - defer mm_atomic.AddUint64(&mmUpdateKnowledgeBaseFile.afterUpdateKnowledgeBaseFileCounter, 1) +// UpdateMessageByUpdateMap implements repository.RepositoryI +func (mmUpdateMessageByUpdateMap *RepositoryIMock) UpdateMessageByUpdateMap(ctx context.Context, messageUID uuid.UUID, updateMap map[string]interface{}) (mp1 *mm_repository.Message, err error) { + mm_atomic.AddUint64(&mmUpdateMessageByUpdateMap.beforeUpdateMessageByUpdateMapCounter, 1) + defer mm_atomic.AddUint64(&mmUpdateMessageByUpdateMap.afterUpdateMessageByUpdateMapCounter, 1) - if mmUpdateKnowledgeBaseFile.inspectFuncUpdateKnowledgeBaseFile != nil { - mmUpdateKnowledgeBaseFile.inspectFuncUpdateKnowledgeBaseFile(ctx, fileUID, updateMap) + if mmUpdateMessageByUpdateMap.inspectFuncUpdateMessageByUpdateMap != nil { + mmUpdateMessageByUpdateMap.inspectFuncUpdateMessageByUpdateMap(ctx, messageUID, updateMap) } - mm_params := RepositoryIMockUpdateKnowledgeBaseFileParams{ctx, fileUID, updateMap} + mm_params := RepositoryIMockUpdateMessageByUpdateMapParams{ctx, messageUID, updateMap} // Record call args - mmUpdateKnowledgeBaseFile.UpdateKnowledgeBaseFileMock.mutex.Lock() - mmUpdateKnowledgeBaseFile.UpdateKnowledgeBaseFileMock.callArgs = append(mmUpdateKnowledgeBaseFile.UpdateKnowledgeBaseFileMock.callArgs, &mm_params) - mmUpdateKnowledgeBaseFile.UpdateKnowledgeBaseFileMock.mutex.Unlock() + mmUpdateMessageByUpdateMap.UpdateMessageByUpdateMapMock.mutex.Lock() + mmUpdateMessageByUpdateMap.UpdateMessageByUpdateMapMock.callArgs = append(mmUpdateMessageByUpdateMap.UpdateMessageByUpdateMapMock.callArgs, &mm_params) + mmUpdateMessageByUpdateMap.UpdateMessageByUpdateMapMock.mutex.Unlock() - for _, e := range mmUpdateKnowledgeBaseFile.UpdateKnowledgeBaseFileMock.expectations { + for _, e := range mmUpdateMessageByUpdateMap.UpdateMessageByUpdateMapMock.expectations { if minimock.Equal(*e.params, mm_params) { mm_atomic.AddUint64(&e.Counter, 1) - return e.results.kp1, e.results.err + return e.results.mp1, e.results.err } } - if mmUpdateKnowledgeBaseFile.UpdateKnowledgeBaseFileMock.defaultExpectation != nil { - mm_atomic.AddUint64(&mmUpdateKnowledgeBaseFile.UpdateKnowledgeBaseFileMock.defaultExpectation.Counter, 1) - mm_want := mmUpdateKnowledgeBaseFile.UpdateKnowledgeBaseFileMock.defaultExpectation.params - mm_want_ptrs := mmUpdateKnowledgeBaseFile.UpdateKnowledgeBaseFileMock.defaultExpectation.paramPtrs + if mmUpdateMessageByUpdateMap.UpdateMessageByUpdateMapMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmUpdateMessageByUpdateMap.UpdateMessageByUpdateMapMock.defaultExpectation.Counter, 1) + mm_want := mmUpdateMessageByUpdateMap.UpdateMessageByUpdateMapMock.defaultExpectation.params + mm_want_ptrs := mmUpdateMessageByUpdateMap.UpdateMessageByUpdateMapMock.defaultExpectation.paramPtrs - mm_got := RepositoryIMockUpdateKnowledgeBaseFileParams{ctx, fileUID, updateMap} + mm_got := RepositoryIMockUpdateMessageByUpdateMapParams{ctx, messageUID, updateMap} if mm_want_ptrs != nil { if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { - mmUpdateKnowledgeBaseFile.t.Errorf("RepositoryIMock.UpdateKnowledgeBaseFile 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)) + mmUpdateMessageByUpdateMap.t.Errorf("RepositoryIMock.UpdateMessageByUpdateMap 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) { - mmUpdateKnowledgeBaseFile.t.Errorf("RepositoryIMock.UpdateKnowledgeBaseFile 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.messageUID != nil && !minimock.Equal(*mm_want_ptrs.messageUID, mm_got.messageUID) { + mmUpdateMessageByUpdateMap.t.Errorf("RepositoryIMock.UpdateMessageByUpdateMap got unexpected parameter messageUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.messageUID, mm_got.messageUID, minimock.Diff(*mm_want_ptrs.messageUID, mm_got.messageUID)) } if mm_want_ptrs.updateMap != nil && !minimock.Equal(*mm_want_ptrs.updateMap, mm_got.updateMap) { - mmUpdateKnowledgeBaseFile.t.Errorf("RepositoryIMock.UpdateKnowledgeBaseFile got unexpected parameter updateMap, want: %#v, got: %#v%s\n", *mm_want_ptrs.updateMap, mm_got.updateMap, minimock.Diff(*mm_want_ptrs.updateMap, mm_got.updateMap)) + mmUpdateMessageByUpdateMap.t.Errorf("RepositoryIMock.UpdateMessageByUpdateMap got unexpected parameter updateMap, want: %#v, got: %#v%s\n", *mm_want_ptrs.updateMap, mm_got.updateMap, minimock.Diff(*mm_want_ptrs.updateMap, mm_got.updateMap)) } } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { - mmUpdateKnowledgeBaseFile.t.Errorf("RepositoryIMock.UpdateKnowledgeBaseFile got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + mmUpdateMessageByUpdateMap.t.Errorf("RepositoryIMock.UpdateMessageByUpdateMap got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) } - mm_results := mmUpdateKnowledgeBaseFile.UpdateKnowledgeBaseFileMock.defaultExpectation.results + mm_results := mmUpdateMessageByUpdateMap.UpdateMessageByUpdateMapMock.defaultExpectation.results if mm_results == nil { - mmUpdateKnowledgeBaseFile.t.Fatal("No results are set for the RepositoryIMock.UpdateKnowledgeBaseFile") + mmUpdateMessageByUpdateMap.t.Fatal("No results are set for the RepositoryIMock.UpdateMessageByUpdateMap") } - return (*mm_results).kp1, (*mm_results).err + return (*mm_results).mp1, (*mm_results).err } - if mmUpdateKnowledgeBaseFile.funcUpdateKnowledgeBaseFile != nil { - return mmUpdateKnowledgeBaseFile.funcUpdateKnowledgeBaseFile(ctx, fileUID, updateMap) + if mmUpdateMessageByUpdateMap.funcUpdateMessageByUpdateMap != nil { + return mmUpdateMessageByUpdateMap.funcUpdateMessageByUpdateMap(ctx, messageUID, updateMap) } - mmUpdateKnowledgeBaseFile.t.Fatalf("Unexpected call to RepositoryIMock.UpdateKnowledgeBaseFile. %v %v %v", ctx, fileUID, updateMap) + mmUpdateMessageByUpdateMap.t.Fatalf("Unexpected call to RepositoryIMock.UpdateMessageByUpdateMap. %v %v %v", ctx, messageUID, updateMap) return } -// UpdateKnowledgeBaseFileAfterCounter returns a count of finished RepositoryIMock.UpdateKnowledgeBaseFile invocations -func (mmUpdateKnowledgeBaseFile *RepositoryIMock) UpdateKnowledgeBaseFileAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmUpdateKnowledgeBaseFile.afterUpdateKnowledgeBaseFileCounter) +// UpdateMessageByUpdateMapAfterCounter returns a count of finished RepositoryIMock.UpdateMessageByUpdateMap invocations +func (mmUpdateMessageByUpdateMap *RepositoryIMock) UpdateMessageByUpdateMapAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmUpdateMessageByUpdateMap.afterUpdateMessageByUpdateMapCounter) } -// UpdateKnowledgeBaseFileBeforeCounter returns a count of RepositoryIMock.UpdateKnowledgeBaseFile invocations -func (mmUpdateKnowledgeBaseFile *RepositoryIMock) UpdateKnowledgeBaseFileBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmUpdateKnowledgeBaseFile.beforeUpdateKnowledgeBaseFileCounter) +// UpdateMessageByUpdateMapBeforeCounter returns a count of RepositoryIMock.UpdateMessageByUpdateMap invocations +func (mmUpdateMessageByUpdateMap *RepositoryIMock) UpdateMessageByUpdateMapBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmUpdateMessageByUpdateMap.beforeUpdateMessageByUpdateMapCounter) } -// Calls returns a list of arguments used in each call to RepositoryIMock.UpdateKnowledgeBaseFile. +// Calls returns a list of arguments used in each call to RepositoryIMock.UpdateMessageByUpdateMap. // The list is in the same order as the calls were made (i.e. recent calls have a higher index) -func (mmUpdateKnowledgeBaseFile *mRepositoryIMockUpdateKnowledgeBaseFile) Calls() []*RepositoryIMockUpdateKnowledgeBaseFileParams { - mmUpdateKnowledgeBaseFile.mutex.RLock() +func (mmUpdateMessageByUpdateMap *mRepositoryIMockUpdateMessageByUpdateMap) Calls() []*RepositoryIMockUpdateMessageByUpdateMapParams { + mmUpdateMessageByUpdateMap.mutex.RLock() - argCopy := make([]*RepositoryIMockUpdateKnowledgeBaseFileParams, len(mmUpdateKnowledgeBaseFile.callArgs)) - copy(argCopy, mmUpdateKnowledgeBaseFile.callArgs) + argCopy := make([]*RepositoryIMockUpdateMessageByUpdateMapParams, len(mmUpdateMessageByUpdateMap.callArgs)) + copy(argCopy, mmUpdateMessageByUpdateMap.callArgs) - mmUpdateKnowledgeBaseFile.mutex.RUnlock() + mmUpdateMessageByUpdateMap.mutex.RUnlock() return argCopy } -// MinimockUpdateKnowledgeBaseFileDone returns true if the count of the UpdateKnowledgeBaseFile invocations corresponds +// MinimockUpdateMessageByUpdateMapDone returns true if the count of the UpdateMessageByUpdateMap invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockUpdateKnowledgeBaseFileDone() bool { - for _, e := range m.UpdateKnowledgeBaseFileMock.expectations { +func (m *RepositoryIMock) MinimockUpdateMessageByUpdateMapDone() bool { + for _, e := range m.UpdateMessageByUpdateMapMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.UpdateKnowledgeBaseFileMock.invocationsDone() + return m.UpdateMessageByUpdateMapMock.invocationsDone() } -// MinimockUpdateKnowledgeBaseFileInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockUpdateKnowledgeBaseFileInspect() { - for _, e := range m.UpdateKnowledgeBaseFileMock.expectations { +// MinimockUpdateMessageByUpdateMapInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockUpdateMessageByUpdateMapInspect() { + for _, e := range m.UpdateMessageByUpdateMapMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { - m.t.Errorf("Expected call to RepositoryIMock.UpdateKnowledgeBaseFile with params: %#v", *e.params) + m.t.Errorf("Expected call to RepositoryIMock.UpdateMessageByUpdateMap with params: %#v", *e.params) } } - afterUpdateKnowledgeBaseFileCounter := mm_atomic.LoadUint64(&m.afterUpdateKnowledgeBaseFileCounter) + afterUpdateMessageByUpdateMapCounter := mm_atomic.LoadUint64(&m.afterUpdateMessageByUpdateMapCounter) // if default expectation was set then invocations count should be greater than zero - if m.UpdateKnowledgeBaseFileMock.defaultExpectation != nil && afterUpdateKnowledgeBaseFileCounter < 1 { - if m.UpdateKnowledgeBaseFileMock.defaultExpectation.params == nil { - m.t.Error("Expected call to RepositoryIMock.UpdateKnowledgeBaseFile") + if m.UpdateMessageByUpdateMapMock.defaultExpectation != nil && afterUpdateMessageByUpdateMapCounter < 1 { + if m.UpdateMessageByUpdateMapMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.UpdateMessageByUpdateMap") } else { - m.t.Errorf("Expected call to RepositoryIMock.UpdateKnowledgeBaseFile with params: %#v", *m.UpdateKnowledgeBaseFileMock.defaultExpectation.params) + m.t.Errorf("Expected call to RepositoryIMock.UpdateMessageByUpdateMap with params: %#v", *m.UpdateMessageByUpdateMapMock.defaultExpectation.params) } } // if func was set then invocations count should be greater than zero - if m.funcUpdateKnowledgeBaseFile != nil && afterUpdateKnowledgeBaseFileCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.UpdateKnowledgeBaseFile") + if m.funcUpdateMessageByUpdateMap != nil && afterUpdateMessageByUpdateMapCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.UpdateMessageByUpdateMap") } - if !m.UpdateKnowledgeBaseFileMock.invocationsDone() && afterUpdateKnowledgeBaseFileCounter > 0 { - m.t.Errorf("Expected %d calls to RepositoryIMock.UpdateKnowledgeBaseFile but found %d calls", - mm_atomic.LoadUint64(&m.UpdateKnowledgeBaseFileMock.expectedInvocations), afterUpdateKnowledgeBaseFileCounter) + if !m.UpdateMessageByUpdateMapMock.invocationsDone() && afterUpdateMessageByUpdateMapCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.UpdateMessageByUpdateMap but found %d calls", + mm_atomic.LoadUint64(&m.UpdateMessageByUpdateMapMock.expectedInvocations), afterUpdateMessageByUpdateMapCounter) } } @@ -16128,14 +20660,20 @@ func (m *RepositoryIMock) MinimockUpsertRepositoryTagInspect() { func (m *RepositoryIMock) MinimockFinish() { m.finishOnce.Do(func() { if !m.minimockDone() { + m.MinimockConversationTableNameInspect() + m.MinimockConvertedFileTableNameInspect() + m.MinimockCreateConversationInspect() + m.MinimockCreateConvertedFileInspect() m.MinimockCreateKnowledgeBaseInspect() m.MinimockCreateKnowledgeBaseFileInspect() + m.MinimockCreateMessageInspect() + m.MinimockDeleteAllConvertedFilesinKbInspect() m.MinimockDeleteAllKnowledgeBaseFilesInspect() @@ -16156,10 +20694,16 @@ func (m *RepositoryIMock) MinimockFinish() { m.MinimockDeleteKnowledgeBaseFileInspect() + m.MinimockDeleteMessageInspect() + m.MinimockDeleteRepositoryTagInspect() m.MinimockGetChunksByUIDsInspect() + m.MinimockGetConversationByIDInspect() + + m.MinimockGetConversationByUIDInspect() + m.MinimockGetConvertedFileByFileUIDInspect() m.MinimockGetCountFilesByListKnowledgeBaseUIDInspect() @@ -16176,6 +20720,8 @@ func (m *RepositoryIMock) MinimockFinish() { m.MinimockGetKnowledgebaseFileByKbUIDAndFileIDInspect() + m.MinimockGetMessageByUIDInspect() + m.MinimockGetNeedProcessFilesInspect() m.MinimockGetRepositoryTagInspect() @@ -16206,24 +20752,38 @@ func (m *RepositoryIMock) MinimockFinish() { m.MinimockListChunksByKbFileUIDInspect() + m.MinimockListConversationsInspect() + m.MinimockListEmbeddingsByKbFileUIDInspect() m.MinimockListKnowledgeBaseFilesInspect() m.MinimockListKnowledgeBasesInspect() + m.MinimockListMessagesInspect() + + m.MinimockMessageTableNameInspect() + m.MinimockProcessKnowledgeBaseFilesInspect() + m.MinimockSoftDeleteConversationInspect() + m.MinimockTextChunkTableNameInspect() m.MinimockUpdateChunkInspect() + m.MinimockUpdateConversationByUpdateMapInspect() + m.MinimockUpdateExtraMetaDataInspect() m.MinimockUpdateKnowledgeBaseInspect() m.MinimockUpdateKnowledgeBaseFileInspect() + m.MinimockUpdateMessageInspect() + + m.MinimockUpdateMessageByUpdateMapInspect() + m.MinimockUpsertEmbeddingsInspect() m.MinimockUpsertRepositoryTagInspect() @@ -16251,10 +20811,13 @@ func (m *RepositoryIMock) MinimockWait(timeout mm_time.Duration) { func (m *RepositoryIMock) minimockDone() bool { done := true return done && + m.MinimockConversationTableNameDone() && m.MinimockConvertedFileTableNameDone() && + m.MinimockCreateConversationDone() && m.MinimockCreateConvertedFileDone() && m.MinimockCreateKnowledgeBaseDone() && m.MinimockCreateKnowledgeBaseFileDone() && + m.MinimockCreateMessageDone() && m.MinimockDeleteAllConvertedFilesinKbDone() && m.MinimockDeleteAllKnowledgeBaseFilesDone() && m.MinimockDeleteAndCreateChunksDone() && @@ -16265,8 +20828,11 @@ func (m *RepositoryIMock) minimockDone() bool { m.MinimockDeleteEmbeddingsByUIDsDone() && m.MinimockDeleteKnowledgeBaseDone() && m.MinimockDeleteKnowledgeBaseFileDone() && + m.MinimockDeleteMessageDone() && m.MinimockDeleteRepositoryTagDone() && m.MinimockGetChunksByUIDsDone() && + m.MinimockGetConversationByIDDone() && + m.MinimockGetConversationByUIDDone() && m.MinimockGetConvertedFileByFileUIDDone() && m.MinimockGetCountFilesByListKnowledgeBaseUIDDone() && m.MinimockGetEmbeddingByUIDsDone() && @@ -16275,6 +20841,7 @@ func (m *RepositoryIMock) minimockDone() bool { m.MinimockGetKnowledgeBaseCountByOwnerDone() && m.MinimockGetKnowledgeBaseFilesByFileUIDsDone() && m.MinimockGetKnowledgebaseFileByKbUIDAndFileIDDone() && + m.MinimockGetMessageByUIDDone() && m.MinimockGetNeedProcessFilesDone() && m.MinimockGetRepositoryTagDone() && m.MinimockGetSourceTableAndUIDByFileUIDsDone() && @@ -16290,15 +20857,22 @@ func (m *RepositoryIMock) minimockDone() bool { m.MinimockIncreaseKnowledgeBaseUsageDone() && m.MinimockKnowledgeBaseFileTableNameDone() && m.MinimockListChunksByKbFileUIDDone() && + m.MinimockListConversationsDone() && m.MinimockListEmbeddingsByKbFileUIDDone() && m.MinimockListKnowledgeBaseFilesDone() && m.MinimockListKnowledgeBasesDone() && + m.MinimockListMessagesDone() && + m.MinimockMessageTableNameDone() && m.MinimockProcessKnowledgeBaseFilesDone() && + m.MinimockSoftDeleteConversationDone() && m.MinimockTextChunkTableNameDone() && m.MinimockUpdateChunkDone() && + m.MinimockUpdateConversationByUpdateMapDone() && m.MinimockUpdateExtraMetaDataDone() && m.MinimockUpdateKnowledgeBaseDone() && m.MinimockUpdateKnowledgeBaseFileDone() && + m.MinimockUpdateMessageDone() && + m.MinimockUpdateMessageByUpdateMapDone() && m.MinimockUpsertEmbeddingsDone() && m.MinimockUpsertRepositoryTagDone() } diff --git a/pkg/repository/conversation.go b/pkg/repository/conversation.go new file mode 100644 index 0000000..fe482a3 --- /dev/null +++ b/pkg/repository/conversation.go @@ -0,0 +1,150 @@ +package repository + +import ( + "context" + "fmt" + "strings" + "time" + + "github.com/gofrs/uuid" + "gorm.io/gorm" +) + +type ConversationI interface { + ConversationTableName() string + CreateConversation(ctx context.Context, conv Conversation) (*Conversation, error) + ListConversations(ctx context.Context, namespaceUID uuid.UUID, catalogUID uuid.UUID, pageSize int32, nextPageToken string) ([]*Conversation, int, string, error) + GetConversationByID(ctx context.Context, namespaceUID uuid.UUID, catalogUID uuid.UUID, conversationID string) (*Conversation, error) + UpdateConversationByUpdateMap(ctx context.Context, convUID uuid.UUID, updateMap map[string]interface{}) (*Conversation, error) + SoftDeleteConversation(ctx context.Context, namespaceUID uuid.UUID, catalogUID uuid.UUID, conversationID string) error + GetConversationByUID(ctx context.Context, convUID uuid.UUID) (*Conversation, error) +} + +type Conversation struct { + UID uuid.UUID `gorm:"column:uid;type:uuid;default:gen_random_uuid();primaryKey" json:"uid"` + NamespaceUID uuid.UUID `gorm:"column:namespace_uid;not null" json:"namespace_uid"` + CatalogUID uuid.UUID `gorm:"column:catalog_uid;not null" json:"catalog_uid"` + ID string `gorm:"column:id;not null" json:"id"` + CreateTime time.Time `gorm:"column:create_time;not null;default:CURRENT_TIMESTAMP" json:"create_time"` + UpdateTime time.Time `gorm:"column:update_time;not null;autoUpdateTime" json:"update_time"` + DeleteTime *time.Time `gorm:"column:delete_time" json:"delete_time"` +} + +type ConversationColumns struct { + UID string + NamespaceUID string + CatalogUID string + ID string + CreateTime string + UpdateTime string + DeleteTime string +} + +var ConversationColumn = ConversationColumns{ + UID: "uid", + NamespaceUID: "namespace_uid", + CatalogUID: "catalog_uid", + ID: "id", + CreateTime: "create_time", + UpdateTime: "update_time", + DeleteTime: "delete_time", +} + +func (r *Repository) ConversationTableName() string { + return "conversation" +} + +func (r *Repository) CreateConversation(ctx context.Context, conv Conversation) (*Conversation, error) { + if err := r.db.WithContext(ctx).Create(&conv).Error; err != nil { + if strings.Contains(err.Error(), "violates unique constraint") { + return nil, fmt.Errorf("a conversation already exists with the same ID") + } + return nil, fmt.Errorf("failed to create conversation: %w", err) + } + return &conv, nil +} + +func (r *Repository) ListConversations(ctx context.Context, namespaceUID uuid.UUID, catalogUID uuid.UUID, pageSize int32, nextPageToken string) ([]*Conversation, int, string, error) { + var conversations []*Conversation + var totalCount int64 + + whereClause := fmt.Sprintf("%v = ? AND %v = ? AND %v IS NULL", ConversationColumn.NamespaceUID, ConversationColumn.CatalogUID, ConversationColumn.DeleteTime) + query := r.db.Model(&Conversation{}).Where(whereClause, namespaceUID, catalogUID) + + if err := query.Count(&totalCount).Error; err != nil { + return nil, 0, "", err + } + + if pageSize > 100 { + pageSize = 100 + } else if pageSize <= 0 { + pageSize = 10 + } + pageSizeAddOne := pageSize + 1 + query = query.Limit(int(pageSizeAddOne)) + + if nextPageToken != "" { + tokenUUID, err := uuid.FromString(nextPageToken) + if err != nil { + return nil, 0, "", fmt.Errorf("invalid next_page_token format(UUID): %v", err) + } + conv, err := r.GetConversationByUID(ctx, tokenUUID) + if err != nil { + return nil, 0, "", fmt.Errorf("invalid next_page_token: %v", err) + } + whereClause := fmt.Sprintf("%v >= ?", ConversationColumn.CreateTime) + query = query.Where(whereClause, conv.CreateTime) + } + + if err := query.Order(ConversationColumn.CreateTime).Find(&conversations).Error; err != nil { + return nil, 0, "", err + } + + newNextPageToken := "" + if len(conversations) == int(pageSizeAddOne) { + newNextPageToken = conversations[pageSizeAddOne-1].UID.String() + conversations = conversations[:pageSizeAddOne-1] + } + + return conversations, int(totalCount), newNextPageToken, nil +} + +func (r *Repository) GetConversationByID(ctx context.Context, namespaceUID uuid.UUID, catalogUID uuid.UUID, conversationID string) (*Conversation, error) { + var conversation Conversation + whereClause := fmt.Sprintf("%v = ? AND %v = ? AND %v = ? AND %v IS NULL", ConversationColumn.NamespaceUID, ConversationColumn.CatalogUID, ConversationColumn.ID, ConversationColumn.DeleteTime) + if err := r.db.WithContext(ctx).Where(whereClause, namespaceUID, catalogUID, conversationID).First(&conversation).Error; err != nil { + if err == gorm.ErrRecordNotFound { + return nil, fmt.Errorf("conversation not found. namespaceUID: %v, catalogUID: %v, conversationID: %v", namespaceUID, catalogUID, conversationID) + } + return nil, err + } + return &conversation, nil +} + +// UpdateConversationByUpdateMap updates an existing conversation using map. +func (r *Repository) UpdateConversationByUpdateMap(ctx context.Context, convUID uuid.UUID, updateMap map[string]interface{}) (*Conversation, error) { + if err := r.db.WithContext(ctx).Model(&Conversation{}).Where(ConversationColumn.UID+" = ?", convUID).Updates(updateMap).Error; err != nil { + return nil, fmt.Errorf("failed to update conversation: %w", err) + } + return r.GetConversationByUID(ctx, convUID) +} + +func (r *Repository) SoftDeleteConversation(ctx context.Context, namespaceUID uuid.UUID, catalogUID uuid.UUID, conversationID string) error { + whereClause := fmt.Sprintf("%v = ? AND %v = ? AND %v = ? AND %v IS NULL", ConversationColumn.NamespaceUID, ConversationColumn.CatalogUID, ConversationColumn.ID, ConversationColumn.DeleteTime) + if err := r.db.WithContext(ctx).Model(&Conversation{}).Where(whereClause, namespaceUID, catalogUID, conversationID).Update(ConversationColumn.DeleteTime, time.Now()).Error; err != nil { + return fmt.Errorf("failed to delete conversation: %w", err) + } + return nil +} + +// GetConversationByUID returns a conversation by its UID. +func (r *Repository) GetConversationByUID(ctx context.Context, convUID uuid.UUID) (*Conversation, error) { + var conversation Conversation + if err := r.db.WithContext(ctx).Where(ConversationColumn.UID+" = ?", convUID).First(&conversation).Error; err != nil { + if err == gorm.ErrRecordNotFound { + return nil, fmt.Errorf("conversation not found. UID: %v", convUID) + } + return nil, err + } + return &conversation, nil +} diff --git a/pkg/repository/knowledgebase.go b/pkg/repository/knowledgebase.go index 8ab15a8..afe8db5 100644 --- a/pkg/repository/knowledgebase.go +++ b/pkg/repository/knowledgebase.go @@ -18,7 +18,7 @@ type KnowledgeBaseI interface { ListKnowledgeBases(ctx context.Context, ownerUID string) ([]KnowledgeBase, error) UpdateKnowledgeBase(ctx context.Context, ownerUID string, kb KnowledgeBase) (*KnowledgeBase, error) DeleteKnowledgeBase(ctx context.Context, ownerUID, kbID string) (*KnowledgeBase, error) - GetKnowledgeBaseByOwnerAndKbID(ctx context.Context, ownerUID string, kbID string) (*KnowledgeBase, error) + GetKnowledgeBaseByOwnerAndKbID(ctx context.Context, ownerUID uuid.UUID, kbID string) (*KnowledgeBase, error) GetKnowledgeBaseCountByOwner(ctx context.Context, ownerUID string) (int64, error) IncreaseKnowledgeBaseUsage(ctx context.Context, kbUID string, amount int) error } @@ -247,7 +247,7 @@ func (r *Repository) checkIfKnowledgeBaseExists(ctx context.Context, kbUID strin } // get the knowledge base by (owner, kb_id) -func (r *Repository) GetKnowledgeBaseByOwnerAndKbID(ctx context.Context, owner string, kbID string) (*KnowledgeBase, error) { +func (r *Repository) GetKnowledgeBaseByOwnerAndKbID(ctx context.Context, owner uuid.UUID, kbID string) (*KnowledgeBase, error) { var existingKB KnowledgeBase whereString := fmt.Sprintf("%v = ? AND %v = ? AND %v is NULL", KnowledgeBaseColumn.Owner, KnowledgeBaseColumn.KbID, KnowledgeBaseColumn.DeleteTime) if err := r.db.WithContext(ctx).Where(whereString, owner, kbID).First(&existingKB).Error; err != nil { diff --git a/pkg/repository/message.go b/pkg/repository/message.go new file mode 100644 index 0000000..22310ad --- /dev/null +++ b/pkg/repository/message.go @@ -0,0 +1,171 @@ +package repository + +import ( + "context" + "fmt" + "time" + + "github.com/gofrs/uuid" + "gorm.io/gorm" +) + +type MessageI interface { + MessageTableName() string + CreateMessage(ctx context.Context, msg Message) (*Message, error) + ListMessages(ctx context.Context, namespaceUID, catalogUID, conversationUID uuid.UUID, latestK int32, pageSize int32, pageToken string, includeSystemMessages bool) ([]*Message, string, int64, error) + GetMessageByUID(ctx context.Context, messageUID uuid.UUID) (*Message, error) + UpdateMessage(ctx context.Context, msg Message) (*Message, error) + UpdateMessageByUpdateMap(ctx context.Context, messageUID uuid.UUID, updateMap map[string]interface{}) (*Message, error) + DeleteMessage(ctx context.Context, messageUID uuid.UUID) error +} + +type Message struct { + UID uuid.UUID `gorm:"column:uid;type:uuid;default:gen_random_uuid();primaryKey" json:"uid"` + NamespaceUID uuid.UUID `gorm:"column:namespace_uid;not null" json:"namespace_id"` + CatalogUID uuid.UUID `gorm:"column:catalog_uid;not null" json:"catalog_uid"` + ConversationUID uuid.UUID `gorm:"column:conversation_uid;not null" json:"conversation_uid"` + Content string `gorm:"column:content;type:text" json:"content"` + Role string `gorm:"column:role;not null" json:"role"` + Type string `gorm:"column:type;not null" json:"type"` + CreateTime time.Time `gorm:"column:create_time;not null;default:CURRENT_TIMESTAMP" json:"create_time"` + UpdateTime time.Time `gorm:"column:update_time;not null;autoUpdateTime" json:"update_time"` + DeleteTime *time.Time `gorm:"column:delete_time" json:"delete_time"` +} + +const reservedWordSystem = "system" + +type MessageColumns struct { + UID string + NamespaceUID string + CatalogUID string + ConversationUID string + Content string + Role string + Type string + CreateTime string + UpdateTime string + DeleteTime string +} + +var MessageColumn = MessageColumns{ + UID: "uid", + NamespaceUID: "namespace_uid", + CatalogUID: "catalog_uid", + ConversationUID: "conversation_uid", + Content: "content", + Role: "role", + Type: "type", + CreateTime: "create_time", + UpdateTime: "update_time", + DeleteTime: "delete_time", +} + +func (r *Repository) MessageTableName() string { + return "message" +} + +func (r *Repository) CreateMessage(ctx context.Context, msg Message) (*Message, error) { + if err := r.db.WithContext(ctx).Create(&msg).Error; err != nil { + return nil, fmt.Errorf("failed to create message: %w", err) + } + return &msg, nil +} + +func (r *Repository) ListMessages( + ctx context.Context, NsUID, catalogUID, conversationUID uuid.UUID, latestK int32, pageSize int32, pageToken string, includeSystemMessages bool) ( + []*Message, string, int64, error) { + var messages []*Message + var totalCount int64 + + baseWhereClause := fmt.Sprintf("%v = ? AND %v = ? AND %v = ? AND %v IS NULL", MessageColumn.NamespaceUID, MessageColumn.CatalogUID, MessageColumn.ConversationUID, MessageColumn.DeleteTime) + + // Count total messages + countQuery := r.db.Model(&Message{}).Where(baseWhereClause, NsUID, catalogUID, conversationUID) + if !includeSystemMessages { + countQuery = countQuery.Where(MessageColumn.Role+" != ?", reservedWordSystem) + } + if err := countQuery.Count(&totalCount).Error; err != nil { + return nil, "", 0, fmt.Errorf("error counting total messages: %v", err) + } + + // Query for messages + query := r.db.Model(&Message{}).Where(baseWhereClause, NsUID, catalogUID, conversationUID) + + if !includeSystemMessages { + query = query.Where(MessageColumn.Role+" != ?", reservedWordSystem) + } + + if pageSize > 100 { + pageSize = 100 + } else if pageSize <= 0 { + pageSize = 10 + } + pageSizeAddOne := pageSize + 1 + query = query.Limit(int(pageSizeAddOne)) + + if pageToken != "" { + tokenUUID, err := uuid.FromString(pageToken) + if err != nil { + return nil, "", 0, fmt.Errorf("invalid page_token format(UUID): %v", err) + } + firstMsg, err := r.GetMessageByUID(ctx, tokenUUID) + if err != nil { + return nil, "", 0, fmt.Errorf("error getting message by page_token: %v", err) + } + whereClause := fmt.Sprintf("%v >= ?", MessageColumn.CreateTime) + query = query.Where(whereClause, firstMsg.CreateTime) + } + + if latestK > 0 { + query = query.Order(MessageColumn.CreateTime + " DESC").Limit(int(latestK)) + } else { + query = query.Order(MessageColumn.CreateTime + " ASC") + } + + if err := query.Find(&messages).Error; err != nil { + return nil, "", 0, err + } + + newPageToken := "" + if len(messages) == int(pageSizeAddOne) { + newPageToken = messages[pageSizeAddOne-1].UID.String() + messages = messages[:pageSizeAddOne-1] + } + + return messages, newPageToken, totalCount, nil +} + +func (r *Repository) GetMessageByUID(ctx context.Context, messageUID uuid.UUID) (*Message, error) { + var message Message + whereClause := fmt.Sprintf("%v = ? AND %v IS NULL", MessageColumn.UID, MessageColumn.DeleteTime) + if err := r.db.WithContext(ctx).Where(whereClause, messageUID).First(&message).Error; err != nil { + if err == gorm.ErrRecordNotFound { + return nil, fmt.Errorf("message not found") + } + return nil, err + } + return &message, nil +} + +func (r *Repository) UpdateMessage(ctx context.Context, msg Message) (*Message, error) { + if err := r.db.WithContext(ctx).Save(&msg).Error; err != nil { + return nil, fmt.Errorf("failed to update message: %w", err) + } + return &msg, nil +} + +// UpdateMessageByUpdateMap updates message by update map +func (r *Repository) UpdateMessageByUpdateMap(ctx context.Context, messageUID uuid.UUID, updateMap map[string]interface{}) (*Message, error) { + if err := r.db.WithContext(ctx).Model(&Message{}).Where(MessageColumn.UID+" = ? AND "+MessageColumn.DeleteTime+" IS NULL", messageUID).Updates(updateMap).Error; err != nil { + return nil, fmt.Errorf("failed to update message: %w", err) + } + return r.GetMessageByUID(ctx, messageUID) +} + +func (r *Repository) DeleteMessage(ctx context.Context, messageUID uuid.UUID) error { + whereClause := fmt.Sprintf("%v = ? AND %v IS NULL", MessageColumn.UID, MessageColumn.DeleteTime) + if err := r.db.WithContext(ctx).Model(&Message{}).Where(whereClause, messageUID).Update(MessageColumn.DeleteTime, time.Now().UTC()).Error; err != nil { + return fmt.Errorf("failed to delete message: %w", err) + } + return nil +} diff --git a/pkg/repository/repository.go b/pkg/repository/repository.go index 3dbb30c..1ceec6e 100644 --- a/pkg/repository/repository.go +++ b/pkg/repository/repository.go @@ -11,6 +11,8 @@ type RepositoryI interface { ConvertedFileI TextChunkI EmbeddingI + ConversationI + MessageI } // Repository implements Artifact storage functions in PostgreSQL. diff --git a/pkg/service/permission.go b/pkg/service/permission.go new file mode 100644 index 0000000..254d861 --- /dev/null +++ b/pkg/service/permission.go @@ -0,0 +1,46 @@ +package service + +import ( + "context" + "fmt" + + "github.com/instill-ai/artifact-backend/pkg/acl" + "github.com/instill-ai/artifact-backend/pkg/customerror" + "github.com/instill-ai/artifact-backend/pkg/logger" + "github.com/instill-ai/artifact-backend/pkg/repository" + "github.com/instill-ai/artifact-backend/pkg/resource" + "go.uber.org/zap" +) + +func (s *Service) CheckCatalogUserPermission(ctx context.Context, nsID, catalogID, authUID string) (*resource.Namespace, *repository.KnowledgeBase, error) { + log, _ := logger.GetZapLogger(ctx) + // ACL - check user's permission to create conversation in the namespace + ns, err := s.GetNamespaceByNsID(ctx, nsID) + if err != nil { + log.Error( + "failed to get namespace", + zap.Error(err), + zap.String("namespace_id", nsID), + zap.String("auth_uid", authUID), + ) + return nil, nil, fmt.Errorf("failed to get namespace: %w", err) + } + + // Check if the catalog exists + catalog, err := s.Repository.GetKnowledgeBaseByOwnerAndKbID(ctx, ns.NsUID, catalogID) + if err != nil { + log.Error("failed to get catalog", zap.Error(err)) + return nil, nil, fmt.Errorf("failed to get catalog: %w", err) + } + granted, err := s.ACLClient.CheckPermission(ctx, acl.CatalogObject, catalog.UID, "writer") + if err != nil { + log.Error("failed to check permission", zap.Error(err)) + + return nil, nil, fmt.Errorf("failed to check permission. err: %w", err) + } + if !granted { + return nil, nil, fmt.Errorf("no permission. err: %w", customerror.ErrNoPermission) + } + + return ns, catalog, nil +} diff --git a/pkg/service/retrieval.go b/pkg/service/retrieval.go index 94ca3cb..6913f22 100644 --- a/pkg/service/retrieval.go +++ b/pkg/service/retrieval.go @@ -7,7 +7,7 @@ import ( "github.com/gofrs/uuid" "github.com/instill-ai/artifact-backend/pkg/logger" - artifactv1alpha "github.com/instill-ai/protogen-go/artifact/artifact/v1alpha" + artifactPb "github.com/instill-ai/protogen-go/artifact/artifact/v1alpha" "go.uber.org/zap" ) @@ -16,7 +16,7 @@ type SimChunk struct { Score float32 } -func (s *Service) SimilarityChunksSearch(ctx context.Context, caller uuid.UUID, requester uuid.UUID, ownerUID string, req *artifactv1alpha.SimilarityChunksSearchRequest) ([]SimChunk, error) { +func (s *Service) SimilarityChunksSearch(ctx context.Context, caller uuid.UUID, requester uuid.UUID, ownerUID uuid.UUID, req *artifactPb.SimilarityChunksSearchRequest) ([]SimChunk, error) { log, _ := logger.GetZapLogger(ctx) t := time.Now() textVector, err := s.EmbeddingTextPipe(ctx, caller, requester, []string{req.TextPrompt})