// 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"
)

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

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

	return mock
}

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

type MockPersister_Expecter struct {
	mock *mock.Mock
}

func (_m *MockPersister) EXPECT() *MockPersister_Expecter {
	return &MockPersister_Expecter{mock: &_m.Mock}
}

// CreateAccessRequest provides a mock function for the type MockPersister
func (_mock *MockPersister) CreateAccessRequest(ctx context.Context, ar *v1alpha1.AccessRequest) (*v1alpha1.AccessRequest, error) {
	ret := _mock.Called(ctx, ar)

	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, *v1alpha1.AccessRequest) (*v1alpha1.AccessRequest, error)); ok {
		return returnFunc(ctx, ar)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, *v1alpha1.AccessRequest) *v1alpha1.AccessRequest); ok {
		r0 = returnFunc(ctx, ar)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*v1alpha1.AccessRequest)
		}
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, *v1alpha1.AccessRequest) error); ok {
		r1 = returnFunc(ctx, ar)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

// CreateAccessRequest is a helper method to define mock.On call
//   - ctx context.Context
//   - ar *v1alpha1.AccessRequest
func (_e *MockPersister_Expecter) CreateAccessRequest(ctx interface{}, ar interface{}) *MockPersister_CreateAccessRequest_Call {
	return &MockPersister_CreateAccessRequest_Call{Call: _e.mock.On("CreateAccessRequest", ctx, ar)}
}

func (_c *MockPersister_CreateAccessRequest_Call) Run(run func(ctx context.Context, ar *v1alpha1.AccessRequest)) *MockPersister_CreateAccessRequest_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 *v1alpha1.AccessRequest
		if args[1] != nil {
			arg1 = args[1].(*v1alpha1.AccessRequest)
		}
		run(
			arg0,
			arg1,
		)
	})
	return _c
}

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

func (_c *MockPersister_CreateAccessRequest_Call) RunAndReturn(run func(ctx context.Context, ar *v1alpha1.AccessRequest) (*v1alpha1.AccessRequest, error)) *MockPersister_CreateAccessRequest_Call {
	_c.Call.Return(run)
	return _c
}

// GetAppProject provides a mock function for the type MockPersister
func (_mock *MockPersister) 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
}

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

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

func (_c *MockPersister_GetAppProject_Call) Run(run func(ctx context.Context, name string, namespace string)) *MockPersister_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 *MockPersister_GetAppProject_Call) Return(unstructured1 *unstructured.Unstructured, err error) *MockPersister_GetAppProject_Call {
	_c.Call.Return(unstructured1, err)
	return _c
}

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

// GetApplication provides a mock function for the type MockPersister
func (_mock *MockPersister) 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
}

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

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

func (_c *MockPersister_GetApplication_Call) Run(run func(ctx context.Context, name string, namespace string)) *MockPersister_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 *MockPersister_GetApplication_Call) Return(unstructured1 *unstructured.Unstructured, err error) *MockPersister_GetApplication_Call {
	_c.Call.Return(unstructured1, err)
	return _c
}

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

// ListAccessBindings provides a mock function for the type MockPersister
func (_mock *MockPersister) ListAccessBindings(ctx context.Context, roleName string, namespace string) (*v1alpha1.AccessBindingList, error) {
	ret := _mock.Called(ctx, roleName, namespace)

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

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

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

// ListAccessBindings is a helper method to define mock.On call
//   - ctx context.Context
//   - roleName string
//   - namespace string
func (_e *MockPersister_Expecter) ListAccessBindings(ctx interface{}, roleName interface{}, namespace interface{}) *MockPersister_ListAccessBindings_Call {
	return &MockPersister_ListAccessBindings_Call{Call: _e.mock.On("ListAccessBindings", ctx, roleName, namespace)}
}

func (_c *MockPersister_ListAccessBindings_Call) Run(run func(ctx context.Context, roleName string, namespace string)) *MockPersister_ListAccessBindings_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 *MockPersister_ListAccessBindings_Call) Return(accessBindingList *v1alpha1.AccessBindingList, err error) *MockPersister_ListAccessBindings_Call {
	_c.Call.Return(accessBindingList, err)
	return _c
}

func (_c *MockPersister_ListAccessBindings_Call) RunAndReturn(run func(ctx context.Context, roleName string, namespace string) (*v1alpha1.AccessBindingList, error)) *MockPersister_ListAccessBindings_Call {
	_c.Call.Return(run)
	return _c
}

// ListAccessRequests provides a mock function for the type MockPersister
func (_mock *MockPersister) ListAccessRequests(ctx context.Context, key *backend.AccessRequestKey) (*v1alpha1.AccessRequestList, error) {
	ret := _mock.Called(ctx, key)

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

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

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

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

func (_c *MockPersister_ListAccessRequests_Call) Run(run func(ctx context.Context, key *backend.AccessRequestKey)) *MockPersister_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)
		}
		run(
			arg0,
			arg1,
		)
	})
	return _c
}

func (_c *MockPersister_ListAccessRequests_Call) Return(accessRequestList *v1alpha1.AccessRequestList, err error) *MockPersister_ListAccessRequests_Call {
	_c.Call.Return(accessRequestList, err)
	return _c
}

func (_c *MockPersister_ListAccessRequests_Call) RunAndReturn(run func(ctx context.Context, key *backend.AccessRequestKey) (*v1alpha1.AccessRequestList, error)) *MockPersister_ListAccessRequests_Call {
	_c.Call.Return(run)
	return _c
}

// ListAllAccessBindings provides a mock function for the type MockPersister
func (_mock *MockPersister) ListAllAccessBindings(ctx context.Context, namespace string) (*v1alpha1.AccessBindingList, error) {
	ret := _mock.Called(ctx, namespace)

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

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

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

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

func (_c *MockPersister_ListAllAccessBindings_Call) Run(run func(ctx context.Context, namespace string)) *MockPersister_ListAllAccessBindings_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)
		}
		run(
			arg0,
			arg1,
		)
	})
	return _c
}

func (_c *MockPersister_ListAllAccessBindings_Call) Return(accessBindingList *v1alpha1.AccessBindingList, err error) *MockPersister_ListAllAccessBindings_Call {
	_c.Call.Return(accessBindingList, err)
	return _c
}

func (_c *MockPersister_ListAllAccessBindings_Call) RunAndReturn(run func(ctx context.Context, namespace string) (*v1alpha1.AccessBindingList, error)) *MockPersister_ListAllAccessBindings_Call {
	_c.Call.Return(run)
	return _c
}
