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

import (
	"sync"

	"code.cloudfoundry.org/cli/command/v7/shared"
	"code.cloudfoundry.org/cli/resources"
	"code.cloudfoundry.org/cli/util/configv3"
)

type FakeAppStager struct {
	StageAndStartStub        func(resources.Application, configv3.Space, configv3.Organization, string, shared.AppStartOpts) error
	stageAndStartMutex       sync.RWMutex
	stageAndStartArgsForCall []struct {
		arg1 resources.Application
		arg2 configv3.Space
		arg3 configv3.Organization
		arg4 string
		arg5 shared.AppStartOpts
	}
	stageAndStartReturns struct {
		result1 error
	}
	stageAndStartReturnsOnCall map[int]struct {
		result1 error
	}
	StageAppStub        func(resources.Application, string, configv3.Space) (resources.Droplet, error)
	stageAppMutex       sync.RWMutex
	stageAppArgsForCall []struct {
		arg1 resources.Application
		arg2 string
		arg3 configv3.Space
	}
	stageAppReturns struct {
		result1 resources.Droplet
		result2 error
	}
	stageAppReturnsOnCall map[int]struct {
		result1 resources.Droplet
		result2 error
	}
	StartAppStub        func(resources.Application, configv3.Space, configv3.Organization, string, shared.AppStartOpts) error
	startAppMutex       sync.RWMutex
	startAppArgsForCall []struct {
		arg1 resources.Application
		arg2 configv3.Space
		arg3 configv3.Organization
		arg4 string
		arg5 shared.AppStartOpts
	}
	startAppReturns struct {
		result1 error
	}
	startAppReturnsOnCall map[int]struct {
		result1 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeAppStager) StageAndStart(arg1 resources.Application, arg2 configv3.Space, arg3 configv3.Organization, arg4 string, arg5 shared.AppStartOpts) error {
	fake.stageAndStartMutex.Lock()
	ret, specificReturn := fake.stageAndStartReturnsOnCall[len(fake.stageAndStartArgsForCall)]
	fake.stageAndStartArgsForCall = append(fake.stageAndStartArgsForCall, struct {
		arg1 resources.Application
		arg2 configv3.Space
		arg3 configv3.Organization
		arg4 string
		arg5 shared.AppStartOpts
	}{arg1, arg2, arg3, arg4, arg5})
	stub := fake.StageAndStartStub
	fakeReturns := fake.stageAndStartReturns
	fake.recordInvocation("StageAndStart", []interface{}{arg1, arg2, arg3, arg4, arg5})
	fake.stageAndStartMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3, arg4, arg5)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeAppStager) StageAndStartCallCount() int {
	fake.stageAndStartMutex.RLock()
	defer fake.stageAndStartMutex.RUnlock()
	return len(fake.stageAndStartArgsForCall)
}

func (fake *FakeAppStager) StageAndStartCalls(stub func(resources.Application, configv3.Space, configv3.Organization, string, shared.AppStartOpts) error) {
	fake.stageAndStartMutex.Lock()
	defer fake.stageAndStartMutex.Unlock()
	fake.StageAndStartStub = stub
}

func (fake *FakeAppStager) StageAndStartArgsForCall(i int) (resources.Application, configv3.Space, configv3.Organization, string, shared.AppStartOpts) {
	fake.stageAndStartMutex.RLock()
	defer fake.stageAndStartMutex.RUnlock()
	argsForCall := fake.stageAndStartArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5
}

