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

import (
	"context"
	"sync"

	"code.cloudfoundry.org/korifi/controllers/webhooks"
)

type NameRegistry struct {
	CheckNameOwnershipStub        func(context.Context, string, string, string, string) (bool, error)
	checkNameOwnershipMutex       sync.RWMutex
	checkNameOwnershipArgsForCall []struct {
		arg1 context.Context
		arg2 string
		arg3 string
		arg4 string
		arg5 string
	}
	checkNameOwnershipReturns struct {
		result1 bool
		result2 error
	}
	checkNameOwnershipReturnsOnCall map[int]struct {
		result1 bool
		result2 error
	}
	DeregisterNameStub        func(context.Context, string, string) error
	deregisterNameMutex       sync.RWMutex
	deregisterNameArgsForCall []struct {
		arg1 context.Context
		arg2 string
		arg3 string
	}
	deregisterNameReturns struct {
		result1 error
	}
	deregisterNameReturnsOnCall map[int]struct {
		result1 error
	}
	RegisterNameStub        func(context.Context, string, string, string, string) error
	registerNameMutex       sync.RWMutex
	registerNameArgsForCall []struct {
		arg1 context.Context
		arg2 string
		arg3 string
		arg4 string
		arg5 string
	}
	registerNameReturns struct {
		result1 error
	}
	registerNameReturnsOnCall map[int]struct {
		result1 error
	}
	TryLockNameStub        func(context.Context, string, string) error
	tryLockNameMutex       sync.RWMutex
	tryLockNameArgsForCall []struct {
		arg1 context.Context
		arg2 string
		arg3 string
	}
	tryLockNameReturns struct {
		result1 error
	}
	tryLockNameReturnsOnCall map[int]struct {
		result1 error
	}
	UnlockNameStub        func(context.Context, string, string) error
	unlockNameMutex       sync.RWMutex
	unlockNameArgsForCall []struct {
		arg1 context.Context
		arg2 string
		arg3 string
	}
	unlockNameReturns struct {
		result1 error
	}
	unlockNameReturnsOnCall map[int]struct {
		result1 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *NameRegistry) CheckNameOwnership(arg1 context.Context, arg2 string, arg3 string, arg4 string, arg5 string) (bool, error) {
	fake.checkNameOwnershipMutex.Lock()
	ret, specificReturn := fake.checkNameOwnershipReturnsOnCall[len(fake.checkNameOwnershipArgsForCall)]
	fake.checkNameOwnershipArgsForCall = append(fake.checkNameOwnershipArgsForCall, struct {
		arg1 context.Context
		arg2 string
		arg3 string
		arg4 string
		arg5 string
	}{arg1, arg2, arg3, arg4, arg5})
	stub := fake.CheckNameOwnershipStub
	fakeReturns := fake.checkNameOwnershipReturns
	fake.recordInvocation("CheckNameOwnership", []interface{}{arg1, arg2, arg3, arg4, arg5})
	fake.checkNameOwnershipMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3, arg4, arg5)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *NameRegistry) CheckNameOwnershipCallCount() int {
	fake.checkNameOwnershipMutex.RLock()
	defer fake.checkNameOwnershipMutex.RUnlock()
	return len(fake.checkNameOwnershipArgsForCall)
}

func (fake *NameRegistry) CheckNameOwnershipCalls(stub func(context.Context, string, string, string, string) (bool, error)) {
	fake.checkNameOwnershipMutex.Lock()
	defer fake.checkNameOwnershipMutex.Unlock()
	fake.CheckNameOwnershipStub = stub
}

func (fake *NameRegistry) CheckNameOwnershipArgsForCall(i int) (context.Context, string, string, string, string) {
	fake.checkNameOwnershipMutex.RLock()
	defer fake.checkNameOwnershipMutex.RUnlock()
	argsForCall := fake.checkNameOwnershipArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5
}

func (fake *NameRegistry) CheckNameOwnershipReturns(result1 bool, result2 error) {
	fake.checkNameOwnershipMutex.Lock()
	defer fake.checkNameOwnershipMutex.Unlock()
	fake.CheckNameOwnershipStub = nil
	fake.checkNameOwnershipReturns = struct {
		result1 bool
		result2 error
	}{result1, result2}
}

