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

import (
	"context"
	"sync"

	"github.com/aws/aws-sdk-go-v2/service/cloudformation/types"
	"github.com/weaveworks/eksctl/pkg/actions/accessentry"
	"github.com/weaveworks/eksctl/pkg/cfn/builder"
)

type FakeStackCreator struct {
	CreateStackStub        func(context.Context, string, builder.ResourceSetReader, map[string]string, map[string]string, chan error) error
	createStackMutex       sync.RWMutex
	createStackArgsForCall []struct {
		arg1 context.Context
		arg2 string
		arg3 builder.ResourceSetReader
		arg4 map[string]string
		arg5 map[string]string
		arg6 chan error
	}
	createStackReturns struct {
		result1 error
	}
	createStackReturnsOnCall map[int]struct {
		result1 error
	}
	TroubleshootStackFailureCauseStub        func(context.Context, *types.Stack, types.StackStatus)
	troubleshootStackFailureCauseMutex       sync.RWMutex
	troubleshootStackFailureCauseArgsForCall []struct {
		arg1 context.Context
		arg2 *types.Stack
		arg3 types.StackStatus
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeStackCreator) CreateStack(arg1 context.Context, arg2 string, arg3 builder.ResourceSetReader, arg4 map[string]string, arg5 map[string]string, arg6 chan error) error {
	fake.createStackMutex.Lock()
	ret, specificReturn := fake.createStackReturnsOnCall[len(fake.createStackArgsForCall)]
	fake.createStackArgsForCall = append(fake.createStackArgsForCall, struct {
		arg1 context.Context
		arg2 string
		arg3 builder.ResourceSetReader
		arg4 map[string]string
		arg5 map[string]string
		arg6 chan error
	}{arg1, arg2, arg3, arg4, arg5, arg6})
	stub := fake.CreateStackStub
	fakeReturns := fake.createStackReturns
	fake.recordInvocation("CreateStack", []interface{}{arg1, arg2, arg3, arg4, arg5, arg6})
	fake.createStackMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3, arg4, arg5, arg6)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeStackCreator) CreateStackCallCount() int {
	fake.createStackMutex.RLock()
	defer fake.createStackMutex.RUnlock()
	return len(fake.createStackArgsForCall)
}

func (fake *FakeStackCreator) CreateStackCalls(stub func(context.Context, string, builder.ResourceSetReader, map[string]string, map[string]string, chan error) error) {
	fake.createStackMutex.Lock()
	defer fake.createStackMutex.Unlock()
	fake.CreateStackStub = stub
}

func (fake *FakeStackCreator) CreateStackArgsForCall(i int) (context.Context, string, builder.ResourceSetReader, map[string]string, map[string]string, chan error) {
	fake.createStackMutex.RLock()
	defer fake.createStackMutex.RUnlock()
	argsForCall := fake.createStackArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5, argsForCall.arg6
}

func (fake *FakeStackCreator) CreateStackReturns(result1 error) {
	fake.createStackMutex.Lock()
	defer fake.createStackMutex.Unlock()
	fake.CreateStackStub = nil
	fake.createStackReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeStackCreator) CreateStackReturnsOnCall(i int, result1 error) {
	fake.createStackMutex.Lock()
	defer fake.createStackMutex.Unlock()
	fake.CreateStackStub = nil
	if fake.createStackReturnsOnCall == nil {
		fake.createStackReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.createStackReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeStackCreator) TroubleshootStackFailureCause(arg1 context.Context, arg2 *types.Stack, arg3 types.StackStatus) {
	fake.troubleshootStackFailureCauseMutex.Lock()
	fake.troubleshootStackFailureCauseArgsForCall = append(fake.troubleshootStackFailureCauseArgsForCall, struct {
		arg1 context.Context
		arg2 *types.Stack
		arg3 types.StackStatus
	}{arg1, arg2, arg3})
	stub := fake.TroubleshootStackFailureCauseStub
	fake.recordInvocation("TroubleshootStackFailureCause", []interface{}{arg1, arg2, arg3})
	fake.troubleshootStackFailureCauseMutex.Unlock()
	if stub != nil {
		fake.TroubleshootStackFailureCauseStub(arg1, arg2, arg3)
	}
}

func (fake *FakeStackCreator) TroubleshootStackFailureCauseCallCount() int {
	fake.troubleshootStackFailureCauseMutex.RLock()
	defer fake.troubleshootStackFailureCauseMutex.RUnlock()
	return len(fake.troubleshootStackFailureCauseArgsForCall)
}

func (fake *FakeStackCreator) TroubleshootStackFailureCauseCalls(stub func(context.Context, *types.Stack, types.StackStatus)) {
	fake.troubleshootStackFailureCauseMutex.Lock()
	defer fake.troubleshootStackFailureCauseMutex.Unlock()
	fake.TroubleshootStackFailureCauseStub = stub
}

func (fake *FakeStackCreator) TroubleshootStackFailureCauseArgsForCall(i int) (context.Context, *types.Stack, types.StackStatus) {
	fake.troubleshootStackFailureCauseMutex.RLock()
	defer fake.troubleshootStackFailureCauseMutex.RUnlock()
	argsForCall := fake.troubleshootStackFailureCauseArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

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

func (fake *FakeStackCreator) 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 _ accessentry.StackCreator = new(FakeStackCreator)
