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

import (
	"sync"

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

type FakeRegistryDeleter struct {
	DeleteFromRegistryStub        func(registry.DeleteFromRegistryRequest) error
	deleteFromRegistryMutex       sync.RWMutex
	deleteFromRegistryArgsForCall []struct {
		arg1 registry.DeleteFromRegistryRequest
	}
	deleteFromRegistryReturns struct {
		result1 error
	}
	deleteFromRegistryReturnsOnCall map[int]struct {
		result1 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeRegistryDeleter) DeleteFromRegistry(arg1 registry.DeleteFromRegistryRequest) error {
	fake.deleteFromRegistryMutex.Lock()
	ret, specificReturn := fake.deleteFromRegistryReturnsOnCall[len(fake.deleteFromRegistryArgsForCall)]
	fake.deleteFromRegistryArgsForCall = append(fake.deleteFromRegistryArgsForCall, struct {
		arg1 registry.DeleteFromRegistryRequest
	}{arg1})
	stub := fake.DeleteFromRegistryStub
	fakeReturns := fake.deleteFromRegistryReturns
	fake.recordInvocation("DeleteFromRegistry", []interface{}{arg1})
	fake.deleteFromRegistryMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeRegistryDeleter) DeleteFromRegistryCallCount() int {
	fake.deleteFromRegistryMutex.RLock()
	defer fake.deleteFromRegistryMutex.RUnlock()
	return len(fake.deleteFromRegistryArgsForCall)
}

func (fake *FakeRegistryDeleter) DeleteFromRegistryCalls(stub func(registry.DeleteFromRegistryRequest) error) {
	fake.deleteFromRegistryMutex.Lock()
	defer fake.deleteFromRegistryMutex.Unlock()
	fake.DeleteFromRegistryStub = stub
}

func (fake *FakeRegistryDeleter) DeleteFromRegistryArgsForCall(i int) registry.DeleteFromRegistryRequest {
	fake.deleteFromRegistryMutex.RLock()
	defer fake.deleteFromRegistryMutex.RUnlock()
	argsForCall := fake.deleteFromRegistryArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeRegistryDeleter) DeleteFromRegistryReturns(result1 error) {
	fake.deleteFromRegistryMutex.Lock()
	defer fake.deleteFromRegistryMutex.Unlock()
	fake.DeleteFromRegistryStub = nil
	fake.deleteFromRegistryReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeRegistryDeleter) DeleteFromRegistryReturnsOnCall(i int, result1 error) {
	fake.deleteFromRegistryMutex.Lock()
	defer fake.deleteFromRegistryMutex.Unlock()
	fake.DeleteFromRegistryStub = nil
	if fake.deleteFromRegistryReturnsOnCall == nil {
		fake.deleteFromRegistryReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.deleteFromRegistryReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

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

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