// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify

package mocks

import (
	"context"

	mock "github.com/stretchr/testify/mock"
	"go.woodpecker-ci.org/woodpecker/v3/server/forge"
	"go.woodpecker-ci.org/woodpecker/v3/server/forge/types"
	"go.woodpecker-ci.org/woodpecker/v3/server/model"
)

// NewMockService creates a new instance of MockService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockService(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockService {
	mock := &MockService{}
	mock.Mock.Test(t)

	t.Cleanup(func() { mock.AssertExpectations(t) })

	return mock
}

// MockService is an autogenerated mock type for the Service type
type MockService struct {
	mock.Mock
}

type MockService_Expecter struct {
	mock *mock.Mock
}

func (_m *MockService) EXPECT() *MockService_Expecter {
	return &MockService_Expecter{mock: &_m.Mock}
}

// Fetch provides a mock function for the type MockService
func (_mock *MockService) Fetch(ctx context.Context, forge1 forge.Forge, user *model.User, repo *model.Repo, pipeline *model.Pipeline, oldConfigData []*types.FileMeta, restart bool) ([]*types.FileMeta, error) {
	ret := _mock.Called(ctx, forge1, user, repo, pipeline, oldConfigData, restart)

	if len(ret) == 0 {
		panic("no return value specified for Fetch")
	}

	var r0 []*types.FileMeta
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, forge.Forge, *model.User, *model.Repo, *model.Pipeline, []*types.FileMeta, bool) ([]*types.FileMeta, error)); ok {
		return returnFunc(ctx, forge1, user, repo, pipeline, oldConfigData, restart)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, forge.Forge, *model.User, *model.Repo, *model.Pipeline, []*types.FileMeta, bool) []*types.FileMeta); ok {
		r0 = returnFunc(ctx, forge1, user, repo, pipeline, oldConfigData, restart)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([]*types.FileMeta)
		}
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, forge.Forge, *model.User, *model.Repo, *model.Pipeline, []*types.FileMeta, bool) error); ok {
		r1 = returnFunc(ctx, forge1, user, repo, pipeline, oldConfigData, restart)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

// MockService_Fetch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Fetch'
type MockService_Fetch_Call struct {
	*mock.Call
}

// Fetch is a helper method to define mock.On call
//   - ctx context.Context
//   - forge1 forge.Forge
//   - user *model.User
//   - repo *model.Repo
//   - pipeline *model.Pipeline
//   - oldConfigData []*types.FileMeta
//   - restart bool
func (_e *MockService_Expecter) Fetch(ctx interface{}, forge1 interface{}, user interface{}, repo interface{}, pipeline interface{}, oldConfigData interface{}, restart interface{}) *MockService_Fetch_Call {
	return &MockService_Fetch_Call{Call: _e.mock.On("Fetch", ctx, forge1, user, repo, pipeline, oldConfigData, restart)}
}

func (_c *MockService_Fetch_Call) Run(run func(ctx context.Context, forge1 forge.Forge, user *model.User, repo *model.Repo, pipeline *model.Pipeline, oldConfigData []*types.FileMeta, restart bool)) *MockService_Fetch_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 forge.Forge
		if args[1] != nil {
			arg1 = args[1].(forge.Forge)
		}
		var arg2 *model.User
		if args[2] != nil {
			arg2 = args[2].(*model.User)
		}
		var arg3 *model.Repo
		if args[3] != nil {
			arg3 = args[3].(*model.Repo)
		}
		var arg4 *model.Pipeline
		if args[4] != nil {
			arg4 = args[4].(*model.Pipeline)
		}
		var arg5 []*types.FileMeta
		if args[5] != nil {
			arg5 = args[5].([]*types.FileMeta)
		}
		var arg6 bool
		if args[6] != nil {
			arg6 = args[6].(bool)
		}
		run(
			arg0,
			arg1,
			arg2,
			arg3,
			arg4,
			arg5,
			arg6,
		)
	})
	return _c
}

func (_c *MockService_Fetch_Call) Return(configData []*types.FileMeta, err error) *MockService_Fetch_Call {
	_c.Call.Return(configData, err)
	return _c
}

func (_c *MockService_Fetch_Call) RunAndReturn(run func(ctx context.Context, forge1 forge.Forge, user *model.User, repo *model.Repo, pipeline *model.Pipeline, oldConfigData []*types.FileMeta, restart bool) ([]*types.FileMeta, error)) *MockService_Fetch_Call {
	_c.Call.Return(run)
	return _c
}
