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

import (
	"context"
	"sync"
	"time"

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

type CFSpaceRepository struct {
	CreateSpaceStub        func(context.Context, authorization.Info, repositories.CreateSpaceMessage) (repositories.SpaceRecord, error)
	createSpaceMutex       sync.RWMutex
	createSpaceArgsForCall []struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 repositories.CreateSpaceMessage
	}
	createSpaceReturns struct {
		result1 repositories.SpaceRecord
		result2 error
	}
	createSpaceReturnsOnCall map[int]struct {
		result1 repositories.SpaceRecord
		result2 error
	}
	DeleteSpaceStub        func(context.Context, authorization.Info, repositories.DeleteSpaceMessage) error
	deleteSpaceMutex       sync.RWMutex
	deleteSpaceArgsForCall []struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 repositories.DeleteSpaceMessage
	}
	deleteSpaceReturns struct {
		result1 error
	}
	deleteSpaceReturnsOnCall map[int]struct {
		result1 error
	}
	GetDeletedAtStub        func(context.Context, authorization.Info, string) (*time.Time, error)
	getDeletedAtMutex       sync.RWMutex
	getDeletedAtArgsForCall []struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 string
	}
	getDeletedAtReturns struct {
		result1 *time.Time
		result2 error
	}
	getDeletedAtReturnsOnCall map[int]struct {
		result1 *time.Time
		result2 error
	}
	GetSpaceStub        func(context.Context, authorization.Info, string) (repositories.SpaceRecord, error)
	getSpaceMutex       sync.RWMutex
	getSpaceArgsForCall []struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 string
	}
	getSpaceReturns struct {
		result1 repositories.SpaceRecord
		result2 error
	}
	getSpaceReturnsOnCall map[int]struct {
		result1 repositories.SpaceRecord
		result2 error
	}
	ListSpacesStub        func(context.Context, authorization.Info, repositories.ListSpacesMessage) (repositories.ListResult[repositories.SpaceRecord], error)
	listSpacesMutex       sync.RWMutex
	listSpacesArgsForCall []struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 repositories.ListSpacesMessage
	}
	listSpacesReturns struct {
		result1 repositories.ListResult[repositories.SpaceRecord]
		result2 error
	}
	listSpacesReturnsOnCall map[int]struct {
		result1 repositories.ListResult[repositories.SpaceRecord]
		result2 error
	}
	PatchSpaceMetadataStub        func(context.Context, authorization.Info, repositories.PatchSpaceMetadataMessage) (repositories.SpaceRecord, error)
	patchSpaceMetadataMutex       sync.RWMutex
	patchSpaceMetadataArgsForCall []struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 repositories.PatchSpaceMetadataMessage
	}
	patchSpaceMetadataReturns struct {
		result1 repositories.SpaceRecord
		result2 error
	}
	patchSpaceMetadataReturnsOnCall map[int]struct {
		result1 repositories.SpaceRecord
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *CFSpaceRepository) CreateSpace(arg1 context.Context, arg2 authorization.Info, arg3 repositories.CreateSpaceMessage) (repositories.SpaceRecord, error) {
	fake.createSpaceMutex.Lock()
	ret, specificReturn := fake.createSpaceReturnsOnCall[len(fake.createSpaceArgsForCall)]
	fake.createSpaceArgsForCall = append(fake.createSpaceArgsForCall, struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 repositories.CreateSpaceMessage
	}{arg1, arg2, arg3})
	stub := fake.CreateSpaceStub
	fakeReturns := fake.createSpaceReturns
	fake.recordInvocation("CreateSpace", []interface{}{arg1, arg2, arg3})
	fake.createSpaceMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *CFSpaceRepository) CreateSpaceCallCount() int {
	fake.createSpaceMutex.RLock()
	defer fake.createSpaceMutex.RUnlock()
	return len(fake.createSpaceArgsForCall)
}

func (fake *CFSpaceRepository) CreateSpaceCalls(stub func(context.Context, authorization.Info, repositories.CreateSpaceMessage) (repositories.SpaceRecord, error)) {
	fake.createSpaceMutex.Lock()
	defer fake.createSpaceMutex.Unlock()
	fake.CreateSpaceStub = stub
}

func (fake *CFSpaceRepository) CreateSpaceArgsForCall(i int) (context.Context, authorization.Info, repositories.CreateSpaceMessage) {
	fake.createSpaceMutex.RLock()
	defer fake.createSpaceMutex.RUnlock()
	argsForCall := fake.createSpaceArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *CFSpaceRepository) CreateSpaceReturns(result1 repositories.SpaceRecord, result2 error) {
	fake.createSpaceMutex.Lock()
	defer fake.createSpaceMutex.Unlock()
	fake.CreateSpaceStub = nil
	fake.createSpaceReturns = struct {
		result1 repositories.SpaceRecord
		result2 error
	}{result1, result2}
}