func (fake *NameRegistry) CheckNameOwnershipReturnsOnCall(i int, result1 bool, result2 error) {
	fake.checkNameOwnershipMutex.Lock()
	defer fake.checkNameOwnershipMutex.Unlock()
	fake.CheckNameOwnershipStub = nil
	if fake.checkNameOwnershipReturnsOnCall == nil {
		fake.checkNameOwnershipReturnsOnCall = make(map[int]struct {
			result1 bool
			result2 error
		})
	}
	fake.checkNameOwnershipReturnsOnCall[i] = struct {
		result1 bool
		result2 error
	}{result1, result2}
}

func (fake *NameRegistry) DeregisterName(arg1 context.Context, arg2 string, arg3 string) error {
	fake.deregisterNameMutex.Lock()
	ret, specificReturn := fake.deregisterNameReturnsOnCall[len(fake.deregisterNameArgsForCall)]
	fake.deregisterNameArgsForCall = append(fake.deregisterNameArgsForCall, struct {
		arg1 context.Context
		arg2 string
		arg3 string
	}{arg1, arg2, arg3})
	stub := fake.DeregisterNameStub
	fakeReturns := fake.deregisterNameReturns
	fake.recordInvocation("DeregisterName", []interface{}{arg1, arg2, arg3})
	fake.deregisterNameMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *NameRegistry) DeregisterNameCallCount() int {
	fake.deregisterNameMutex.RLock()
	defer fake.deregisterNameMutex.RUnlock()
	return len(fake.deregisterNameArgsForCall)
}

func (fake *NameRegistry) DeregisterNameCalls(stub func(context.Context, string, string) error) {
	fake.deregisterNameMutex.Lock()
	defer fake.deregisterNameMutex.Unlock()
	fake.DeregisterNameStub = stub
}

func (fake *NameRegistry) DeregisterNameArgsForCall(i int) (context.Context, string, string) {
	fake.deregisterNameMutex.RLock()
	defer fake.deregisterNameMutex.RUnlock()
	argsForCall := fake.deregisterNameArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *NameRegistry) DeregisterNameReturns(result1 error) {
	fake.deregisterNameMutex.Lock()
	defer fake.deregisterNameMutex.Unlock()
	fake.DeregisterNameStub = nil
	fake.deregisterNameReturns = struct {
		result1 error
	}{result1}
}

func (fake *NameRegistry) DeregisterNameReturnsOnCall(i int, result1 error) {
	fake.deregisterNameMutex.Lock()
	defer fake.deregisterNameMutex.Unlock()
	fake.DeregisterNameStub = nil
	if fake.deregisterNameReturnsOnCall == nil {
		fake.deregisterNameReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.deregisterNameReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *NameRegistry) RegisterName(arg1 context.Context, arg2 string, arg3 string, arg4 string, arg5 string) error {
	fake.registerNameMutex.Lock()
	ret, specificReturn := fake.registerNameReturnsOnCall[len(fake.registerNameArgsForCall)]
	fake.registerNameArgsForCall = append(fake.registerNameArgsForCall, struct {
		arg1 context.Context
		arg2 string
		arg3 string
		arg4 string
		arg5 string
	}{arg1, arg2, arg3, arg4, arg5})
	stub := fake.RegisterNameStub
	fakeReturns := fake.registerNameReturns
	fake.recordInvocation("RegisterName", []interface{}{arg1, arg2, arg3, arg4, arg5})
	fake.registerNameMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3, arg4, arg5)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *NameRegistry) RegisterNameCallCount() int {
	fake.registerNameMutex.RLock()
	defer fake.registerNameMutex.RUnlock()
	return len(fake.registerNameArgsForCall)
}

func (fake *NameRegistry) RegisterNameCalls(stub func(context.Context, string, string, string, string) error) {
	fake.registerNameMutex.Lock()
	defer fake.registerNameMutex.Unlock()
	fake.RegisterNameStub = stub
}

func (fake *NameRegistry) RegisterNameArgsForCall(i int) (context.Context, string, string, string, string) {
	fake.registerNameMutex.RLock()
	defer fake.registerNameMutex.RUnlock()
	argsForCall := fake.registerNameArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5
}

func (fake *NameRegistry) RegisterNameReturns(result1 error) {
	fake.registerNameMutex.Lock()
	defer fake.registerNameMutex.Unlock()
	fake.RegisterNameStub = nil
	fake.registerNameReturns = struct {
		result1 error
	}{result1}
}

