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

package mocks

import (
	"context"

	"github.com/argoproj-labs/argocd-ephemeral-access/api/ephemeral-access/v1alpha1"
	"github.com/argoproj-labs/argocd-ephemeral-access/internal/backend"
	mock "github.com/stretchr/testify/mock"
	"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
)

// 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}
}

// CreateAccessRequest provides a mock function for the type MockService
func (_mock *MockService) CreateAccessRequest(ctx context.Context, key *backend.AccessRequestKey, binding *v1alpha1.AccessBinding) (*v1alpha1.AccessRequest, error) {
	ret := _mock.Called(ctx, key, binding)

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

	var r0 *v1alpha1.AccessRequest
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, *backend.AccessRequestKey, *v1alpha1.AccessBinding) (*v1alpha1.AccessRequest, error)); ok {
		return returnFunc(ctx, key, binding)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, *backend.AccessRequestKey, *v1alpha1.AccessBinding) *v1alpha1.AccessRequest); ok {
		r0 = returnFunc(ctx, key, binding)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*v1alpha1.AccessRequest)
		}
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, *backend.AccessRequestKey, *v1alpha1.AccessBinding) error); ok {
		r1 = returnFunc(ctx, key, binding)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

// CreateAccessRequest is a helper method to define mock.On call
//   - ctx context.Context
//   - key *backend.AccessRequestKey
//   - binding *v1alpha1.AccessBinding
func (_e *MockService_Expecter) CreateAccessRequest(ctx interface{}, key interface{}, binding interface{}) *MockService_CreateAccessRequest_Call {
	return &MockService_CreateAccessRequest_Call{Call: _e.mock.On("CreateAccessRequest", ctx, key, binding)}
}

func (_c *MockService_CreateAccessRequest_Call) Run(run func(ctx context.Context, key *backend.AccessRequestKey, binding *v1alpha1.AccessBinding)) *MockService_CreateAccessRequest_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 *backend.AccessRequestKey
		if args[1] != nil {
			arg1 = args[1].(*backend.AccessRequestKey)
		}
		var arg2 *v1alpha1.AccessBinding
		if args[2] != nil {
			arg2 = args[2].(*v1alpha1.AccessBinding)
		}
		run(
			arg0,
			arg1,
			arg2,
		)
	})
	return _c
}

func (_c *MockService_CreateAccessRequest_Call) Return(accessRequest *v1alpha1.AccessRequest, err error) *MockService_CreateAccessRequest_Call {
	_c.Call.Return(accessRequest, err)
	return _c
}

func (_c *MockService_CreateAccessRequest_Call) RunAndReturn(run func(ctx context.Context, key *backend.AccessRequestKey, binding *v1alpha1.AccessBinding) (*v1alpha1.AccessRequest, error)) *MockService_CreateAccessRequest_Call {
	_c.Call.Return(run)
	return _c
}

// GetAccessBindingsForGroups provides a mock function for the type MockService
func (_mock *MockService) GetAccessBindingsForGroups(ctx context.Context, namespace string, groups []string, app *unstructured.Unstructured, project *unstructured.Unstructured) ([]*v1alpha1.AccessBinding, error) {
	ret := _mock.Called(ctx, namespace, groups, app, project)

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

	var r0 []*v1alpha1.AccessBinding
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, string, []string, *unstructured.Unstructured, *unstructured.Unstructured) ([]*v1alpha1.AccessBinding, error)); ok {
		return returnFunc(ctx, namespace, groups, app, project)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, string, []string, *unstructured.Unstructured, *unstructured.Unstructured) []*v1alpha1.AccessBinding); ok {
		r0 = returnFunc(ctx, namespace, groups, app, project)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([]*v1alpha1.AccessBinding)
		}
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, string, []string, *unstructured.Unstructured, *unstructured.Unstructured) error); ok {
		r1 = returnFunc(ctx, namespace, groups, app, project)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

// GetAccessBindingsForGroups is a helper method to define mock.On call
//   - ctx context.Context
//   - namespace string
//   - groups []string
//   - app *unstructured.Unstructured
//   - project *unstructured.Unstructured
func (_e *MockService_Expecter) GetAccessBindingsForGroups(ctx interface{}, namespace interface{}, groups interface{}, app interface{}, project interface{}) *MockService_GetAccessBindingsForGroups_Call {
	return &MockService_GetAccessBindingsForGroups_Call{Call: _e.mock.On("GetAccessBindingsForGroups", ctx, namespace, groups, app, project)}
}

func (_c *MockService_GetAccessBindingsForGroups_Call) Run(run func(ctx context.Context, namespace string, groups []string, app *unstructured.Unstructured, project *unstructured.Unstructured)) *MockService_GetAccessBindingsForGroups_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 string
		if args[1] != nil {
			arg1 = args[1].(string)
		}
		var arg2 []string
		if args[2] != nil {
			arg2 = args[2].([]string)
		}
		var arg3 *unstructured.Unstructured
		if args[3] != nil {
			arg3 = args[3].(*unstructured.Unstructured)
		}
		var arg4 *unstructured.Unstructured
		if args[4] != nil {
			arg4 = args[4].(*unstructured.Unstructured)
		}
		run(
			arg0,
			arg1,
			arg2,
			arg3,
			arg4,
		)
	})
	return _c
}

