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

package authz

import (
	"context"

	"forgejo.org/models/perm"
	"forgejo.org/models/repo"

	mock "github.com/stretchr/testify/mock"
	"xorm.io/builder"
)

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

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

	return mock
}

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

type MockAuthorizationReducer_Expecter struct {
	mock *mock.Mock
}

func (_m *MockAuthorizationReducer) EXPECT() *MockAuthorizationReducer_Expecter {
	return &MockAuthorizationReducer_Expecter{mock: &_m.Mock}
}

// AllowAdminOverride provides a mock function for the type MockAuthorizationReducer
func (_mock *MockAuthorizationReducer) AllowAdminOverride() bool {
	ret := _mock.Called()

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

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

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

// AllowAdminOverride is a helper method to define mock.On call
func (_e *MockAuthorizationReducer_Expecter) AllowAdminOverride() *MockAuthorizationReducer_AllowAdminOverride_Call {
	return &MockAuthorizationReducer_AllowAdminOverride_Call{Call: _e.mock.On("AllowAdminOverride")}
}

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

func (_c *MockAuthorizationReducer_AllowAdminOverride_Call) Return(b bool) *MockAuthorizationReducer_AllowAdminOverride_Call {
	_c.Call.Return(b)
	return _c
}

func (_c *MockAuthorizationReducer_AllowAdminOverride_Call) RunAndReturn(run func() bool) *MockAuthorizationReducer_AllowAdminOverride_Call {
	_c.Call.Return(run)
	return _c
}

// ReduceRepoAccess provides a mock function for the type MockAuthorizationReducer
func (_mock *MockAuthorizationReducer) ReduceRepoAccess(ctx context.Context, repo1 *repo.Repository, accessMode perm.AccessMode) (perm.AccessMode, error) {
	ret := _mock.Called(ctx, repo1, accessMode)

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

	var r0 perm.AccessMode
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, *repo.Repository, perm.AccessMode) (perm.AccessMode, error)); ok {
		return returnFunc(ctx, repo1, accessMode)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, *repo.Repository, perm.AccessMode) perm.AccessMode); ok {
		r0 = returnFunc(ctx, repo1, accessMode)
	} else {
		r0 = ret.Get(0).(perm.AccessMode)
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, *repo.Repository, perm.AccessMode) error); ok {
		r1 = returnFunc(ctx, repo1, accessMode)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

// ReduceRepoAccess is a helper method to define mock.On call
//   - ctx context.Context
//   - repo1 *repo.Repository
//   - accessMode perm.AccessMode
func (_e *MockAuthorizationReducer_Expecter) ReduceRepoAccess(ctx, repo1, accessMode any) *MockAuthorizationReducer_ReduceRepoAccess_Call {
	return &MockAuthorizationReducer_ReduceRepoAccess_Call{Call: _e.mock.On("ReduceRepoAccess", ctx, repo1, accessMode)}
}

func (_c *MockAuthorizationReducer_ReduceRepoAccess_Call) Run(run func(ctx context.Context, repo1 *repo.Repository, accessMode perm.AccessMode)) *MockAuthorizationReducer_ReduceRepoAccess_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 *repo.Repository
		if args[1] != nil {
			arg1 = args[1].(*repo.Repository)
		}
		var arg2 perm.AccessMode
		if args[2] != nil {
			arg2 = args[2].(perm.AccessMode)
		}
		run(
			arg0,
			arg1,
			arg2,
		)
	})
	return _c
}

func (_c *MockAuthorizationReducer_ReduceRepoAccess_Call) Return(accessMode1 perm.AccessMode, err error) *MockAuthorizationReducer_ReduceRepoAccess_Call {
	_c.Call.Return(accessMode1, err)
	return _c
}

func (_c *MockAuthorizationReducer_ReduceRepoAccess_Call) RunAndReturn(run func(ctx context.Context, repo1 *repo.Repository, accessMode perm.AccessMode) (perm.AccessMode, error)) *MockAuthorizationReducer_ReduceRepoAccess_Call {
	_c.Call.Return(run)
	return _c
}

// RepoReadAccessFilter provides a mock function for the type MockAuthorizationReducer
func (_mock *MockAuthorizationReducer) RepoReadAccessFilter() builder.Cond {
	ret := _mock.Called()

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

	var r0 builder.Cond
	if returnFunc, ok := ret.Get(0).(func() builder.Cond); ok {
		r0 = returnFunc()
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(builder.Cond)
		}
	}
	return r0
}

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

// RepoReadAccessFilter is a helper method to define mock.On call
func (_e *MockAuthorizationReducer_Expecter) RepoReadAccessFilter() *MockAuthorizationReducer_RepoReadAccessFilter_Call {
	return &MockAuthorizationReducer_RepoReadAccessFilter_Call{Call: _e.mock.On("RepoReadAccessFilter")}
}

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

func (_c *MockAuthorizationReducer_RepoReadAccessFilter_Call) Return(cond builder.Cond) *MockAuthorizationReducer_RepoReadAccessFilter_Call {
	_c.Call.Return(cond)
	return _c
}

func (_c *MockAuthorizationReducer_RepoReadAccessFilter_Call) RunAndReturn(run func() builder.Cond) *MockAuthorizationReducer_RepoReadAccessFilter_Call {
	_c.Call.Return(run)
	return _c
}
