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

import (
	"sync"

	lxd "github.com/lxc/lxd/client"
	"github.com/lxc/lxd/shared/api"
)

type FakeRemoteOperation struct {
	AddHandlerStub        func(func(api.Operation)) (*lxd.EventTarget, error)
	addHandlerMutex       sync.RWMutex
	addHandlerArgsForCall []struct {
		arg1 func(api.Operation)
	}
	addHandlerReturns struct {
		result1 *lxd.EventTarget
		result2 error
	}
	addHandlerReturnsOnCall map[int]struct {
		result1 *lxd.EventTarget
		result2 error
	}
	CancelTargetStub        func() error
	cancelTargetMutex       sync.RWMutex
	cancelTargetArgsForCall []struct {
	}
	cancelTargetReturns struct {
		result1 error
	}
	cancelTargetReturnsOnCall map[int]struct {
		result1 error
	}
	GetTargetStub        func() (*api.Operation, error)
	getTargetMutex       sync.RWMutex
	getTargetArgsForCall []struct {
	}
	getTargetReturns struct {
		result1 *api.Operation
		result2 error
	}
	getTargetReturnsOnCall map[int]struct {
		result1 *api.Operation
		result2 error
	}
	WaitStub        func() error
	waitMutex       sync.RWMutex
	waitArgsForCall []struct {
	}
	waitReturns struct {
		result1 error
	}
	waitReturnsOnCall map[int]struct {
		result1 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeRemoteOperation) AddHandler(arg1 func(api.Operation)) (*lxd.EventTarget, error) {
	fake.addHandlerMutex.Lock()
	ret, specificReturn := fake.addHandlerReturnsOnCall[len(fake.addHandlerArgsForCall)]
	fake.addHandlerArgsForCall = append(fake.addHandlerArgsForCall, struct {
		arg1 func(api.Operation)
	}{arg1})
	stub := fake.AddHandlerStub
	fakeReturns := fake.addHandlerReturns
	fake.recordInvocation("AddHandler", []interface{}{arg1})
	fake.addHandlerMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeRemoteOperation) AddHandlerCallCount() int {
	fake.addHandlerMutex.RLock()
	defer fake.addHandlerMutex.RUnlock()
	return len(fake.addHandlerArgsForCall)
}

func (fake *FakeRemoteOperation) AddHandlerCalls(stub func(func(api.Operation)) (*lxd.EventTarget, error)) {
	fake.addHandlerMutex.Lock()
	defer fake.addHandlerMutex.Unlock()
	fake.AddHandlerStub = stub
}

func (fake *FakeRemoteOperation) AddHandlerArgsForCall(i int) func(api.Operation) {
	fake.addHandlerMutex.RLock()
	defer fake.addHandlerMutex.RUnlock()
	argsForCall := fake.addHandlerArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeRemoteOperation) AddHandlerReturns(result1 *lxd.EventTarget, result2 error) {
	fake.addHandlerMutex.Lock()
	defer fake.addHandlerMutex.Unlock()
	fake.AddHandlerStub = nil
	fake.addHandlerReturns = struct {
		result1 *lxd.EventTarget
		result2 error
	}{result1, result2}
}

func (fake *FakeRemoteOperation) AddHandlerReturnsOnCall(i int, result1 *lxd.EventTarget, result2 error) {
	fake.addHandlerMutex.Lock()
	defer fake.addHandlerMutex.Unlock()
	fake.AddHandlerStub = nil
	if fake.addHandlerReturnsOnCall == nil {
		fake.addHandlerReturnsOnCall = make(map[int]struct {
			result1 *lxd.EventTarget
			result2 error
		})
	}
	fake.addHandlerReturnsOnCall[i] = struct {
		result1 *lxd.EventTarget
		result2 error
	}{result1, result2}
}

func (fake *FakeRemoteOperation) CancelTarget() error {
	fake.cancelTargetMutex.Lock()
	ret, specificReturn := fake.cancelTargetReturnsOnCall[len(fake.cancelTargetArgsForCall)]
	fake.cancelTargetArgsForCall = append(fake.cancelTargetArgsForCall, struct {
	}{})
	stub := fake.CancelTargetStub
	fakeReturns := fake.cancelTargetReturns
	fake.recordInvocation("CancelTarget", []interface{}{})
	fake.cancelTargetMutex.Unlock()
	if stub != nil {
		return stub()
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeRemoteOperation) CancelTargetCallCount() int {
	fake.cancelTargetMutex.RLock()
	defer fake.cancelTargetMutex.RUnlock()
	return len(fake.cancelTargetArgsForCall)
}

func (fake *FakeRemoteOperation) CancelTargetCalls(stub func() error) {
	fake.cancelTargetMutex.Lock()
	defer fake.cancelTargetMutex.Unlock()
	fake.CancelTargetStub = stub
}

func (fake *FakeRemoteOperation) CancelTargetReturns(result1 error) {
	fake.cancelTargetMutex.Lock()
	defer fake.cancelTargetMutex.Unlock()
	fake.CancelTargetStub = nil
	fake.cancelTargetReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeRemoteOperation) CancelTargetReturnsOnCall(i int, result1 error) {
	fake.cancelTargetMutex.Lock()
	defer fake.cancelTargetMutex.Unlock()
	fake.CancelTargetStub = nil
	if fake.cancelTargetReturnsOnCall == nil {
		fake.cancelTargetReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.cancelTargetReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeRemoteOperation) GetTarget() (*api.Operation, error) {
	fake.getTargetMutex.Lock()
	ret, specificReturn := fake.getTargetReturnsOnCall[len(fake.getTargetArgsForCall)]
	fake.getTargetArgsForCall = append(fake.getTargetArgsForCall, struct {
	}{})
	stub := fake.GetTargetStub
	fakeReturns := fake.getTargetReturns
	fake.recordInvocation("GetTarget", []interface{}{})
	fake.getTargetMutex.Unlock()
	if stub != nil {
		return stub()
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeRemoteOperation) GetTargetCallCount() int {
	fake.getTargetMutex.RLock()
	defer fake.getTargetMutex.RUnlock()
	return len(fake.getTargetArgsForCall)
}

func (fake *FakeRemoteOperation) GetTargetCalls(stub func() (*api.Operation, error)) {
	fake.getTargetMutex.Lock()
	defer fake.getTargetMutex.Unlock()
	fake.GetTargetStub = stub
}

func (fake *FakeRemoteOperation) GetTargetReturns(result1 *api.Operation, result2 error) {
	fake.getTargetMutex.Lock()
	defer fake.getTargetMutex.Unlock()
	fake.GetTargetStub = nil
	fake.getTargetReturns = struct {
		result1 *api.Operation
		result2 error
	}{result1, result2}
}

func (fake *FakeRemoteOperation) GetTargetReturnsOnCall(i int, result1 *api.Operation, result2 error) {
	fake.getTargetMutex.Lock()
	defer fake.getTargetMutex.Unlock()
	fake.GetTargetStub = nil
	if fake.getTargetReturnsOnCall == nil {
		fake.getTargetReturnsOnCall = make(map[int]struct {
			result1 *api.Operation
			result2 error
		})
	}
	fake.getTargetReturnsOnCall[i] = struct {
		result1 *api.Operation
		result2 error
	}{result1, result2}
}

func (fake *FakeRemoteOperation) Wait() error {
	fake.waitMutex.Lock()
	ret, specificReturn := fake.waitReturnsOnCall[len(fake.waitArgsForCall)]
	fake.waitArgsForCall = append(fake.waitArgsForCall, struct {
	}{})
	stub := fake.WaitStub
	fakeReturns := fake.waitReturns
	fake.recordInvocation("Wait", []interface{}{})
	fake.waitMutex.Unlock()
	if stub != nil {
		return stub()
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeRemoteOperation) WaitCallCount() int {
	fake.waitMutex.RLock()
	defer fake.waitMutex.RUnlock()
	return len(fake.waitArgsForCall)
}

func (fake *FakeRemoteOperation) WaitCalls(stub func() error) {
	fake.waitMutex.Lock()
	defer fake.waitMutex.Unlock()
	fake.WaitStub = stub
}

func (fake *FakeRemoteOperation) WaitReturns(result1 error) {
	fake.waitMutex.Lock()
	defer fake.waitMutex.Unlock()
	fake.WaitStub = nil
	fake.waitReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeRemoteOperation) WaitReturnsOnCall(i int, result1 error) {
	fake.waitMutex.Lock()
	defer fake.waitMutex.Unlock()
	fake.WaitStub = nil
	if fake.waitReturnsOnCall == nil {
		fake.waitReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.waitReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

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

func (fake *FakeRemoteOperation) 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 _ lxd.RemoteOperation = new(FakeRemoteOperation)
