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

import (
	"sync"

	"github.com/weaveworks/eksctl/pkg/actions/cluster"
	"github.com/weaveworks/eksctl/pkg/apis/eksctl.io/v1alpha5"
	"github.com/weaveworks/eksctl/pkg/cfn/manager"
)

type FakeStackManagerConstructor struct {
	Stub        func(v1alpha5.ClusterProvider, *v1alpha5.ClusterConfig) manager.StackManager
	mutex       sync.RWMutex
	argsForCall []struct {
		arg1 v1alpha5.ClusterProvider
		arg2 *v1alpha5.ClusterConfig
	}
	returns struct {
		result1 manager.StackManager
	}
	returnsOnCall map[int]struct {
		result1 manager.StackManager
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeStackManagerConstructor) Spy(arg1 v1alpha5.ClusterProvider, arg2 *v1alpha5.ClusterConfig) manager.StackManager {
	fake.mutex.Lock()
	ret, specificReturn := fake.returnsOnCall[len(fake.argsForCall)]
	fake.argsForCall = append(fake.argsForCall, struct {
		arg1 v1alpha5.ClusterProvider
		arg2 *v1alpha5.ClusterConfig
	}{arg1, arg2})
	stub := fake.Stub
	returns := fake.returns
	fake.recordInvocation("StackManagerConstructor", []interface{}{arg1, arg2})
	fake.mutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	return returns.result1
}

func (fake *FakeStackManagerConstructor) CallCount() int {
	fake.mutex.RLock()
	defer fake.mutex.RUnlock()
	return len(fake.argsForCall)
}

func (fake *FakeStackManagerConstructor) Calls(stub func(v1alpha5.ClusterProvider, *v1alpha5.ClusterConfig) manager.StackManager) {
	fake.mutex.Lock()
	defer fake.mutex.Unlock()
	fake.Stub = stub
}

func (fake *FakeStackManagerConstructor) ArgsForCall(i int) (v1alpha5.ClusterProvider, *v1alpha5.ClusterConfig) {
	fake.mutex.RLock()
	defer fake.mutex.RUnlock()
	return fake.argsForCall[i].arg1, fake.argsForCall[i].arg2
}

func (fake *FakeStackManagerConstructor) Returns(result1 manager.StackManager) {
	fake.mutex.Lock()
	defer fake.mutex.Unlock()
	fake.Stub = nil
	fake.returns = struct {
		result1 manager.StackManager
	}{result1}
}

func (fake *FakeStackManagerConstructor) ReturnsOnCall(i int, result1 manager.StackManager) {
	fake.mutex.Lock()
	defer fake.mutex.Unlock()
	fake.Stub = nil
	if fake.returnsOnCall == nil {
		fake.returnsOnCall = make(map[int]struct {
			result1 manager.StackManager
		})
	}
	fake.returnsOnCall[i] = struct {
		result1 manager.StackManager
	}{result1}
}

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

func (fake *FakeStackManagerConstructor) 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 _ cluster.StackManagerConstructor = new(FakeStackManagerConstructor).Spy
