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

package mocks

import (
	"context"

	"github.com/qsfera/server/protogen/gen/qsfera/services/search/v0"
	"github.com/qsfera/server/services/search/pkg/search"
	mock "github.com/stretchr/testify/mock"
)

// NewEngine creates a new instance of Engine. 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 NewEngine(t interface {
	mock.TestingT
	Cleanup(func())
}) *Engine {
	mock := &Engine{}
	mock.Mock.Test(t)

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

	return mock
}

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

type Engine_Expecter struct {
	mock *mock.Mock
}

func (_m *Engine) EXPECT() *Engine_Expecter {
	return &Engine_Expecter{mock: &_m.Mock}
}

// Delete provides a mock function for the type Engine
func (_mock *Engine) Delete(id string) error {
	ret := _mock.Called(id)

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

	var r0 error
	if returnFunc, ok := ret.Get(0).(func(string) error); ok {
		r0 = returnFunc(id)
	} else {
		r0 = ret.Error(0)
	}
	return r0
}

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

// Delete is a helper method to define mock.On call
//   - id string
func (_e *Engine_Expecter) Delete(id interface{}) *Engine_Delete_Call {
	return &Engine_Delete_Call{Call: _e.mock.On("Delete", id)}
}

func (_c *Engine_Delete_Call) Run(run func(id string)) *Engine_Delete_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 string
		if args[0] != nil {
			arg0 = args[0].(string)
		}
		run(
			arg0,
		)
	})
	return _c
}

func (_c *Engine_Delete_Call) Return(err error) *Engine_Delete_Call {
	_c.Call.Return(err)
	return _c
}

func (_c *Engine_Delete_Call) RunAndReturn(run func(id string) error) *Engine_Delete_Call {
	_c.Call.Return(run)
	return _c
}

// DocCount provides a mock function for the type Engine
func (_mock *Engine) DocCount() (uint64, error) {
	ret := _mock.Called()

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

	var r0 uint64
	var r1 error
	if returnFunc, ok := ret.Get(0).(func() (uint64, error)); ok {
		return returnFunc()
	}
	if returnFunc, ok := ret.Get(0).(func() uint64); ok {
		r0 = returnFunc()
	} else {
		r0 = ret.Get(0).(uint64)
	}
	if returnFunc, ok := ret.Get(1).(func() error); ok {
		r1 = returnFunc()
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

// DocCount is a helper method to define mock.On call
func (_e *Engine_Expecter) DocCount() *Engine_DocCount_Call {
	return &Engine_DocCount_Call{Call: _e.mock.On("DocCount")}
}

func (_c *Engine_DocCount_Call) Run(run func()) *Engine_DocCount_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run()
	})
	return _c
}

func (_c *Engine_DocCount_Call) Return(v uint64, err error) *Engine_DocCount_Call {
	_c.Call.Return(v, err)
	return _c
}

func (_c *Engine_DocCount_Call) RunAndReturn(run func() (uint64, error)) *Engine_DocCount_Call {
	_c.Call.Return(run)
	return _c
}

// Move provides a mock function for the type Engine
func (_mock *Engine) Move(id string, parentid string, target string) error {
	ret := _mock.Called(id, parentid, target)

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

	var r0 error
	if returnFunc, ok := ret.Get(0).(func(string, string, string) error); ok {
		r0 = returnFunc(id, parentid, target)
	} else {
		r0 = ret.Error(0)
	}
	return r0
}

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

// Move is a helper method to define mock.On call
//   - id string
//   - parentid string
//   - target string
func (_e *Engine_Expecter) Move(id interface{}, parentid interface{}, target interface{}) *Engine_Move_Call {
	return &Engine_Move_Call{Call: _e.mock.On("Move", id, parentid, target)}
}

