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

import (
	"sync"

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

type FakeOperation 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
	}
	CancelStub        func() error
	cancelMutex       sync.RWMutex
	cancelArgsForCall []struct {
	}
	cancelReturns struct {
		result1 error
	}
	cancelReturnsOnCall map[int]struct {
		result1 error
	}
	GetStub        func() api.Operation
	getMutex       sync.RWMutex
	getArgsForCall []struct {
	}
	getReturns struct {
		result1 api.Operation
	}
	getReturnsOnCall map[int]struct {
		result1 api.Operation
	}
	GetWebsocketStub        func(string) (*websocket.Conn, error)
	getWebsocketMutex       sync.RWMutex
	getWebsocketArgsForCall []struct {
		arg1 string
	}
	getWebsocketReturns struct {
		result1 *websocket.Conn
		result2 error
	}
	getWebsocketReturnsOnCall map[int]struct {
		result1 *websocket.Conn
		result2 error
	}
	RefreshStub        func() error
	refreshMutex       sync.RWMutex
	refreshArgsForCall []struct {
	}
	refreshReturns struct {
		result1 error
	}
	refreshReturnsOnCall map[int]struct {
		result1 error
	}
	RemoveHandlerStub        func(*lxd.EventTarget) error
	removeHandlerMutex       sync.RWMutex
	removeHandlerArgsForCall []struct {
		arg1 *lxd.EventTarget
	}
	removeHandlerReturns struct {
		result1 error
	}
	removeHandlerReturnsOnCall map[int]struct {
		result1 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 *FakeOperation) 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 *FakeOperation) AddHandlerCallCount() int {
	fake.addHandlerMutex.RLock()
	defer fake.addHandlerMutex.RUnlock()
	return len(fake.addHandlerArgsForCall)
}

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

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