func (_c *MockService_GetAccessBindingsForGroups_Call) Return(accessBindings []*v1alpha1.AccessBinding, err error) *MockService_GetAccessBindingsForGroups_Call {
	_c.Call.Return(accessBindings, err)
	return _c
}

func (_c *MockService_GetAccessBindingsForGroups_Call) RunAndReturn(run func(ctx context.Context, namespace string, groups []string, app *unstructured.Unstructured, project *unstructured.Unstructured) ([]*v1alpha1.AccessBinding, error)) *MockService_GetAccessBindingsForGroups_Call {
	_c.Call.Return(run)
	return _c
}

// GetAccessRequestByRole provides a mock function for the type MockService
func (_mock *MockService) GetAccessRequestByRole(ctx context.Context, key *backend.AccessRequestKey, roleName string) (*v1alpha1.AccessRequest, error) {
	ret := _mock.Called(ctx, key, roleName)

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

	var r0 *v1alpha1.AccessRequest
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, *backend.AccessRequestKey, string) (*v1alpha1.AccessRequest, error)); ok {
		return returnFunc(ctx, key, roleName)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, *backend.AccessRequestKey, string) *v1alpha1.AccessRequest); ok {
		r0 = returnFunc(ctx, key, roleName)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*v1alpha1.AccessRequest)
		}
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, *backend.AccessRequestKey, string) error); ok {
		r1 = returnFunc(ctx, key, roleName)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

// GetAccessRequestByRole is a helper method to define mock.On call
//   - ctx context.Context
//   - key *backend.AccessRequestKey
//   - roleName string
func (_e *MockService_Expecter) GetAccessRequestByRole(ctx interface{}, key interface{}, roleName interface{}) *MockService_GetAccessRequestByRole_Call {
	return &MockService_GetAccessRequestByRole_Call{Call: _e.mock.On("GetAccessRequestByRole", ctx, key, roleName)}
}

func (_c *MockService_GetAccessRequestByRole_Call) Run(run func(ctx context.Context, key *backend.AccessRequestKey, roleName string)) *MockService_GetAccessRequestByRole_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 *backend.AccessRequestKey
		if args[1] != nil {
			arg1 = args[1].(*backend.AccessRequestKey)
		}
		var arg2 string
		if args[2] != nil {
			arg2 = args[2].(string)
		}
		run(
			arg0,
			arg1,
			arg2,
		)
	})
	return _c
}

func (_c *MockService_GetAccessRequestByRole_Call) Return(accessRequest *v1alpha1.AccessRequest, err error) *MockService_GetAccessRequestByRole_Call {
	_c.Call.Return(accessRequest, err)
	return _c
}

func (_c *MockService_GetAccessRequestByRole_Call) RunAndReturn(run func(ctx context.Context, key *backend.AccessRequestKey, roleName string) (*v1alpha1.AccessRequest, error)) *MockService_GetAccessRequestByRole_Call {
	_c.Call.Return(run)
	return _c
}