func (_c *Engine_Move_Call) Run(run func(id string, parentid string, target string)) *Engine_Move_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 string
		if args[0] != nil {
			arg0 = args[0].(string)
		}
		var arg1 string
		if args[1] != nil {
			arg1 = args[1].(string)
		}
		var arg2 string
		if args[2] != nil {
			arg2 = args[2].(string)
		}
		run(
			arg0,
			arg1,
			arg2,
		)
	})
	return _c
}

func (_c *Engine_Move_Call) Return(err error) *Engine_Move_Call {
	_c.Call.Return(err)
	return _c
}

func (_c *Engine_Move_Call) RunAndReturn(run func(id string, parentid string, target string) error) *Engine_Move_Call {
	_c.Call.Return(run)
	return _c
}

// NewBatch provides a mock function for the type Engine
func (_mock *Engine) NewBatch(batchSize int) (search.BatchOperator, error) {
	ret := _mock.Called(batchSize)

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

	var r0 search.BatchOperator
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(int) (search.BatchOperator, error)); ok {
		return returnFunc(batchSize)
	}
	if returnFunc, ok := ret.Get(0).(func(int) search.BatchOperator); ok {
		r0 = returnFunc(batchSize)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(search.BatchOperator)
		}
	}
	if returnFunc, ok := ret.Get(1).(func(int) error); ok {
		r1 = returnFunc(batchSize)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

// NewBatch is a helper method to define mock.On call
//   - batchSize int
func (_e *Engine_Expecter) NewBatch(batchSize interface{}) *Engine_NewBatch_Call {
	return &Engine_NewBatch_Call{Call: _e.mock.On("NewBatch", batchSize)}
}

func (_c *Engine_NewBatch_Call) Run(run func(batchSize int)) *Engine_NewBatch_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 int
		if args[0] != nil {
			arg0 = args[0].(int)
		}
		run(
			arg0,
		)
	})
	return _c
}

func (_c *Engine_NewBatch_Call) Return(batchOperator search.BatchOperator, err error) *Engine_NewBatch_Call {
	_c.Call.Return(batchOperator, err)
	return _c
}

func (_c *Engine_NewBatch_Call) RunAndReturn(run func(batchSize int) (search.BatchOperator, error)) *Engine_NewBatch_Call {
	_c.Call.Return(run)
	return _c
}

// Purge provides a mock function for the type Engine
func (_mock *Engine) Purge(id string, onlyDeleted bool) error {
	ret := _mock.Called(id, onlyDeleted)

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

	var r0 error
	if returnFunc, ok := ret.Get(0).(func(string, bool) error); ok {
		r0 = returnFunc(id, onlyDeleted)
	} else {
		r0 = ret.Error(0)
	}
	return r0
}

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

// Purge is a helper method to define mock.On call
//   - id string
//   - onlyDeleted bool
func (_e *Engine_Expecter) Purge(id interface{}, onlyDeleted interface{}) *Engine_Purge_Call {
	return &Engine_Purge_Call{Call: _e.mock.On("Purge", id, onlyDeleted)}
}

func (_c *Engine_Purge_Call) Run(run func(id string, onlyDeleted bool)) *Engine_Purge_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 string
		if args[0] != nil {
			arg0 = args[0].(string)
		}
		var arg1 bool
		if args[1] != nil {
			arg1 = args[1].(bool)
		}
		run(
			arg0,
			arg1,
		)
	})
	return _c
}

func (_c *Engine_Purge_Call) Return(err error) *Engine_Purge_Call {
	_c.Call.Return(err)
	return _c
}

func (_c *Engine_Purge_Call) RunAndReturn(run func(id string, onlyDeleted bool) error) *Engine_Purge_Call {
	_c.Call.Return(run)
	return _c
}

// Restore provides a mock function for the type Engine
func (_mock *Engine) Restore(id string) error {
	ret := _mock.Called(id)

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

	var r0 error
	if returnFunc, ok := ret.Get(0).(func(string) error); ok {
		r0 = returnFunc(id)
	} else {
		r0 = ret.Error(0)
	}
	return r0
}

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