func (fake *NameRegistry) RegisterNameReturnsOnCall(i int, result1 error) {
	fake.registerNameMutex.Lock()
	defer fake.registerNameMutex.Unlock()
	fake.RegisterNameStub = nil
	if fake.registerNameReturnsOnCall == nil {
		fake.registerNameReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.registerNameReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *NameRegistry) TryLockName(arg1 context.Context, arg2 string, arg3 string) error {
	fake.tryLockNameMutex.Lock()
	ret, specificReturn := fake.tryLockNameReturnsOnCall[len(fake.tryLockNameArgsForCall)]
	fake.tryLockNameArgsForCall = append(fake.tryLockNameArgsForCall, struct {
		arg1 context.Context
		arg2 string
		arg3 string
	}{arg1, arg2, arg3})
	stub := fake.TryLockNameStub
	fakeReturns := fake.tryLockNameReturns
	fake.recordInvocation("TryLockName", []interface{}{arg1, arg2, arg3})
	fake.tryLockNameMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *NameRegistry) TryLockNameCallCount() int {
	fake.tryLockNameMutex.RLock()
	defer fake.tryLockNameMutex.RUnlock()
	return len(fake.tryLockNameArgsForCall)
}

func (fake *NameRegistry) TryLockNameCalls(stub func(context.Context, string, string) error) {
	fake.tryLockNameMutex.Lock()
	defer fake.tryLockNameMutex.Unlock()
	fake.TryLockNameStub = stub
}

func (fake *NameRegistry) TryLockNameArgsForCall(i int) (context.Context, string, string) {
	fake.tryLockNameMutex.RLock()
	defer fake.tryLockNameMutex.RUnlock()
	argsForCall := fake.tryLockNameArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *NameRegistry) TryLockNameReturns(result1 error) {
	fake.tryLockNameMutex.Lock()
	defer fake.tryLockNameMutex.Unlock()
	fake.TryLockNameStub = nil
	fake.tryLockNameReturns = struct {
		result1 error
	}{result1}
}

func (fake *NameRegistry) TryLockNameReturnsOnCall(i int, result1 error) {
	fake.tryLockNameMutex.Lock()
	defer fake.tryLockNameMutex.Unlock()
	fake.TryLockNameStub = nil
	if fake.tryLockNameReturnsOnCall == nil {
		fake.tryLockNameReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.tryLockNameReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *NameRegistry) UnlockName(arg1 context.Context, arg2 string, arg3 string) error {
	fake.unlockNameMutex.Lock()
	ret, specificReturn := fake.unlockNameReturnsOnCall[len(fake.unlockNameArgsForCall)]
	fake.unlockNameArgsForCall = append(fake.unlockNameArgsForCall, struct {
		arg1 context.Context
		arg2 string
		arg3 string
	}{arg1, arg2, arg3})
	stub := fake.UnlockNameStub
	fakeReturns := fake.unlockNameReturns
	fake.recordInvocation("UnlockName", []interface{}{arg1, arg2, arg3})
	fake.unlockNameMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *NameRegistry) UnlockNameCallCount() int {
	fake.unlockNameMutex.RLock()
	defer fake.unlockNameMutex.RUnlock()
	return len(fake.unlockNameArgsForCall)
}

func (fake *NameRegistry) UnlockNameCalls(stub func(context.Context, string, string) error) {
	fake.unlockNameMutex.Lock()
	defer fake.unlockNameMutex.Unlock()
	fake.UnlockNameStub = stub
}

func (fake *NameRegistry) UnlockNameArgsForCall(i int) (context.Context, string, string) {
	fake.unlockNameMutex.RLock()
	defer fake.unlockNameMutex.RUnlock()
	argsForCall := fake.unlockNameArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *NameRegistry) UnlockNameReturns(result1 error) {
	fake.unlockNameMutex.Lock()
	defer fake.unlockNameMutex.Unlock()
	fake.UnlockNameStub = nil
	fake.unlockNameReturns = struct {
		result1 error
	}{result1}
}

func (fake *NameRegistry) UnlockNameReturnsOnCall(i int, result1 error) {
	fake.unlockNameMutex.Lock()
	defer fake.unlockNameMutex.Unlock()
	fake.UnlockNameStub = nil
	if fake.unlockNameReturnsOnCall == nil {
		fake.unlockNameReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.unlockNameReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

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