package dbfakes

import (
	"sync"

	"code.cloudfoundry.org/lager"
	"github.com/cloudfoundry-community/vps/db"
	"github.com/cloudfoundry-community/vps/generated/models"
)

type FakeVirtualGuestDB struct {
	VirtualGuestsStub        func(logger lager.Logger, filter models.VMFilter) ([]*models.VM, error)
	virtualGuestsMutex       sync.RWMutex
	virtualGuestsArgsForCall []struct {
		logger lager.Logger
		filter models.VMFilter
	}
	virtualGuestsReturns struct {
		result1 []*models.VM
		result2 error
	}
	OrderVirtualGuestToProvisionStub        func(logger lager.Logger, filter models.VMFilter) (*models.VM, error)
	orderVirtualGuestToProvisionMutex       sync.RWMutex
	orderVirtualGuestToProvisionArgsForCall []struct {
		logger lager.Logger
		filter models.VMFilter
	}
	orderVirtualGuestToProvisionReturns struct {
		result1 *models.VM
		result2 error
	}
	VirtualGuestsByStatesStub        func(logger lager.Logger, states []string) ([]*models.VM, error)
	virtualGuestsByStatesMutex       sync.RWMutex
	virtualGuestsByStatesArgsForCall []struct {
		logger lager.Logger
		states []string
	}
	virtualGuestsByStatesReturns struct {
		result1 []*models.VM
		result2 error
	}
	VirtualGuestsByDeploymentsStub        func(logger lager.Logger, names []string) ([]*models.VM, error)
	virtualGuestsByDeploymentsMutex       sync.RWMutex
	virtualGuestsByDeploymentsArgsForCall []struct {
		logger lager.Logger
		names  []string
	}
	virtualGuestsByDeploymentsReturns struct {
		result1 []*models.VM
		result2 error
	}
	VirtualGuestByCIDStub        func(logger lager.Logger, cid int32) (*models.VM, error)
	virtualGuestByCIDMutex       sync.RWMutex
	virtualGuestByCIDArgsForCall []struct {
		logger lager.Logger
		cid    int32
	}
	virtualGuestByCIDReturns struct {
		result1 *models.VM
		result2 error
	}
	VirtualGuestByIPStub        func(logger lager.Logger, ip string) (*models.VM, error)
	virtualGuestByIPMutex       sync.RWMutex
	virtualGuestByIPArgsForCall []struct {
		logger lager.Logger
		ip     string
	}
	virtualGuestByIPReturns struct {
		result1 *models.VM
		result2 error
	}
	InsertVirtualGuestToPoolStub        func(logger lager.Logger, virtualGuest *models.VM) error
	insertVirtualGuestToPoolMutex       sync.RWMutex
	insertVirtualGuestToPoolArgsForCall []struct {
		logger       lager.Logger
		virtualGuest *models.VM
	}
	insertVirtualGuestToPoolReturns struct {
		result1 error
	}
	UpdateVirtualGuestInPoolStub        func(logger lager.Logger, virtualGuest *models.VM) error
	updateVirtualGuestInPoolMutex       sync.RWMutex
	updateVirtualGuestInPoolArgsForCall []struct {
		logger       lager.Logger
		virtualGuest *models.VM
	}
	updateVirtualGuestInPoolReturns struct {
		result1 error
	}
	ChangeVirtualGuestToProvisionStub        func(logger lager.Logger, cid int32) error
	changeVirtualGuestToProvisionMutex       sync.RWMutex
	changeVirtualGuestToProvisionArgsForCall []struct {
		logger lager.Logger
		cid    int32
	}
	changeVirtualGuestToProvisionReturns struct {
		result1 error
	}
	ChangeVirtualGuestToUseStub        func(logger lager.Logger, cid int32) error
	changeVirtualGuestToUseMutex       sync.RWMutex
	changeVirtualGuestToUseArgsForCall []struct {
		logger lager.Logger
		cid    int32
	}
	changeVirtualGuestToUseReturns struct {
		result1 error
	}
	ChangeVirtualGuestToFreeStub        func(logger lager.Logger, cid int32) error
	changeVirtualGuestToFreeMutex       sync.RWMutex
	changeVirtualGuestToFreeArgsForCall []struct {
		logger lager.Logger
		cid    int32
	}
	changeVirtualGuestToFreeReturns struct {
		result1 error
	}
	DeleteVirtualGuestFromPoolStub        func(logger lager.Logger, cid int32) error
	deleteVirtualGuestFromPoolMutex       sync.RWMutex
	deleteVirtualGuestFromPoolArgsForCall []struct {
		logger lager.Logger
		cid    int32
	}
	deleteVirtualGuestFromPoolReturns struct {
		result1 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeVirtualGuestDB) VirtualGuests(logger lager.Logger, filter models.VMFilter) ([]*models.VM, error) {
	fake.virtualGuestsMutex.Lock()
	fake.virtualGuestsArgsForCall = append(fake.virtualGuestsArgsForCall, struct {
		logger lager.Logger
		filter models.VMFilter
	}{logger, filter})
	fake.recordInvocation("VirtualGuests", []interface{}{logger, filter})
	fake.virtualGuestsMutex.Unlock()
	if fake.VirtualGuestsStub != nil {
		return fake.VirtualGuestsStub(logger, filter)
	} else {
		return fake.virtualGuestsReturns.result1, fake.virtualGuestsReturns.result2
	}
}

func (fake *FakeVirtualGuestDB) VirtualGuestsCallCount() int {
	fake.virtualGuestsMutex.RLock()
	defer fake.virtualGuestsMutex.RUnlock()
	return len(fake.virtualGuestsArgsForCall)
}

func (fake *FakeVirtualGuestDB) VirtualGuestsArgsForCall(i int) (lager.Logger, models.VMFilter) {
	fake.virtualGuestsMutex.RLock()
	defer fake.virtualGuestsMutex.RUnlock()
	return fake.virtualGuestsArgsForCall[i].logger, fake.virtualGuestsArgsForCall[i].filter
}

func (fake *FakeVirtualGuestDB) VirtualGuestsReturns(result1 []*models.VM, result2 error) {
	fake.VirtualGuestsStub = nil
	fake.virtualGuestsReturns = struct {
		result1 []*models.VM
		result2 error
	}{result1, result2}
}

func (fake *FakeVirtualGuestDB) OrderVirtualGuestToProvision(logger lager.Logger, filter models.VMFilter) (*models.VM, error) {
	fake.orderVirtualGuestToProvisionMutex.Lock()
	fake.orderVirtualGuestToProvisionArgsForCall = append(fake.orderVirtualGuestToProvisionArgsForCall, struct {
		logger lager.Logger
		filter models.VMFilter
	}{logger, filter})
	fake.recordInvocation("OrderVirtualGuestToProvision", []interface{}{logger, filter})
	fake.orderVirtualGuestToProvisionMutex.Unlock()
	if fake.OrderVirtualGuestToProvisionStub != nil {
		return fake.OrderVirtualGuestToProvisionStub(logger, filter)
	} else {
		return fake.orderVirtualGuestToProvisionReturns.result1, fake.orderVirtualGuestToProvisionReturns.result2
	}
}

func (fake *FakeVirtualGuestDB) OrderVirtualGuestToProvisionCallCount() int {
	fake.orderVirtualGuestToProvisionMutex.RLock()
	defer fake.orderVirtualGuestToProvisionMutex.RUnlock()
	return len(fake.orderVirtualGuestToProvisionArgsForCall)
}

func (fake *FakeVirtualGuestDB) OrderVirtualGuestToProvisionArgsForCall(i int) (lager.Logger, models.VMFilter) {
	fake.orderVirtualGuestToProvisionMutex.RLock()
	defer fake.orderVirtualGuestToProvisionMutex.RUnlock()
	return fake.orderVirtualGuestToProvisionArgsForCall[i].logger, fake.orderVirtualGuestToProvisionArgsForCall[i].filter
}

func (fake *FakeVirtualGuestDB) OrderVirtualGuestToProvisionReturns(result1 *models.VM, result2 error) {
	fake.OrderVirtualGuestToProvisionStub = nil
	fake.orderVirtualGuestToProvisionReturns = struct {
		result1 *models.VM
		result2 error
	}{result1, result2}
}

func (fake *FakeVirtualGuestDB) VirtualGuestsByStates(logger lager.Logger, states []string) ([]*models.VM, error) {
	var statesCopy []string
	if states != nil {
		statesCopy = make([]string, len(states))
		copy(statesCopy, states)
	}
	fake.virtualGuestsByStatesMutex.Lock()
	fake.virtualGuestsByStatesArgsForCall = append(fake.virtualGuestsByStatesArgsForCall, struct {
		logger lager.Logger
		states []string
	}{logger, statesCopy})
	fake.recordInvocation("VirtualGuestsByStates", []interface{}{logger, statesCopy})
	fake.virtualGuestsByStatesMutex.Unlock()
	if fake.VirtualGuestsByStatesStub != nil {
		return fake.VirtualGuestsByStatesStub(logger, states)
	} else {
		return fake.virtualGuestsByStatesReturns.result1, fake.virtualGuestsByStatesReturns.result2
	}
}

func (fake *FakeVirtualGuestDB) VirtualGuestsByStatesCallCount() int {
	fake.virtualGuestsByStatesMutex.RLock()
	defer fake.virtualGuestsByStatesMutex.RUnlock()
	return len(fake.virtualGuestsByStatesArgsForCall)
}

func (fake *FakeVirtualGuestDB) VirtualGuestsByStatesArgsForCall(i int) (lager.Logger, []string) {
	fake.virtualGuestsByStatesMutex.RLock()
	defer fake.virtualGuestsByStatesMutex.RUnlock()
	return fake.virtualGuestsByStatesArgsForCall[i].logger, fake.virtualGuestsByStatesArgsForCall[i].states
}

func (fake *FakeVirtualGuestDB) VirtualGuestsByStatesReturns(result1 []*models.VM, result2 error) {
	fake.VirtualGuestsByStatesStub = nil
	fake.virtualGuestsByStatesReturns = struct {
		result1 []*models.VM
		result2 error
	}{result1, result2}
}

func (fake *FakeVirtualGuestDB) VirtualGuestsByDeployments(logger lager.Logger, names []string) ([]*models.VM, error) {
	var namesCopy []string
	if names != nil {
		namesCopy = make([]string, len(names))
		copy(namesCopy, names)
	}
	fake.virtualGuestsByDeploymentsMutex.Lock()
	fake.virtualGuestsByDeploymentsArgsForCall = append(fake.virtualGuestsByDeploymentsArgsForCall, struct {
		logger lager.Logger
		names  []string
	}{logger, namesCopy})
	fake.recordInvocation("VirtualGuestsByDeployments", []interface{}{logger, namesCopy})
	fake.virtualGuestsByDeploymentsMutex.Unlock()
	if fake.VirtualGuestsByDeploymentsStub != nil {
		return fake.VirtualGuestsByDeploymentsStub(logger, names)
	} else {
		return fake.virtualGuestsByDeploymentsReturns.result1, fake.virtualGuestsByDeploymentsReturns.result2
	}
}

func (fake *FakeVirtualGuestDB) VirtualGuestsByDeploymentsCallCount() int {
	fake.virtualGuestsByDeploymentsMutex.RLock()
	defer fake.virtualGuestsByDeploymentsMutex.RUnlock()
	return len(fake.virtualGuestsByDeploymentsArgsForCall)
}

func (fake *FakeVirtualGuestDB) VirtualGuestsByDeploymentsArgsForCall(i int) (lager.Logger, []string) {
	fake.virtualGuestsByDeploymentsMutex.RLock()
	defer fake.virtualGuestsByDeploymentsMutex.RUnlock()
	return fake.virtualGuestsByDeploymentsArgsForCall[i].logger, fake.virtualGuestsByDeploymentsArgsForCall[i].names
}

func (fake *FakeVirtualGuestDB) VirtualGuestsByDeploymentsReturns(result1 []*models.VM, result2 error) {
	fake.VirtualGuestsByDeploymentsStub = nil
	fake.virtualGuestsByDeploymentsReturns = struct {
		result1 []*models.VM
		result2 error
	}{result1, result2}
}

func (fake *FakeVirtualGuestDB) VirtualGuestByCID(logger lager.Logger, cid int32) (*models.VM, error) {
	fake.virtualGuestByCIDMutex.Lock()
	fake.virtualGuestByCIDArgsForCall = append(fake.virtualGuestByCIDArgsForCall, struct {
		logger lager.Logger
		cid    int32
	}{logger, cid})
	fake.recordInvocation("VirtualGuestByCID", []interface{}{logger, cid})
	fake.virtualGuestByCIDMutex.Unlock()
	if fake.VirtualGuestByCIDStub != nil {
		return fake.VirtualGuestByCIDStub(logger, cid)
	} else {
		return fake.virtualGuestByCIDReturns.result1, fake.virtualGuestByCIDReturns.result2
	}
}

func (fake *FakeVirtualGuestDB) VirtualGuestByCIDCallCount() int {
	fake.virtualGuestByCIDMutex.RLock()
	defer fake.virtualGuestByCIDMutex.RUnlock()
	return len(fake.virtualGuestByCIDArgsForCall)
}

func (fake *FakeVirtualGuestDB) VirtualGuestByCIDArgsForCall(i int) (lager.Logger, int32) {
	fake.virtualGuestByCIDMutex.RLock()
	defer fake.virtualGuestByCIDMutex.RUnlock()
	return fake.virtualGuestByCIDArgsForCall[i].logger, fake.virtualGuestByCIDArgsForCall[i].cid
}

func (fake *FakeVirtualGuestDB) VirtualGuestByCIDReturns(result1 *models.VM, result2 error) {
	fake.VirtualGuestByCIDStub = nil
	fake.virtualGuestByCIDReturns = struct {
		result1 *models.VM
		result2 error
	}{result1, result2}
}

func (fake *FakeVirtualGuestDB) VirtualGuestByIP(logger lager.Logger, ip string) (*models.VM, error) {
	fake.virtualGuestByIPMutex.Lock()
	fake.virtualGuestByIPArgsForCall = append(fake.virtualGuestByIPArgsForCall, struct {
		logger lager.Logger
		ip     string
	}{logger, ip})
	fake.recordInvocation("VirtualGuestByIP", []interface{}{logger, ip})
	fake.virtualGuestByIPMutex.Unlock()
	if fake.VirtualGuestByIPStub != nil {
		return fake.VirtualGuestByIPStub(logger, ip)
	} else {
		return fake.virtualGuestByIPReturns.result1, fake.virtualGuestByIPReturns.result2
	}
}

func (fake *FakeVirtualGuestDB) VirtualGuestByIPCallCount() int {
	fake.virtualGuestByIPMutex.RLock()
	defer fake.virtualGuestByIPMutex.RUnlock()
	return len(fake.virtualGuestByIPArgsForCall)
}

func (fake *FakeVirtualGuestDB) VirtualGuestByIPArgsForCall(i int) (lager.Logger, string) {
	fake.virtualGuestByIPMutex.RLock()
	defer fake.virtualGuestByIPMutex.RUnlock()
	return fake.virtualGuestByIPArgsForCall[i].logger, fake.virtualGuestByIPArgsForCall[i].ip
}

func (fake *FakeVirtualGuestDB) VirtualGuestByIPReturns(result1 *models.VM, result2 error) {
	fake.VirtualGuestByIPStub = nil
	fake.virtualGuestByIPReturns = struct {
		result1 *models.VM
		result2 error
	}{result1, result2}
}

func (fake *FakeVirtualGuestDB) InsertVirtualGuestToPool(logger lager.Logger, virtualGuest *models.VM) error {
	fake.insertVirtualGuestToPoolMutex.Lock()
	fake.insertVirtualGuestToPoolArgsForCall = append(fake.insertVirtualGuestToPoolArgsForCall, struct {
		logger       lager.Logger
		virtualGuest *models.VM
	}{logger, virtualGuest})
	fake.recordInvocation("InsertVirtualGuestToPool", []interface{}{logger, virtualGuest})
	fake.insertVirtualGuestToPoolMutex.Unlock()
	if fake.InsertVirtualGuestToPoolStub != nil {
		return fake.InsertVirtualGuestToPoolStub(logger, virtualGuest)
	} else {
		return fake.insertVirtualGuestToPoolReturns.result1
	}
}

func (fake *FakeVirtualGuestDB) InsertVirtualGuestToPoolCallCount() int {
	fake.insertVirtualGuestToPoolMutex.RLock()
	defer fake.insertVirtualGuestToPoolMutex.RUnlock()
	return len(fake.insertVirtualGuestToPoolArgsForCall)
}

func (fake *FakeVirtualGuestDB) InsertVirtualGuestToPoolArgsForCall(i int) (lager.Logger, *models.VM) {
	fake.insertVirtualGuestToPoolMutex.RLock()
	defer fake.insertVirtualGuestToPoolMutex.RUnlock()
	return fake.insertVirtualGuestToPoolArgsForCall[i].logger, fake.insertVirtualGuestToPoolArgsForCall[i].virtualGuest
}

func (fake *FakeVirtualGuestDB) InsertVirtualGuestToPoolReturns(result1 error) {
	fake.InsertVirtualGuestToPoolStub = nil
	fake.insertVirtualGuestToPoolReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeVirtualGuestDB) UpdateVirtualGuestInPool(logger lager.Logger, virtualGuest *models.VM) error {
	fake.updateVirtualGuestInPoolMutex.Lock()
	fake.updateVirtualGuestInPoolArgsForCall = append(fake.updateVirtualGuestInPoolArgsForCall, struct {
		logger       lager.Logger
		virtualGuest *models.VM
	}{logger, virtualGuest})
	fake.recordInvocation("UpdateVirtualGuestInPool", []interface{}{logger, virtualGuest})
	fake.updateVirtualGuestInPoolMutex.Unlock()
	if fake.UpdateVirtualGuestInPoolStub != nil {
		return fake.UpdateVirtualGuestInPoolStub(logger, virtualGuest)
	} else {
		return fake.updateVirtualGuestInPoolReturns.result1
	}
}

func (fake *FakeVirtualGuestDB) UpdateVirtualGuestInPoolCallCount() int {
	fake.updateVirtualGuestInPoolMutex.RLock()
	defer fake.updateVirtualGuestInPoolMutex.RUnlock()
	return len(fake.updateVirtualGuestInPoolArgsForCall)
}

func (fake *FakeVirtualGuestDB) UpdateVirtualGuestInPoolArgsForCall(i int) (lager.Logger, *models.VM) {
	fake.updateVirtualGuestInPoolMutex.RLock()
	defer fake.updateVirtualGuestInPoolMutex.RUnlock()
	return fake.updateVirtualGuestInPoolArgsForCall[i].logger, fake.updateVirtualGuestInPoolArgsForCall[i].virtualGuest
}

func (fake *FakeVirtualGuestDB) UpdateVirtualGuestInPoolReturns(result1 error) {
	fake.UpdateVirtualGuestInPoolStub = nil
	fake.updateVirtualGuestInPoolReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeVirtualGuestDB) ChangeVirtualGuestToProvision(logger lager.Logger, cid int32) error {
	fake.changeVirtualGuestToProvisionMutex.Lock()
	fake.changeVirtualGuestToProvisionArgsForCall = append(fake.changeVirtualGuestToProvisionArgsForCall, struct {
		logger lager.Logger
		cid    int32
	}{logger, cid})
	fake.recordInvocation("ChangeVirtualGuestToProvision", []interface{}{logger, cid})
	fake.changeVirtualGuestToProvisionMutex.Unlock()
	if fake.ChangeVirtualGuestToProvisionStub != nil {
		return fake.ChangeVirtualGuestToProvisionStub(logger, cid)
	} else {
		return fake.changeVirtualGuestToProvisionReturns.result1
	}
}

func (fake *FakeVirtualGuestDB) ChangeVirtualGuestToProvisionCallCount() int {
	fake.changeVirtualGuestToProvisionMutex.RLock()
	defer fake.changeVirtualGuestToProvisionMutex.RUnlock()
	return len(fake.changeVirtualGuestToProvisionArgsForCall)
}

func (fake *FakeVirtualGuestDB) ChangeVirtualGuestToProvisionArgsForCall(i int) (lager.Logger, int32) {
	fake.changeVirtualGuestToProvisionMutex.RLock()
	defer fake.changeVirtualGuestToProvisionMutex.RUnlock()
	return fake.changeVirtualGuestToProvisionArgsForCall[i].logger, fake.changeVirtualGuestToProvisionArgsForCall[i].cid
}

func (fake *FakeVirtualGuestDB) ChangeVirtualGuestToProvisionReturns(result1 error) {
	fake.ChangeVirtualGuestToProvisionStub = nil
	fake.changeVirtualGuestToProvisionReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeVirtualGuestDB) ChangeVirtualGuestToUse(logger lager.Logger, cid int32) error {
	fake.changeVirtualGuestToUseMutex.Lock()
	fake.changeVirtualGuestToUseArgsForCall = append(fake.changeVirtualGuestToUseArgsForCall, struct {
		logger lager.Logger
		cid    int32
	}{logger, cid})
	fake.recordInvocation("ChangeVirtualGuestToUse", []interface{}{logger, cid})
	fake.changeVirtualGuestToUseMutex.Unlock()
	if fake.ChangeVirtualGuestToUseStub != nil {
		return fake.ChangeVirtualGuestToUseStub(logger, cid)
	} else {
		return fake.changeVirtualGuestToUseReturns.result1
	}
}

func (fake *FakeVirtualGuestDB) ChangeVirtualGuestToUseCallCount() int {
	fake.changeVirtualGuestToUseMutex.RLock()
	defer fake.changeVirtualGuestToUseMutex.RUnlock()
	return len(fake.changeVirtualGuestToUseArgsForCall)
}

func (fake *FakeVirtualGuestDB) ChangeVirtualGuestToUseArgsForCall(i int) (lager.Logger, int32) {
	fake.changeVirtualGuestToUseMutex.RLock()
	defer fake.changeVirtualGuestToUseMutex.RUnlock()
	return fake.changeVirtualGuestToUseArgsForCall[i].logger, fake.changeVirtualGuestToUseArgsForCall[i].cid
}

func (fake *FakeVirtualGuestDB) ChangeVirtualGuestToUseReturns(result1 error) {
	fake.ChangeVirtualGuestToUseStub = nil
	fake.changeVirtualGuestToUseReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeVirtualGuestDB) ChangeVirtualGuestToFree(logger lager.Logger, cid int32) error {
	fake.changeVirtualGuestToFreeMutex.Lock()
	fake.changeVirtualGuestToFreeArgsForCall = append(fake.changeVirtualGuestToFreeArgsForCall, struct {
		logger lager.Logger
		cid    int32
	}{logger, cid})
	fake.recordInvocation("ChangeVirtualGuestToFree", []interface{}{logger, cid})
	fake.changeVirtualGuestToFreeMutex.Unlock()
	if fake.ChangeVirtualGuestToFreeStub != nil {
		return fake.ChangeVirtualGuestToFreeStub(logger, cid)
	} else {
		return fake.changeVirtualGuestToFreeReturns.result1
	}
}

func (fake *FakeVirtualGuestDB) ChangeVirtualGuestToFreeCallCount() int {
	fake.changeVirtualGuestToFreeMutex.RLock()
	defer fake.changeVirtualGuestToFreeMutex.RUnlock()
	return len(fake.changeVirtualGuestToFreeArgsForCall)
}

func (fake *FakeVirtualGuestDB) ChangeVirtualGuestToFreeArgsForCall(i int) (lager.Logger, int32) {
	fake.changeVirtualGuestToFreeMutex.RLock()
	defer fake.changeVirtualGuestToFreeMutex.RUnlock()
	return fake.changeVirtualGuestToFreeArgsForCall[i].logger, fake.changeVirtualGuestToFreeArgsForCall[i].cid
}

func (fake *FakeVirtualGuestDB) ChangeVirtualGuestToFreeReturns(result1 error) {
	fake.ChangeVirtualGuestToFreeStub = nil
	fake.changeVirtualGuestToFreeReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeVirtualGuestDB) DeleteVirtualGuestFromPool(logger lager.Logger, cid int32) error {
	fake.deleteVirtualGuestFromPoolMutex.Lock()
	fake.deleteVirtualGuestFromPoolArgsForCall = append(fake.deleteVirtualGuestFromPoolArgsForCall, struct {
		logger lager.Logger
		cid    int32
	}{logger, cid})
	fake.recordInvocation("DeleteVirtualGuestFromPool", []interface{}{logger, cid})
	fake.deleteVirtualGuestFromPoolMutex.Unlock()
	if fake.DeleteVirtualGuestFromPoolStub != nil {
		return fake.DeleteVirtualGuestFromPoolStub(logger, cid)
	} else {
		return fake.deleteVirtualGuestFromPoolReturns.result1
	}
}

func (fake *FakeVirtualGuestDB) DeleteVirtualGuestFromPoolCallCount() int {
	fake.deleteVirtualGuestFromPoolMutex.RLock()
	defer fake.deleteVirtualGuestFromPoolMutex.RUnlock()
	return len(fake.deleteVirtualGuestFromPoolArgsForCall)
}

func (fake *FakeVirtualGuestDB) DeleteVirtualGuestFromPoolArgsForCall(i int) (lager.Logger, int32) {
	fake.deleteVirtualGuestFromPoolMutex.RLock()
	defer fake.deleteVirtualGuestFromPoolMutex.RUnlock()
	return fake.deleteVirtualGuestFromPoolArgsForCall[i].logger, fake.deleteVirtualGuestFromPoolArgsForCall[i].cid
}

func (fake *FakeVirtualGuestDB) DeleteVirtualGuestFromPoolReturns(result1 error) {
	fake.DeleteVirtualGuestFromPoolStub = nil
	fake.deleteVirtualGuestFromPoolReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeVirtualGuestDB) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	fake.virtualGuestsMutex.RLock()
	defer fake.virtualGuestsMutex.RUnlock()
	fake.orderVirtualGuestToProvisionMutex.RLock()
	defer fake.orderVirtualGuestToProvisionMutex.RUnlock()
	fake.virtualGuestsByStatesMutex.RLock()
	defer fake.virtualGuestsByStatesMutex.RUnlock()
	fake.virtualGuestsByDeploymentsMutex.RLock()
	defer fake.virtualGuestsByDeploymentsMutex.RUnlock()
	fake.virtualGuestByCIDMutex.RLock()
	defer fake.virtualGuestByCIDMutex.RUnlock()
	fake.virtualGuestByIPMutex.RLock()
	defer fake.virtualGuestByIPMutex.RUnlock()
	fake.insertVirtualGuestToPoolMutex.RLock()
	defer fake.insertVirtualGuestToPoolMutex.RUnlock()
	fake.updateVirtualGuestInPoolMutex.RLock()
	defer fake.updateVirtualGuestInPoolMutex.RUnlock()
	fake.changeVirtualGuestToProvisionMutex.RLock()
	defer fake.changeVirtualGuestToProvisionMutex.RUnlock()
	fake.changeVirtualGuestToUseMutex.RLock()
	defer fake.changeVirtualGuestToUseMutex.RUnlock()
	fake.changeVirtualGuestToFreeMutex.RLock()
	defer fake.changeVirtualGuestToFreeMutex.RUnlock()
	fake.deleteVirtualGuestFromPoolMutex.RLock()
	defer fake.deleteVirtualGuestFromPoolMutex.RUnlock()
	return fake.invocations
}

