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

import (
	"sync"

	"code.cloudfoundry.org/cli/actor/v7action"
	"code.cloudfoundry.org/cli/api/cloudcontroller/ccv3"
	"code.cloudfoundry.org/cli/resources"
)

type FakeWhoAmIer struct {
	WhoAmIStub        func() (resources.K8sUser, ccv3.Warnings, error)
	whoAmIMutex       sync.RWMutex
	whoAmIArgsForCall []struct {
	}
	whoAmIReturns struct {
		result1 resources.K8sUser
		result2 ccv3.Warnings
		result3 error
	}
	whoAmIReturnsOnCall map[int]struct {
		result1 resources.K8sUser
		result2 ccv3.Warnings
		result3 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeWhoAmIer) WhoAmI() (resources.K8sUser, ccv3.Warnings, error) {
	fake.whoAmIMutex.Lock()
	ret, specificReturn := fake.whoAmIReturnsOnCall[len(fake.whoAmIArgsForCall)]
	fake.whoAmIArgsForCall = append(fake.whoAmIArgsForCall, struct {
	}{})
	fake.recordInvocation("WhoAmI", []interface{}{})
	fake.whoAmIMutex.Unlock()
	if fake.WhoAmIStub != nil {
		return fake.WhoAmIStub()
	}
	if specificReturn {
		return ret.result1, ret.result2, ret.result3
	}
	fakeReturns := fake.whoAmIReturns
	return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3
}

func (fake *FakeWhoAmIer) WhoAmICallCount() int {
	fake.whoAmIMutex.RLock()
	defer fake.whoAmIMutex.RUnlock()
	return len(fake.whoAmIArgsForCall)
}

func (fake *FakeWhoAmIer) WhoAmICalls(stub func() (resources.K8sUser, ccv3.Warnings, error)) {
	fake.whoAmIMutex.Lock()
	defer fake.whoAmIMutex.Unlock()
	fake.WhoAmIStub = stub
}

func (fake *FakeWhoAmIer) WhoAmIReturns(result1 resources.K8sUser, result2 ccv3.Warnings, result3 error) {
	fake.whoAmIMutex.Lock()
	defer fake.whoAmIMutex.Unlock()
	fake.WhoAmIStub = nil
	fake.whoAmIReturns = struct {
		result1 resources.K8sUser
		result2 ccv3.Warnings
		result3 error
	}{result1, result2, result3}
}

func (fake *FakeWhoAmIer) WhoAmIReturnsOnCall(i int, result1 resources.K8sUser, result2 ccv3.Warnings, result3 error) {
	fake.whoAmIMutex.Lock()
	defer fake.whoAmIMutex.Unlock()
	fake.WhoAmIStub = nil
	if fake.whoAmIReturnsOnCall == nil {
		fake.whoAmIReturnsOnCall = make(map[int]struct {
			result1 resources.K8sUser
			result2 ccv3.Warnings
			result3 error
		})
	}
	fake.whoAmIReturnsOnCall[i] = struct {
		result1 resources.K8sUser
		result2 ccv3.Warnings
		result3 error
	}{result1, result2, result3}
}

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

func (fake *FakeWhoAmIer) 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 _ v7action.WhoAmIer = new(FakeWhoAmIer)
