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

import (
	"context"
	"sync"

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

type FakeWorkspace struct {
	ExecuteStub        func(context.Context, executor.TerraformExecutor, ...command.TerraformCommand) (executor.ExecutionOutput, error)
	executeMutex       sync.RWMutex
	executeArgsForCall []struct {
		arg1 context.Context
		arg2 executor.TerraformExecutor
		arg3 []command.TerraformCommand
	}
	executeReturns struct {
		result1 executor.ExecutionOutput
		result2 error
	}
	executeReturnsOnCall map[int]struct {
		result1 executor.ExecutionOutput
		result2 error
	}
	HasStateStub        func() bool
	hasStateMutex       sync.RWMutex
	hasStateArgsForCall []struct {
	}
	hasStateReturns struct {
		result1 bool
	}
	hasStateReturnsOnCall map[int]struct {
		result1 bool
	}
	ModuleDefinitionsStub        func() []workspace.ModuleDefinition
	moduleDefinitionsMutex       sync.RWMutex
	moduleDefinitionsArgsForCall []struct {
	}
	moduleDefinitionsReturns struct {
		result1 []workspace.ModuleDefinition
	}
	moduleDefinitionsReturnsOnCall map[int]struct {
		result1 []workspace.ModuleDefinition
	}
	ModuleInstancesStub        func() []workspace.ModuleInstance
	moduleInstancesMutex       sync.RWMutex
	moduleInstancesArgsForCall []struct {
	}
	moduleInstancesReturns struct {
		result1 []workspace.ModuleInstance
	}
	moduleInstancesReturnsOnCall map[int]struct {
		result1 []workspace.ModuleInstance
	}
	OutputsStub        func(string) (map[string]any, error)
	outputsMutex       sync.RWMutex
	outputsArgsForCall []struct {
		arg1 string
	}
	outputsReturns struct {
		result1 map[string]any
		result2 error
	}
	outputsReturnsOnCall map[int]struct {
		result1 map[string]any
		result2 error
	}
	SerializeStub        func() (string, error)
	serializeMutex       sync.RWMutex
	serializeArgsForCall []struct {
	}
	serializeReturns struct {
		result1 string
		result2 error
	}
	serializeReturnsOnCall map[int]struct {
		result1 string
		result2 error
	}
	StateTFVersionStub        func() (*version.Version, error)
	stateTFVersionMutex       sync.RWMutex
	stateTFVersionArgsForCall []struct {
	}
	stateTFVersionReturns struct {
		result1 *version.Version
		result2 error
	}
	stateTFVersionReturnsOnCall map[int]struct {
		result1 *version.Version
		result2 error
	}
	UpdateInstanceConfigurationStub        func(map[string]any) error
	updateInstanceConfigurationMutex       sync.RWMutex
	updateInstanceConfigurationArgsForCall []struct {
		arg1 map[string]any
	}
	updateInstanceConfigurationReturns struct {
		result1 error
	}
	updateInstanceConfigurationReturnsOnCall map[int]struct {
		result1 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeWorkspace) Execute(arg1 context.Context, arg2 executor.TerraformExecutor, arg3 ...command.TerraformCommand) (executor.ExecutionOutput, error) {
	fake.executeMutex.Lock()
	ret, specificReturn := fake.executeReturnsOnCall[len(fake.executeArgsForCall)]
	fake.executeArgsForCall = append(fake.executeArgsForCall, struct {
		arg1 context.Context
		arg2 executor.TerraformExecutor
		arg3 []command.TerraformCommand
	}{arg1, arg2, arg3})
	stub := fake.ExecuteStub
	fakeReturns := fake.executeReturns
	fake.recordInvocation("Execute", []interface{}{arg1, arg2, arg3})
	fake.executeMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3...)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeWorkspace) ExecuteCallCount() int {
	fake.executeMutex.RLock()
	defer fake.executeMutex.RUnlock()
	return len(fake.executeArgsForCall)
}

func (fake *FakeWorkspace) ExecuteCalls(stub func(context.Context, executor.TerraformExecutor, ...command.TerraformCommand) (executor.ExecutionOutput, error)) {
	fake.executeMutex.Lock()
	defer fake.executeMutex.Unlock()
	fake.ExecuteStub = stub
}

func (fake *FakeWorkspace) ExecuteArgsForCall(i int) (context.Context, executor.TerraformExecutor, []command.TerraformCommand) {
	fake.executeMutex.RLock()
	defer fake.executeMutex.RUnlock()
	argsForCall := fake.executeArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *FakeWorkspace) ExecuteReturns(result1 executor.ExecutionOutput, result2 error) {
	fake.executeMutex.Lock()
	defer fake.executeMutex.Unlock()
	fake.ExecuteStub = nil
	fake.executeReturns = struct {
		result1 executor.ExecutionOutput
		result2 error
	}{result1, result2}
}

func (fake *FakeWorkspace) ExecuteReturnsOnCall(i int, result1 executor.ExecutionOutput, result2 error) {
	fake.executeMutex.Lock()
	defer fake.executeMutex.Unlock()
	fake.ExecuteStub = nil
	if fake.executeReturnsOnCall == nil {
		fake.executeReturnsOnCall = make(map[int]struct {
			result1 executor.ExecutionOutput
			result2 error
		})
	}
	fake.executeReturnsOnCall[i] = struct {
		result1 executor.ExecutionOutput
		result2 error
	}{result1, result2}
}

func (fake *FakeWorkspace) HasState() bool {
	fake.hasStateMutex.Lock()
	ret, specificReturn := fake.hasStateReturnsOnCall[len(fake.hasStateArgsForCall)]
	fake.hasStateArgsForCall = append(fake.hasStateArgsForCall, struct {
	}{})
	stub := fake.HasStateStub
	fakeReturns := fake.hasStateReturns
	fake.recordInvocation("HasState", []interface{}{})
	fake.hasStateMutex.Unlock()
	if stub != nil {
		return stub()
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeWorkspace) HasStateCallCount() int {
	fake.hasStateMutex.RLock()
	defer fake.hasStateMutex.RUnlock()
	return len(fake.hasStateArgsForCall)
}

func (fake *FakeWorkspace) HasStateCalls(stub func() bool) {
	fake.hasStateMutex.Lock()
	defer fake.hasStateMutex.Unlock()
	fake.HasStateStub = stub
}

func (fake *FakeWorkspace) HasStateReturns(result1 bool) {
	fake.hasStateMutex.Lock()
	defer fake.hasStateMutex.Unlock()
	fake.HasStateStub = nil
	fake.hasStateReturns = struct {
		result1 bool
	}{result1}
}

func (fake *FakeWorkspace) HasStateReturnsOnCall(i int, result1 bool) {
	fake.hasStateMutex.Lock()
	defer fake.hasStateMutex.Unlock()
	fake.HasStateStub = nil
	if fake.hasStateReturnsOnCall == nil {
		fake.hasStateReturnsOnCall = make(map[int]struct {
			result1 bool
		})
	}
	fake.hasStateReturnsOnCall[i] = struct {
		result1 bool
	}{result1}
}

func (fake *FakeWorkspace) ModuleDefinitions() []workspace.ModuleDefinition {
	fake.moduleDefinitionsMutex.Lock()
	ret, specificReturn := fake.moduleDefinitionsReturnsOnCall[len(fake.moduleDefinitionsArgsForCall)]
	fake.moduleDefinitionsArgsForCall = append(fake.moduleDefinitionsArgsForCall, struct {
	}{})
	stub := fake.ModuleDefinitionsStub
	fakeReturns := fake.moduleDefinitionsReturns
	fake.recordInvocation("ModuleDefinitions", []interface{}{})
	fake.moduleDefinitionsMutex.Unlock()
	if stub != nil {
		return stub()
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeWorkspace) ModuleDefinitionsCallCount() int {
	fake.moduleDefinitionsMutex.RLock()
	defer fake.moduleDefinitionsMutex.RUnlock()
	return len(fake.moduleDefinitionsArgsForCall)
}

func (fake *FakeWorkspace) ModuleDefinitionsCalls(stub func() []workspace.ModuleDefinition) {
	fake.moduleDefinitionsMutex.Lock()
	defer fake.moduleDefinitionsMutex.Unlock()
	fake.ModuleDefinitionsStub = stub
}

func (fake *FakeWorkspace) ModuleDefinitionsReturns(result1 []workspace.ModuleDefinition) {
	fake.moduleDefinitionsMutex.Lock()
	defer fake.moduleDefinitionsMutex.Unlock()
	fake.ModuleDefinitionsStub = nil
	fake.moduleDefinitionsReturns = struct {
		result1 []workspace.ModuleDefinition
	}{result1}
}

func (fake *FakeWorkspace) ModuleDefinitionsReturnsOnCall(i int, result1 []workspace.ModuleDefinition) {
	fake.moduleDefinitionsMutex.Lock()
	defer fake.moduleDefinitionsMutex.Unlock()
	fake.ModuleDefinitionsStub = nil
	if fake.moduleDefinitionsReturnsOnCall == nil {
		fake.moduleDefinitionsReturnsOnCall = make(map[int]struct {
			result1 []workspace.ModuleDefinition
		})
	}
	fake.moduleDefinitionsReturnsOnCall[i] = struct {
		result1 []workspace.ModuleDefinition
	}{result1}
}

func (fake *FakeWorkspace) ModuleInstances() []workspace.ModuleInstance {
	fake.moduleInstancesMutex.Lock()
	ret, specificReturn := fake.moduleInstancesReturnsOnCall[len(fake.moduleInstancesArgsForCall)]
	fake.moduleInstancesArgsForCall = append(fake.moduleInstancesArgsForCall, struct {
	}{})
	stub := fake.ModuleInstancesStub
	fakeReturns := fake.moduleInstancesReturns
	fake.recordInvocation("ModuleInstances", []interface{}{})
	fake.moduleInstancesMutex.Unlock()
	if stub != nil {
		return stub()
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeWorkspace) ModuleInstancesCallCount() int {
	fake.moduleInstancesMutex.RLock()
	defer fake.moduleInstancesMutex.RUnlock()
	return len(fake.moduleInstancesArgsForCall)
}

func (fake *FakeWorkspace) ModuleInstancesCalls(stub func() []workspace.ModuleInstance) {
	fake.moduleInstancesMutex.Lock()
	defer fake.moduleInstancesMutex.Unlock()
	fake.ModuleInstancesStub = stub
}

func (fake *FakeWorkspace) ModuleInstancesReturns(result1 []workspace.ModuleInstance) {
	fake.moduleInstancesMutex.Lock()
	defer fake.moduleInstancesMutex.Unlock()
	fake.ModuleInstancesStub = nil
	fake.moduleInstancesReturns = struct {
		result1 []workspace.ModuleInstance
	}{result1}
}

func (fake *FakeWorkspace) ModuleInstancesReturnsOnCall(i int, result1 []workspace.ModuleInstance) {
	fake.moduleInstancesMutex.Lock()
	defer fake.moduleInstancesMutex.Unlock()
	fake.ModuleInstancesStub = nil
	if fake.moduleInstancesReturnsOnCall == nil {
		fake.moduleInstancesReturnsOnCall = make(map[int]struct {
			result1 []workspace.ModuleInstance
		})
	}
	fake.moduleInstancesReturnsOnCall[i] = struct {
		result1 []workspace.ModuleInstance
	}{result1}
}

func (fake *FakeWorkspace) Outputs(arg1 string) (map[string]any, error) {
	fake.outputsMutex.Lock()
	ret, specificReturn := fake.outputsReturnsOnCall[len(fake.outputsArgsForCall)]
	fake.outputsArgsForCall = append(fake.outputsArgsForCall, struct {
		arg1 string
	}{arg1})
	stub := fake.OutputsStub
	fakeReturns := fake.outputsReturns
	fake.recordInvocation("Outputs", []interface{}{arg1})
	fake.outputsMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeWorkspace) OutputsCallCount() int {
	fake.outputsMutex.RLock()
	defer fake.outputsMutex.RUnlock()
	return len(fake.outputsArgsForCall)
}

func (fake *FakeWorkspace) OutputsCalls(stub func(string) (map[string]any, error)) {
	fake.outputsMutex.Lock()
	defer fake.outputsMutex.Unlock()
	fake.OutputsStub = stub
}

func (fake *FakeWorkspace) OutputsArgsForCall(i int) string {
	fake.outputsMutex.RLock()
	defer fake.outputsMutex.RUnlock()
	argsForCall := fake.outputsArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeWorkspace) OutputsReturns(result1 map[string]any, result2 error) {
	fake.outputsMutex.Lock()
	defer fake.outputsMutex.Unlock()
	fake.OutputsStub = nil
	fake.outputsReturns = struct {
		result1 map[string]any
		result2 error
	}{result1, result2}
}

func (fake *FakeWorkspace) OutputsReturnsOnCall(i int, result1 map[string]any, result2 error) {
	fake.outputsMutex.Lock()
	defer fake.outputsMutex.Unlock()
	fake.OutputsStub = nil
	if fake.outputsReturnsOnCall == nil {
		fake.outputsReturnsOnCall = make(map[int]struct {
			result1 map[string]any
			result2 error
		})
	}
	fake.outputsReturnsOnCall[i] = struct {
		result1 map[string]any
		result2 error
	}{result1, result2}
}

func (fake *FakeWorkspace) Serialize() (string, error) {
	fake.serializeMutex.Lock()
	ret, specificReturn := fake.serializeReturnsOnCall[len(fake.serializeArgsForCall)]
	fake.serializeArgsForCall = append(fake.serializeArgsForCall, struct {
	}{})
	stub := fake.SerializeStub
	fakeReturns := fake.serializeReturns
	fake.recordInvocation("Serialize", []interface{}{})
	fake.serializeMutex.Unlock()
	if stub != nil {
		return stub()
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeWorkspace) SerializeCallCount() int {
	fake.serializeMutex.RLock()
	defer fake.serializeMutex.RUnlock()
	return len(fake.serializeArgsForCall)
}

func (fake *FakeWorkspace) SerializeCalls(stub func() (string, error)) {
	fake.serializeMutex.Lock()
	defer fake.serializeMutex.Unlock()
	fake.SerializeStub = stub
}

func (fake *FakeWorkspace) SerializeReturns(result1 string, result2 error) {
	fake.serializeMutex.Lock()
	defer fake.serializeMutex.Unlock()
	fake.SerializeStub = nil
	fake.serializeReturns = struct {
		result1 string
		result2 error
	}{result1, result2}
}

func (fake *FakeWorkspace) SerializeReturnsOnCall(i int, result1 string, result2 error) {
	fake.serializeMutex.Lock()
	defer fake.serializeMutex.Unlock()
	fake.SerializeStub = nil
	if fake.serializeReturnsOnCall == nil {
		fake.serializeReturnsOnCall = make(map[int]struct {
			result1 string
			result2 error
		})
	}
	fake.serializeReturnsOnCall[i] = struct {
		result1 string
		result2 error
	}{result1, result2}
}

func (fake *FakeWorkspace) StateTFVersion() (*version.Version, error) {
	fake.stateTFVersionMutex.Lock()
	ret, specificReturn := fake.stateTFVersionReturnsOnCall[len(fake.stateTFVersionArgsForCall)]
	fake.stateTFVersionArgsForCall = append(fake.stateTFVersionArgsForCall, struct {
	}{})
	stub := fake.StateTFVersionStub
	fakeReturns := fake.stateTFVersionReturns
	fake.recordInvocation("StateTFVersion", []interface{}{})
	fake.stateTFVersionMutex.Unlock()
	if stub != nil {
		return stub()
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeWorkspace) StateTFVersionCallCount() int {
	fake.stateTFVersionMutex.RLock()
	defer fake.stateTFVersionMutex.RUnlock()
	return len(fake.stateTFVersionArgsForCall)
}

func (fake *FakeWorkspace) StateTFVersionCalls(stub func() (*version.Version, error)) {
	fake.stateTFVersionMutex.Lock()
	defer fake.stateTFVersionMutex.Unlock()
	fake.StateTFVersionStub = stub
}

func (fake *FakeWorkspace) StateTFVersionReturns(result1 *version.Version, result2 error) {
	fake.stateTFVersionMutex.Lock()
	defer fake.stateTFVersionMutex.Unlock()
	fake.StateTFVersionStub = nil
	fake.stateTFVersionReturns = struct {
		result1 *version.Version
		result2 error
	}{result1, result2}
}

func (fake *FakeWorkspace) StateTFVersionReturnsOnCall(i int, result1 *version.Version, result2 error) {
	fake.stateTFVersionMutex.Lock()
	defer fake.stateTFVersionMutex.Unlock()
	fake.StateTFVersionStub = nil
	if fake.stateTFVersionReturnsOnCall == nil {
		fake.stateTFVersionReturnsOnCall = make(map[int]struct {
			result1 *version.Version
			result2 error
		})
	}
	fake.stateTFVersionReturnsOnCall[i] = struct {
		result1 *version.Version
		result2 error
	}{result1, result2}
}

func (fake *FakeWorkspace) UpdateInstanceConfiguration(arg1 map[string]any) error {
	fake.updateInstanceConfigurationMutex.Lock()
	ret, specificReturn := fake.updateInstanceConfigurationReturnsOnCall[len(fake.updateInstanceConfigurationArgsForCall)]
	fake.updateInstanceConfigurationArgsForCall = append(fake.updateInstanceConfigurationArgsForCall, struct {
		arg1 map[string]any
	}{arg1})
	stub := fake.UpdateInstanceConfigurationStub
	fakeReturns := fake.updateInstanceConfigurationReturns
	fake.recordInvocation("UpdateInstanceConfiguration", []interface{}{arg1})
	fake.updateInstanceConfigurationMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeWorkspace) UpdateInstanceConfigurationCallCount() int {
	fake.updateInstanceConfigurationMutex.RLock()
	defer fake.updateInstanceConfigurationMutex.RUnlock()
	return len(fake.updateInstanceConfigurationArgsForCall)
}

func (fake *FakeWorkspace) UpdateInstanceConfigurationCalls(stub func(map[string]any) error) {
	fake.updateInstanceConfigurationMutex.Lock()
	defer fake.updateInstanceConfigurationMutex.Unlock()
	fake.UpdateInstanceConfigurationStub = stub
}

func (fake *FakeWorkspace) UpdateInstanceConfigurationArgsForCall(i int) map[string]any {
	fake.updateInstanceConfigurationMutex.RLock()
	defer fake.updateInstanceConfigurationMutex.RUnlock()
	argsForCall := fake.updateInstanceConfigurationArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeWorkspace) UpdateInstanceConfigurationReturns(result1 error) {
	fake.updateInstanceConfigurationMutex.Lock()
	defer fake.updateInstanceConfigurationMutex.Unlock()
	fake.UpdateInstanceConfigurationStub = nil
	fake.updateInstanceConfigurationReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeWorkspace) UpdateInstanceConfigurationReturnsOnCall(i int, result1 error) {
	fake.updateInstanceConfigurationMutex.Lock()
	defer fake.updateInstanceConfigurationMutex.Unlock()
	fake.UpdateInstanceConfigurationStub = nil
	if fake.updateInstanceConfigurationReturnsOnCall == nil {
		fake.updateInstanceConfigurationReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.updateInstanceConfigurationReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeWorkspace) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	fake.executeMutex.RLock()
	defer fake.executeMutex.RUnlock()
	fake.hasStateMutex.RLock()
	defer fake.hasStateMutex.RUnlock()
	fake.moduleDefinitionsMutex.RLock()
	defer fake.moduleDefinitionsMutex.RUnlock()
	fake.moduleInstancesMutex.RLock()
	defer fake.moduleInstancesMutex.RUnlock()
	fake.outputsMutex.RLock()
	defer fake.outputsMutex.RUnlock()
	fake.serializeMutex.RLock()
	defer fake.serializeMutex.RUnlock()
	fake.stateTFVersionMutex.RLock()
	defer fake.stateTFVersionMutex.RUnlock()
	fake.updateInstanceConfigurationMutex.RLock()
	defer fake.updateInstanceConfigurationMutex.RUnlock()
	copiedInvocations := map[string][][]interface{}{}
	for key, value := range fake.invocations {
		copiedInvocations[key] = value
	}
	return copiedInvocations
}

func (fake *FakeWorkspace) 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 _ workspace.Workspace = new(FakeWorkspace)
