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

import (
	"context"
	"sync"

	"code.cloudfoundry.org/korifi/api/authorization"
	"code.cloudfoundry.org/korifi/api/handlers"
	"code.cloudfoundry.org/korifi/api/repositories"
)

type CFServiceBrokerRepository struct {
	CreateServiceBrokerStub        func(context.Context, authorization.Info, repositories.CreateServiceBrokerMessage) (repositories.ServiceBrokerRecord, error)
	createServiceBrokerMutex       sync.RWMutex
	createServiceBrokerArgsForCall []struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 repositories.CreateServiceBrokerMessage
	}
	createServiceBrokerReturns struct {
		result1 repositories.ServiceBrokerRecord
		result2 error
	}
	createServiceBrokerReturnsOnCall map[int]struct {
		result1 repositories.ServiceBrokerRecord
		result2 error
	}
	DeleteServiceBrokerStub        func(context.Context, authorization.Info, string) error
	deleteServiceBrokerMutex       sync.RWMutex
	deleteServiceBrokerArgsForCall []struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 string
	}
	deleteServiceBrokerReturns struct {
		result1 error
	}
	deleteServiceBrokerReturnsOnCall map[int]struct {
		result1 error
	}
	GetServiceBrokerStub        func(context.Context, authorization.Info, string) (repositories.ServiceBrokerRecord, error)
	getServiceBrokerMutex       sync.RWMutex
	getServiceBrokerArgsForCall []struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 string
	}
	getServiceBrokerReturns struct {
		result1 repositories.ServiceBrokerRecord
		result2 error
	}
	getServiceBrokerReturnsOnCall map[int]struct {
		result1 repositories.ServiceBrokerRecord
		result2 error
	}
	ListServiceBrokersStub        func(context.Context, authorization.Info, repositories.ListServiceBrokerMessage) (repositories.ListResult[repositories.ServiceBrokerRecord], error)
	listServiceBrokersMutex       sync.RWMutex
	listServiceBrokersArgsForCall []struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 repositories.ListServiceBrokerMessage
	}
	listServiceBrokersReturns struct {
		result1 repositories.ListResult[repositories.ServiceBrokerRecord]
		result2 error
	}
	listServiceBrokersReturnsOnCall map[int]struct {
		result1 repositories.ListResult[repositories.ServiceBrokerRecord]
		result2 error
	}
	UpdateServiceBrokerStub        func(context.Context, authorization.Info, repositories.UpdateServiceBrokerMessage) (repositories.ServiceBrokerRecord, error)
	updateServiceBrokerMutex       sync.RWMutex
	updateServiceBrokerArgsForCall []struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 repositories.UpdateServiceBrokerMessage
	}
	updateServiceBrokerReturns struct {
		result1 repositories.ServiceBrokerRecord
		result2 error
	}
	updateServiceBrokerReturnsOnCall map[int]struct {
		result1 repositories.ServiceBrokerRecord
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *CFServiceBrokerRepository) CreateServiceBroker(arg1 context.Context, arg2 authorization.Info, arg3 repositories.CreateServiceBrokerMessage) (repositories.ServiceBrokerRecord, error) {
	fake.createServiceBrokerMutex.Lock()
	ret, specificReturn := fake.createServiceBrokerReturnsOnCall[len(fake.createServiceBrokerArgsForCall)]
	fake.createServiceBrokerArgsForCall = append(fake.createServiceBrokerArgsForCall, struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 repositories.CreateServiceBrokerMessage
	}{arg1, arg2, arg3})
	stub := fake.CreateServiceBrokerStub
	fakeReturns := fake.createServiceBrokerReturns
	fake.recordInvocation("CreateServiceBroker", []interface{}{arg1, arg2, arg3})
	fake.createServiceBrokerMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *CFServiceBrokerRepository) CreateServiceBrokerCallCount() int {
	fake.createServiceBrokerMutex.RLock()
	defer fake.createServiceBrokerMutex.RUnlock()
	return len(fake.createServiceBrokerArgsForCall)
}

func (fake *CFServiceBrokerRepository) CreateServiceBrokerCalls(stub func(context.Context, authorization.Info, repositories.CreateServiceBrokerMessage) (repositories.ServiceBrokerRecord, error)) {
	fake.createServiceBrokerMutex.Lock()
	defer fake.createServiceBrokerMutex.Unlock()
	fake.CreateServiceBrokerStub = stub
}

