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

import (
	"context"
	"sync"

	"github.com/weaveworks/eksctl/pkg/apis/eksctl.io/v1alpha5"
	"github.com/weaveworks/eksctl/pkg/utils/tasks"
	"github.com/weaveworks/eksctl/pkg/vpc"
)

type FakeNodeGroupTaskCreator struct {
	NewUnmanagedNodeGroupTaskStub        func(context.Context, []*v1alpha5.NodeGroup, bool, bool, bool, vpc.Importer) *tasks.TaskTree
	newUnmanagedNodeGroupTaskMutex       sync.RWMutex
	newUnmanagedNodeGroupTaskArgsForCall []struct {
		arg1 context.Context
		arg2 []*v1alpha5.NodeGroup
		arg3 bool
		arg4 bool
		arg5 bool
		arg6 vpc.Importer
	}
	newUnmanagedNodeGroupTaskReturns struct {
		result1 *tasks.TaskTree
	}
	newUnmanagedNodeGroupTaskReturnsOnCall map[int]struct {
		result1 *tasks.TaskTree
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeNodeGroupTaskCreator) NewUnmanagedNodeGroupTask(arg1 context.Context, arg2 []*v1alpha5.NodeGroup, arg3 bool, arg4 bool, arg5 bool, arg6 vpc.Importer) *tasks.TaskTree {
	var arg2Copy []*v1alpha5.NodeGroup
	if arg2 != nil {
		arg2Copy = make([]*v1alpha5.NodeGroup, len(arg2))
		copy(arg2Copy, arg2)
	}
	fake.newUnmanagedNodeGroupTaskMutex.Lock()
	ret, specificReturn := fake.newUnmanagedNodeGroupTaskReturnsOnCall[len(fake.newUnmanagedNodeGroupTaskArgsForCall)]
	fake.newUnmanagedNodeGroupTaskArgsForCall = append(fake.newUnmanagedNodeGroupTaskArgsForCall, struct {
		arg1 context.Context
		arg2 []*v1alpha5.NodeGroup
		arg3 bool
		arg4 bool
		arg5 bool
		arg6 vpc.Importer
	}{arg1, arg2Copy, arg3, arg4, arg5, arg6})
	stub := fake.NewUnmanagedNodeGroupTaskStub
	fakeReturns := fake.newUnmanagedNodeGroupTaskReturns
	fake.recordInvocation("NewUnmanagedNodeGroupTask", []interface{}{arg1, arg2Copy, arg3, arg4, arg5, arg6})
	fake.newUnmanagedNodeGroupTaskMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3, arg4, arg5, arg6)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeNodeGroupTaskCreator) NewUnmanagedNodeGroupTaskCallCount() int {
	fake.newUnmanagedNodeGroupTaskMutex.RLock()
	defer fake.newUnmanagedNodeGroupTaskMutex.RUnlock()
	return len(fake.newUnmanagedNodeGroupTaskArgsForCall)
}

func (fake *FakeNodeGroupTaskCreator) NewUnmanagedNodeGroupTaskCalls(stub func(context.Context, []*v1alpha5.NodeGroup, bool, bool, bool, vpc.Importer) *tasks.TaskTree) {
	fake.newUnmanagedNodeGroupTaskMutex.Lock()
	defer fake.newUnmanagedNodeGroupTaskMutex.Unlock()
	fake.NewUnmanagedNodeGroupTaskStub = stub
}

func (fake *FakeNodeGroupTaskCreator) NewUnmanagedNodeGroupTaskArgsForCall(i int) (context.Context, []*v1alpha5.NodeGroup, bool, bool, bool, vpc.Importer) {
	fake.newUnmanagedNodeGroupTaskMutex.RLock()
	defer fake.newUnmanagedNodeGroupTaskMutex.RUnlock()
	argsForCall := fake.newUnmanagedNodeGroupTaskArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5, argsForCall.arg6
}

func (fake *FakeNodeGroupTaskCreator) NewUnmanagedNodeGroupTaskReturns(result1 *tasks.TaskTree) {
	fake.newUnmanagedNodeGroupTaskMutex.Lock()
	defer fake.newUnmanagedNodeGroupTaskMutex.Unlock()
	fake.NewUnmanagedNodeGroupTaskStub = nil
	fake.newUnmanagedNodeGroupTaskReturns = struct {
		result1 *tasks.TaskTree
	}{result1}
}

func (fake *FakeNodeGroupTaskCreator) NewUnmanagedNodeGroupTaskReturnsOnCall(i int, result1 *tasks.TaskTree) {
	fake.newUnmanagedNodeGroupTaskMutex.Lock()
	defer fake.newUnmanagedNodeGroupTaskMutex.Unlock()
	fake.NewUnmanagedNodeGroupTaskStub = nil
	if fake.newUnmanagedNodeGroupTaskReturnsOnCall == nil {
		fake.newUnmanagedNodeGroupTaskReturnsOnCall = make(map[int]struct {
			result1 *tasks.TaskTree
		})
	}
	fake.newUnmanagedNodeGroupTaskReturnsOnCall[i] = struct {
		result1 *tasks.TaskTree
	}{result1}
}

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

func (fake *FakeNodeGroupTaskCreator) 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)
}
