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

import (
	"sync"

	"github.com/maximilien/kn-source-pkg/pkg/types"
	"k8s.io/client-go/rest"
)

type FakeKnSourceFactory struct {
	CreateKnSourceClientStub        func(*rest.Config, string) types.KnSourceClient
	createKnSourceClientMutex       sync.RWMutex
	createKnSourceClientArgsForCall []struct {
		arg1 *rest.Config
		arg2 string
	}
	createKnSourceClientReturns struct {
		result1 types.KnSourceClient
	}
	createKnSourceClientReturnsOnCall map[int]struct {
		result1 types.KnSourceClient
	}
	CreateKnSourceParamsStub        func() *types.KnSourceParams
	createKnSourceParamsMutex       sync.RWMutex
	createKnSourceParamsArgsForCall []struct {
	}
	createKnSourceParamsReturns struct {
		result1 *types.KnSourceParams
	}
	createKnSourceParamsReturnsOnCall map[int]struct {
		result1 *types.KnSourceParams
	}
	KnSourceParamsStub        func() *types.KnSourceParams
	knSourceParamsMutex       sync.RWMutex
	knSourceParamsArgsForCall []struct {
	}
	knSourceParamsReturns struct {
		result1 *types.KnSourceParams
	}
	knSourceParamsReturnsOnCall map[int]struct {
		result1 *types.KnSourceParams
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeKnSourceFactory) CreateKnSourceClient(arg1 *rest.Config, arg2 string) types.KnSourceClient {
	fake.createKnSourceClientMutex.Lock()
	ret, specificReturn := fake.createKnSourceClientReturnsOnCall[len(fake.createKnSourceClientArgsForCall)]
	fake.createKnSourceClientArgsForCall = append(fake.createKnSourceClientArgsForCall, struct {
		arg1 *rest.Config
		arg2 string
	}{arg1, arg2})
	stub := fake.CreateKnSourceClientStub
	fakeReturns := fake.createKnSourceClientReturns
	fake.recordInvocation("CreateKnSourceClient", []interface{}{arg1, arg2})
	fake.createKnSourceClientMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeKnSourceFactory) CreateKnSourceClientCallCount() int {
	fake.createKnSourceClientMutex.RLock()
	defer fake.createKnSourceClientMutex.RUnlock()
	return len(fake.createKnSourceClientArgsForCall)
}

func (fake *FakeKnSourceFactory) CreateKnSourceClientCalls(stub func(*rest.Config, string) types.KnSourceClient) {
	fake.createKnSourceClientMutex.Lock()
	defer fake.createKnSourceClientMutex.Unlock()
	fake.CreateKnSourceClientStub = stub
}

func (fake *FakeKnSourceFactory) CreateKnSourceClientArgsForCall(i int) (*rest.Config, string) {
	fake.createKnSourceClientMutex.RLock()
	defer fake.createKnSourceClientMutex.RUnlock()
	argsForCall := fake.createKnSourceClientArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeKnSourceFactory) CreateKnSourceClientReturns(result1 types.KnSourceClient) {
	fake.createKnSourceClientMutex.Lock()
	defer fake.createKnSourceClientMutex.Unlock()
	fake.CreateKnSourceClientStub = nil
	fake.createKnSourceClientReturns = struct {
		result1 types.KnSourceClient
	}{result1}
}

func (fake *FakeKnSourceFactory) CreateKnSourceClientReturnsOnCall(i int, result1 types.KnSourceClient) {
	fake.createKnSourceClientMutex.Lock()
	defer fake.createKnSourceClientMutex.Unlock()
	fake.CreateKnSourceClientStub = nil
	if fake.createKnSourceClientReturnsOnCall == nil {
		fake.createKnSourceClientReturnsOnCall = make(map[int]struct {
			result1 types.KnSourceClient
		})
	}
	fake.createKnSourceClientReturnsOnCall[i] = struct {
		result1 types.KnSourceClient
	}{result1}
}

func (fake *FakeKnSourceFactory) CreateKnSourceParams() *types.KnSourceParams {
	fake.createKnSourceParamsMutex.Lock()
	ret, specificReturn := fake.createKnSourceParamsReturnsOnCall[len(fake.createKnSourceParamsArgsForCall)]
	fake.createKnSourceParamsArgsForCall = append(fake.createKnSourceParamsArgsForCall, struct {
	}{})
	stub := fake.CreateKnSourceParamsStub
	fakeReturns := fake.createKnSourceParamsReturns
	fake.recordInvocation("CreateKnSourceParams", []interface{}{})
	fake.createKnSourceParamsMutex.Unlock()
	if stub != nil {
		return stub()
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeKnSourceFactory) CreateKnSourceParamsCallCount() int {
	fake.createKnSourceParamsMutex.RLock()
	defer fake.createKnSourceParamsMutex.RUnlock()
	return len(fake.createKnSourceParamsArgsForCall)
}

func (fake *FakeKnSourceFactory) CreateKnSourceParamsCalls(stub func() *types.KnSourceParams) {
	fake.createKnSourceParamsMutex.Lock()
	defer fake.createKnSourceParamsMutex.Unlock()
	fake.CreateKnSourceParamsStub = stub
}

func (fake *FakeKnSourceFactory) CreateKnSourceParamsReturns(result1 *types.KnSourceParams) {
	fake.createKnSourceParamsMutex.Lock()
	defer fake.createKnSourceParamsMutex.Unlock()
	fake.CreateKnSourceParamsStub = nil
	fake.createKnSourceParamsReturns = struct {
		result1 *types.KnSourceParams
	}{result1}
}

func (fake *FakeKnSourceFactory) CreateKnSourceParamsReturnsOnCall(i int, result1 *types.KnSourceParams) {
	fake.createKnSourceParamsMutex.Lock()
	defer fake.createKnSourceParamsMutex.Unlock()
	fake.CreateKnSourceParamsStub = nil
	if fake.createKnSourceParamsReturnsOnCall == nil {
		fake.createKnSourceParamsReturnsOnCall = make(map[int]struct {
			result1 *types.KnSourceParams
		})
	}
	fake.createKnSourceParamsReturnsOnCall[i] = struct {
		result1 *types.KnSourceParams
	}{result1}
}

func (fake *FakeKnSourceFactory) KnSourceParams() *types.KnSourceParams {
	fake.knSourceParamsMutex.Lock()
	ret, specificReturn := fake.knSourceParamsReturnsOnCall[len(fake.knSourceParamsArgsForCall)]
	fake.knSourceParamsArgsForCall = append(fake.knSourceParamsArgsForCall, struct {
	}{})
	stub := fake.KnSourceParamsStub
	fakeReturns := fake.knSourceParamsReturns
	fake.recordInvocation("KnSourceParams", []interface{}{})
	fake.knSourceParamsMutex.Unlock()
	if stub != nil {
		return stub()
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeKnSourceFactory) KnSourceParamsCallCount() int {
	fake.knSourceParamsMutex.RLock()
	defer fake.knSourceParamsMutex.RUnlock()
	return len(fake.knSourceParamsArgsForCall)
}

func (fake *FakeKnSourceFactory) KnSourceParamsCalls(stub func() *types.KnSourceParams) {
	fake.knSourceParamsMutex.Lock()
	defer fake.knSourceParamsMutex.Unlock()
	fake.KnSourceParamsStub = stub
}

func (fake *FakeKnSourceFactory) KnSourceParamsReturns(result1 *types.KnSourceParams) {
	fake.knSourceParamsMutex.Lock()
	defer fake.knSourceParamsMutex.Unlock()
	fake.KnSourceParamsStub = nil
	fake.knSourceParamsReturns = struct {
		result1 *types.KnSourceParams
	}{result1}
}

func (fake *FakeKnSourceFactory) KnSourceParamsReturnsOnCall(i int, result1 *types.KnSourceParams) {
	fake.knSourceParamsMutex.Lock()
	defer fake.knSourceParamsMutex.Unlock()
	fake.KnSourceParamsStub = nil
	if fake.knSourceParamsReturnsOnCall == nil {
		fake.knSourceParamsReturnsOnCall = make(map[int]struct {
			result1 *types.KnSourceParams
		})
	}
	fake.knSourceParamsReturnsOnCall[i] = struct {
		result1 *types.KnSourceParams
	}{result1}
}

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

func (fake *FakeKnSourceFactory) 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 _ types.KnSourceFactory = new(FakeKnSourceFactory)
