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

import (
	"context"
	"sync"

	"github.com/aws/aws-sdk-go-v2/aws"
	"github.com/aws/aws-sdk-go-v2/config"
	"github.com/weaveworks/eksctl/pkg/eks"
)

type FakeAWSConfigurationLoader struct {
	LoadDefaultConfigStub        func(context.Context, ...func(*config.LoadOptions) error) (aws.Config, error)
	loadDefaultConfigMutex       sync.RWMutex
	loadDefaultConfigArgsForCall []struct {
		arg1 context.Context
		arg2 []func(*config.LoadOptions) error
	}
	loadDefaultConfigReturns struct {
		result1 aws.Config
		result2 error
	}
	loadDefaultConfigReturnsOnCall map[int]struct {
		result1 aws.Config
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeAWSConfigurationLoader) LoadDefaultConfig(arg1 context.Context, arg2 ...func(*config.LoadOptions) error) (aws.Config, error) {
	fake.loadDefaultConfigMutex.Lock()
	ret, specificReturn := fake.loadDefaultConfigReturnsOnCall[len(fake.loadDefaultConfigArgsForCall)]
	fake.loadDefaultConfigArgsForCall = append(fake.loadDefaultConfigArgsForCall, struct {
		arg1 context.Context
		arg2 []func(*config.LoadOptions) error
	}{arg1, arg2})
	stub := fake.LoadDefaultConfigStub
	fakeReturns := fake.loadDefaultConfigReturns
	fake.recordInvocation("LoadDefaultConfig", []interface{}{arg1, arg2})
	fake.loadDefaultConfigMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2...)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeAWSConfigurationLoader) LoadDefaultConfigCallCount() int {
	fake.loadDefaultConfigMutex.RLock()
	defer fake.loadDefaultConfigMutex.RUnlock()
	return len(fake.loadDefaultConfigArgsForCall)
}

func (fake *FakeAWSConfigurationLoader) LoadDefaultConfigCalls(stub func(context.Context, ...func(*config.LoadOptions) error) (aws.Config, error)) {
	fake.loadDefaultConfigMutex.Lock()
	defer fake.loadDefaultConfigMutex.Unlock()
	fake.LoadDefaultConfigStub = stub
}

func (fake *FakeAWSConfigurationLoader) LoadDefaultConfigArgsForCall(i int) (context.Context, []func(*config.LoadOptions) error) {
	fake.loadDefaultConfigMutex.RLock()
	defer fake.loadDefaultConfigMutex.RUnlock()
	argsForCall := fake.loadDefaultConfigArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeAWSConfigurationLoader) LoadDefaultConfigReturns(result1 aws.Config, result2 error) {
	fake.loadDefaultConfigMutex.Lock()
	defer fake.loadDefaultConfigMutex.Unlock()
	fake.LoadDefaultConfigStub = nil
	fake.loadDefaultConfigReturns = struct {
		result1 aws.Config
		result2 error
	}{result1, result2}
}

func (fake *FakeAWSConfigurationLoader) LoadDefaultConfigReturnsOnCall(i int, result1 aws.Config, result2 error) {
	fake.loadDefaultConfigMutex.Lock()
	defer fake.loadDefaultConfigMutex.Unlock()
	fake.LoadDefaultConfigStub = nil
	if fake.loadDefaultConfigReturnsOnCall == nil {
		fake.loadDefaultConfigReturnsOnCall = make(map[int]struct {
			result1 aws.Config
			result2 error
		})
	}
	fake.loadDefaultConfigReturnsOnCall[i] = struct {
		result1 aws.Config
		result2 error
	}{result1, result2}
}

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

func (fake *FakeAWSConfigurationLoader) 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 _ eks.AWSConfigurationLoader = new(FakeAWSConfigurationLoader)