// GetAppProject provides a mock function for the type MockService
func (_mock *MockService) GetAppProject(ctx context.Context, name string, namespace string) (*unstructured.Unstructured, error) {
	ret := _mock.Called(ctx, name, namespace)

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

	var r0 *unstructured.Unstructured
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) (*unstructured.Unstructured, error)); ok {
		return returnFunc(ctx, name, namespace)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) *unstructured.Unstructured); ok {
		r0 = returnFunc(ctx, name, namespace)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*unstructured.Unstructured)
		}
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, string, string) error); ok {
		r1 = returnFunc(ctx, name, namespace)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

// GetAppProject is a helper method to define mock.On call
//   - ctx context.Context
//   - name string
//   - namespace string
func (_e *MockService_Expecter) GetAppProject(ctx interface{}, name interface{}, namespace interface{}) *MockService_GetAppProject_Call {
	return &MockService_GetAppProject_Call{Call: _e.mock.On("GetAppProject", ctx, name, namespace)}
}

func (_c *MockService_GetAppProject_Call) Run(run func(ctx context.Context, name string, namespace string)) *MockService_GetAppProject_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		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 *MockService_GetAppProject_Call) Return(unstructured1 *unstructured.Unstructured, err error) *MockService_GetAppProject_Call {
	_c.Call.Return(unstructured1, err)
	return _c
}

func (_c *MockService_GetAppProject_Call) RunAndReturn(run func(ctx context.Context, name string, namespace string) (*unstructured.Unstructured, error)) *MockService_GetAppProject_Call {
	_c.Call.Return(run)
	return _c
}

// GetApplication provides a mock function for the type MockService
func (_mock *MockService) GetApplication(ctx context.Context, name string, namespace string) (*unstructured.Unstructured, error) {
	ret := _mock.Called(ctx, name, namespace)

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

	var r0 *unstructured.Unstructured
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) (*unstructured.Unstructured, error)); ok {
		return returnFunc(ctx, name, namespace)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) *unstructured.Unstructured); ok {
		r0 = returnFunc(ctx, name, namespace)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*unstructured.Unstructured)
		}
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, string, string) error); ok {
		r1 = returnFunc(ctx, name, namespace)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

// GetApplication is a helper method to define mock.On call
//   - ctx context.Context
//   - name string
//   - namespace string
func (_e *MockService_Expecter) GetApplication(ctx interface{}, name interface{}, namespace interface{}) *MockService_GetApplication_Call {
	return &MockService_GetApplication_Call{Call: _e.mock.On("GetApplication", ctx, name, namespace)}
}

func (_c *MockService_GetApplication_Call) Run(run func(ctx context.Context, name string, namespace string)) *MockService_GetApplication_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		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 *MockService_GetApplication_Call) Return(unstructured1 *unstructured.Unstructured, err error) *MockService_GetApplication_Call {
	_c.Call.Return(unstructured1, err)
	return _c
}

func (_c *MockService_GetApplication_Call) RunAndReturn(run func(ctx context.Context, name string, namespace string) (*unstructured.Unstructured, error)) *MockService_GetApplication_Call {
	_c.Call.Return(run)
	return _c
}