func (fake *CFSpaceRepository) CreateSpaceReturnsOnCall(i int, result1 repositories.SpaceRecord, result2 error) {
	fake.createSpaceMutex.Lock()
	defer fake.createSpaceMutex.Unlock()
	fake.CreateSpaceStub = nil
	if fake.createSpaceReturnsOnCall == nil {
		fake.createSpaceReturnsOnCall = make(map[int]struct {
			result1 repositories.SpaceRecord
			result2 error
		})
	}
	fake.createSpaceReturnsOnCall[i] = struct {
		result1 repositories.SpaceRecord
		result2 error
	}{result1, result2}
}

func (fake *CFSpaceRepository) DeleteSpace(arg1 context.Context, arg2 authorization.Info, arg3 repositories.DeleteSpaceMessage) error {
	fake.deleteSpaceMutex.Lock()
	ret, specificReturn := fake.deleteSpaceReturnsOnCall[len(fake.deleteSpaceArgsForCall)]
	fake.deleteSpaceArgsForCall = append(fake.deleteSpaceArgsForCall, struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 repositories.DeleteSpaceMessage
	}{arg1, arg2, arg3})
	stub := fake.DeleteSpaceStub
	fakeReturns := fake.deleteSpaceReturns
	fake.recordInvocation("DeleteSpace", []interface{}{arg1, arg2, arg3})
	fake.deleteSpaceMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *CFSpaceRepository) DeleteSpaceCallCount() int {
	fake.deleteSpaceMutex.RLock()
	defer fake.deleteSpaceMutex.RUnlock()
	return len(fake.deleteSpaceArgsForCall)
}

func (fake *CFSpaceRepository) DeleteSpaceCalls(stub func(context.Context, authorization.Info, repositories.DeleteSpaceMessage) error) {
	fake.deleteSpaceMutex.Lock()
	defer fake.deleteSpaceMutex.Unlock()
	fake.DeleteSpaceStub = stub
}

func (fake *CFSpaceRepository) DeleteSpaceArgsForCall(i int) (context.Context, authorization.Info, repositories.DeleteSpaceMessage) {
	fake.deleteSpaceMutex.RLock()
	defer fake.deleteSpaceMutex.RUnlock()
	argsForCall := fake.deleteSpaceArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *CFSpaceRepository) DeleteSpaceReturns(result1 error) {
	fake.deleteSpaceMutex.Lock()
	defer fake.deleteSpaceMutex.Unlock()
	fake.DeleteSpaceStub = nil
	fake.deleteSpaceReturns = struct {
		result1 error
	}{result1}
}

func (fake *CFSpaceRepository) DeleteSpaceReturnsOnCall(i int, result1 error) {
	fake.deleteSpaceMutex.Lock()
	defer fake.deleteSpaceMutex.Unlock()
	fake.DeleteSpaceStub = nil
	if fake.deleteSpaceReturnsOnCall == nil {
		fake.deleteSpaceReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.deleteSpaceReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *CFSpaceRepository) GetDeletedAt(arg1 context.Context, arg2 authorization.Info, arg3 string) (*time.Time, error) {
	fake.getDeletedAtMutex.Lock()
	ret, specificReturn := fake.getDeletedAtReturnsOnCall[len(fake.getDeletedAtArgsForCall)]
	fake.getDeletedAtArgsForCall = append(fake.getDeletedAtArgsForCall, struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 string
	}{arg1, arg2, arg3})
	stub := fake.GetDeletedAtStub
	fakeReturns := fake.getDeletedAtReturns
	fake.recordInvocation("GetDeletedAt", []interface{}{arg1, arg2, arg3})
	fake.getDeletedAtMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *CFSpaceRepository) GetDeletedAtCallCount() int {
	fake.getDeletedAtMutex.RLock()
	defer fake.getDeletedAtMutex.RUnlock()
	return len(fake.getDeletedAtArgsForCall)
}

func (fake *CFSpaceRepository) GetDeletedAtCalls(stub func(context.Context, authorization.Info, string) (*time.Time, error)) {
	fake.getDeletedAtMutex.Lock()
	defer fake.getDeletedAtMutex.Unlock()
	fake.GetDeletedAtStub = stub
}

