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

import (
	"context"
	"sync"

	"github.com/aws/aws-sdk-go-v2/aws"
)

type FakeProvider struct {
	RetrieveStub        func(context.Context) (aws.Credentials, error)
	retrieveMutex       sync.RWMutex
	retrieveArgsForCall []struct {
		arg1 context.Context
	}
	retrieveReturns struct {
		result1 aws.Credentials
		result2 error
	}
	retrieveReturnsOnCall map[int]struct {
		result1 aws.Credentials
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeProvider) Retrieve(arg1 context.Context) (aws.Credentials, error) {
	fake.retrieveMutex.Lock()
	ret, specificReturn := fake.retrieveReturnsOnCall[len(fake.retrieveArgsForCall)]
	fake.retrieveArgsForCall = append(fake.retrieveArgsForCall, struct {
		arg1 context.Context
	}{arg1})
	stub := fake.RetrieveStub
	fakeReturns := fake.retrieveReturns
	fake.recordInvocation("Retrieve", []interface{}{arg1})
	fake.retrieveMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeProvider) RetrieveCallCount() int {
	fake.retrieveMutex.RLock()
	defer fake.retrieveMutex.RUnlock()
	return len(fake.retrieveArgsForCall)
}

func (fake *FakeProvider) RetrieveCalls(stub func(context.Context) (aws.Credentials, error)) {
	fake.retrieveMutex.Lock()
	defer fake.retrieveMutex.Unlock()
	fake.RetrieveStub = stub
}

func (fake *FakeProvider) RetrieveArgsForCall(i int) context.Context {
	fake.retrieveMutex.RLock()
	defer fake.retrieveMutex.RUnlock()
	argsForCall := fake.retrieveArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeProvider) RetrieveReturns(result1 aws.Credentials, result2 error) {
	fake.retrieveMutex.Lock()
	defer fake.retrieveMutex.Unlock()
	fake.RetrieveStub = nil
	fake.retrieveReturns = struct {
		result1 aws.Credentials
		result2 error
	}{result1, result2}
}

func (fake *FakeProvider) RetrieveReturnsOnCall(i int, result1 aws.Credentials, result2 error) {
	fake.retrieveMutex.Lock()
	defer fake.retrieveMutex.Unlock()
	fake.RetrieveStub = nil
	if fake.retrieveReturnsOnCall == nil {
		fake.retrieveReturnsOnCall = make(map[int]struct {
			result1 aws.Credentials
			result2 error
		})
	}
	fake.retrieveReturnsOnCall[i] = struct {
		result1 aws.Credentials
		result2 error
	}{result1, result2}
}

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

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