func (fake *CFServiceBrokerRepository) CreateServiceBrokerArgsForCall(i int) (context.Context, authorization.Info, repositories.CreateServiceBrokerMessage) {
	fake.createServiceBrokerMutex.RLock()
	defer fake.createServiceBrokerMutex.RUnlock()
	argsForCall := fake.createServiceBrokerArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *CFServiceBrokerRepository) CreateServiceBrokerReturns(result1 repositories.ServiceBrokerRecord, result2 error) {
	fake.createServiceBrokerMutex.Lock()
	defer fake.createServiceBrokerMutex.Unlock()
	fake.CreateServiceBrokerStub = nil
	fake.createServiceBrokerReturns = struct {
		result1 repositories.ServiceBrokerRecord
		result2 error
	}{result1, result2}
}

func (fake *CFServiceBrokerRepository) CreateServiceBrokerReturnsOnCall(i int, result1 repositories.ServiceBrokerRecord, result2 error) {
	fake.createServiceBrokerMutex.Lock()
	defer fake.createServiceBrokerMutex.Unlock()
	fake.CreateServiceBrokerStub = nil
	if fake.createServiceBrokerReturnsOnCall == nil {
		fake.createServiceBrokerReturnsOnCall = make(map[int]struct {
			result1 repositories.ServiceBrokerRecord
			result2 error
		})
	}
	fake.createServiceBrokerReturnsOnCall[i] = struct {
		result1 repositories.ServiceBrokerRecord
		result2 error
	}{result1, result2}
}

func (fake *CFServiceBrokerRepository) DeleteServiceBroker(arg1 context.Context, arg2 authorization.Info, arg3 string) error {
	fake.deleteServiceBrokerMutex.Lock()
	ret, specificReturn := fake.deleteServiceBrokerReturnsOnCall[len(fake.deleteServiceBrokerArgsForCall)]
	fake.deleteServiceBrokerArgsForCall = append(fake.deleteServiceBrokerArgsForCall, struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 string
	}{arg1, arg2, arg3})
	stub := fake.DeleteServiceBrokerStub
	fakeReturns := fake.deleteServiceBrokerReturns
	fake.recordInvocation("DeleteServiceBroker", []interface{}{arg1, arg2, arg3})
	fake.deleteServiceBrokerMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *CFServiceBrokerRepository) DeleteServiceBrokerCallCount() int {
	fake.deleteServiceBrokerMutex.RLock()
	defer fake.deleteServiceBrokerMutex.RUnlock()
	return len(fake.deleteServiceBrokerArgsForCall)
}

func (fake *CFServiceBrokerRepository) DeleteServiceBrokerCalls(stub func(context.Context, authorization.Info, string) error) {
	fake.deleteServiceBrokerMutex.Lock()
	defer fake.deleteServiceBrokerMutex.Unlock()
	fake.DeleteServiceBrokerStub = stub
}

func (fake *CFServiceBrokerRepository) DeleteServiceBrokerArgsForCall(i int) (context.Context, authorization.Info, string) {
	fake.deleteServiceBrokerMutex.RLock()
	defer fake.deleteServiceBrokerMutex.RUnlock()
	argsForCall := fake.deleteServiceBrokerArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *CFServiceBrokerRepository) DeleteServiceBrokerReturns(result1 error) {
	fake.deleteServiceBrokerMutex.Lock()
	defer fake.deleteServiceBrokerMutex.Unlock()
	fake.DeleteServiceBrokerStub = nil
	fake.deleteServiceBrokerReturns = struct {
		result1 error
	}{result1}
}

func (fake *CFServiceBrokerRepository) DeleteServiceBrokerReturnsOnCall(i int, result1 error) {
	fake.deleteServiceBrokerMutex.Lock()
	defer fake.deleteServiceBrokerMutex.Unlock()
	fake.DeleteServiceBrokerStub = nil
	if fake.deleteServiceBrokerReturnsOnCall == nil {
		fake.deleteServiceBrokerReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.deleteServiceBrokerReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *CFServiceBrokerRepository) GetServiceBroker(arg1 context.Context, arg2 authorization.Info, arg3 string) (repositories.ServiceBrokerRecord, error) {
	fake.getServiceBrokerMutex.Lock()
	ret, specificReturn := fake.getServiceBrokerReturnsOnCall[len(fake.getServiceBrokerArgsForCall)]
	fake.getServiceBrokerArgsForCall = append(fake.getServiceBrokerArgsForCall, struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 string
	}{arg1, arg2, arg3})
	stub := fake.GetServiceBrokerStub
	fakeReturns := fake.getServiceBrokerReturns
	fake.recordInvocation("GetServiceBroker", []interface{}{arg1, arg2, arg3})
	fake.getServiceBrokerMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *CFServiceBrokerRepository) GetServiceBrokerCallCount() int {
	fake.getServiceBrokerMutex.RLock()
	defer fake.getServiceBrokerMutex.RUnlock()
	return len(fake.getServiceBrokerArgsForCall)
}