func (fake *CFSpaceRepository) GetDeletedAtArgsForCall(i int) (context.Context, authorization.Info, string) {
	fake.getDeletedAtMutex.RLock()
	defer fake.getDeletedAtMutex.RUnlock()
	argsForCall := fake.getDeletedAtArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *CFSpaceRepository) GetDeletedAtReturns(result1 *time.Time, result2 error) {
	fake.getDeletedAtMutex.Lock()
	defer fake.getDeletedAtMutex.Unlock()
	fake.GetDeletedAtStub = nil
	fake.getDeletedAtReturns = struct {
		result1 *time.Time
		result2 error
	}{result1, result2}
}

func (fake *CFSpaceRepository) GetDeletedAtReturnsOnCall(i int, result1 *time.Time, result2 error) {
	fake.getDeletedAtMutex.Lock()
	defer fake.getDeletedAtMutex.Unlock()
	fake.GetDeletedAtStub = nil
	if fake.getDeletedAtReturnsOnCall == nil {
		fake.getDeletedAtReturnsOnCall = make(map[int]struct {
			result1 *time.Time
			result2 error
		})
	}
	fake.getDeletedAtReturnsOnCall[i] = struct {
		result1 *time.Time
		result2 error
	}{result1, result2}
}

func (fake *CFSpaceRepository) GetSpace(arg1 context.Context, arg2 authorization.Info, arg3 string) (repositories.SpaceRecord, error) {
	fake.getSpaceMutex.Lock()
	ret, specificReturn := fake.getSpaceReturnsOnCall[len(fake.getSpaceArgsForCall)]
	fake.getSpaceArgsForCall = append(fake.getSpaceArgsForCall, struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 string
	}{arg1, arg2, arg3})
	stub := fake.GetSpaceStub
	fakeReturns := fake.getSpaceReturns
	fake.recordInvocation("GetSpace", []interface{}{arg1, arg2, arg3})
	fake.getSpaceMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *CFSpaceRepository) GetSpaceCallCount() int {
	fake.getSpaceMutex.RLock()
	defer fake.getSpaceMutex.RUnlock()
	return len(fake.getSpaceArgsForCall)
}

func (fake *CFSpaceRepository) GetSpaceCalls(stub func(context.Context, authorization.Info, string) (repositories.SpaceRecord, error)) {
	fake.getSpaceMutex.Lock()
	defer fake.getSpaceMutex.Unlock()
	fake.GetSpaceStub = stub
}

func (fake *CFSpaceRepository) GetSpaceArgsForCall(i int) (context.Context, authorization.Info, string) {
	fake.getSpaceMutex.RLock()
	defer fake.getSpaceMutex.RUnlock()
	argsForCall := fake.getSpaceArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *CFSpaceRepository) GetSpaceReturns(result1 repositories.SpaceRecord, result2 error) {
	fake.getSpaceMutex.Lock()
	defer fake.getSpaceMutex.Unlock()
	fake.GetSpaceStub = nil
	fake.getSpaceReturns = struct {
		result1 repositories.SpaceRecord
		result2 error
	}{result1, result2}
}

func (fake *CFSpaceRepository) GetSpaceReturnsOnCall(i int, result1 repositories.SpaceRecord, result2 error) {
	fake.getSpaceMutex.Lock()
	defer fake.getSpaceMutex.Unlock()
	fake.GetSpaceStub = nil
	if fake.getSpaceReturnsOnCall == nil {
		fake.getSpaceReturnsOnCall = make(map[int]struct {
			result1 repositories.SpaceRecord
			result2 error
		})
	}
	fake.getSpaceReturnsOnCall[i] = struct {
		result1 repositories.SpaceRecord
		result2 error
	}{result1, result2}
}

func (fake *CFSpaceRepository) ListSpaces(arg1 context.Context, arg2 authorization.Info, arg3 repositories.ListSpacesMessage) (repositories.ListResult[repositories.SpaceRecord], error) {
	fake.listSpacesMutex.Lock()
	ret, specificReturn := fake.listSpacesReturnsOnCall[len(fake.listSpacesArgsForCall)]
	fake.listSpacesArgsForCall = append(fake.listSpacesArgsForCall, struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 repositories.ListSpacesMessage
	}{arg1, arg2, arg3})
	stub := fake.ListSpacesStub
	fakeReturns := fake.listSpacesReturns
	fake.recordInvocation("ListSpaces", []interface{}{arg1, arg2, arg3})
	fake.listSpacesMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *CFSpaceRepository) ListSpacesCallCount() int {
	fake.listSpacesMutex.RLock()
	defer fake.listSpacesMutex.RUnlock()
	return len(fake.listSpacesArgsForCall)
}