func (fake *FakeVirtualGuestDB) 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 _ db.VirtualGuestDB = new(FakeVirtualGuestDB)
// This file was generated by counterfeiter
package dbfakes

import (
	"sync"

	"code.cloudfoundry.org/lager"
	"github.com/cloudfoundry-community/vps/db"
	"github.com/cloudfoundry-community/vps/generated/models"
)

type FakeVirtualGuestDB struct {
	VirtualGuestsStub        func(logger lager.Logger, filter models.VMFilter) ([]*models.VM, error)
	virtualGuestsMutex       sync.RWMutex
	virtualGuestsArgsForCall []struct {
		logger lager.Logger
		filter models.VMFilter
	}
	virtualGuestsReturns struct {
		result1 []*models.VM
		result2 error
	}
	OrderVirtualGuestToProvisionStub        func(logger lager.Logger, filter models.VMFilter) (*models.VM, error)
	orderVirtualGuestToProvisionMutex       sync.RWMutex
	orderVirtualGuestToProvisionArgsForCall []struct {
		logger lager.Logger
		filter models.VMFilter
	}
	orderVirtualGuestToProvisionReturns struct {
		result1 *models.VM
		result2 error
	}
	VirtualGuestsByStatesStub        func(logger lager.Logger, states []string) ([]*models.VM, error)
	virtualGuestsByStatesMutex       sync.RWMutex
	virtualGuestsByStatesArgsForCall []struct {
		logger lager.Logger
		states []string
	}
	virtualGuestsByStatesReturns struct {
		result1 []*models.VM
		result2 error
	}
	VirtualGuestsByDeploymentsStub        func(logger lager.Logger, names []string) ([]*models.VM, error)
	virtualGuestsByDeploymentsMutex       sync.RWMutex
	virtualGuestsByDeploymentsArgsForCall []struct {
		logger lager.Logger
		names  []string
	}
	virtualGuestsByDeploymentsReturns struct {
		result1 []*models.VM
		result2 error
	}
	VirtualGuestByCIDStub        func(logger lager.Logger, cid int32) (*models.VM, error)
	virtualGuestByCIDMutex       sync.RWMutex
	virtualGuestByCIDArgsForCall []struct {
		logger lager.Logger
		cid    int32
	}
	virtualGuestByCIDReturns struct {
		result1 *models.VM
		result2 error
	}
	VirtualGuestByIPStub        func(logger lager.Logger, ip string) (*models.VM, error)
	virtualGuestByIPMutex       sync.RWMutex
	virtualGuestByIPArgsForCall []struct {
		logger lager.Logger
		ip     string
	}
	virtualGuestByIPReturns struct {
		result1 *models.VM
		result2 error
	}
	InsertVirtualGuestToPoolStub        func(logger lager.Logger, virtualGuest *models.VM) error
	insertVirtualGuestToPoolMutex       sync.RWMutex
	insertVirtualGuestToPoolArgsForCall []struct {
		logger       lager.Logger
		virtualGuest *models.VM
	}
	insertVirtualGuestToPoolReturns struct {
		result1 error
	}
	UpdateVirtualGuestInPoolStub        func(logger lager.Logger, virtualGuest *models.VM) error
	updateVirtualGuestInPoolMutex       sync.RWMutex
	updateVirtualGuestInPoolArgsForCall []struct {
		logger       lager.Logger
		virtualGuest *models.VM
	}
	updateVirtualGuestInPoolReturns struct {
		result1 error
	}
	ChangeVirtualGuestToProvisionStub        func(logger lager.Logger, cid int32) error
	changeVirtualGuestToProvisionMutex       sync.RWMutex
	changeVirtualGuestToProvisionArgsForCall []struct {
		logger lager.Logger
		cid    int32
	}
	changeVirtualGuestToProvisionReturns struct {
		result1 error
	}
	ChangeVirtualGuestToUseStub        func(logger lager.Logger, cid int32) error
	changeVirtualGuestToUseMutex       sync.RWMutex
	changeVirtualGuestToUseArgsForCall []struct {
		logger lager.Logger
		cid    int32
	}
	changeVirtualGuestToUseReturns struct {
		result1 error
	}
	ChangeVirtualGuestToFreeStub        func(logger lager.Logger, cid int32) error
	changeVirtualGuestToFreeMutex       sync.RWMutex
	changeVirtualGuestToFreeArgsForCall []struct {
		logger lager.Logger
		cid    int32
	}
	changeVirtualGuestToFreeReturns struct {
		result1 error
	}
	DeleteVirtualGuestFromPoolStub        func(logger lager.Logger, cid int32) error
	deleteVirtualGuestFromPoolMutex       sync.RWMutex
	deleteVirtualGuestFromPoolArgsForCall []struct {
		logger lager.Logger
		cid    int32
	}
	deleteVirtualGuestFromPoolReturns struct {
		result1 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeVirtualGuestDB) VirtualGuests(logger lager.Logger, filter models.VMFilter) ([]*models.VM, error) {
	fake.virtualGuestsMutex.Lock()
	fake.virtualGuestsArgsForCall = append(fake.virtualGuestsArgsForCall, struct {
		logger lager.Logger
		filter models.VMFilter
	}{logger, filter})
	fake.recordInvocation("VirtualGuests", []interface{}{logger, filter})
	fake.virtualGuestsMutex.Unlock()
	if fake.VirtualGuestsStub != nil {
		return fake.VirtualGuestsStub(logger, filter)
	} else {
		return fake.virtualGuestsReturns.result1, fake.virtualGuestsReturns.result2
	}
}

func (fake *FakeVirtualGuestDB) VirtualGuestsCallCount() int {
	fake.virtualGuestsMutex.RLock()
	defer fake.virtualGuestsMutex.RUnlock()
	return len(fake.virtualGuestsArgsForCall)
}

func (fake *FakeVirtualGuestDB) VirtualGuestsArgsForCall(i int) (lager.Logger, models.VMFilter) {
	fake.virtualGuestsMutex.RLock()
	defer fake.virtualGuestsMutex.RUnlock()
	return fake.virtualGuestsArgsForCall[i].logger, fake.virtualGuestsArgsForCall[i].filter
}

func (fake *FakeVirtualGuestDB) VirtualGuestsReturns(result1 []*models.VM, result2 error) {
	fake.VirtualGuestsStub = nil
	fake.virtualGuestsReturns = struct {
		result1 []*models.VM
		result2 error
	}{result1, result2}
}

func (fake *FakeVirtualGuestDB) OrderVirtualGuestToProvision(logger lager.Logger, filter models.VMFilter) (*models.VM, error) {
	fake.orderVirtualGuestToProvisionMutex.Lock()
	fake.orderVirtualGuestToProvisionArgsForCall = append(fake.orderVirtualGuestToProvisionArgsForCall, struct {
		logger lager.Logger
		filter models.VMFilter
	}{logger, filter})
	fake.recordInvocation("OrderVirtualGuestToProvision", []interface{}{logger, filter})
	fake.orderVirtualGuestToProvisionMutex.Unlock()
	if fake.OrderVirtualGuestToProvisionStub != nil {
		return fake.OrderVirtualGuestToProvisionStub(logger, filter)
	} else {
		return fake.orderVirtualGuestToProvisionReturns.result1, fake.orderVirtualGuestToProvisionReturns.result2
	}
}

func (fake *FakeVirtualGuestDB) OrderVirtualGuestToProvisionCallCount() int {
	fake.orderVirtualGuestToProvisionMutex.RLock()
	defer fake.orderVirtualGuestToProvisionMutex.RUnlock()
	return len(fake.orderVirtualGuestToProvisionArgsForCall)
}

func (fake *FakeVirtualGuestDB) OrderVirtualGuestToProvisionArgsForCall(i int) (lager.Logger, models.VMFilter) {
	fake.orderVirtualGuestToProvisionMutex.RLock()
	defer fake.orderVirtualGuestToProvisionMutex.RUnlock()
	return fake.orderVirtualGuestToProvisionArgsForCall[i].logger, fake.orderVirtualGuestToProvisionArgsForCall[i].filter
}

func (fake *FakeVirtualGuestDB) OrderVirtualGuestToProvisionReturns(result1 *models.VM, result2 error) {
	fake.OrderVirtualGuestToProvisionStub = nil
	fake.orderVirtualGuestToProvisionReturns = struct {
		result1 *models.VM
		result2 error
	}{result1, result2}
}

func (fake *FakeVirtualGuestDB) VirtualGuestsByStates(logger lager.Logger, states []string) ([]*models.VM, error) {
	var statesCopy []string
	if states != nil {
		statesCopy = make([]string, len(states))
		copy(statesCopy, states)
	}
	fake.virtualGuestsByStatesMutex.Lock()
	fake.virtualGuestsByStatesArgsForCall = append(fake.virtualGuestsByStatesArgsForCall, struct {
		logger lager.Logger
		states []string
	}{logger, statesCopy})
	fake.recordInvocation("VirtualGuestsByStates", []interface{}{logger, statesCopy})
	fake.virtualGuestsByStatesMutex.Unlock()
	if fake.VirtualGuestsByStatesStub != nil {
		return fake.VirtualGuestsByStatesStub(logger, states)
	} else {
		return fake.virtualGuestsByStatesReturns.result1, fake.virtualGuestsByStatesReturns.result2
	}
}

func (fake *FakeVirtualGuestDB) VirtualGuestsByStatesCallCount() int {
	fake.virtualGuestsByStatesMutex.RLock()
	defer fake.virtualGuestsByStatesMutex.RUnlock()
	return len(fake.virtualGuestsByStatesArgsForCall)
}

func (fake *FakeVirtualGuestDB) VirtualGuestsByStatesArgsForCall(i int) (lager.Logger, []string) {
	fake.virtualGuestsByStatesMutex.RLock()
	defer fake.virtualGuestsByStatesMutex.RUnlock()
	return fake.virtualGuestsByStatesArgsForCall[i].logger, fake.virtualGuestsByStatesArgsForCall[i].states
}

func (fake *FakeVirtualGuestDB) VirtualGuestsByStatesReturns(result1 []*models.VM, result2 error) {
	fake.VirtualGuestsByStatesStub = nil
	fake.virtualGuestsByStatesReturns = struct {
		result1 []*models.VM
		result2 error
	}{result1, result2}
}

func (fake *FakeVirtualGuestDB) VirtualGuestsByDeployments(logger lager.Logger, names []string) ([]*models.VM, error) {
	var namesCopy []string
	if names != nil {
		namesCopy = make([]string, len(names))
		copy(namesCopy, names)
	}
	fake.virtualGuestsByDeploymentsMutex.Lock()
	fake.virtualGuestsByDeploymentsArgsForCall = append(fake.virtualGuestsByDeploymentsArgsForCall, struct {
		logger lager.Logger
		names  []string
	}{logger, namesCopy})
	fake.recordInvocation("VirtualGuestsByDeployments", []interface{}{logger, namesCopy})
	fake.virtualGuestsByDeploymentsMutex.Unlock()
	if fake.VirtualGuestsByDeploymentsStub != nil {
		return fake.VirtualGuestsByDeploymentsStub(logger, names)
	} else {
		return fake.virtualGuestsByDeploymentsReturns.result1, fake.virtualGuestsByDeploymentsReturns.result2
	}
}

func (fake *FakeVirtualGuestDB) VirtualGuestsByDeploymentsCallCount() int {
	fake.virtualGuestsByDeploymentsMutex.RLock()
	defer fake.virtualGuestsByDeploymentsMutex.RUnlock()
	return len(fake.virtualGuestsByDeploymentsArgsForCall)
}

func (fake *FakeVirtualGuestDB) VirtualGuestsByDeploymentsArgsForCall(i int) (lager.Logger, []string) {
	fake.virtualGuestsByDeploymentsMutex.RLock()
	defer fake.virtualGuestsByDeploymentsMutex.RUnlock()
	return fake.virtualGuestsByDeploymentsArgsForCall[i].logger, fake.virtualGuestsByDeploymentsArgsForCall[i].names
}

func (fake *FakeVirtualGuestDB) VirtualGuestsByDeploymentsReturns(result1 []*models.VM, result2 error) {
	fake.VirtualGuestsByDeploymentsStub = nil
	fake.virtualGuestsByDeploymentsReturns = struct {
		result1 []*models.VM
		result2 error
	}{result1, result2}
}

func (fake *FakeVirtualGuestDB) VirtualGuestByCID(logger lager.Logger, cid int32) (*models.VM, error) {
	fake.virtualGuestByCIDMutex.Lock()
	fake.virtualGuestByCIDArgsForCall = append(fake.virtualGuestByCIDArgsForCall, struct {
		logger lager.Logger
		cid    int32
	}{logger, cid})
	fake.recordInvocation("VirtualGuestByCID", []interface{}{logger, cid})
	fake.virtualGuestByCIDMutex.Unlock()
	if fake.VirtualGuestByCIDStub != nil {
		return fake.VirtualGuestByCIDStub(logger, cid)
	} else {
		return fake.virtualGuestByCIDReturns.result1, fake.virtualGuestByCIDReturns.result2
	}
}

func (fake *FakeVirtualGuestDB) VirtualGuestByCIDCallCount() int {
	fake.virtualGuestByCIDMutex.RLock()
	defer fake.virtualGuestByCIDMutex.RUnlock()
	return len(fake.virtualGuestByCIDArgsForCall)
}

func (fake *FakeVirtualGuestDB) VirtualGuestByCIDArgsForCall(i int) (lager.Logger, int32) {
	fake.virtualGuestByCIDMutex.RLock()
	defer fake.virtualGuestByCIDMutex.RUnlock()
	return fake.virtualGuestByCIDArgsForCall[i].logger, fake.virtualGuestByCIDArgsForCall[i].cid
}

func (fake *FakeVirtualGuestDB) VirtualGuestByCIDReturns(result1 *models.VM, result2 error) {
	fake.VirtualGuestByCIDStub = nil
	fake.virtualGuestByCIDReturns = struct {
		result1 *models.VM
		result2 error
	}{result1, result2}
}

func (fake *FakeVirtualGuestDB) VirtualGuestByIP(logger lager.Logger, ip string) (*models.VM, error) {
	fake.virtualGuestByIPMutex.Lock()
	fake.virtualGuestByIPArgsForCall = append(fake.virtualGuestByIPArgsForCall, struct {
		logger lager.Logger
		ip     string
	}{logger, ip})
	fake.recordInvocation("VirtualGuestByIP", []interface{}{logger, ip})
	fake.virtualGuestByIPMutex.Unlock()
	if fake.VirtualGuestByIPStub != nil {
		return fake.VirtualGuestByIPStub(logger, ip)
	} else {
		return fake.virtualGuestByIPReturns.result1, fake.virtualGuestByIPReturns.result2
	}
}

func (fake *FakeVirtualGuestDB) VirtualGuestByIPCallCount() int {
	fake.virtualGuestByIPMutex.RLock()
	defer fake.virtualGuestByIPMutex.RUnlock()
	return len(fake.virtualGuestByIPArgsForCall)
}

func (fake *FakeVirtualGuestDB) VirtualGuestByIPArgsForCall(i int) (lager.Logger, string) {
	fake.virtualGuestByIPMutex.RLock()
	defer fake.virtualGuestByIPMutex.RUnlock()
	return fake.virtualGuestByIPArgsForCall[i].logger, fake.virtualGuestByIPArgsForCall[i].ip
}

func (fake *FakeVirtualGuestDB) VirtualGuestByIPReturns(result1 *models.VM, result2 error) {
	fake.VirtualGuestByIPStub = nil
	fake.virtualGuestByIPReturns = struct {
		result1 *models.VM
		result2 error
	}{result1, result2}
}

func (fake *FakeVirtualGuestDB) InsertVirtualGuestToPool(logger lager.Logger, virtualGuest *models.VM) error {
	fake.insertVirtualGuestToPoolMutex.Lock()
	fake.insertVirtualGuestToPoolArgsForCall = append(fake.insertVirtualGuestToPoolArgsForCall, struct {
		logger       lager.Logger
		virtualGuest *models.VM
	}{logger, virtualGuest})
	fake.recordInvocation("InsertVirtualGuestToPool", []interface{}{logger, virtualGuest})
	fake.insertVirtualGuestToPoolMutex.Unlock()
	if fake.InsertVirtualGuestToPoolStub != nil {
		return fake.InsertVirtualGuestToPoolStub(logger, virtualGuest)
	} else {
		return fake.insertVirtualGuestToPoolReturns.result1
	}
}

func (fake *FakeVirtualGuestDB) InsertVirtualGuestToPoolCallCount() int {
	fake.insertVirtualGuestToPoolMutex.RLock()
	defer fake.insertVirtualGuestToPoolMutex.RUnlock()
	return len(fake.insertVirtualGuestToPoolArgsForCall)
}

func (fake *FakeVirtualGuestDB) InsertVirtualGuestToPoolArgsForCall(i int) (lager.Logger, *models.VM) {
	fake.insertVirtualGuestToPoolMutex.RLock()
	defer fake.insertVirtualGuestToPoolMutex.RUnlock()
	return fake.insertVirtualGuestToPoolArgsForCall[i].logger, fake.insertVirtualGuestToPoolArgsForCall[i].virtualGuest
}

func (fake *FakeVirtualGuestDB) InsertVirtualGuestToPoolReturns(result1 error) {
	fake.InsertVirtualGuestToPoolStub = nil
	fake.insertVirtualGuestToPoolReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeVirtualGuestDB) UpdateVirtualGuestInPool(logger lager.Logger, virtualGuest *models.VM) error {
	fake.updateVirtualGuestInPoolMutex.Lock()
	fake.updateVirtualGuestInPoolArgsForCall = append(fake.updateVirtualGuestInPoolArgsForCall, struct {
		logger       lager.Logger
		virtualGuest *models.VM
	}{logger, virtualGuest})
	fake.recordInvocation("UpdateVirtualGuestInPool", []interface{}{logger, virtualGuest})
	fake.updateVirtualGuestInPoolMutex.Unlock()
	if fake.UpdateVirtualGuestInPoolStub != nil {
		return fake.UpdateVirtualGuestInPoolStub(logger, virtualGuest)
	} else {
		return fake.updateVirtualGuestInPoolReturns.result1
	}
}

func (fake *FakeVirtualGuestDB) UpdateVirtualGuestInPoolCallCount() int {
	fake.updateVirtualGuestInPoolMutex.RLock()
	defer fake.updateVirtualGuestInPoolMutex.RUnlock()
	return len(fake.updateVirtualGuestInPoolArgsForCall)
}

func (fake *FakeVirtualGuestDB) UpdateVirtualGuestInPoolArgsForCall(i int) (lager.Logger, *models.VM) {
	fake.updateVirtualGuestInPoolMutex.RLock()
	defer fake.updateVirtualGuestInPoolMutex.RUnlock()
	return fake.updateVirtualGuestInPoolArgsForCall[i].logger, fake.updateVirtualGuestInPoolArgsForCall[i].virtualGuest
}

func (fake *FakeVirtualGuestDB) UpdateVirtualGuestInPoolReturns(result1 error) {
	fake.UpdateVirtualGuestInPoolStub = nil
	fake.updateVirtualGuestInPoolReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeVirtualGuestDB) ChangeVirtualGuestToProvision(logger lager.Logger, cid int32) error {
	fake.changeVirtualGuestToProvisionMutex.Lock()
	fake.changeVirtualGuestToProvisionArgsForCall = append(fake.changeVirtualGuestToProvisionArgsForCall, struct {
		logger lager.Logger
		cid    int32
	}{logger, cid})
	fake.recordInvocation("ChangeVirtualGuestToProvision", []interface{}{logger, cid})
	fake.changeVirtualGuestToProvisionMutex.Unlock()
	if fake.ChangeVirtualGuestToProvisionStub != nil {
		return fake.ChangeVirtualGuestToProvisionStub(logger, cid)
	} else {
		return fake.changeVirtualGuestToProvisionReturns.result1
	}
}

func (fake *FakeVirtualGuestDB) ChangeVirtualGuestToProvisionCallCount() int {
	fake.changeVirtualGuestToProvisionMutex.RLock()
	defer fake.changeVirtualGuestToProvisionMutex.RUnlock()
	return len(fake.changeVirtualGuestToProvisionArgsForCall)
}

func (fake *FakeVirtualGuestDB) ChangeVirtualGuestToProvisionArgsForCall(i int) (lager.Logger, int32) {
	fake.changeVirtualGuestToProvisionMutex.RLock()
	defer fake.changeVirtualGuestToProvisionMutex.RUnlock()
	return fake.changeVirtualGuestToProvisionArgsForCall[i].logger, fake.changeVirtualGuestToProvisionArgsForCall[i].cid
}

func (fake *FakeVirtualGuestDB) ChangeVirtualGuestToProvisionReturns(result1 error) {
	fake.ChangeVirtualGuestToProvisionStub = nil
	fake.changeVirtualGuestToProvisionReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeVirtualGuestDB) ChangeVirtualGuestToUse(logger lager.Logger, cid int32) error {
	fake.changeVirtualGuestToUseMutex.Lock()
	fake.changeVirtualGuestToUseArgsForCall = append(fake.changeVirtualGuestToUseArgsForCall, struct {
		logger lager.Logger
		cid    int32
	}{logger, cid})
	fake.recordInvocation("ChangeVirtualGuestToUse", []interface{}{logger, cid})
	fake.changeVirtualGuestToUseMutex.Unlock()
	if fake.ChangeVirtualGuestToUseStub != nil {
		return fake.ChangeVirtualGuestToUseStub(logger, cid)
	} else {
		return fake.changeVirtualGuestToUseReturns.result1
	}
}

func (fake *FakeVirtualGuestDB) ChangeVirtualGuestToUseCallCount() int {
	fake.changeVirtualGuestToUseMutex.RLock()
	defer fake.changeVirtualGuestToUseMutex.RUnlock()
	return len(fake.changeVirtualGuestToUseArgsForCall)
}

func (fake *FakeVirtualGuestDB) ChangeVirtualGuestToUseArgsForCall(i int) (lager.Logger, int32) {
	fake.changeVirtualGuestToUseMutex.RLock()
	defer fake.changeVirtualGuestToUseMutex.RUnlock()
	return fake.changeVirtualGuestToUseArgsForCall[i].logger, fake.changeVirtualGuestToUseArgsForCall[i].cid
}

func (fake *FakeVirtualGuestDB) ChangeVirtualGuestToUseReturns(result1 error) {
	fake.ChangeVirtualGuestToUseStub = nil
	fake.changeVirtualGuestToUseReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeVirtualGuestDB) ChangeVirtualGuestToFree(logger lager.Logger, cid int32) error {
	fake.changeVirtualGuestToFreeMutex.Lock()
	fake.changeVirtualGuestToFreeArgsForCall = append(fake.changeVirtualGuestToFreeArgsForCall, struct {
		logger lager.Logger
		cid    int32
	}{logger, cid})
	fake.recordInvocation("ChangeVirtualGuestToFree", []interface{}{logger, cid})
	fake.changeVirtualGuestToFreeMutex.Unlock()
	if fake.ChangeVirtualGuestToFreeStub != nil {
		return fake.ChangeVirtualGuestToFreeStub(logger, cid)
	} else {
		return fake.changeVirtualGuestToFreeReturns.result1
	}
}

func (fake *FakeVirtualGuestDB) ChangeVirtualGuestToFreeCallCount() int {
	fake.changeVirtualGuestToFreeMutex.RLock()
	defer fake.changeVirtualGuestToFreeMutex.RUnlock()
	return len(fake.changeVirtualGuestToFreeArgsForCall)
}

func (fake *FakeVirtualGuestDB) ChangeVirtualGuestToFreeArgsForCall(i int) (lager.Logger, int32) {
	fake.changeVirtualGuestToFreeMutex.RLock()
	defer fake.changeVirtualGuestToFreeMutex.RUnlock()
	return fake.changeVirtualGuestToFreeArgsForCall[i].logger, fake.changeVirtualGuestToFreeArgsForCall[i].cid
}

func (fake *FakeVirtualGuestDB) ChangeVirtualGuestToFreeReturns(result1 error) {
	fake.ChangeVirtualGuestToFreeStub = nil
	fake.changeVirtualGuestToFreeReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeVirtualGuestDB) DeleteVirtualGuestFromPool(logger lager.Logger, cid int32) error {
	fake.deleteVirtualGuestFromPoolMutex.Lock()
	fake.deleteVirtualGuestFromPoolArgsForCall = append(fake.deleteVirtualGuestFromPoolArgsForCall, struct {
		logger lager.Logger
		cid    int32
	}{logger, cid})
	fake.recordInvocation("DeleteVirtualGuestFromPool", []interface{}{logger, cid})
	fake.deleteVirtualGuestFromPoolMutex.Unlock()
	if fake.DeleteVirtualGuestFromPoolStub != nil {
		return fake.DeleteVirtualGuestFromPoolStub(logger, cid)
	} else {
		return fake.deleteVirtualGuestFromPoolReturns.result1
	}
}

func (fake *FakeVirtualGuestDB) DeleteVirtualGuestFromPoolCallCount() int {
	fake.deleteVirtualGuestFromPoolMutex.RLock()
	defer fake.deleteVirtualGuestFromPoolMutex.RUnlock()
	return len(fake.deleteVirtualGuestFromPoolArgsForCall)
}

func (fake *FakeVirtualGuestDB) DeleteVirtualGuestFromPoolArgsForCall(i int) (lager.Logger, int32) {
	fake.deleteVirtualGuestFromPoolMutex.RLock()
	defer fake.deleteVirtualGuestFromPoolMutex.RUnlock()
	return fake.deleteVirtualGuestFromPoolArgsForCall[i].logger, fake.deleteVirtualGuestFromPoolArgsForCall[i].cid
}

func (fake *FakeVirtualGuestDB) DeleteVirtualGuestFromPoolReturns(result1 error) {
	fake.DeleteVirtualGuestFromPoolStub = nil
	fake.deleteVirtualGuestFromPoolReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeVirtualGuestDB) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	fake.virtualGuestsMutex.RLock()
	defer fake.virtualGuestsMutex.RUnlock()
	fake.orderVirtualGuestToProvisionMutex.RLock()
	defer fake.orderVirtualGuestToProvisionMutex.RUnlock()
	fake.virtualGuestsByStatesMutex.RLock()
	defer fake.virtualGuestsByStatesMutex.RUnlock()
	fake.virtualGuestsByDeploymentsMutex.RLock()
	defer fake.virtualGuestsByDeploymentsMutex.RUnlock()
	fake.virtualGuestByCIDMutex.RLock()
	defer fake.virtualGuestByCIDMutex.RUnlock()
	fake.virtualGuestByIPMutex.RLock()
	defer fake.virtualGuestByIPMutex.RUnlock()
	fake.insertVirtualGuestToPoolMutex.RLock()
	defer fake.insertVirtualGuestToPoolMutex.RUnlock()
	fake.updateVirtualGuestInPoolMutex.RLock()
	defer fake.updateVirtualGuestInPoolMutex.RUnlock()
	fake.changeVirtualGuestToProvisionMutex.RLock()
	defer fake.changeVirtualGuestToProvisionMutex.RUnlock()
	fake.changeVirtualGuestToUseMutex.RLock()
	defer fake.changeVirtualGuestToUseMutex.RUnlock()
	fake.changeVirtualGuestToFreeMutex.RLock()
	defer fake.changeVirtualGuestToFreeMutex.RUnlock()
	fake.deleteVirtualGuestFromPoolMutex.RLock()
	defer fake.deleteVirtualGuestFromPoolMutex.RUnlock()
	return fake.invocations
}

func (fake *FakeVirtualGuestDB) 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 _ db.VirtualGuestDB = new(FakeVirtualGuestDB)
