// 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 FakeClusterServiceVersionLister struct {
	ClusterServiceVersionsStub        func(string) v1alpha1.ClusterServiceVersionNamespaceLister
	clusterServiceVersionsMutex       sync.RWMutex
	clusterServiceVersionsArgsForCall []struct {
		arg1 string
	}
	clusterServiceVersionsReturns struct {
		result1 v1alpha1.ClusterServiceVersionNamespaceLister
	}
	clusterServiceVersionsReturnsOnCall map[int]struct {
		result1 v1alpha1.ClusterServiceVersionNamespaceLister
	}
	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 *FakeClusterServiceVersionLister) ClusterServiceVersions(arg1 string) v1alpha1.ClusterServiceVersionNamespaceLister {
	fake.clusterServiceVersionsMutex.Lock()
	ret, specificReturn := fake.clusterServiceVersionsReturnsOnCall[len(fake.clusterServiceVersionsArgsForCall)]
	fake.clusterServiceVersionsArgsForCall = append(fake.clusterServiceVersionsArgsForCall, struct {
		arg1 string
	}{arg1})
	fake.recordInvocation("ClusterServiceVersions", []interface{}{arg1})
	fake.clusterServiceVersionsMutex.Unlock()
	if fake.ClusterServiceVersionsStub != nil {
		return fake.ClusterServiceVersionsStub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	fakeReturns := fake.clusterServiceVersionsReturns
	return fakeReturns.result1
}

func (fake *FakeClusterServiceVersionLister) ClusterServiceVersionsCallCount() int {
	fake.clusterServiceVersionsMutex.RLock()
	defer fake.clusterServiceVersionsMutex.RUnlock()
	return len(fake.clusterServiceVersionsArgsForCall)
}

func (fake *FakeClusterServiceVersionLister) ClusterServiceVersionsCalls(stub func(string) v1alpha1.ClusterServiceVersionNamespaceLister) {
	fake.clusterServiceVersionsMutex.Lock()
	defer fake.clusterServiceVersionsMutex.Unlock()
	fake.ClusterServiceVersionsStub = stub
}

func (fake *FakeClusterServiceVersionLister) ClusterServiceVersionsArgsForCall(i int) string {
	fake.clusterServiceVersionsMutex.RLock()
	defer fake.clusterServiceVersionsMutex.RUnlock()
	argsForCall := fake.clusterServiceVersionsArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeClusterServiceVersionLister) ClusterServiceVersionsReturns(result1 v1alpha1.ClusterServiceVersionNamespaceLister) {
	fake.clusterServiceVersionsMutex.Lock()
	defer fake.clusterServiceVersionsMutex.Unlock()
	fake.ClusterServiceVersionsStub = nil
	fake.clusterServiceVersionsReturns = struct {
		result1 v1alpha1.ClusterServiceVersionNamespaceLister
	}{result1}
}

func (fake *FakeClusterServiceVersionLister) ClusterServiceVersionsReturnsOnCall(i int, result1 v1alpha1.ClusterServiceVersionNamespaceLister) {
	fake.clusterServiceVersionsMutex.Lock()
	defer fake.clusterServiceVersionsMutex.Unlock()
	fake.ClusterServiceVersionsStub = nil
	if fake.clusterServiceVersionsReturnsOnCall == nil {
		fake.clusterServiceVersionsReturnsOnCall = make(map[int]struct {
			result1 v1alpha1.ClusterServiceVersionNamespaceLister
		})
	}
	fake.clusterServiceVersionsReturnsOnCall[i] = struct {
		result1 v1alpha1.ClusterServiceVersionNamespaceLister
	}{result1}
}

func (fake *FakeClusterServiceVersionLister) 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 *FakeClusterServiceVersionLister) ListCallCount() int {
	fake.listMutex.RLock()
	defer fake.listMutex.RUnlock()
	return len(fake.listArgsForCall)
}

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

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

func (fake *FakeClusterServiceVersionLister) 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 *FakeClusterServiceVersionLister) 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 *FakeClusterServiceVersionLister) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	fake.clusterServiceVersionsMutex.RLock()
	defer fake.clusterServiceVersionsMutex.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 *FakeClusterServiceVersionLister) 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.ClusterServiceVersionLister = new(FakeClusterServiceVersionLister)