// Restore is a helper method to define mock.On call
//   - id string
func (_e *Engine_Expecter) Restore(id interface{}) *Engine_Restore_Call {
	return &Engine_Restore_Call{Call: _e.mock.On("Restore", id)}
}

func (_c *Engine_Restore_Call) Run(run func(id string)) *Engine_Restore_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 string
		if args[0] != nil {
			arg0 = args[0].(string)
		}
		run(
			arg0,
		)
	})
	return _c
}

func (_c *Engine_Restore_Call) Return(err error) *Engine_Restore_Call {
	_c.Call.Return(err)
	return _c
}

func (_c *Engine_Restore_Call) RunAndReturn(run func(id string) error) *Engine_Restore_Call {
	_c.Call.Return(run)
	return _c
}

// Search provides a mock function for the type Engine
func (_mock *Engine) Search(ctx context.Context, req *v0.SearchIndexRequest) (*v0.SearchIndexResponse, error) {
	ret := _mock.Called(ctx, req)

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

	var r0 *v0.SearchIndexResponse
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.SearchIndexRequest) (*v0.SearchIndexResponse, error)); ok {
		return returnFunc(ctx, req)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.SearchIndexRequest) *v0.SearchIndexResponse); ok {
		r0 = returnFunc(ctx, req)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*v0.SearchIndexResponse)
		}
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.SearchIndexRequest) error); ok {
		r1 = returnFunc(ctx, req)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

// Search is a helper method to define mock.On call
//   - ctx context.Context
//   - req *v0.SearchIndexRequest
func (_e *Engine_Expecter) Search(ctx interface{}, req interface{}) *Engine_Search_Call {
	return &Engine_Search_Call{Call: _e.mock.On("Search", ctx, req)}
}

func (_c *Engine_Search_Call) Run(run func(ctx context.Context, req *v0.SearchIndexRequest)) *Engine_Search_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 *v0.SearchIndexRequest
		if args[1] != nil {
			arg1 = args[1].(*v0.SearchIndexRequest)
		}
		run(
			arg0,
			arg1,
		)
	})
	return _c
}

func (_c *Engine_Search_Call) Return(searchIndexResponse *v0.SearchIndexResponse, err error) *Engine_Search_Call {
	_c.Call.Return(searchIndexResponse, err)
	return _c
}

func (_c *Engine_Search_Call) RunAndReturn(run func(ctx context.Context, req *v0.SearchIndexRequest) (*v0.SearchIndexResponse, error)) *Engine_Search_Call {
	_c.Call.Return(run)
	return _c
}

// Upsert provides a mock function for the type Engine
func (_mock *Engine) Upsert(id string, r search.Resource) error {
	ret := _mock.Called(id, r)

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

	var r0 error
	if returnFunc, ok := ret.Get(0).(func(string, search.Resource) error); ok {
		r0 = returnFunc(id, r)
	} else {
		r0 = ret.Error(0)
	}
	return r0
}

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

// Upsert is a helper method to define mock.On call
//   - id string
//   - r search.Resource
func (_e *Engine_Expecter) Upsert(id interface{}, r interface{}) *Engine_Upsert_Call {
	return &Engine_Upsert_Call{Call: _e.mock.On("Upsert", id, r)}
}

func (_c *Engine_Upsert_Call) Run(run func(id string, r search.Resource)) *Engine_Upsert_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 string
		if args[0] != nil {
			arg0 = args[0].(string)
		}
		var arg1 search.Resource
		if args[1] != nil {
			arg1 = args[1].(search.Resource)
		}
		run(
			arg0,
			arg1,
		)
	})
	return _c
}

func (_c *Engine_Upsert_Call) Return(err error) *Engine_Upsert_Call {
	_c.Call.Return(err)
	return _c
}

func (_c *Engine_Upsert_Call) RunAndReturn(run func(id string, r search.Resource) error) *Engine_Upsert_Call {
	_c.Call.Return(run)
	return _c
}