func (fake *CFServiceBrokerRepository) GetServiceBrokerCalls(stub func(context.Context, authorization.Info, string) (repositories.ServiceBrokerRecord, error)) {
	fake.getServiceBrokerMutex.Lock()
	defer fake.getServiceBrokerMutex.Unlock()
	fake.GetServiceBrokerStub = stub
}

func (fake *CFServiceBrokerRepository) GetServiceBrokerArgsForCall(i int) (context.Context, authorization.Info, string) {
	fake.getServiceBrokerMutex.RLock()
	defer fake.getServiceBrokerMutex.RUnlock()
	argsForCall := fake.getServiceBrokerArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *CFServiceBrokerRepository) GetServiceBrokerReturns(result1 repositories.ServiceBrokerRecord, result2 error) {
	fake.getServiceBrokerMutex.Lock()
	defer fake.getServiceBrokerMutex.Unlock()
	fake.GetServiceBrokerStub = nil
	fake.getServiceBrokerReturns = struct {
		result1 repositories.ServiceBrokerRecord
		result2 error
	}{result1, result2}
}

func (fake *CFServiceBrokerRepository) GetServiceBrokerReturnsOnCall(i int, result1 repositories.ServiceBrokerRecord, result2 error) {
	fake.getServiceBrokerMutex.Lock()
	defer fake.getServiceBrokerMutex.Unlock()
	fake.GetServiceBrokerStub = nil
	if fake.getServiceBrokerReturnsOnCall == nil {
		fake.getServiceBrokerReturnsOnCall = make(map[int]struct {
			result1 repositories.ServiceBrokerRecord
			result2 error
		})
	}
	fake.getServiceBrokerReturnsOnCall[i] = struct {
		result1 repositories.ServiceBrokerRecord
		result2 error
	}{result1, result2}
}

func (fake *CFServiceBrokerRepository) ListServiceBrokers(arg1 context.Context, arg2 authorization.Info, arg3 repositories.ListServiceBrokerMessage) (repositories.ListResult[repositories.ServiceBrokerRecord], error) {
	fake.listServiceBrokersMutex.Lock()
	ret, specificReturn := fake.listServiceBrokersReturnsOnCall[len(fake.listServiceBrokersArgsForCall)]
	fake.listServiceBrokersArgsForCall = append(fake.listServiceBrokersArgsForCall, struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 repositories.ListServiceBrokerMessage
	}{arg1, arg2, arg3})
	stub := fake.ListServiceBrokersStub
	fakeReturns := fake.listServiceBrokersReturns
	fake.recordInvocation("ListServiceBrokers", []interface{}{arg1, arg2, arg3})
	fake.listServiceBrokersMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *CFServiceBrokerRepository) ListServiceBrokersCallCount() int {
	fake.listServiceBrokersMutex.RLock()
	defer fake.listServiceBrokersMutex.RUnlock()
	return len(fake.listServiceBrokersArgsForCall)
}

func (fake *CFServiceBrokerRepository) ListServiceBrokersCalls(stub func(context.Context, authorization.Info, repositories.ListServiceBrokerMessage) (repositories.ListResult[repositories.ServiceBrokerRecord], error)) {
	fake.listServiceBrokersMutex.Lock()
	defer fake.listServiceBrokersMutex.Unlock()
	fake.ListServiceBrokersStub = stub
}

