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

import (
	"sync"

	"code.cloudfoundry.org/garden"
	"code.cloudfoundry.org/guardian/gardener"
	lager "code.cloudfoundry.org/lager/v3"
	specs "github.com/opencontainers/runtime-spec/specs-go"
)

type FakeVolumizer struct {
	CapacityStub        func(lager.Logger) (uint64, error)
	capacityMutex       sync.RWMutex
	capacityArgsForCall []struct {
		arg1 lager.Logger
	}
	capacityReturns struct {
		result1 uint64
		result2 error
	}
	capacityReturnsOnCall map[int]struct {
		result1 uint64
		result2 error
	}
	CreateStub        func(lager.Logger, garden.ContainerSpec) (specs.Spec, error)
	createMutex       sync.RWMutex
	createArgsForCall []struct {
		arg1 lager.Logger
		arg2 garden.ContainerSpec
	}
	createReturns struct {
		result1 specs.Spec
		result2 error
	}
	createReturnsOnCall map[int]struct {
		result1 specs.Spec
		result2 error
	}
	DestroyStub        func(lager.Logger, string) error
	destroyMutex       sync.RWMutex
	destroyArgsForCall []struct {
		arg1 lager.Logger
		arg2 string
	}
	destroyReturns struct {
		result1 error
	}
	destroyReturnsOnCall map[int]struct {
		result1 error
	}
	GCStub        func(lager.Logger) error
	gCMutex       sync.RWMutex
	gCArgsForCall []struct {
		arg1 lager.Logger
	}
	gCReturns struct {
		result1 error
	}
	gCReturnsOnCall map[int]struct {
		result1 error
	}
	MetricsStub        func(lager.Logger, string, bool) (garden.ContainerDiskStat, error)
	metricsMutex       sync.RWMutex
	metricsArgsForCall []struct {
		arg1 lager.Logger
		arg2 string
		arg3 bool
	}
	metricsReturns struct {
		result1 garden.ContainerDiskStat
		result2 error
	}
	metricsReturnsOnCall map[int]struct {
		result1 garden.ContainerDiskStat
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeVolumizer) Capacity(arg1 lager.Logger) (uint64, error) {
	fake.capacityMutex.Lock()
	ret, specificReturn := fake.capacityReturnsOnCall[len(fake.capacityArgsForCall)]
	fake.capacityArgsForCall = append(fake.capacityArgsForCall, struct {
		arg1 lager.Logger
	}{arg1})
	stub := fake.CapacityStub
	fakeReturns := fake.capacityReturns
	fake.recordInvocation("Capacity", []interface{}{arg1})
	fake.capacityMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeVolumizer) CapacityCallCount() int {
	fake.capacityMutex.RLock()
	defer fake.capacityMutex.RUnlock()
	return len(fake.capacityArgsForCall)
}

func (fake *FakeVolumizer) CapacityCalls(stub func(lager.Logger) (uint64, error)) {
	fake.capacityMutex.Lock()
	defer fake.capacityMutex.Unlock()
	fake.CapacityStub = stub
}

func (fake *FakeVolumizer) CapacityArgsForCall(i int) lager.Logger {
	fake.capacityMutex.RLock()
	defer fake.capacityMutex.RUnlock()
	argsForCall := fake.capacityArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeVolumizer) CapacityReturns(result1 uint64, result2 error) {
	fake.capacityMutex.Lock()
	defer fake.capacityMutex.Unlock()
	fake.CapacityStub = nil
	fake.capacityReturns = struct {
		result1 uint64
		result2 error
	}{result1, result2}
}

func (fake *FakeVolumizer) CapacityReturnsOnCall(i int, result1 uint64, result2 error) {
	fake.capacityMutex.Lock()
	defer fake.capacityMutex.Unlock()
	fake.CapacityStub = nil
	if fake.capacityReturnsOnCall == nil {
		fake.capacityReturnsOnCall = make(map[int]struct {
			result1 uint64
			result2 error
		})
	}
	fake.capacityReturnsOnCall[i] = struct {
		result1 uint64
		result2 error
	}{result1, result2}
}

func (fake *FakeVolumizer) Create(arg1 lager.Logger, arg2 garden.ContainerSpec) (specs.Spec, error) {
	fake.createMutex.Lock()
	ret, specificReturn := fake.createReturnsOnCall[len(fake.createArgsForCall)]
	fake.createArgsForCall = append(fake.createArgsForCall, struct {
		arg1 lager.Logger
		arg2 garden.ContainerSpec
	}{arg1, arg2})
	stub := fake.CreateStub
	fakeReturns := fake.createReturns
	fake.recordInvocation("Create", []interface{}{arg1, arg2})
	fake.createMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

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

func (fake *FakeVolumizer) CreateCalls(stub func(lager.Logger, garden.ContainerSpec) (specs.Spec, error)) {
	fake.createMutex.Lock()
	defer fake.createMutex.Unlock()
	fake.CreateStub = stub
}

func (fake *FakeVolumizer) CreateArgsForCall(i int) (lager.Logger, garden.ContainerSpec) {
	fake.createMutex.RLock()
	defer fake.createMutex.RUnlock()
	argsForCall := fake.createArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeVolumizer) CreateReturns(result1 specs.Spec, result2 error) {
	fake.createMutex.Lock()
	defer fake.createMutex.Unlock()
	fake.CreateStub = nil
	fake.createReturns = struct {
		result1 specs.Spec
		result2 error
	}{result1, result2}
}

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

func (fake *FakeVolumizer) Destroy(arg1 lager.Logger, arg2 string) error {
	fake.destroyMutex.Lock()
	ret, specificReturn := fake.destroyReturnsOnCall[len(fake.destroyArgsForCall)]
	fake.destroyArgsForCall = append(fake.destroyArgsForCall, struct {
		arg1 lager.Logger
		arg2 string
	}{arg1, arg2})
	stub := fake.DestroyStub
	fakeReturns := fake.destroyReturns
	fake.recordInvocation("Destroy", []interface{}{arg1, arg2})
	fake.destroyMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeVolumizer) DestroyCallCount() int {
	fake.destroyMutex.RLock()
	defer fake.destroyMutex.RUnlock()
	return len(fake.destroyArgsForCall)
}

func (fake *FakeVolumizer) DestroyCalls(stub func(lager.Logger, string) error) {
	fake.destroyMutex.Lock()
	defer fake.destroyMutex.Unlock()
	fake.DestroyStub = stub
}

func (fake *FakeVolumizer) DestroyArgsForCall(i int) (lager.Logger, string) {
	fake.destroyMutex.RLock()
	defer fake.destroyMutex.RUnlock()
	argsForCall := fake.destroyArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeVolumizer) DestroyReturns(result1 error) {
	fake.destroyMutex.Lock()
	defer fake.destroyMutex.Unlock()
	fake.DestroyStub = nil
	fake.destroyReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeVolumizer) DestroyReturnsOnCall(i int, result1 error) {
	fake.destroyMutex.Lock()
	defer fake.destroyMutex.Unlock()
	fake.DestroyStub = nil
	if fake.destroyReturnsOnCall == nil {
		fake.destroyReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.destroyReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeVolumizer) GC(arg1 lager.Logger) error {
	fake.gCMutex.Lock()
	ret, specificReturn := fake.gCReturnsOnCall[len(fake.gCArgsForCall)]
	fake.gCArgsForCall = append(fake.gCArgsForCall, struct {
		arg1 lager.Logger
	}{arg1})
	stub := fake.GCStub
	fakeReturns := fake.gCReturns
	fake.recordInvocation("GC", []interface{}{arg1})
	fake.gCMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeVolumizer) GCCallCount() int {
	fake.gCMutex.RLock()
	defer fake.gCMutex.RUnlock()
	return len(fake.gCArgsForCall)
}

func (fake *FakeVolumizer) GCCalls(stub func(lager.Logger) error) {
	fake.gCMutex.Lock()
	defer fake.gCMutex.Unlock()
	fake.GCStub = stub
}

func (fake *FakeVolumizer) GCArgsForCall(i int) lager.Logger {
	fake.gCMutex.RLock()
	defer fake.gCMutex.RUnlock()
	argsForCall := fake.gCArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeVolumizer) GCReturns(result1 error) {
	fake.gCMutex.Lock()
	defer fake.gCMutex.Unlock()
	fake.GCStub = nil
	fake.gCReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeVolumizer) GCReturnsOnCall(i int, result1 error) {
	fake.gCMutex.Lock()
	defer fake.gCMutex.Unlock()
	fake.GCStub = nil
	if fake.gCReturnsOnCall == nil {
		fake.gCReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.gCReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeVolumizer) Metrics(arg1 lager.Logger, arg2 string, arg3 bool) (garden.ContainerDiskStat, error) {
	fake.metricsMutex.Lock()
	ret, specificReturn := fake.metricsReturnsOnCall[len(fake.metricsArgsForCall)]
	fake.metricsArgsForCall = append(fake.metricsArgsForCall, struct {
		arg1 lager.Logger
		arg2 string
		arg3 bool
	}{arg1, arg2, arg3})
	stub := fake.MetricsStub
	fakeReturns := fake.metricsReturns
	fake.recordInvocation("Metrics", []interface{}{arg1, arg2, arg3})
	fake.metricsMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeVolumizer) MetricsCallCount() int {
	fake.metricsMutex.RLock()
	defer fake.metricsMutex.RUnlock()
	return len(fake.metricsArgsForCall)
}

func (fake *FakeVolumizer) MetricsCalls(stub func(lager.Logger, string, bool) (garden.ContainerDiskStat, error)) {
	fake.metricsMutex.Lock()
	defer fake.metricsMutex.Unlock()
	fake.MetricsStub = stub
}

func (fake *FakeVolumizer) MetricsArgsForCall(i int) (lager.Logger, string, bool) {
	fake.metricsMutex.RLock()
	defer fake.metricsMutex.RUnlock()
	argsForCall := fake.metricsArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *FakeVolumizer) MetricsReturns(result1 garden.ContainerDiskStat, result2 error) {
	fake.metricsMutex.Lock()
	defer fake.metricsMutex.Unlock()
	fake.MetricsStub = nil
	fake.metricsReturns = struct {
		result1 garden.ContainerDiskStat
		result2 error
	}{result1, result2}
}

func (fake *FakeVolumizer) MetricsReturnsOnCall(i int, result1 garden.ContainerDiskStat, result2 error) {
	fake.metricsMutex.Lock()
	defer fake.metricsMutex.Unlock()
	fake.MetricsStub = nil
	if fake.metricsReturnsOnCall == nil {
		fake.metricsReturnsOnCall = make(map[int]struct {
			result1 garden.ContainerDiskStat
			result2 error
		})
	}
	fake.metricsReturnsOnCall[i] = struct {
		result1 garden.ContainerDiskStat
		result2 error
	}{result1, result2}
}

func (fake *FakeVolumizer) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	fake.capacityMutex.RLock()
	defer fake.capacityMutex.RUnlock()
	fake.createMutex.RLock()
	defer fake.createMutex.RUnlock()
	fake.destroyMutex.RLock()
	defer fake.destroyMutex.RUnlock()
	fake.gCMutex.RLock()
	defer fake.gCMutex.RUnlock()
	fake.metricsMutex.RLock()
	defer fake.metricsMutex.RUnlock()
	copiedInvocations := map[string][][]interface{}{}
	for key, value := range fake.invocations {
		copiedInvocations[key] = value
	}
	return copiedInvocations
}

func (fake *FakeVolumizer) 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 _ gardener.Volumizer = new(FakeVolumizer)
