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

import (
	"context"
	"sync"

	"code.cloudfoundry.org/korifi/api/repositories/k8sklient"
)

type NamespaceRetriever struct {
	NamespaceForStub        func(context.Context, string, string) (string, error)
	namespaceForMutex       sync.RWMutex
	namespaceForArgsForCall []struct {
		arg1 context.Context
		arg2 string
		arg3 string
	}
	namespaceForReturns struct {
		result1 string
		result2 error
	}
	namespaceForReturnsOnCall map[int]struct {
		result1 string
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *NamespaceRetriever) NamespaceFor(arg1 context.Context, arg2 string, arg3 string) (string, error) {
	fake.namespaceForMutex.Lock()
	ret, specificReturn := fake.namespaceForReturnsOnCall[len(fake.namespaceForArgsForCall)]
	fake.namespaceForArgsForCall = append(fake.namespaceForArgsForCall, struct {
		arg1 context.Context
		arg2 string
		arg3 string
	}{arg1, arg2, arg3})
	stub := fake.NamespaceForStub
	fakeReturns := fake.namespaceForReturns
	fake.recordInvocation("NamespaceFor", []interface{}{arg1, arg2, arg3})
	fake.namespaceForMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *NamespaceRetriever) NamespaceForCallCount() int {
	fake.namespaceForMutex.RLock()
	defer fake.namespaceForMutex.RUnlock()
	return len(fake.namespaceForArgsForCall)
}

func (fake *NamespaceRetriever) NamespaceForCalls(stub func(context.Context, string, string) (string, error)) {
	fake.namespaceForMutex.Lock()
	defer fake.namespaceForMutex.Unlock()
	fake.NamespaceForStub = stub
}

func (fake *NamespaceRetriever) NamespaceForArgsForCall(i int) (context.Context, string, string) {
	fake.namespaceForMutex.RLock()
	defer fake.namespaceForMutex.RUnlock()
	argsForCall := fake.namespaceForArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *NamespaceRetriever) NamespaceForReturns(result1 string, result2 error) {
	fake.namespaceForMutex.Lock()
	defer fake.namespaceForMutex.Unlock()
	fake.NamespaceForStub = nil
	fake.namespaceForReturns = struct {
		result1 string
		result2 error
	}{result1, result2}
}

func (fake *NamespaceRetriever) NamespaceForReturnsOnCall(i int, result1 string, result2 error) {
	fake.namespaceForMutex.Lock()
	defer fake.namespaceForMutex.Unlock()
	fake.NamespaceForStub = nil
	if fake.namespaceForReturnsOnCall == nil {
		fake.namespaceForReturnsOnCall = make(map[int]struct {
			result1 string
			result2 error
		})
	}
	fake.namespaceForReturnsOnCall[i] = struct {
		result1 string
		result2 error
	}{result1, result2}
}

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

func (fake *NamespaceRetriever) 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 _ k8sklient.NamespaceRetriever = new(NamespaceRetriever)