func (fake *FakeOperation) 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 *FakeOperation) 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 *FakeOperation) Cancel() error {
	fake.cancelMutex.Lock()
	ret, specificReturn := fake.cancelReturnsOnCall[len(fake.cancelArgsForCall)]
	fake.cancelArgsForCall = append(fake.cancelArgsForCall, struct {
	}{})
	stub := fake.CancelStub
	fakeReturns := fake.cancelReturns
	fake.recordInvocation("Cancel", []interface{}{})
	fake.cancelMutex.Unlock()
	if stub != nil {
		return stub()
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeOperation) CancelCallCount() int {
	fake.cancelMutex.RLock()
	defer fake.cancelMutex.RUnlock()
	return len(fake.cancelArgsForCall)
}

func (fake *FakeOperation) CancelCalls(stub func() error) {
	fake.cancelMutex.Lock()
	defer fake.cancelMutex.Unlock()
	fake.CancelStub = stub
}

func (fake *FakeOperation) CancelReturns(result1 error) {
	fake.cancelMutex.Lock()
	defer fake.cancelMutex.Unlock()
	fake.CancelStub = nil
	fake.cancelReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeOperation) CancelReturnsOnCall(i int, result1 error) {
	fake.cancelMutex.Lock()
	defer fake.cancelMutex.Unlock()
	fake.CancelStub = nil
	if fake.cancelReturnsOnCall == nil {
		fake.cancelReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.cancelReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeOperation) Get() api.Operation {
	fake.getMutex.Lock()
	ret, specificReturn := fake.getReturnsOnCall[len(fake.getArgsForCall)]
	fake.getArgsForCall = append(fake.getArgsForCall, struct {
	}{})
	stub := fake.GetStub
	fakeReturns := fake.getReturns
	fake.recordInvocation("Get", []interface{}{})
	fake.getMutex.Unlock()
	if stub != nil {
		return stub()
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeOperation) GetCallCount() int {
	fake.getMutex.RLock()
	defer fake.getMutex.RUnlock()
	return len(fake.getArgsForCall)
}

func (fake *FakeOperation) GetCalls(stub func() api.Operation) {
	fake.getMutex.Lock()
	defer fake.getMutex.Unlock()
	fake.GetStub = stub
}

func (fake *FakeOperation) GetReturns(result1 api.Operation) {
	fake.getMutex.Lock()
	defer fake.getMutex.Unlock()
	fake.GetStub = nil
	fake.getReturns = struct {
		result1 api.Operation
	}{result1}
}

func (fake *FakeOperation) GetReturnsOnCall(i int, result1 api.Operation) {
	fake.getMutex.Lock()
	defer fake.getMutex.Unlock()
	fake.GetStub = nil
	if fake.getReturnsOnCall == nil {
		fake.getReturnsOnCall = make(map[int]struct {
			result1 api.Operation
		})
	}
	fake.getReturnsOnCall[i] = struct {
		result1 api.Operation
	}{result1}
}

func (fake *FakeOperation) GetWebsocket(arg1 string) (*websocket.Conn, error) {
	fake.getWebsocketMutex.Lock()
	ret, specificReturn := fake.getWebsocketReturnsOnCall[len(fake.getWebsocketArgsForCall)]
	fake.getWebsocketArgsForCall = append(fake.getWebsocketArgsForCall, struct {
		arg1 string
	}{arg1})
	stub := fake.GetWebsocketStub
	fakeReturns := fake.getWebsocketReturns
	fake.recordInvocation("GetWebsocket", []interface{}{arg1})
	fake.getWebsocketMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeOperation) GetWebsocketCallCount() int {
	fake.getWebsocketMutex.RLock()
	defer fake.getWebsocketMutex.RUnlock()
	return len(fake.getWebsocketArgsForCall)
}

func (fake *FakeOperation) GetWebsocketCalls(stub func(string) (*websocket.Conn, error)) {
	fake.getWebsocketMutex.Lock()
	defer fake.getWebsocketMutex.Unlock()
	fake.GetWebsocketStub = stub
}

func (fake *FakeOperation) GetWebsocketArgsForCall(i int) string {
	fake.getWebsocketMutex.RLock()
	defer fake.getWebsocketMutex.RUnlock()
	argsForCall := fake.getWebsocketArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeOperation) GetWebsocketReturns(result1 *websocket.Conn, result2 error) {
	fake.getWebsocketMutex.Lock()
	defer fake.getWebsocketMutex.Unlock()
	fake.GetWebsocketStub = nil
	fake.getWebsocketReturns = struct {
		result1 *websocket.Conn
		result2 error
	}{result1, result2}
}

func (fake *FakeOperation) GetWebsocketReturnsOnCall(i int, result1 *websocket.Conn, result2 error) {
	fake.getWebsocketMutex.Lock()
	defer fake.getWebsocketMutex.Unlock()
	fake.GetWebsocketStub = nil
	if fake.getWebsocketReturnsOnCall == nil {
		fake.getWebsocketReturnsOnCall = make(map[int]struct {
			result1 *websocket.Conn
			result2 error
		})
	}
	fake.getWebsocketReturnsOnCall[i] = struct {
		result1 *websocket.Conn
		result2 error
	}{result1, result2}
}

func (fake *FakeOperation) Refresh() error {
	fake.refreshMutex.Lock()
	ret, specificReturn := fake.refreshReturnsOnCall[len(fake.refreshArgsForCall)]
	fake.refreshArgsForCall = append(fake.refreshArgsForCall, struct {
	}{})
	stub := fake.RefreshStub
	fakeReturns := fake.refreshReturns
	fake.recordInvocation("Refresh", []interface{}{})
	fake.refreshMutex.Unlock()
	if stub != nil {
		return stub()
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeOperation) RefreshCallCount() int {
	fake.refreshMutex.RLock()
	defer fake.refreshMutex.RUnlock()
	return len(fake.refreshArgsForCall)
}

func (fake *FakeOperation) RefreshCalls(stub func() error) {
	fake.refreshMutex.Lock()
	defer fake.refreshMutex.Unlock()
	fake.RefreshStub = stub
}

func (fake *FakeOperation) RefreshReturns(result1 error) {
	fake.refreshMutex.Lock()
	defer fake.refreshMutex.Unlock()
	fake.RefreshStub = nil
	fake.refreshReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeOperation) RefreshReturnsOnCall(i int, result1 error) {
	fake.refreshMutex.Lock()
	defer fake.refreshMutex.Unlock()
	fake.RefreshStub = nil
	if fake.refreshReturnsOnCall == nil {
		fake.refreshReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.refreshReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeOperation) RemoveHandler(arg1 *lxd.EventTarget) error {
	fake.removeHandlerMutex.Lock()
	ret, specificReturn := fake.removeHandlerReturnsOnCall[len(fake.removeHandlerArgsForCall)]
	fake.removeHandlerArgsForCall = append(fake.removeHandlerArgsForCall, struct {
		arg1 *lxd.EventTarget
	}{arg1})
	stub := fake.RemoveHandlerStub
	fakeReturns := fake.removeHandlerReturns
	fake.recordInvocation("RemoveHandler", []interface{}{arg1})
	fake.removeHandlerMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeOperation) RemoveHandlerCallCount() int {
	fake.removeHandlerMutex.RLock()
	defer fake.removeHandlerMutex.RUnlock()
	return len(fake.removeHandlerArgsForCall)
}

func (fake *FakeOperation) RemoveHandlerCalls(stub func(*lxd.EventTarget) error) {
	fake.removeHandlerMutex.Lock()
	defer fake.removeHandlerMutex.Unlock()
	fake.RemoveHandlerStub = stub
}

func (fake *FakeOperation) RemoveHandlerArgsForCall(i int) *lxd.EventTarget {
	fake.removeHandlerMutex.RLock()
	defer fake.removeHandlerMutex.RUnlock()
	argsForCall := fake.removeHandlerArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeOperation) RemoveHandlerReturns(result1 error) {
	fake.removeHandlerMutex.Lock()
	defer fake.removeHandlerMutex.Unlock()
	fake.RemoveHandlerStub = nil
	fake.removeHandlerReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeOperation) RemoveHandlerReturnsOnCall(i int, result1 error) {
	fake.removeHandlerMutex.Lock()
	defer fake.removeHandlerMutex.Unlock()
	fake.RemoveHandlerStub = nil
	if fake.removeHandlerReturnsOnCall == nil {
		fake.removeHandlerReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.removeHandlerReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeOperation) 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 *FakeOperation) WaitCallCount() int {
	fake.waitMutex.RLock()
	defer fake.waitMutex.RUnlock()
	return len(fake.waitArgsForCall)
}

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

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

func (fake *FakeOperation) 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 *FakeOperation) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	fake.addHandlerMutex.RLock()
	defer fake.addHandlerMutex.RUnlock()
	fake.cancelMutex.RLock()
	defer fake.cancelMutex.RUnlock()
	fake.getMutex.RLock()
	defer fake.getMutex.RUnlock()
	fake.getWebsocketMutex.RLock()
	defer fake.getWebsocketMutex.RUnlock()
	fake.refreshMutex.RLock()
	defer fake.refreshMutex.RUnlock()
	fake.removeHandlerMutex.RLock()
	defer fake.removeHandlerMutex.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 *FakeOperation) 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.Operation = new(FakeOperation)
