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

import (
	"sync"

	"code.cloudfoundry.org/cli/cf/api/spaces"
	"code.cloudfoundry.org/cli/cf/models"
)

type FakeSpaceRepository struct {
	CreateStub        func(string, string, string) (models.Space, error)
	createMutex       sync.RWMutex
	createArgsForCall []struct {
		arg1 string
		arg2 string
		arg3 string
	}
	createReturns struct {
		result1 models.Space
		result2 error
	}
	createReturnsOnCall map[int]struct {
		result1 models.Space
		result2 error
	}
	DeleteStub        func(string) error
	deleteMutex       sync.RWMutex
	deleteArgsForCall []struct {
		arg1 string
	}
	deleteReturns struct {
		result1 error
	}
	deleteReturnsOnCall map[int]struct {
		result1 error
	}
	FindByNameStub        func(string) (models.Space, error)
	findByNameMutex       sync.RWMutex
	findByNameArgsForCall []struct {
		arg1 string
	}
	findByNameReturns struct {
		result1 models.Space
		result2 error
	}
	findByNameReturnsOnCall map[int]struct {
		result1 models.Space
		result2 error
	}
	FindByNameInOrgStub        func(string, string) (models.Space, error)
	findByNameInOrgMutex       sync.RWMutex
	findByNameInOrgArgsForCall []struct {
		arg1 string
		arg2 string
	}
	findByNameInOrgReturns struct {
		result1 models.Space
		result2 error
	}
	findByNameInOrgReturnsOnCall map[int]struct {
		result1 models.Space
		result2 error
	}
	ListSpacesStub        func(func(models.Space) bool) error
	listSpacesMutex       sync.RWMutex
	listSpacesArgsForCall []struct {
		arg1 func(models.Space) bool
	}
	listSpacesReturns struct {
		result1 error
	}
	listSpacesReturnsOnCall map[int]struct {
		result1 error
	}
	ListSpacesFromOrgStub        func(string, func(models.Space) bool) error
	listSpacesFromOrgMutex       sync.RWMutex
	listSpacesFromOrgArgsForCall []struct {
		arg1 string
		arg2 func(models.Space) bool
	}
	listSpacesFromOrgReturns struct {
		result1 error
	}
	listSpacesFromOrgReturnsOnCall map[int]struct {
		result1 error
	}
	RenameStub        func(string, string) error
	renameMutex       sync.RWMutex
	renameArgsForCall []struct {
		arg1 string
		arg2 string
	}
	renameReturns struct {
		result1 error
	}
	renameReturnsOnCall map[int]struct {
		result1 error
	}
	SetAllowSSHStub        func(string, bool) error
	setAllowSSHMutex       sync.RWMutex
	setAllowSSHArgsForCall []struct {
		arg1 string
		arg2 bool
	}
	setAllowSSHReturns struct {
		result1 error
	}
	setAllowSSHReturnsOnCall map[int]struct {
		result1 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeSpaceRepository) Create(arg1 string, arg2 string, arg3 string) (models.Space, error) {
	fake.createMutex.Lock()
	ret, specificReturn := fake.createReturnsOnCall[len(fake.createArgsForCall)]
	fake.createArgsForCall = append(fake.createArgsForCall, struct {
		arg1 string
		arg2 string
		arg3 string
	}{arg1, arg2, arg3})
	fake.recordInvocation("Create", []interface{}{arg1, arg2, arg3})
	fake.createMutex.Unlock()
	if fake.CreateStub != nil {
		return fake.CreateStub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	fakeReturns := fake.createReturns
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeSpaceRepository) CreateCallCount() int {
	fake.createMutex.RLock()
	defer fake.createMutex.RUnlock()
	return len(fake.createArgsForCall)
}

func (fake *FakeSpaceRepository) CreateCalls(stub func(string, string, string) (models.Space, error)) {
	fake.createMutex.Lock()
	defer fake.createMutex.Unlock()
	fake.CreateStub = stub
}

func (fake *FakeSpaceRepository) CreateArgsForCall(i int) (string, string, string) {
	fake.createMutex.RLock()
	defer fake.createMutex.RUnlock()
	argsForCall := fake.createArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *FakeSpaceRepository) CreateReturns(result1 models.Space, result2 error) {
	fake.createMutex.Lock()
	defer fake.createMutex.Unlock()
	fake.CreateStub = nil
	fake.createReturns = struct {
		result1 models.Space
		result2 error
	}{result1, result2}
}

func (fake *FakeSpaceRepository) CreateReturnsOnCall(i int, result1 models.Space, result2 error) {
	fake.createMutex.Lock()
	defer fake.createMutex.Unlock()
	fake.CreateStub = nil
	if fake.createReturnsOnCall == nil {
		fake.createReturnsOnCall = make(map[int]struct {
			result1 models.Space
			result2 error
		})
	}
	fake.createReturnsOnCall[i] = struct {
		result1 models.Space
		result2 error
	}{result1, result2}
}

func (fake *FakeSpaceRepository) Delete(arg1 string) error {
	fake.deleteMutex.Lock()
	ret, specificReturn := fake.deleteReturnsOnCall[len(fake.deleteArgsForCall)]
	fake.deleteArgsForCall = append(fake.deleteArgsForCall, struct {
		arg1 string
	}{arg1})
	fake.recordInvocation("Delete", []interface{}{arg1})
	fake.deleteMutex.Unlock()
	if fake.DeleteStub != nil {
		return fake.DeleteStub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	fakeReturns := fake.deleteReturns
	return fakeReturns.result1
}

func (fake *FakeSpaceRepository) DeleteCallCount() int {
	fake.deleteMutex.RLock()
	defer fake.deleteMutex.RUnlock()
	return len(fake.deleteArgsForCall)
}

func (fake *FakeSpaceRepository) DeleteCalls(stub func(string) error) {
	fake.deleteMutex.Lock()
	defer fake.deleteMutex.Unlock()
	fake.DeleteStub = stub
}

func (fake *FakeSpaceRepository) DeleteArgsForCall(i int) string {
	fake.deleteMutex.RLock()
	defer fake.deleteMutex.RUnlock()
	argsForCall := fake.deleteArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeSpaceRepository) DeleteReturns(result1 error) {
	fake.deleteMutex.Lock()
	defer fake.deleteMutex.Unlock()
	fake.DeleteStub = nil
	fake.deleteReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeSpaceRepository) DeleteReturnsOnCall(i int, result1 error) {
	fake.deleteMutex.Lock()
	defer fake.deleteMutex.Unlock()
	fake.DeleteStub = nil
	if fake.deleteReturnsOnCall == nil {
		fake.deleteReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.deleteReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeSpaceRepository) FindByName(arg1 string) (models.Space, error) {
	fake.findByNameMutex.Lock()
	ret, specificReturn := fake.findByNameReturnsOnCall[len(fake.findByNameArgsForCall)]
	fake.findByNameArgsForCall = append(fake.findByNameArgsForCall, struct {
		arg1 string
	}{arg1})
	fake.recordInvocation("FindByName", []interface{}{arg1})
	fake.findByNameMutex.Unlock()
	if fake.FindByNameStub != nil {
		return fake.FindByNameStub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	fakeReturns := fake.findByNameReturns
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeSpaceRepository) FindByNameCallCount() int {
	fake.findByNameMutex.RLock()
	defer fake.findByNameMutex.RUnlock()
	return len(fake.findByNameArgsForCall)
}

func (fake *FakeSpaceRepository) FindByNameCalls(stub func(string) (models.Space, error)) {
	fake.findByNameMutex.Lock()
	defer fake.findByNameMutex.Unlock()
	fake.FindByNameStub = stub
}

func (fake *FakeSpaceRepository) FindByNameArgsForCall(i int) string {
	fake.findByNameMutex.RLock()
	defer fake.findByNameMutex.RUnlock()
	argsForCall := fake.findByNameArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeSpaceRepository) FindByNameReturns(result1 models.Space, result2 error) {
	fake.findByNameMutex.Lock()
	defer fake.findByNameMutex.Unlock()
	fake.FindByNameStub = nil
	fake.findByNameReturns = struct {
		result1 models.Space
		result2 error
	}{result1, result2}
}

func (fake *FakeSpaceRepository) FindByNameReturnsOnCall(i int, result1 models.Space, result2 error) {
	fake.findByNameMutex.Lock()
	defer fake.findByNameMutex.Unlock()
	fake.FindByNameStub = nil
	if fake.findByNameReturnsOnCall == nil {
		fake.findByNameReturnsOnCall = make(map[int]struct {
			result1 models.Space
			result2 error
		})
	}
	fake.findByNameReturnsOnCall[i] = struct {
		result1 models.Space
		result2 error
	}{result1, result2}
}

func (fake *FakeSpaceRepository) FindByNameInOrg(arg1 string, arg2 string) (models.Space, error) {
	fake.findByNameInOrgMutex.Lock()
	ret, specificReturn := fake.findByNameInOrgReturnsOnCall[len(fake.findByNameInOrgArgsForCall)]
	fake.findByNameInOrgArgsForCall = append(fake.findByNameInOrgArgsForCall, struct {
		arg1 string
		arg2 string
	}{arg1, arg2})
	fake.recordInvocation("FindByNameInOrg", []interface{}{arg1, arg2})
	fake.findByNameInOrgMutex.Unlock()
	if fake.FindByNameInOrgStub != nil {
		return fake.FindByNameInOrgStub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	fakeReturns := fake.findByNameInOrgReturns
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeSpaceRepository) FindByNameInOrgCallCount() int {
	fake.findByNameInOrgMutex.RLock()
	defer fake.findByNameInOrgMutex.RUnlock()
	return len(fake.findByNameInOrgArgsForCall)
}

func (fake *FakeSpaceRepository) FindByNameInOrgCalls(stub func(string, string) (models.Space, error)) {
	fake.findByNameInOrgMutex.Lock()
	defer fake.findByNameInOrgMutex.Unlock()
	fake.FindByNameInOrgStub = stub
}

func (fake *FakeSpaceRepository) FindByNameInOrgArgsForCall(i int) (string, string) {
	fake.findByNameInOrgMutex.RLock()
	defer fake.findByNameInOrgMutex.RUnlock()
	argsForCall := fake.findByNameInOrgArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeSpaceRepository) FindByNameInOrgReturns(result1 models.Space, result2 error) {
	fake.findByNameInOrgMutex.Lock()
	defer fake.findByNameInOrgMutex.Unlock()
	fake.FindByNameInOrgStub = nil
	fake.findByNameInOrgReturns = struct {
		result1 models.Space
		result2 error
	}{result1, result2}
}

func (fake *FakeSpaceRepository) FindByNameInOrgReturnsOnCall(i int, result1 models.Space, result2 error) {
	fake.findByNameInOrgMutex.Lock()
	defer fake.findByNameInOrgMutex.Unlock()
	fake.FindByNameInOrgStub = nil
	if fake.findByNameInOrgReturnsOnCall == nil {
		fake.findByNameInOrgReturnsOnCall = make(map[int]struct {
			result1 models.Space
			result2 error
		})
	}
	fake.findByNameInOrgReturnsOnCall[i] = struct {
		result1 models.Space
		result2 error
	}{result1, result2}
}

func (fake *FakeSpaceRepository) ListSpaces(arg1 func(models.Space) bool) error {
	fake.listSpacesMutex.Lock()
	ret, specificReturn := fake.listSpacesReturnsOnCall[len(fake.listSpacesArgsForCall)]
	fake.listSpacesArgsForCall = append(fake.listSpacesArgsForCall, struct {
		arg1 func(models.Space) bool
	}{arg1})
	fake.recordInvocation("ListSpaces", []interface{}{arg1})
	fake.listSpacesMutex.Unlock()
	if fake.ListSpacesStub != nil {
		return fake.ListSpacesStub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	fakeReturns := fake.listSpacesReturns
	return fakeReturns.result1
}

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

func (fake *FakeSpaceRepository) ListSpacesCalls(stub func(func(models.Space) bool) error) {
	fake.listSpacesMutex.Lock()
	defer fake.listSpacesMutex.Unlock()
	fake.ListSpacesStub = stub
}

func (fake *FakeSpaceRepository) ListSpacesArgsForCall(i int) func(models.Space) bool {
	fake.listSpacesMutex.RLock()
	defer fake.listSpacesMutex.RUnlock()
	argsForCall := fake.listSpacesArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeSpaceRepository) ListSpacesReturns(result1 error) {
	fake.listSpacesMutex.Lock()
	defer fake.listSpacesMutex.Unlock()
	fake.ListSpacesStub = nil
	fake.listSpacesReturns = struct {
		result1 error
	}{result1}
}

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

func (fake *FakeSpaceRepository) ListSpacesFromOrg(arg1 string, arg2 func(models.Space) bool) error {
	fake.listSpacesFromOrgMutex.Lock()
	ret, specificReturn := fake.listSpacesFromOrgReturnsOnCall[len(fake.listSpacesFromOrgArgsForCall)]
	fake.listSpacesFromOrgArgsForCall = append(fake.listSpacesFromOrgArgsForCall, struct {
		arg1 string
		arg2 func(models.Space) bool
	}{arg1, arg2})
	fake.recordInvocation("ListSpacesFromOrg", []interface{}{arg1, arg2})
	fake.listSpacesFromOrgMutex.Unlock()
	if fake.ListSpacesFromOrgStub != nil {
		return fake.ListSpacesFromOrgStub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	fakeReturns := fake.listSpacesFromOrgReturns
	return fakeReturns.result1
}

func (fake *FakeSpaceRepository) ListSpacesFromOrgCallCount() int {
	fake.listSpacesFromOrgMutex.RLock()
	defer fake.listSpacesFromOrgMutex.RUnlock()
	return len(fake.listSpacesFromOrgArgsForCall)
}

func (fake *FakeSpaceRepository) ListSpacesFromOrgCalls(stub func(string, func(models.Space) bool) error) {
	fake.listSpacesFromOrgMutex.Lock()
	defer fake.listSpacesFromOrgMutex.Unlock()
	fake.ListSpacesFromOrgStub = stub
}

func (fake *FakeSpaceRepository) ListSpacesFromOrgArgsForCall(i int) (string, func(models.Space) bool) {
	fake.listSpacesFromOrgMutex.RLock()
	defer fake.listSpacesFromOrgMutex.RUnlock()
	argsForCall := fake.listSpacesFromOrgArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeSpaceRepository) ListSpacesFromOrgReturns(result1 error) {
	fake.listSpacesFromOrgMutex.Lock()
	defer fake.listSpacesFromOrgMutex.Unlock()
	fake.ListSpacesFromOrgStub = nil
	fake.listSpacesFromOrgReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeSpaceRepository) ListSpacesFromOrgReturnsOnCall(i int, result1 error) {
	fake.listSpacesFromOrgMutex.Lock()
	defer fake.listSpacesFromOrgMutex.Unlock()
	fake.ListSpacesFromOrgStub = nil
	if fake.listSpacesFromOrgReturnsOnCall == nil {
		fake.listSpacesFromOrgReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.listSpacesFromOrgReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeSpaceRepository) Rename(arg1 string, arg2 string) error {
	fake.renameMutex.Lock()
	ret, specificReturn := fake.renameReturnsOnCall[len(fake.renameArgsForCall)]
	fake.renameArgsForCall = append(fake.renameArgsForCall, struct {
		arg1 string
		arg2 string
	}{arg1, arg2})
	fake.recordInvocation("Rename", []interface{}{arg1, arg2})
	fake.renameMutex.Unlock()
	if fake.RenameStub != nil {
		return fake.RenameStub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	fakeReturns := fake.renameReturns
	return fakeReturns.result1
}

func (fake *FakeSpaceRepository) RenameCallCount() int {
	fake.renameMutex.RLock()
	defer fake.renameMutex.RUnlock()
	return len(fake.renameArgsForCall)
}

func (fake *FakeSpaceRepository) RenameCalls(stub func(string, string) error) {
	fake.renameMutex.Lock()
	defer fake.renameMutex.Unlock()
	fake.RenameStub = stub
}

func (fake *FakeSpaceRepository) RenameArgsForCall(i int) (string, string) {
	fake.renameMutex.RLock()
	defer fake.renameMutex.RUnlock()
	argsForCall := fake.renameArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeSpaceRepository) RenameReturns(result1 error) {
	fake.renameMutex.Lock()
	defer fake.renameMutex.Unlock()
	fake.RenameStub = nil
	fake.renameReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeSpaceRepository) RenameReturnsOnCall(i int, result1 error) {
	fake.renameMutex.Lock()
	defer fake.renameMutex.Unlock()
	fake.RenameStub = nil
	if fake.renameReturnsOnCall == nil {
		fake.renameReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.renameReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeSpaceRepository) SetAllowSSH(arg1 string, arg2 bool) error {
	fake.setAllowSSHMutex.Lock()
	ret, specificReturn := fake.setAllowSSHReturnsOnCall[len(fake.setAllowSSHArgsForCall)]
	fake.setAllowSSHArgsForCall = append(fake.setAllowSSHArgsForCall, struct {
		arg1 string
		arg2 bool
	}{arg1, arg2})
	fake.recordInvocation("SetAllowSSH", []interface{}{arg1, arg2})
	fake.setAllowSSHMutex.Unlock()
	if fake.SetAllowSSHStub != nil {
		return fake.SetAllowSSHStub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	fakeReturns := fake.setAllowSSHReturns
	return fakeReturns.result1
}

func (fake *FakeSpaceRepository) SetAllowSSHCallCount() int {
	fake.setAllowSSHMutex.RLock()
	defer fake.setAllowSSHMutex.RUnlock()
	return len(fake.setAllowSSHArgsForCall)
}

func (fake *FakeSpaceRepository) SetAllowSSHCalls(stub func(string, bool) error) {
	fake.setAllowSSHMutex.Lock()
	defer fake.setAllowSSHMutex.Unlock()
	fake.SetAllowSSHStub = stub
}

func (fake *FakeSpaceRepository) SetAllowSSHArgsForCall(i int) (string, bool) {
	fake.setAllowSSHMutex.RLock()
	defer fake.setAllowSSHMutex.RUnlock()
	argsForCall := fake.setAllowSSHArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeSpaceRepository) SetAllowSSHReturns(result1 error) {
	fake.setAllowSSHMutex.Lock()
	defer fake.setAllowSSHMutex.Unlock()
	fake.SetAllowSSHStub = nil
	fake.setAllowSSHReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeSpaceRepository) SetAllowSSHReturnsOnCall(i int, result1 error) {
	fake.setAllowSSHMutex.Lock()
	defer fake.setAllowSSHMutex.Unlock()
	fake.SetAllowSSHStub = nil
	if fake.setAllowSSHReturnsOnCall == nil {
		fake.setAllowSSHReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.setAllowSSHReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeSpaceRepository) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	fake.createMutex.RLock()
	defer fake.createMutex.RUnlock()
	fake.deleteMutex.RLock()
	defer fake.deleteMutex.RUnlock()
	fake.findByNameMutex.RLock()
	defer fake.findByNameMutex.RUnlock()
	fake.findByNameInOrgMutex.RLock()
	defer fake.findByNameInOrgMutex.RUnlock()
	fake.listSpacesMutex.RLock()
	defer fake.listSpacesMutex.RUnlock()
	fake.listSpacesFromOrgMutex.RLock()
	defer fake.listSpacesFromOrgMutex.RUnlock()
	fake.renameMutex.RLock()
	defer fake.renameMutex.RUnlock()
	fake.setAllowSSHMutex.RLock()
	defer fake.setAllowSSHMutex.RUnlock()
	copiedInvocations := map[string][][]interface{}{}
	for key, value := range fake.invocations {
		copiedInvocations[key] = value
	}
	return copiedInvocations
}

func (fake *FakeSpaceRepository) 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 _ spaces.SpaceRepository = new(FakeSpaceRepository)