// GetGrantingAccessBinding provides a mock function for the type MockService
func (_mock *MockService) GetGrantingAccessBinding(ctx context.Context, roleName string, namespace string, groups []string, app *unstructured.Unstructured, project *unstructured.Unstructured) (*v1alpha1.AccessBinding, error) {
	ret := _mock.Called(ctx, roleName, namespace, groups, app, project)

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

	var r0 *v1alpha1.AccessBinding
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, []string, *unstructured.Unstructured, *unstructured.Unstructured) (*v1alpha1.AccessBinding, error)); ok {
		return returnFunc(ctx, roleName, namespace, groups, app, project)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, []string, *unstructured.Unstructured, *unstructured.Unstructured) *v1alpha1.AccessBinding); ok {
		r0 = returnFunc(ctx, roleName, namespace, groups, app, project)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*v1alpha1.AccessBinding)
		}
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, string, string, []string, *unstructured.Unstructured, *unstructured.Unstructured) error); ok {
		r1 = returnFunc(ctx, roleName, namespace, groups, app, project)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

// GetGrantingAccessBinding is a helper method to define mock.On call
//   - ctx context.Context
//   - roleName string
//   - namespace string
//   - groups []string
//   - app *unstructured.Unstructured
//   - project *unstructured.Unstructured
func (_e *MockService_Expecter) GetGrantingAccessBinding(ctx interface{}, roleName interface{}, namespace interface{}, groups interface{}, app interface{}, project interface{}) *MockService_GetGrantingAccessBinding_Call {
	return &MockService_GetGrantingAccessBinding_Call{Call: _e.mock.On("GetGrantingAccessBinding", ctx, roleName, namespace, groups, app, project)}
}

func (_c *MockService_GetGrantingAccessBinding_Call) Run(run func(ctx context.Context, roleName string, namespace string, groups []string, app *unstructured.Unstructured, project *unstructured.Unstructured)) *MockService_GetGrantingAccessBinding_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 string
		if args[1] != nil {
			arg1 = args[1].(string)
		}
		var arg2 string
		if args[2] != nil {
			arg2 = args[2].(string)
		}
		var arg3 []string
		if args[3] != nil {
			arg3 = args[3].([]string)
		}
		var arg4 *unstructured.Unstructured
		if args[4] != nil {
			arg4 = args[4].(*unstructured.Unstructured)
		}
		var arg5 *unstructured.Unstructured
		if args[5] != nil {
			arg5 = args[5].(*unstructured.Unstructured)
		}
		run(
			arg0,
			arg1,
			arg2,
			arg3,
			arg4,
			arg5,
		)
	})
	return _c
}

func (_c *MockService_GetGrantingAccessBinding_Call) Return(accessBinding *v1alpha1.AccessBinding, err error) *MockService_GetGrantingAccessBinding_Call {
	_c.Call.Return(accessBinding, err)
	return _c
}

func (_c *MockService_GetGrantingAccessBinding_Call) RunAndReturn(run func(ctx context.Context, roleName string, namespace string, groups []string, app *unstructured.Unstructured, project *unstructured.Unstructured) (*v1alpha1.AccessBinding, error)) *MockService_GetGrantingAccessBinding_Call {
	_c.Call.Return(run)
	return _c
}

// ListAccessRequests provides a mock function for the type MockService
func (_mock *MockService) ListAccessRequests(ctx context.Context, key *backend.AccessRequestKey, sort bool) ([]*v1alpha1.AccessRequest, error) {
	ret := _mock.Called(ctx, key, sort)

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

	var r0 []*v1alpha1.AccessRequest
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, *backend.AccessRequestKey, bool) ([]*v1alpha1.AccessRequest, error)); ok {
		return returnFunc(ctx, key, sort)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, *backend.AccessRequestKey, bool) []*v1alpha1.AccessRequest); ok {
		r0 = returnFunc(ctx, key, sort)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([]*v1alpha1.AccessRequest)
		}
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, *backend.AccessRequestKey, bool) error); ok {
		r1 = returnFunc(ctx, key, sort)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

// ListAccessRequests is a helper method to define mock.On call
//   - ctx context.Context
//   - key *backend.AccessRequestKey
//   - sort bool
func (_e *MockService_Expecter) ListAccessRequests(ctx interface{}, key interface{}, sort interface{}) *MockService_ListAccessRequests_Call {
	return &MockService_ListAccessRequests_Call{Call: _e.mock.On("ListAccessRequests", ctx, key, sort)}
}

func (_c *MockService_ListAccessRequests_Call) Run(run func(ctx context.Context, key *backend.AccessRequestKey, sort bool)) *MockService_ListAccessRequests_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 *backend.AccessRequestKey
		if args[1] != nil {
			arg1 = args[1].(*backend.AccessRequestKey)
		}
		var arg2 bool
		if args[2] != nil {
			arg2 = args[2].(bool)
		}
		run(
			arg0,
			arg1,
			arg2,
		)
	})
	return _c
}

func (_c *MockService_ListAccessRequests_Call) Return(accessRequests []*v1alpha1.AccessRequest, err error) *MockService_ListAccessRequests_Call {
	_c.Call.Return(accessRequests, err)
	return _c
}

func (_c *MockService_ListAccessRequests_Call) RunAndReturn(run func(ctx context.Context, key *backend.AccessRequestKey, sort bool) ([]*v1alpha1.AccessRequest, error)) *MockService_ListAccessRequests_Call {
	_c.Call.Return(run)
	return _c
}