func (fake *FakeAppStager) StageAndStartReturns(result1 error) {
	fake.stageAndStartMutex.Lock()
	defer fake.stageAndStartMutex.Unlock()
	fake.StageAndStartStub = nil
	fake.stageAndStartReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeAppStager) StageAndStartReturnsOnCall(i int, result1 error) {
	fake.stageAndStartMutex.Lock()
	defer fake.stageAndStartMutex.Unlock()
	fake.StageAndStartStub = nil
	if fake.stageAndStartReturnsOnCall == nil {
		fake.stageAndStartReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.stageAndStartReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeAppStager) StageApp(arg1 resources.Application, arg2 string, arg3 configv3.Space) (resources.Droplet, error) {
	fake.stageAppMutex.Lock()
	ret, specificReturn := fake.stageAppReturnsOnCall[len(fake.stageAppArgsForCall)]
	fake.stageAppArgsForCall = append(fake.stageAppArgsForCall, struct {
		arg1 resources.Application
		arg2 string
		arg3 configv3.Space
	}{arg1, arg2, arg3})
	stub := fake.StageAppStub
	fakeReturns := fake.stageAppReturns
	fake.recordInvocation("StageApp", []interface{}{arg1, arg2, arg3})
	fake.stageAppMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeAppStager) StageAppCallCount() int {
	fake.stageAppMutex.RLock()
	defer fake.stageAppMutex.RUnlock()
	return len(fake.stageAppArgsForCall)
}

func (fake *FakeAppStager) StageAppCalls(stub func(resources.Application, string, configv3.Space) (resources.Droplet, error)) {
	fake.stageAppMutex.Lock()
	defer fake.stageAppMutex.Unlock()
	fake.StageAppStub = stub
}

func (fake *FakeAppStager) StageAppArgsForCall(i int) (resources.Application, string, configv3.Space) {
	fake.stageAppMutex.RLock()
	defer fake.stageAppMutex.RUnlock()
	argsForCall := fake.stageAppArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *FakeAppStager) StageAppReturns(result1 resources.Droplet, result2 error) {
	fake.stageAppMutex.Lock()
	defer fake.stageAppMutex.Unlock()
	fake.StageAppStub = nil
	fake.stageAppReturns = struct {
		result1 resources.Droplet
		result2 error
	}{result1, result2}
}

func (fake *FakeAppStager) StageAppReturnsOnCall(i int, result1 resources.Droplet, result2 error) {
	fake.stageAppMutex.Lock()
	defer fake.stageAppMutex.Unlock()
	fake.StageAppStub = nil
	if fake.stageAppReturnsOnCall == nil {
		fake.stageAppReturnsOnCall = make(map[int]struct {
			result1 resources.Droplet
			result2 error
		})
	}
	fake.stageAppReturnsOnCall[i] = struct {
		result1 resources.Droplet
		result2 error
	}{result1, result2}
}

func (fake *FakeAppStager) StartApp(arg1 resources.Application, arg2 configv3.Space, arg3 configv3.Organization, arg4 string, arg5 shared.AppStartOpts) error {
	fake.startAppMutex.Lock()
	ret, specificReturn := fake.startAppReturnsOnCall[len(fake.startAppArgsForCall)]
	fake.startAppArgsForCall = append(fake.startAppArgsForCall, struct {
		arg1 resources.Application
		arg2 configv3.Space
		arg3 configv3.Organization
		arg4 string
		arg5 shared.AppStartOpts
	}{arg1, arg2, arg3, arg4, arg5})
	stub := fake.StartAppStub
	fakeReturns := fake.startAppReturns
	fake.recordInvocation("StartApp", []interface{}{arg1, arg2, arg3, arg4, arg5})
	fake.startAppMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3, arg4, arg5)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeAppStager) StartAppCallCount() int {
	fake.startAppMutex.RLock()
	defer fake.startAppMutex.RUnlock()
	return len(fake.startAppArgsForCall)
}

func (fake *FakeAppStager) StartAppCalls(stub func(resources.Application, configv3.Space, configv3.Organization, string, shared.AppStartOpts) error) {
	fake.startAppMutex.Lock()
	defer fake.startAppMutex.Unlock()
	fake.StartAppStub = stub
}

func (fake *FakeAppStager) StartAppArgsForCall(i int) (resources.Application, configv3.Space, configv3.Organization, string, shared.AppStartOpts) {
	fake.startAppMutex.RLock()
	defer fake.startAppMutex.RUnlock()
	argsForCall := fake.startAppArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5
}

func (fake *FakeAppStager) StartAppReturns(result1 error) {
	fake.startAppMutex.Lock()
	defer fake.startAppMutex.Unlock()
	fake.StartAppStub = nil
	fake.startAppReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeAppStager) StartAppReturnsOnCall(i int, result1 error) {
	fake.startAppMutex.Lock()
	defer fake.startAppMutex.Unlock()
	fake.StartAppStub = nil
	if fake.startAppReturnsOnCall == nil {
		fake.startAppReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.startAppReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

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

func (fake *FakeAppStager) 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 _ shared.AppStager = new(FakeAppStager)
