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

import (
	"sync"

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

type FakeIndexDeleter struct {
	DeleteFromIndexStub        func(indexer.DeleteFromIndexRequest) error
	deleteFromIndexMutex       sync.RWMutex
	deleteFromIndexArgsForCall []struct {
		arg1 indexer.DeleteFromIndexRequest
	}
	deleteFromIndexReturns struct {
		result1 error
	}
	deleteFromIndexReturnsOnCall map[int]struct {
		result1 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeIndexDeleter) DeleteFromIndex(arg1 indexer.DeleteFromIndexRequest) error {
	fake.deleteFromIndexMutex.Lock()
	ret, specificReturn := fake.deleteFromIndexReturnsOnCall[len(fake.deleteFromIndexArgsForCall)]
	fake.deleteFromIndexArgsForCall = append(fake.deleteFromIndexArgsForCall, struct {
		arg1 indexer.DeleteFromIndexRequest
	}{arg1})
	fake.recordInvocation("DeleteFromIndex", []interface{}{arg1})
	fake.deleteFromIndexMutex.Unlock()
	if fake.DeleteFromIndexStub != nil {
		return fake.DeleteFromIndexStub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	fakeReturns := fake.deleteFromIndexReturns
	return fakeReturns.result1
}

func (fake *FakeIndexDeleter) DeleteFromIndexCallCount() int {
	fake.deleteFromIndexMutex.RLock()
	defer fake.deleteFromIndexMutex.RUnlock()
	return len(fake.deleteFromIndexArgsForCall)
}

func (fake *FakeIndexDeleter) DeleteFromIndexCalls(stub func(indexer.DeleteFromIndexRequest) error) {
	fake.deleteFromIndexMutex.Lock()
	defer fake.deleteFromIndexMutex.Unlock()
	fake.DeleteFromIndexStub = stub
}

func (fake *FakeIndexDeleter) DeleteFromIndexArgsForCall(i int) indexer.DeleteFromIndexRequest {
	fake.deleteFromIndexMutex.RLock()
	defer fake.deleteFromIndexMutex.RUnlock()
	argsForCall := fake.deleteFromIndexArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeIndexDeleter) DeleteFromIndexReturns(result1 error) {
	fake.deleteFromIndexMutex.Lock()
	defer fake.deleteFromIndexMutex.Unlock()
	fake.DeleteFromIndexStub = nil
	fake.deleteFromIndexReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeIndexDeleter) DeleteFromIndexReturnsOnCall(i int, result1 error) {
	fake.deleteFromIndexMutex.Lock()
	defer fake.deleteFromIndexMutex.Unlock()
	fake.DeleteFromIndexStub = nil
	if fake.deleteFromIndexReturnsOnCall == nil {
		fake.deleteFromIndexReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.deleteFromIndexReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

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

func (fake *FakeIndexDeleter) 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 _ indexer.IndexDeleter = new(FakeIndexDeleter)