func (fake *CFSpaceRepository) ListSpacesCalls(stub func(context.Context, authorization.Info, repositories.ListSpacesMessage) (repositories.ListResult[repositories.SpaceRecord], error)) {
	fake.listSpacesMutex.Lock()
	defer fake.listSpacesMutex.Unlock()
	fake.ListSpacesStub = stub
}

func (fake *CFSpaceRepository) ListSpacesArgsForCall(i int) (context.Context, authorization.Info, repositories.ListSpacesMessage) {
	fake.listSpacesMutex.RLock()
	defer fake.listSpacesMutex.RUnlock()
	argsForCall := fake.listSpacesArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *CFSpaceRepository) ListSpacesReturns(result1 repositories.ListResult[repositories.SpaceRecord], result2 error) {
	fake.listSpacesMutex.Lock()
	defer fake.listSpacesMutex.Unlock()
	fake.ListSpacesStub = nil
	fake.listSpacesReturns = struct {
		result1 repositories.ListResult[repositories.SpaceRecord]
		result2 error
	}{result1, result2}
}

func (fake *CFSpaceRepository) ListSpacesReturnsOnCall(i int, result1 repositories.ListResult[repositories.SpaceRecord], result2 error) {
	fake.listSpacesMutex.Lock()
	defer fake.listSpacesMutex.Unlock()
	fake.ListSpacesStub = nil
	if fake.listSpacesReturnsOnCall == nil {
		fake.listSpacesReturnsOnCall = make(map[int]struct {
			result1 repositories.ListResult[repositories.SpaceRecord]
			result2 error
		})
	}
	fake.listSpacesReturnsOnCall[i] = struct {
		result1 repositories.ListResult[repositories.SpaceRecord]
		result2 error
	}{result1, result2}
}

func (fake *CFSpaceRepository) PatchSpaceMetadata(arg1 context.Context, arg2 authorization.Info, arg3 repositories.PatchSpaceMetadataMessage) (repositories.SpaceRecord, error) {
	fake.patchSpaceMetadataMutex.Lock()
	ret, specificReturn := fake.patchSpaceMetadataReturnsOnCall[len(fake.patchSpaceMetadataArgsForCall)]
	fake.patchSpaceMetadataArgsForCall = append(fake.patchSpaceMetadataArgsForCall, struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 repositories.PatchSpaceMetadataMessage
	}{arg1, arg2, arg3})
	stub := fake.PatchSpaceMetadataStub
	fakeReturns := fake.patchSpaceMetadataReturns
	fake.recordInvocation("PatchSpaceMetadata", []interface{}{arg1, arg2, arg3})
	fake.patchSpaceMetadataMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *CFSpaceRepository) PatchSpaceMetadataCallCount() int {
	fake.patchSpaceMetadataMutex.RLock()
	defer fake.patchSpaceMetadataMutex.RUnlock()
	return len(fake.patchSpaceMetadataArgsForCall)
}

func (fake *CFSpaceRepository) PatchSpaceMetadataCalls(stub func(context.Context, authorization.Info, repositories.PatchSpaceMetadataMessage) (repositories.SpaceRecord, error)) {
	fake.patchSpaceMetadataMutex.Lock()
	defer fake.patchSpaceMetadataMutex.Unlock()
	fake.PatchSpaceMetadataStub = stub
}

func (fake *CFSpaceRepository) PatchSpaceMetadataArgsForCall(i int) (context.Context, authorization.Info, repositories.PatchSpaceMetadataMessage) {
	fake.patchSpaceMetadataMutex.RLock()
	defer fake.patchSpaceMetadataMutex.RUnlock()
	argsForCall := fake.patchSpaceMetadataArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *CFSpaceRepository) PatchSpaceMetadataReturns(result1 repositories.SpaceRecord, result2 error) {
	fake.patchSpaceMetadataMutex.Lock()
	defer fake.patchSpaceMetadataMutex.Unlock()
	fake.PatchSpaceMetadataStub = nil
	fake.patchSpaceMetadataReturns = struct {
		result1 repositories.SpaceRecord
		result2 error
	}{result1, result2}
}

func (fake *CFSpaceRepository) PatchSpaceMetadataReturnsOnCall(i int, result1 repositories.SpaceRecord, result2 error) {
	fake.patchSpaceMetadataMutex.Lock()
	defer fake.patchSpaceMetadataMutex.Unlock()
	fake.PatchSpaceMetadataStub = nil
	if fake.patchSpaceMetadataReturnsOnCall == nil {
		fake.patchSpaceMetadataReturnsOnCall = make(map[int]struct {
			result1 repositories.SpaceRecord
			result2 error
		})
	}
	fake.patchSpaceMetadataReturnsOnCall[i] = struct {
		result1 repositories.SpaceRecord
		result2 error
	}{result1, result2}
}

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