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

import (
	"context"
	"sync"

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

type FakeCreatorInterface struct {
	CreateStub        func(context.Context, []v1alpha5.AccessEntry) error
	createMutex       sync.RWMutex
	createArgsForCall []struct {
		arg1 context.Context
		arg2 []v1alpha5.AccessEntry
	}
	createReturns struct {
		result1 error
	}
	createReturnsOnCall map[int]struct {
		result1 error
	}
	CreateTasksStub        func(context.Context, []v1alpha5.AccessEntry) *tasks.TaskTree
	createTasksMutex       sync.RWMutex
	createTasksArgsForCall []struct {
		arg1 context.Context
		arg2 []v1alpha5.AccessEntry
	}
	createTasksReturns struct {
		result1 *tasks.TaskTree
	}
	createTasksReturnsOnCall map[int]struct {
		result1 *tasks.TaskTree
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeCreatorInterface) Create(arg1 context.Context, arg2 []v1alpha5.AccessEntry) error {
	var arg2Copy []v1alpha5.AccessEntry
	if arg2 != nil {
		arg2Copy = make([]v1alpha5.AccessEntry, len(arg2))
		copy(arg2Copy, arg2)
	}
	fake.createMutex.Lock()
	ret, specificReturn := fake.createReturnsOnCall[len(fake.createArgsForCall)]
	fake.createArgsForCall = append(fake.createArgsForCall, struct {
		arg1 context.Context
		arg2 []v1alpha5.AccessEntry
	}{arg1, arg2Copy})
	stub := fake.CreateStub
	fakeReturns := fake.createReturns
	fake.recordInvocation("Create", []interface{}{arg1, arg2Copy})
	fake.createMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeCreatorInterface) CreateCallCount() int {
	fake.createMutex.RLock()
	defer fake.createMutex.RUnlock()
	return len(fake.createArgsForCall)
}

func (fake *FakeCreatorInterface) CreateCalls(stub func(context.Context, []v1alpha5.AccessEntry) error) {
	fake.createMutex.Lock()
	defer fake.createMutex.Unlock()
	fake.CreateStub = stub
}

func (fake *FakeCreatorInterface) CreateArgsForCall(i int) (context.Context, []v1alpha5.AccessEntry) {
	fake.createMutex.RLock()
	defer fake.createMutex.RUnlock()
	argsForCall := fake.createArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeCreatorInterface) CreateReturns(result1 error) {
	fake.createMutex.Lock()
	defer fake.createMutex.Unlock()
	fake.CreateStub = nil
	fake.createReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeCreatorInterface) CreateReturnsOnCall(i int, result1 error) {
	fake.createMutex.Lock()
	defer fake.createMutex.Unlock()
	fake.CreateStub = nil
	if fake.createReturnsOnCall == nil {
		fake.createReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.createReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeCreatorInterface) CreateTasks(arg1 context.Context, arg2 []v1alpha5.AccessEntry) *tasks.TaskTree {
	var arg2Copy []v1alpha5.AccessEntry
	if arg2 != nil {
		arg2Copy = make([]v1alpha5.AccessEntry, len(arg2))
		copy(arg2Copy, arg2)
	}
	fake.createTasksMutex.Lock()
	ret, specificReturn := fake.createTasksReturnsOnCall[len(fake.createTasksArgsForCall)]
	fake.createTasksArgsForCall = append(fake.createTasksArgsForCall, struct {
		arg1 context.Context
		arg2 []v1alpha5.AccessEntry
	}{arg1, arg2Copy})
	stub := fake.CreateTasksStub
	fakeReturns := fake.createTasksReturns
	fake.recordInvocation("CreateTasks", []interface{}{arg1, arg2Copy})
	fake.createTasksMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeCreatorInterface) CreateTasksCallCount() int {
	fake.createTasksMutex.RLock()
	defer fake.createTasksMutex.RUnlock()
	return len(fake.createTasksArgsForCall)
}

func (fake *FakeCreatorInterface) CreateTasksCalls(stub func(context.Context, []v1alpha5.AccessEntry) *tasks.TaskTree) {
	fake.createTasksMutex.Lock()
	defer fake.createTasksMutex.Unlock()
	fake.CreateTasksStub = stub
}

func (fake *FakeCreatorInterface) CreateTasksArgsForCall(i int) (context.Context, []v1alpha5.AccessEntry) {
	fake.createTasksMutex.RLock()
	defer fake.createTasksMutex.RUnlock()
	argsForCall := fake.createTasksArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeCreatorInterface) CreateTasksReturns(result1 *tasks.TaskTree) {
	fake.createTasksMutex.Lock()
	defer fake.createTasksMutex.Unlock()
	fake.CreateTasksStub = nil
	fake.createTasksReturns = struct {
		result1 *tasks.TaskTree
	}{result1}
}

func (fake *FakeCreatorInterface) CreateTasksReturnsOnCall(i int, result1 *tasks.TaskTree) {
	fake.createTasksMutex.Lock()
	defer fake.createTasksMutex.Unlock()
	fake.CreateTasksStub = nil
	if fake.createTasksReturnsOnCall == nil {
		fake.createTasksReturnsOnCall = make(map[int]struct {
			result1 *tasks.TaskTree
		})
	}
	fake.createTasksReturnsOnCall[i] = struct {
		result1 *tasks.TaskTree
	}{result1}
}

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