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

import (
	"sync"

	v1alpha1a "github.com/operator-framework/api/pkg/operators/v1alpha1"
	"github.com/operator-framework/operator-lifecycle-manager/pkg/api/client/listers/operators/v1alpha1"
	"k8s.io/apimachinery/pkg/labels"
)

type FakeClusterServiceVersionNamespaceLister struct {
	GetStub        func(string) (*v1alpha1a.ClusterServiceVersion, error)
	getMutex       sync.RWMutex
	getArgsForCall []struct {
		arg1 string
	}
	getReturns struct {
		result1 *v1alpha1a.ClusterServiceVersion
		result2 error
	}
	getReturnsOnCall map[int]struct {
		result1 *v1alpha1a.ClusterServiceVersion
		result2 error
	}
	ListStub        func(labels.Selector) ([]*v1alpha1a.ClusterServiceVersion, error)
	listMutex       sync.RWMutex
	listArgsForCall []struct {
		arg1 labels.Selector
	}
	listReturns struct {
		result1 []*v1alpha1a.ClusterServiceVersion
		result2 error
	}
	listReturnsOnCall map[int]struct {
		result1 []*v1alpha1a.ClusterServiceVersion
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeClusterServiceVersionNamespaceLister) Get(arg1 string) (*v1alpha1a.ClusterServiceVersion, error) {
	fake.getMutex.Lock()
	ret, specificReturn := fake.getReturnsOnCall[len(fake.getArgsForCall)]
	fake.getArgsForCall = append(fake.getArgsForCall, struct {
		arg1 string
	}{arg1})
	fake.recordInvocation("Get", []interface{}{arg1})
	fake.getMutex.Unlock()
	if fake.GetStub != nil {
		return fake.GetStub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	fakeReturns := fake.getReturns
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeClusterServiceVersionNamespaceLister) GetCallCount() int {
	fake.getMutex.RLock()
	defer fake.getMutex.RUnlock()
	return len(fake.getArgsForCall)
}

func (fake *FakeClusterServiceVersionNamespaceLister) GetCalls(stub func(string) (*v1alpha1a.ClusterServiceVersion, error)) {
	fake.getMutex.Lock()
	defer fake.getMutex.Unlock()
	fake.GetStub = stub
}

func (fake *FakeClusterServiceVersionNamespaceLister) GetArgsForCall(i int) string {
	fake.getMutex.RLock()
	defer fake.getMutex.RUnlock()
	argsForCall := fake.getArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeClusterServiceVersionNamespaceLister) GetReturns(result1 *v1alpha1a.ClusterServiceVersion, result2 error) {
	fake.getMutex.Lock()
	defer fake.getMutex.Unlock()
	fake.GetStub = nil
	fake.getReturns = struct {
		result1 *v1alpha1a.ClusterServiceVersion
		result2 error
	}{result1, result2}
}

func (fake *FakeClusterServiceVersionNamespaceLister) GetReturnsOnCall(i int, result1 *v1alpha1a.ClusterServiceVersion, result2 error) {
	fake.getMutex.Lock()
	defer fake.getMutex.Unlock()
	fake.GetStub = nil
	if fake.getReturnsOnCall == nil {
		fake.getReturnsOnCall = make(map[int]struct {
			result1 *v1alpha1a.ClusterServiceVersion
			result2 error
		})
	}
	fake.getReturnsOnCall[i] = struct {
		result1 *v1alpha1a.ClusterServiceVersion
		result2 error
	}{result1, result2}
}

func (fake *FakeClusterServiceVersionNamespaceLister) List(arg1 labels.Selector) ([]*v1alpha1a.ClusterServiceVersion, 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 *FakeClusterServiceVersionNamespaceLister) ListCallCount() int {
	fake.listMutex.RLock()
	defer fake.listMutex.RUnlock()
	return len(fake.listArgsForCall)
}

func (fake *FakeClusterServiceVersionNamespaceLister) ListCalls(stub func(labels.Selector) ([]*v1alpha1a.ClusterServiceVersion, error)) {
	fake.listMutex.Lock()
	defer fake.listMutex.Unlock()
	fake.ListStub = stub
}

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

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

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

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

func (fake *FakeClusterServiceVersionNamespaceLister) 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 _ v1alpha1.ClusterServiceVersionNamespaceLister = new(FakeClusterServiceVersionNamespaceLister)
