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

import (
	"sync"

	"github.com/cloudfoundry/cloud-service-broker/v2/pkg/providers/tf/invoker"
	version "github.com/hashicorp/go-version"
)

type FakeTerraformInvokerBuilder struct {
	VersionedTerraformInvokerStub        func(*version.Version) invoker.TerraformInvoker
	versionedTerraformInvokerMutex       sync.RWMutex
	versionedTerraformInvokerArgsForCall []struct {
		arg1 *version.Version
	}
	versionedTerraformInvokerReturns struct {
		result1 invoker.TerraformInvoker
	}
	versionedTerraformInvokerReturnsOnCall map[int]struct {
		result1 invoker.TerraformInvoker
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeTerraformInvokerBuilder) VersionedTerraformInvoker(arg1 *version.Version) invoker.TerraformInvoker {
	fake.versionedTerraformInvokerMutex.Lock()
	ret, specificReturn := fake.versionedTerraformInvokerReturnsOnCall[len(fake.versionedTerraformInvokerArgsForCall)]
	fake.versionedTerraformInvokerArgsForCall = append(fake.versionedTerraformInvokerArgsForCall, struct {
		arg1 *version.Version
	}{arg1})
	stub := fake.VersionedTerraformInvokerStub
	fakeReturns := fake.versionedTerraformInvokerReturns
	fake.recordInvocation("VersionedTerraformInvoker", []interface{}{arg1})
	fake.versionedTerraformInvokerMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeTerraformInvokerBuilder) VersionedTerraformInvokerCallCount() int {
	fake.versionedTerraformInvokerMutex.RLock()
	defer fake.versionedTerraformInvokerMutex.RUnlock()
	return len(fake.versionedTerraformInvokerArgsForCall)
}

func (fake *FakeTerraformInvokerBuilder) VersionedTerraformInvokerCalls(stub func(*version.Version) invoker.TerraformInvoker) {
	fake.versionedTerraformInvokerMutex.Lock()
	defer fake.versionedTerraformInvokerMutex.Unlock()
	fake.VersionedTerraformInvokerStub = stub
}

func (fake *FakeTerraformInvokerBuilder) VersionedTerraformInvokerArgsForCall(i int) *version.Version {
	fake.versionedTerraformInvokerMutex.RLock()
	defer fake.versionedTerraformInvokerMutex.RUnlock()
	argsForCall := fake.versionedTerraformInvokerArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeTerraformInvokerBuilder) VersionedTerraformInvokerReturns(result1 invoker.TerraformInvoker) {
	fake.versionedTerraformInvokerMutex.Lock()
	defer fake.versionedTerraformInvokerMutex.Unlock()
	fake.VersionedTerraformInvokerStub = nil
	fake.versionedTerraformInvokerReturns = struct {
		result1 invoker.TerraformInvoker
	}{result1}
}

func (fake *FakeTerraformInvokerBuilder) VersionedTerraformInvokerReturnsOnCall(i int, result1 invoker.TerraformInvoker) {
	fake.versionedTerraformInvokerMutex.Lock()
	defer fake.versionedTerraformInvokerMutex.Unlock()
	fake.VersionedTerraformInvokerStub = nil
	if fake.versionedTerraformInvokerReturnsOnCall == nil {
		fake.versionedTerraformInvokerReturnsOnCall = make(map[int]struct {
			result1 invoker.TerraformInvoker
		})
	}
	fake.versionedTerraformInvokerReturnsOnCall[i] = struct {
		result1 invoker.TerraformInvoker
	}{result1}
}

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

func (fake *FakeTerraformInvokerBuilder) 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 _ invoker.TerraformInvokerBuilder = new(FakeTerraformInvokerBuilder)