func (fake *CFServiceBrokerRepository) ListServiceBrokersArgsForCall(i int) (context.Context, authorization.Info, repositories.ListServiceBrokerMessage) {
	fake.listServiceBrokersMutex.RLock()
	defer fake.listServiceBrokersMutex.RUnlock()
	argsForCall := fake.listServiceBrokersArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *CFServiceBrokerRepository) ListServiceBrokersReturns(result1 repositories.ListResult[repositories.ServiceBrokerRecord], result2 error) {
	fake.listServiceBrokersMutex.Lock()
	defer fake.listServiceBrokersMutex.Unlock()
	fake.ListServiceBrokersStub = nil
	fake.listServiceBrokersReturns = struct {
		result1 repositories.ListResult[repositories.ServiceBrokerRecord]
		result2 error
	}{result1, result2}
}

func (fake *CFServiceBrokerRepository) ListServiceBrokersReturnsOnCall(i int, result1 repositories.ListResult[repositories.ServiceBrokerRecord], result2 error) {
	fake.listServiceBrokersMutex.Lock()
	defer fake.listServiceBrokersMutex.Unlock()
	fake.ListServiceBrokersStub = nil
	if fake.listServiceBrokersReturnsOnCall == nil {
		fake.listServiceBrokersReturnsOnCall = make(map[int]struct {
			result1 repositories.ListResult[repositories.ServiceBrokerRecord]
			result2 error
		})
	}
	fake.listServiceBrokersReturnsOnCall[i] = struct {
		result1 repositories.ListResult[repositories.ServiceBrokerRecord]
		result2 error
	}{result1, result2}
}

func (fake *CFServiceBrokerRepository) UpdateServiceBroker(arg1 context.Context, arg2 authorization.Info, arg3 repositories.UpdateServiceBrokerMessage) (repositories.ServiceBrokerRecord, error) {
	fake.updateServiceBrokerMutex.Lock()
	ret, specificReturn := fake.updateServiceBrokerReturnsOnCall[len(fake.updateServiceBrokerArgsForCall)]
	fake.updateServiceBrokerArgsForCall = append(fake.updateServiceBrokerArgsForCall, struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 repositories.UpdateServiceBrokerMessage
	}{arg1, arg2, arg3})
	stub := fake.UpdateServiceBrokerStub
	fakeReturns := fake.updateServiceBrokerReturns
	fake.recordInvocation("UpdateServiceBroker", []interface{}{arg1, arg2, arg3})
	fake.updateServiceBrokerMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *CFServiceBrokerRepository) UpdateServiceBrokerCallCount() int {
	fake.updateServiceBrokerMutex.RLock()
	defer fake.updateServiceBrokerMutex.RUnlock()
	return len(fake.updateServiceBrokerArgsForCall)
}

func (fake *CFServiceBrokerRepository) UpdateServiceBrokerCalls(stub func(context.Context, authorization.Info, repositories.UpdateServiceBrokerMessage) (repositories.ServiceBrokerRecord, error)) {
	fake.updateServiceBrokerMutex.Lock()
	defer fake.updateServiceBrokerMutex.Unlock()
	fake.UpdateServiceBrokerStub = stub
}

func (fake *CFServiceBrokerRepository) UpdateServiceBrokerArgsForCall(i int) (context.Context, authorization.Info, repositories.UpdateServiceBrokerMessage) {
	fake.updateServiceBrokerMutex.RLock()
	defer fake.updateServiceBrokerMutex.RUnlock()
	argsForCall := fake.updateServiceBrokerArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *CFServiceBrokerRepository) UpdateServiceBrokerReturns(result1 repositories.ServiceBrokerRecord, result2 error) {
	fake.updateServiceBrokerMutex.Lock()
	defer fake.updateServiceBrokerMutex.Unlock()
	fake.UpdateServiceBrokerStub = nil
	fake.updateServiceBrokerReturns = struct {
		result1 repositories.ServiceBrokerRecord
		result2 error
	}{result1, result2}
}

func (fake *CFServiceBrokerRepository) UpdateServiceBrokerReturnsOnCall(i int, result1 repositories.ServiceBrokerRecord, result2 error) {
	fake.updateServiceBrokerMutex.Lock()
	defer fake.updateServiceBrokerMutex.Unlock()
	fake.UpdateServiceBrokerStub = nil
	if fake.updateServiceBrokerReturnsOnCall == nil {
		fake.updateServiceBrokerReturnsOnCall = make(map[int]struct {
			result1 repositories.ServiceBrokerRecord
			result2 error
		})
	}
	fake.updateServiceBrokerReturnsOnCall[i] = struct {
		result1 repositories.ServiceBrokerRecord
		result2 error
	}{result1, result2}
}

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