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

import (
	"sync"

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

type FakeRegistryAdder struct {
	AddToRegistryStub        func(registry.AddToRegistryRequest) error
	addToRegistryMutex       sync.RWMutex
	addToRegistryArgsForCall []struct {
		arg1 registry.AddToRegistryRequest
	}
	addToRegistryReturns struct {
		result1 error
	}
	addToRegistryReturnsOnCall map[int]struct {
		result1 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeRegistryAdder) AddToRegistry(arg1 registry.AddToRegistryRequest) error {
	fake.addToRegistryMutex.Lock()
	ret, specificReturn := fake.addToRegistryReturnsOnCall[len(fake.addToRegistryArgsForCall)]
	fake.addToRegistryArgsForCall = append(fake.addToRegistryArgsForCall, struct {
		arg1 registry.AddToRegistryRequest
	}{arg1})
	stub := fake.AddToRegistryStub
	fakeReturns := fake.addToRegistryReturns
	fake.recordInvocation("AddToRegistry", []interface{}{arg1})
	fake.addToRegistryMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeRegistryAdder) AddToRegistryCallCount() int {
	fake.addToRegistryMutex.RLock()
	defer fake.addToRegistryMutex.RUnlock()
	return len(fake.addToRegistryArgsForCall)
}

func (fake *FakeRegistryAdder) AddToRegistryCalls(stub func(registry.AddToRegistryRequest) error) {
	fake.addToRegistryMutex.Lock()
	defer fake.addToRegistryMutex.Unlock()
	fake.AddToRegistryStub = stub
}

func (fake *FakeRegistryAdder) AddToRegistryArgsForCall(i int) registry.AddToRegistryRequest {
	fake.addToRegistryMutex.RLock()
	defer fake.addToRegistryMutex.RUnlock()
	argsForCall := fake.addToRegistryArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeRegistryAdder) AddToRegistryReturns(result1 error) {
	fake.addToRegistryMutex.Lock()
	defer fake.addToRegistryMutex.Unlock()
	fake.AddToRegistryStub = nil
	fake.addToRegistryReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeRegistryAdder) AddToRegistryReturnsOnCall(i int, result1 error) {
	fake.addToRegistryMutex.Lock()
	defer fake.addToRegistryMutex.Unlock()
	fake.AddToRegistryStub = nil
	if fake.addToRegistryReturnsOnCall == nil {
		fake.addToRegistryReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.addToRegistryReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

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

func (fake *FakeRegistryAdder) 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 _ registry.RegistryAdder = new(FakeRegistryAdder)
