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

import (
	"sync"

	"github.com/operator-framework/operator-registry/pkg/containertools"
)

type FakeLabelReader struct {
	GetLabelsFromImageStub        func(string) (map[string]string, error)
	getLabelsFromImageMutex       sync.RWMutex
	getLabelsFromImageArgsForCall []struct {
		arg1 string
	}
	getLabelsFromImageReturns struct {
		result1 map[string]string
		result2 error
	}
	getLabelsFromImageReturnsOnCall map[int]struct {
		result1 map[string]string
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeLabelReader) GetLabelsFromImage(arg1 string) (map[string]string, error) {
	fake.getLabelsFromImageMutex.Lock()
	ret, specificReturn := fake.getLabelsFromImageReturnsOnCall[len(fake.getLabelsFromImageArgsForCall)]
	fake.getLabelsFromImageArgsForCall = append(fake.getLabelsFromImageArgsForCall, struct {
		arg1 string
	}{arg1})
	stub := fake.GetLabelsFromImageStub
	fakeReturns := fake.getLabelsFromImageReturns
	fake.recordInvocation("GetLabelsFromImage", []interface{}{arg1})
	fake.getLabelsFromImageMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeLabelReader) GetLabelsFromImageCallCount() int {
	fake.getLabelsFromImageMutex.RLock()
	defer fake.getLabelsFromImageMutex.RUnlock()
	return len(fake.getLabelsFromImageArgsForCall)
}

func (fake *FakeLabelReader) GetLabelsFromImageCalls(stub func(string) (map[string]string, error)) {
	fake.getLabelsFromImageMutex.Lock()
	defer fake.getLabelsFromImageMutex.Unlock()
	fake.GetLabelsFromImageStub = stub
}

func (fake *FakeLabelReader) GetLabelsFromImageArgsForCall(i int) string {
	fake.getLabelsFromImageMutex.RLock()
	defer fake.getLabelsFromImageMutex.RUnlock()
	argsForCall := fake.getLabelsFromImageArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeLabelReader) GetLabelsFromImageReturns(result1 map[string]string, result2 error) {
	fake.getLabelsFromImageMutex.Lock()
	defer fake.getLabelsFromImageMutex.Unlock()
	fake.GetLabelsFromImageStub = nil
	fake.getLabelsFromImageReturns = struct {
		result1 map[string]string
		result2 error
	}{result1, result2}
}

func (fake *FakeLabelReader) GetLabelsFromImageReturnsOnCall(i int, result1 map[string]string, result2 error) {
	fake.getLabelsFromImageMutex.Lock()
	defer fake.getLabelsFromImageMutex.Unlock()
	fake.GetLabelsFromImageStub = nil
	if fake.getLabelsFromImageReturnsOnCall == nil {
		fake.getLabelsFromImageReturnsOnCall = make(map[int]struct {
			result1 map[string]string
			result2 error
		})
	}
	fake.getLabelsFromImageReturnsOnCall[i] = struct {
		result1 map[string]string
		result2 error
	}{result1, result2}
}

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

func (fake *FakeLabelReader) 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 _ containertools.LabelReader = new(FakeLabelReader)
