Files
coze-studio/backend/crossdomain/plugin/pluginmock/plugin_mock.go

301 lines
12 KiB
Go

/*
* Copyright 2025 coze-dev Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Code generated by MockGen. DO NOT EDIT.
// Source: plugin.go
//
// Generated by this command:
//
// mockgen -destination pluginmock/plugin_mock.go --package pluginmock -source plugin.go
//
// Package pluginmock is a generated GoMock package.
package pluginmock
import (
context "context"
reflect "reflect"
schema "github.com/cloudwego/eino/schema"
workflow "github.com/coze-dev/coze-studio/backend/crossdomain/workflow/model"
model "github.com/coze-dev/coze-studio/backend/crossdomain/plugin/model"
entity "github.com/coze-dev/coze-studio/backend/domain/plugin/entity"
gomock "go.uber.org/mock/gomock"
)
// MockPluginService is a mock of PluginService interface.
type MockPluginService struct {
ctrl *gomock.Controller
recorder *MockPluginServiceMockRecorder
isgomock struct{}
}
// MockPluginServiceMockRecorder is the mock recorder for MockPluginService.
type MockPluginServiceMockRecorder struct {
mock *MockPluginService
}
// NewMockPluginService creates a new mock instance.
func NewMockPluginService(ctrl *gomock.Controller) *MockPluginService {
mock := &MockPluginService{ctrl: ctrl}
mock.recorder = &MockPluginServiceMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockPluginService) EXPECT() *MockPluginServiceMockRecorder {
return m.recorder
}
// BatchGetSaasPluginToolsInfo mocks base method.
func (m *MockPluginService) BatchGetSaasPluginToolsInfo(ctx context.Context, pluginIDs []int64) (map[int64][]*entity.ToolInfo, map[int64]*model.PluginInfo, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "BatchGetSaasPluginToolsInfo", ctx, pluginIDs)
ret0, _ := ret[0].(map[int64][]*entity.ToolInfo)
ret1, _ := ret[1].(map[int64]*model.PluginInfo)
ret2, _ := ret[2].(error)
return ret0, ret1, ret2
}
// BatchGetSaasPluginToolsInfo indicates an expected call of BatchGetSaasPluginToolsInfo.
func (mr *MockPluginServiceMockRecorder) BatchGetSaasPluginToolsInfo(ctx, pluginIDs any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BatchGetSaasPluginToolsInfo", reflect.TypeOf((*MockPluginService)(nil).BatchGetSaasPluginToolsInfo), ctx, pluginIDs)
}
// BindAgentTools mocks base method.
func (m *MockPluginService) BindAgentTools(ctx context.Context, agentID int64, bindTools []*model.BindToolInfo) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "BindAgentTools", ctx, agentID, bindTools)
ret0, _ := ret[0].(error)
return ret0
}
// BindAgentTools indicates an expected call of BindAgentTools.
func (mr *MockPluginServiceMockRecorder) BindAgentTools(ctx, agentID, bindTools any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BindAgentTools", reflect.TypeOf((*MockPluginService)(nil).BindAgentTools), ctx, agentID, bindTools)
}
// ExecuteTool mocks base method.
func (m *MockPluginService) ExecuteTool(ctx context.Context, req *model.ExecuteToolRequest, opts ...model.ExecuteToolOpt) (*model.ExecuteToolResponse, error) {
m.ctrl.T.Helper()
varargs := []any{ctx, req}
for _, a := range opts {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "ExecuteTool", varargs...)
ret0, _ := ret[0].(*model.ExecuteToolResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ExecuteTool indicates an expected call of ExecuteTool.
func (mr *MockPluginServiceMockRecorder) ExecuteTool(ctx, req any, opts ...any) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx, req}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExecuteTool", reflect.TypeOf((*MockPluginService)(nil).ExecuteTool), varargs...)
}
// GetAPPAllPlugins mocks base method.
func (m *MockPluginService) GetAPPAllPlugins(ctx context.Context, appID int64) ([]*model.PluginInfo, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetAPPAllPlugins", ctx, appID)
ret0, _ := ret[0].([]*model.PluginInfo)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetAPPAllPlugins indicates an expected call of GetAPPAllPlugins.
func (mr *MockPluginServiceMockRecorder) GetAPPAllPlugins(ctx, appID any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAPPAllPlugins", reflect.TypeOf((*MockPluginService)(nil).GetAPPAllPlugins), ctx, appID)
}
// MGetAgentTools mocks base method.
func (m *MockPluginService) MGetAgentTools(ctx context.Context, req *model.MGetAgentToolsRequest) ([]*model.ToolInfo, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MGetAgentTools", ctx, req)
ret0, _ := ret[0].([]*model.ToolInfo)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// MGetAgentTools indicates an expected call of MGetAgentTools.
func (mr *MockPluginServiceMockRecorder) MGetAgentTools(ctx, req any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MGetAgentTools", reflect.TypeOf((*MockPluginService)(nil).MGetAgentTools), ctx, req)
}
// MGetDraftPlugins mocks base method.
func (m *MockPluginService) MGetDraftPlugins(ctx context.Context, pluginIDs []int64) ([]*model.PluginInfo, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MGetDraftPlugins", ctx, pluginIDs)
ret0, _ := ret[0].([]*model.PluginInfo)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// MGetDraftPlugins indicates an expected call of MGetDraftPlugins.
func (mr *MockPluginServiceMockRecorder) MGetDraftPlugins(ctx, pluginIDs any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MGetDraftPlugins", reflect.TypeOf((*MockPluginService)(nil).MGetDraftPlugins), ctx, pluginIDs)
}
// MGetDraftTools mocks base method.
func (m *MockPluginService) MGetDraftTools(ctx context.Context, pluginIDs []int64) ([]*model.ToolInfo, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MGetDraftTools", ctx, pluginIDs)
ret0, _ := ret[0].([]*model.ToolInfo)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// MGetDraftTools indicates an expected call of MGetDraftTools.
func (mr *MockPluginServiceMockRecorder) MGetDraftTools(ctx, pluginIDs any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MGetDraftTools", reflect.TypeOf((*MockPluginService)(nil).MGetDraftTools), ctx, pluginIDs)
}
// MGetOnlinePlugins mocks base method.
func (m *MockPluginService) MGetOnlinePlugins(ctx context.Context, pluginIDs []int64) ([]*model.PluginInfo, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MGetOnlinePlugins", ctx, pluginIDs)
ret0, _ := ret[0].([]*model.PluginInfo)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// MGetOnlinePlugins indicates an expected call of MGetOnlinePlugins.
func (mr *MockPluginServiceMockRecorder) MGetOnlinePlugins(ctx, pluginIDs any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MGetOnlinePlugins", reflect.TypeOf((*MockPluginService)(nil).MGetOnlinePlugins), ctx, pluginIDs)
}
// MGetOnlineTools mocks base method.
func (m *MockPluginService) MGetOnlineTools(ctx context.Context, pluginIDs []int64) ([]*model.ToolInfo, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MGetOnlineTools", ctx, pluginIDs)
ret0, _ := ret[0].([]*model.ToolInfo)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// MGetOnlineTools indicates an expected call of MGetOnlineTools.
func (mr *MockPluginServiceMockRecorder) MGetOnlineTools(ctx, pluginIDs any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MGetOnlineTools", reflect.TypeOf((*MockPluginService)(nil).MGetOnlineTools), ctx, pluginIDs)
}
// MGetVersionPlugins mocks base method.
func (m *MockPluginService) MGetVersionPlugins(ctx context.Context, versionPlugins []model.VersionPlugin) ([]*model.PluginInfo, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MGetVersionPlugins", ctx, versionPlugins)
ret0, _ := ret[0].([]*model.PluginInfo)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// MGetVersionPlugins indicates an expected call of MGetVersionPlugins.
func (mr *MockPluginServiceMockRecorder) MGetVersionPlugins(ctx, versionPlugins any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MGetVersionPlugins", reflect.TypeOf((*MockPluginService)(nil).MGetVersionPlugins), ctx, versionPlugins)
}
// MGetVersionTools mocks base method.
func (m *MockPluginService) MGetVersionTools(ctx context.Context, versionTools []model.VersionTool) ([]*model.ToolInfo, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MGetVersionTools", ctx, versionTools)
ret0, _ := ret[0].([]*model.ToolInfo)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// MGetVersionTools indicates an expected call of MGetVersionTools.
func (mr *MockPluginServiceMockRecorder) MGetVersionTools(ctx, versionTools any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MGetVersionTools", reflect.TypeOf((*MockPluginService)(nil).MGetVersionTools), ctx, versionTools)
}
// PublishAPPPlugins mocks base method.
func (m *MockPluginService) PublishAPPPlugins(ctx context.Context, req *model.PublishAPPPluginsRequest) (*model.PublishAPPPluginsResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "PublishAPPPlugins", ctx, req)
ret0, _ := ret[0].(*model.PublishAPPPluginsResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// PublishAPPPlugins indicates an expected call of PublishAPPPlugins.
func (mr *MockPluginServiceMockRecorder) PublishAPPPlugins(ctx, req any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PublishAPPPlugins", reflect.TypeOf((*MockPluginService)(nil).PublishAPPPlugins), ctx, req)
}
// MockInvokableTool is a mock of InvokableTool interface.
type MockInvokableTool struct {
ctrl *gomock.Controller
recorder *MockInvokableToolMockRecorder
isgomock struct{}
}
// MockInvokableToolMockRecorder is the mock recorder for MockInvokableTool.
type MockInvokableToolMockRecorder struct {
mock *MockInvokableTool
}
// NewMockInvokableTool creates a new mock instance.
func NewMockInvokableTool(ctrl *gomock.Controller) *MockInvokableTool {
mock := &MockInvokableTool{ctrl: ctrl}
mock.recorder = &MockInvokableToolMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockInvokableTool) EXPECT() *MockInvokableToolMockRecorder {
return m.recorder
}
// Info mocks base method.
func (m *MockInvokableTool) Info(ctx context.Context) (*schema.ToolInfo, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Info", ctx)
ret0, _ := ret[0].(*schema.ToolInfo)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Info indicates an expected call of Info.
func (mr *MockInvokableToolMockRecorder) Info(ctx any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Info", reflect.TypeOf((*MockInvokableTool)(nil).Info), ctx)
}
// PluginInvoke mocks base method.
func (m *MockInvokableTool) PluginInvoke(ctx context.Context, argumentsInJSON string, cfg workflow.ExecuteConfig) (string, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "PluginInvoke", ctx, argumentsInJSON, cfg)
ret0, _ := ret[0].(string)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// PluginInvoke indicates an expected call of PluginInvoke.
func (mr *MockInvokableToolMockRecorder) PluginInvoke(ctx, argumentsInJSON, cfg any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PluginInvoke", reflect.TypeOf((*MockInvokableTool)(nil).PluginInvoke), ctx, argumentsInJSON, cfg)
}