// Code generated by counterfeiter. DO NOT EDIT.
package listers

import (
	"sync"

	v1a "k8s.io/api/rbac/v1"
	"k8s.io/apimachinery/pkg/labels"
	v1 "k8s.io/client-go/listers/rbac/v1"
)

type FakeRoleLister struct {
	ListStub        func(labels.Selector) ([]*v1a.Role, error)
	listMutex       sync.RWMutex
	listArgsForCall []struct {
		arg1 labels.Selector
	}
	listReturns struct {
		result1 []*v1a.Role
		result2 error
	}
	listReturnsOnCall map[int]struct {
		result1 []*v1a.Role
		result2 error
	}
	RolesStub        func(string) v1.RoleNamespaceLister
	rolesMutex       sync.RWMutex
	rolesArgsForCall []struct {
		arg1 string
	}
	rolesReturns struct {
		result1 v1.RoleNamespaceLister
	}
	rolesReturnsOnCall map[int]struct {
		result1 v1.RoleNamespaceLister
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeRoleLister) List(arg1 labels.Selector) ([]*v1a.Role, error) {
	fake.listMutex.Lock()
	ret, specificReturn := fake.listReturnsOnCall[len(fake.listArgsForCall)]
	fake.listArgsForCall = append(fake.listArgsForCall, struct {
		arg1 labels.Selector
	}{arg1})
	fake.recordInvocation("List", []interface{}{arg1})
	fake.listMutex.Unlock()
	if fake.ListStub != nil {
		return fake.ListStub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	fakeReturns := fake.listReturns
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeRoleLister) ListCallCount() int {
	fake.listMutex.RLock()
	defer fake.listMutex.RUnlock()
	return len(fake.listArgsForCall)
}

func (fake *FakeRoleLister) ListCalls(stub func(labels.Selector) ([]*v1a.Role, error)) {
	fake.listMutex.Lock()
	defer fake.listMutex.Unlock()
	fake.ListStub = stub
}

func (fake *FakeRoleLister) ListArgsForCall(i int) labels.Selector {
	fake.listMutex.RLock()
	defer fake.listMutex.RUnlock()
	argsForCall := fake.listArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeRoleLister) ListReturns(result1 []*v1a.Role, result2 error) {
	fake.listMutex.Lock()
	defer fake.listMutex.Unlock()
	fake.ListStub = nil
	fake.listReturns = struct {
		result1 []*v1a.Role
		result2 error
	}{result1, result2}
}

func (fake *FakeRoleLister) ListReturnsOnCall(i int, result1 []*v1a.Role, result2 error) {
	fake.listMutex.Lock()
	defer fake.listMutex.Unlock()
	fake.ListStub = nil
	if fake.listReturnsOnCall == nil {
		fake.listReturnsOnCall = make(map[int]struct {
			result1 []*v1a.Role
			result2 error
		})
	}
	fake.listReturnsOnCall[i] = struct {
		result1 []*v1a.Role
		result2 error
	}{result1, result2}
}

func (fake *FakeRoleLister) Roles(arg1 string) v1.RoleNamespaceLister {
	fake.rolesMutex.Lock()
	ret, specificReturn := fake.rolesReturnsOnCall[len(fake.rolesArgsForCall)]
	fake.rolesArgsForCall = append(fake.rolesArgsForCall, struct {
		arg1 string
	}{arg1})
	fake.recordInvocation("Roles", []interface{}{arg1})
	fake.rolesMutex.Unlock()
	if fake.RolesStub != nil {
		return fake.RolesStub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	fakeReturns := fake.rolesReturns
	return fakeReturns.result1
}

func (fake *FakeRoleLister) RolesCallCount() int {
	fake.rolesMutex.RLock()
	defer fake.rolesMutex.RUnlock()
	return len(fake.rolesArgsForCall)
}

func (fake *FakeRoleLister) RolesCalls(stub func(string) v1.RoleNamespaceLister) {
	fake.rolesMutex.Lock()
	defer fake.rolesMutex.Unlock()
	fake.RolesStub = stub
}

func (fake *FakeRoleLister) RolesArgsForCall(i int) string {
	fake.rolesMutex.RLock()
	defer fake.rolesMutex.RUnlock()
	argsForCall := fake.rolesArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeRoleLister) RolesReturns(result1 v1.RoleNamespaceLister) {
	fake.rolesMutex.Lock()
	defer fake.rolesMutex.Unlock()
	fake.RolesStub = nil
	fake.rolesReturns = struct {
		result1 v1.RoleNamespaceLister
	}{result1}
}

func (fake *FakeRoleLister) RolesReturnsOnCall(i int, result1 v1.RoleNamespaceLister) {
	fake.rolesMutex.Lock()
	defer fake.rolesMutex.Unlock()
	fake.RolesStub = nil
	if fake.rolesReturnsOnCall == nil {
		fake.rolesReturnsOnCall = make(map[int]struct {
			result1 v1.RoleNamespaceLister
		})
	}
	fake.rolesReturnsOnCall[i] = struct {
		result1 v1.RoleNamespaceLister
	}{result1}
}

func (fake *FakeRoleLister) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	fake.listMutex.RLock()
	defer fake.listMutex.RUnlock()
	fake.rolesMutex.RLock()
	defer fake.rolesMutex.RUnlock()
	copiedInvocations := map[string][][]interface{}{}
	for key, value := range fake.invocations {
		copiedInvocations[key] = value
	}
	return copiedInvocations
}

func (fake *FakeRoleLister) recordInvocation(key string, args []interface{}) {
	fake.invocationsMutex.Lock()
	defer fake.invocationsMutex.Unlock()
	if fake.invocations == nil {
		fake.invocations = map[string][][]interface{}{}
	}
	if fake.invocations[key] == nil {
		fake.invocations[key] = [][]interface{}{}
	}
	fake.invocations[key] = append(fake.invocations[key], args)
}

var _ v1.RoleLister = new(FakeRoleLister)
