// 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"
)

type FakeContainerNetworkMetricsProvider struct {
	GetStub        func(lager.Logger, string) (*garden.ContainerNetworkStat, error)
	getMutex       sync.RWMutex
	getArgsForCall []struct {
		arg1 lager.Logger
		arg2 string
	}
	getReturns struct {
		result1 *garden.ContainerNetworkStat
		result2 error
	}
	getReturnsOnCall map[int]struct {
		result1 *garden.ContainerNetworkStat
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeContainerNetworkMetricsProvider) Get(arg1 lager.Logger, arg2 string) (*garden.ContainerNetworkStat, error) {
	fake.getMutex.Lock()
	ret, specificReturn := fake.getReturnsOnCall[len(fake.getArgsForCall)]
	fake.getArgsForCall = append(fake.getArgsForCall, struct {
		arg1 lager.Logger
		arg2 string
	}{arg1, arg2})
	stub := fake.GetStub
	fakeReturns := fake.getReturns
	fake.recordInvocation("Get", []interface{}{arg1, arg2})
	fake.getMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeContainerNetworkMetricsProvider) GetCallCount() int {
	fake.getMutex.RLock()
	defer fake.getMutex.RUnlock()
	return len(fake.getArgsForCall)
}

func (fake *FakeContainerNetworkMetricsProvider) GetCalls(stub func(lager.Logger, string) (*garden.ContainerNetworkStat, error)) {
	fake.getMutex.Lock()
	defer fake.getMutex.Unlock()
	fake.GetStub = stub
}

func (fake *FakeContainerNetworkMetricsProvider) GetArgsForCall(i int) (lager.Logger, string) {
	fake.getMutex.RLock()
	defer fake.getMutex.RUnlock()
	argsForCall := fake.getArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeContainerNetworkMetricsProvider) GetReturns(result1 *garden.ContainerNetworkStat, result2 error) {
	fake.getMutex.Lock()
	defer fake.getMutex.Unlock()
	fake.GetStub = nil
	fake.getReturns = struct {
		result1 *garden.ContainerNetworkStat
		result2 error
	}{result1, result2}
}

func (fake *FakeContainerNetworkMetricsProvider) GetReturnsOnCall(i int, result1 *garden.ContainerNetworkStat, result2 error) {
	fake.getMutex.Lock()
	defer fake.getMutex.Unlock()
	fake.GetStub = nil
	if fake.getReturnsOnCall == nil {
		fake.getReturnsOnCall = make(map[int]struct {
			result1 *garden.ContainerNetworkStat
			result2 error
		})
	}
	fake.getReturnsOnCall[i] = struct {
		result1 *garden.ContainerNetworkStat
		result2 error
	}{result1, result2}
}

func (fake *FakeContainerNetworkMetricsProvider) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	fake.getMutex.RLock()
	defer fake.getMutex.RUnlock()
	copiedInvocations := map[string][][]interface{}{}
	for key, value := range fake.invocations {
		copiedInvocations[key] = value
	}
	return copiedInvocations
}

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