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

import (
	"sync"

	"github.com/weaveworks/eksctl/pkg/drain"
	"github.com/weaveworks/eksctl/pkg/drain/evictor"
	v1 "k8s.io/api/core/v1"
)

type FakeEvictor struct {
	CanUseEvictionsStub        func() error
	canUseEvictionsMutex       sync.RWMutex
	canUseEvictionsArgsForCall []struct {
	}
	canUseEvictionsReturns struct {
		result1 error
	}
	canUseEvictionsReturnsOnCall map[int]struct {
		result1 error
	}
	EvictOrDeletePodStub        func(v1.Pod) error
	evictOrDeletePodMutex       sync.RWMutex
	evictOrDeletePodArgsForCall []struct {
		arg1 v1.Pod
	}
	evictOrDeletePodReturns struct {
		result1 error
	}
	evictOrDeletePodReturnsOnCall map[int]struct {
		result1 error
	}
	GetPodsForEvictionStub        func(string) (*evictor.PodDeleteList, []error)
	getPodsForEvictionMutex       sync.RWMutex
	getPodsForEvictionArgsForCall []struct {
		arg1 string
	}
	getPodsForEvictionReturns struct {
		result1 *evictor.PodDeleteList
		result2 []error
	}
	getPodsForEvictionReturnsOnCall map[int]struct {
		result1 *evictor.PodDeleteList
		result2 []error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeEvictor) CanUseEvictions() error {
	fake.canUseEvictionsMutex.Lock()
	ret, specificReturn := fake.canUseEvictionsReturnsOnCall[len(fake.canUseEvictionsArgsForCall)]
	fake.canUseEvictionsArgsForCall = append(fake.canUseEvictionsArgsForCall, struct {
	}{})
	stub := fake.CanUseEvictionsStub
	fakeReturns := fake.canUseEvictionsReturns
	fake.recordInvocation("CanUseEvictions", []interface{}{})
	fake.canUseEvictionsMutex.Unlock()
	if stub != nil {
		return stub()
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeEvictor) CanUseEvictionsCallCount() int {
	fake.canUseEvictionsMutex.RLock()
	defer fake.canUseEvictionsMutex.RUnlock()
	return len(fake.canUseEvictionsArgsForCall)
}

func (fake *FakeEvictor) CanUseEvictionsCalls(stub func() error) {
	fake.canUseEvictionsMutex.Lock()
	defer fake.canUseEvictionsMutex.Unlock()
	fake.CanUseEvictionsStub = stub
}

func (fake *FakeEvictor) CanUseEvictionsReturns(result1 error) {
	fake.canUseEvictionsMutex.Lock()
	defer fake.canUseEvictionsMutex.Unlock()
	fake.CanUseEvictionsStub = nil
	fake.canUseEvictionsReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeEvictor) CanUseEvictionsReturnsOnCall(i int, result1 error) {
	fake.canUseEvictionsMutex.Lock()
	defer fake.canUseEvictionsMutex.Unlock()
	fake.CanUseEvictionsStub = nil
	if fake.canUseEvictionsReturnsOnCall == nil {
		fake.canUseEvictionsReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.canUseEvictionsReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeEvictor) EvictOrDeletePod(arg1 v1.Pod) error {
	fake.evictOrDeletePodMutex.Lock()
	ret, specificReturn := fake.evictOrDeletePodReturnsOnCall[len(fake.evictOrDeletePodArgsForCall)]
	fake.evictOrDeletePodArgsForCall = append(fake.evictOrDeletePodArgsForCall, struct {
		arg1 v1.Pod
	}{arg1})
	stub := fake.EvictOrDeletePodStub
	fakeReturns := fake.evictOrDeletePodReturns
	fake.recordInvocation("EvictOrDeletePod", []interface{}{arg1})
	fake.evictOrDeletePodMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeEvictor) EvictOrDeletePodCallCount() int {
	fake.evictOrDeletePodMutex.RLock()
	defer fake.evictOrDeletePodMutex.RUnlock()
	return len(fake.evictOrDeletePodArgsForCall)
}

func (fake *FakeEvictor) EvictOrDeletePodCalls(stub func(v1.Pod) error) {
	fake.evictOrDeletePodMutex.Lock()
	defer fake.evictOrDeletePodMutex.Unlock()
	fake.EvictOrDeletePodStub = stub
}

func (fake *FakeEvictor) EvictOrDeletePodArgsForCall(i int) v1.Pod {
	fake.evictOrDeletePodMutex.RLock()
	defer fake.evictOrDeletePodMutex.RUnlock()
	argsForCall := fake.evictOrDeletePodArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeEvictor) EvictOrDeletePodReturns(result1 error) {
	fake.evictOrDeletePodMutex.Lock()
	defer fake.evictOrDeletePodMutex.Unlock()
	fake.EvictOrDeletePodStub = nil
	fake.evictOrDeletePodReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeEvictor) EvictOrDeletePodReturnsOnCall(i int, result1 error) {
	fake.evictOrDeletePodMutex.Lock()
	defer fake.evictOrDeletePodMutex.Unlock()
	fake.EvictOrDeletePodStub = nil
	if fake.evictOrDeletePodReturnsOnCall == nil {
		fake.evictOrDeletePodReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.evictOrDeletePodReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeEvictor) GetPodsForEviction(arg1 string) (*evictor.PodDeleteList, []error) {
	fake.getPodsForEvictionMutex.Lock()
	ret, specificReturn := fake.getPodsForEvictionReturnsOnCall[len(fake.getPodsForEvictionArgsForCall)]
	fake.getPodsForEvictionArgsForCall = append(fake.getPodsForEvictionArgsForCall, struct {
		arg1 string
	}{arg1})
	stub := fake.GetPodsForEvictionStub
	fakeReturns := fake.getPodsForEvictionReturns
	fake.recordInvocation("GetPodsForEviction", []interface{}{arg1})
	fake.getPodsForEvictionMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeEvictor) GetPodsForEvictionCallCount() int {
	fake.getPodsForEvictionMutex.RLock()
	defer fake.getPodsForEvictionMutex.RUnlock()
	return len(fake.getPodsForEvictionArgsForCall)
}

func (fake *FakeEvictor) GetPodsForEvictionCalls(stub func(string) (*evictor.PodDeleteList, []error)) {
	fake.getPodsForEvictionMutex.Lock()
	defer fake.getPodsForEvictionMutex.Unlock()
	fake.GetPodsForEvictionStub = stub
}

func (fake *FakeEvictor) GetPodsForEvictionArgsForCall(i int) string {
	fake.getPodsForEvictionMutex.RLock()
	defer fake.getPodsForEvictionMutex.RUnlock()
	argsForCall := fake.getPodsForEvictionArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeEvictor) GetPodsForEvictionReturns(result1 *evictor.PodDeleteList, result2 []error) {
	fake.getPodsForEvictionMutex.Lock()
	defer fake.getPodsForEvictionMutex.Unlock()
	fake.GetPodsForEvictionStub = nil
	fake.getPodsForEvictionReturns = struct {
		result1 *evictor.PodDeleteList
		result2 []error
	}{result1, result2}
}

func (fake *FakeEvictor) GetPodsForEvictionReturnsOnCall(i int, result1 *evictor.PodDeleteList, result2 []error) {
	fake.getPodsForEvictionMutex.Lock()
	defer fake.getPodsForEvictionMutex.Unlock()
	fake.GetPodsForEvictionStub = nil
	if fake.getPodsForEvictionReturnsOnCall == nil {
		fake.getPodsForEvictionReturnsOnCall = make(map[int]struct {
			result1 *evictor.PodDeleteList
			result2 []error
		})
	}
	fake.getPodsForEvictionReturnsOnCall[i] = struct {
		result1 *evictor.PodDeleteList
		result2 []error
	}{result1, result2}
}

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

func (fake *FakeEvictor) 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 _ drain.Evictor = new(FakeEvictor)
