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

import (
	"context"
	"sync"

	"code.cloudfoundry.org/korifi/api/repositories/k8sklient"
	"k8s.io/apimachinery/pkg/runtime/schema"
	"sigs.k8s.io/controller-runtime/pkg/client"
)

type ObjectListMapper struct {
	GUIDsToObjectListStub        func(context.Context, schema.GroupVersionKind, []string) (client.ObjectList, error)
	gUIDsToObjectListMutex       sync.RWMutex
	gUIDsToObjectListArgsForCall []struct {
		arg1 context.Context
		arg2 schema.GroupVersionKind
		arg3 []string
	}
	gUIDsToObjectListReturns struct {
		result1 client.ObjectList
		result2 error
	}
	gUIDsToObjectListReturnsOnCall map[int]struct {
		result1 client.ObjectList
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *ObjectListMapper) GUIDsToObjectList(arg1 context.Context, arg2 schema.GroupVersionKind, arg3 []string) (client.ObjectList, error) {
	var arg3Copy []string
	if arg3 != nil {
		arg3Copy = make([]string, len(arg3))
		copy(arg3Copy, arg3)
	}
	fake.gUIDsToObjectListMutex.Lock()
	ret, specificReturn := fake.gUIDsToObjectListReturnsOnCall[len(fake.gUIDsToObjectListArgsForCall)]
	fake.gUIDsToObjectListArgsForCall = append(fake.gUIDsToObjectListArgsForCall, struct {
		arg1 context.Context
		arg2 schema.GroupVersionKind
		arg3 []string
	}{arg1, arg2, arg3Copy})
	stub := fake.GUIDsToObjectListStub
	fakeReturns := fake.gUIDsToObjectListReturns
	fake.recordInvocation("GUIDsToObjectList", []interface{}{arg1, arg2, arg3Copy})
	fake.gUIDsToObjectListMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *ObjectListMapper) GUIDsToObjectListCallCount() int {
	fake.gUIDsToObjectListMutex.RLock()
	defer fake.gUIDsToObjectListMutex.RUnlock()
	return len(fake.gUIDsToObjectListArgsForCall)
}

func (fake *ObjectListMapper) GUIDsToObjectListCalls(stub func(context.Context, schema.GroupVersionKind, []string) (client.ObjectList, error)) {
	fake.gUIDsToObjectListMutex.Lock()
	defer fake.gUIDsToObjectListMutex.Unlock()
	fake.GUIDsToObjectListStub = stub
}

func (fake *ObjectListMapper) GUIDsToObjectListArgsForCall(i int) (context.Context, schema.GroupVersionKind, []string) {
	fake.gUIDsToObjectListMutex.RLock()
	defer fake.gUIDsToObjectListMutex.RUnlock()
	argsForCall := fake.gUIDsToObjectListArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *ObjectListMapper) GUIDsToObjectListReturns(result1 client.ObjectList, result2 error) {
	fake.gUIDsToObjectListMutex.Lock()
	defer fake.gUIDsToObjectListMutex.Unlock()
	fake.GUIDsToObjectListStub = nil
	fake.gUIDsToObjectListReturns = struct {
		result1 client.ObjectList
		result2 error
	}{result1, result2}
}

func (fake *ObjectListMapper) GUIDsToObjectListReturnsOnCall(i int, result1 client.ObjectList, result2 error) {
	fake.gUIDsToObjectListMutex.Lock()
	defer fake.gUIDsToObjectListMutex.Unlock()
	fake.GUIDsToObjectListStub = nil
	if fake.gUIDsToObjectListReturnsOnCall == nil {
		fake.gUIDsToObjectListReturnsOnCall = make(map[int]struct {
			result1 client.ObjectList
			result2 error
		})
	}
	fake.gUIDsToObjectListReturnsOnCall[i] = struct {
		result1 client.ObjectList
		result2 error
	}{result1, result2}
}

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