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

import (
	"context"
	"sync"

	"code.cloudfoundry.org/korifi/kpack-image-builder/controllers"
	"code.cloudfoundry.org/korifi/tools/image"
)

type ImageConfigGetter struct {
	ConfigStub        func(context.Context, image.Creds, string) (image.Config, error)
	configMutex       sync.RWMutex
	configArgsForCall []struct {
		arg1 context.Context
		arg2 image.Creds
		arg3 string
	}
	configReturns struct {
		result1 image.Config
		result2 error
	}
	configReturnsOnCall map[int]struct {
		result1 image.Config
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *ImageConfigGetter) Config(arg1 context.Context, arg2 image.Creds, arg3 string) (image.Config, error) {
	fake.configMutex.Lock()
	ret, specificReturn := fake.configReturnsOnCall[len(fake.configArgsForCall)]
	fake.configArgsForCall = append(fake.configArgsForCall, struct {
		arg1 context.Context
		arg2 image.Creds
		arg3 string
	}{arg1, arg2, arg3})
	stub := fake.ConfigStub
	fakeReturns := fake.configReturns
	fake.recordInvocation("Config", []interface{}{arg1, arg2, arg3})
	fake.configMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *ImageConfigGetter) ConfigCallCount() int {
	fake.configMutex.RLock()
	defer fake.configMutex.RUnlock()
	return len(fake.configArgsForCall)
}

func (fake *ImageConfigGetter) ConfigCalls(stub func(context.Context, image.Creds, string) (image.Config, error)) {
	fake.configMutex.Lock()
	defer fake.configMutex.Unlock()
	fake.ConfigStub = stub
}

func (fake *ImageConfigGetter) ConfigArgsForCall(i int) (context.Context, image.Creds, string) {
	fake.configMutex.RLock()
	defer fake.configMutex.RUnlock()
	argsForCall := fake.configArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *ImageConfigGetter) ConfigReturns(result1 image.Config, result2 error) {
	fake.configMutex.Lock()
	defer fake.configMutex.Unlock()
	fake.ConfigStub = nil
	fake.configReturns = struct {
		result1 image.Config
		result2 error
	}{result1, result2}
}

func (fake *ImageConfigGetter) ConfigReturnsOnCall(i int, result1 image.Config, result2 error) {
	fake.configMutex.Lock()
	defer fake.configMutex.Unlock()
	fake.ConfigStub = nil
	if fake.configReturnsOnCall == nil {
		fake.configReturnsOnCall = make(map[int]struct {
			result1 image.Config
			result2 error
		})
	}
	fake.configReturnsOnCall[i] = struct {
		result1 image.Config
		result2 error
	}{result1, result2}
}

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