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

import (
	"net/http"
	"sync"

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

type FakeServer struct {
	DisconnectStub        func()
	disconnectMutex       sync.RWMutex
	disconnectArgsForCall []struct {
	}
	DoHTTPStub        func(*http.Request) (*http.Response, error)
	doHTTPMutex       sync.RWMutex
	doHTTPArgsForCall []struct {
		arg1 *http.Request
	}
	doHTTPReturns struct {
		result1 *http.Response
		result2 error
	}
	doHTTPReturnsOnCall map[int]struct {
		result1 *http.Response
		result2 error
	}
	GetConnectionInfoStub        func() (*lxd.ConnectionInfo, error)
	getConnectionInfoMutex       sync.RWMutex
	getConnectionInfoArgsForCall []struct {
	}
	getConnectionInfoReturns struct {
		result1 *lxd.ConnectionInfo
		result2 error
	}
	getConnectionInfoReturnsOnCall map[int]struct {
		result1 *lxd.ConnectionInfo
		result2 error
	}
	GetHTTPClientStub        func() (*http.Client, error)
	getHTTPClientMutex       sync.RWMutex
	getHTTPClientArgsForCall []struct {
	}
	getHTTPClientReturns struct {
		result1 *http.Client
		result2 error
	}
	getHTTPClientReturnsOnCall map[int]struct {
		result1 *http.Client
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeServer) Disconnect() {
	fake.disconnectMutex.Lock()
	fake.disconnectArgsForCall = append(fake.disconnectArgsForCall, struct {
	}{})
	stub := fake.DisconnectStub
	fake.recordInvocation("Disconnect", []interface{}{})
	fake.disconnectMutex.Unlock()
	if stub != nil {
		fake.DisconnectStub()
	}
}

func (fake *FakeServer) DisconnectCallCount() int {
	fake.disconnectMutex.RLock()
	defer fake.disconnectMutex.RUnlock()
	return len(fake.disconnectArgsForCall)
}

func (fake *FakeServer) DisconnectCalls(stub func()) {
	fake.disconnectMutex.Lock()
	defer fake.disconnectMutex.Unlock()
	fake.DisconnectStub = stub
}

func (fake *FakeServer) DoHTTP(arg1 *http.Request) (*http.Response, error) {
	fake.doHTTPMutex.Lock()
	ret, specificReturn := fake.doHTTPReturnsOnCall[len(fake.doHTTPArgsForCall)]
	fake.doHTTPArgsForCall = append(fake.doHTTPArgsForCall, struct {
		arg1 *http.Request
	}{arg1})
	stub := fake.DoHTTPStub
	fakeReturns := fake.doHTTPReturns
	fake.recordInvocation("DoHTTP", []interface{}{arg1})
	fake.doHTTPMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeServer) DoHTTPCallCount() int {
	fake.doHTTPMutex.RLock()
	defer fake.doHTTPMutex.RUnlock()
	return len(fake.doHTTPArgsForCall)
}

func (fake *FakeServer) DoHTTPCalls(stub func(*http.Request) (*http.Response, error)) {
	fake.doHTTPMutex.Lock()
	defer fake.doHTTPMutex.Unlock()
	fake.DoHTTPStub = stub
}

func (fake *FakeServer) DoHTTPArgsForCall(i int) *http.Request {
	fake.doHTTPMutex.RLock()
	defer fake.doHTTPMutex.RUnlock()
	argsForCall := fake.doHTTPArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeServer) DoHTTPReturns(result1 *http.Response, result2 error) {
	fake.doHTTPMutex.Lock()
	defer fake.doHTTPMutex.Unlock()
	fake.DoHTTPStub = nil
	fake.doHTTPReturns = struct {
		result1 *http.Response
		result2 error
	}{result1, result2}
}

func (fake *FakeServer) DoHTTPReturnsOnCall(i int, result1 *http.Response, result2 error) {
	fake.doHTTPMutex.Lock()
	defer fake.doHTTPMutex.Unlock()
	fake.DoHTTPStub = nil
	if fake.doHTTPReturnsOnCall == nil {
		fake.doHTTPReturnsOnCall = make(map[int]struct {
			result1 *http.Response
			result2 error
		})
	}
	fake.doHTTPReturnsOnCall[i] = struct {
		result1 *http.Response
		result2 error
	}{result1, result2}
}

func (fake *FakeServer) GetConnectionInfo() (*lxd.ConnectionInfo, error) {
	fake.getConnectionInfoMutex.Lock()
	ret, specificReturn := fake.getConnectionInfoReturnsOnCall[len(fake.getConnectionInfoArgsForCall)]
	fake.getConnectionInfoArgsForCall = append(fake.getConnectionInfoArgsForCall, struct {
	}{})
	stub := fake.GetConnectionInfoStub
	fakeReturns := fake.getConnectionInfoReturns
	fake.recordInvocation("GetConnectionInfo", []interface{}{})
	fake.getConnectionInfoMutex.Unlock()
	if stub != nil {
		return stub()
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeServer) GetConnectionInfoCallCount() int {
	fake.getConnectionInfoMutex.RLock()
	defer fake.getConnectionInfoMutex.RUnlock()
	return len(fake.getConnectionInfoArgsForCall)
}

func (fake *FakeServer) GetConnectionInfoCalls(stub func() (*lxd.ConnectionInfo, error)) {
	fake.getConnectionInfoMutex.Lock()
	defer fake.getConnectionInfoMutex.Unlock()
	fake.GetConnectionInfoStub = stub
}

func (fake *FakeServer) GetConnectionInfoReturns(result1 *lxd.ConnectionInfo, result2 error) {
	fake.getConnectionInfoMutex.Lock()
	defer fake.getConnectionInfoMutex.Unlock()
	fake.GetConnectionInfoStub = nil
	fake.getConnectionInfoReturns = struct {
		result1 *lxd.ConnectionInfo
		result2 error
	}{result1, result2}
}

func (fake *FakeServer) GetConnectionInfoReturnsOnCall(i int, result1 *lxd.ConnectionInfo, result2 error) {
	fake.getConnectionInfoMutex.Lock()
	defer fake.getConnectionInfoMutex.Unlock()
	fake.GetConnectionInfoStub = nil
	if fake.getConnectionInfoReturnsOnCall == nil {
		fake.getConnectionInfoReturnsOnCall = make(map[int]struct {
			result1 *lxd.ConnectionInfo
			result2 error
		})
	}
	fake.getConnectionInfoReturnsOnCall[i] = struct {
		result1 *lxd.ConnectionInfo
		result2 error
	}{result1, result2}
}

func (fake *FakeServer) GetHTTPClient() (*http.Client, error) {
	fake.getHTTPClientMutex.Lock()
	ret, specificReturn := fake.getHTTPClientReturnsOnCall[len(fake.getHTTPClientArgsForCall)]
	fake.getHTTPClientArgsForCall = append(fake.getHTTPClientArgsForCall, struct {
	}{})
	stub := fake.GetHTTPClientStub
	fakeReturns := fake.getHTTPClientReturns
	fake.recordInvocation("GetHTTPClient", []interface{}{})
	fake.getHTTPClientMutex.Unlock()
	if stub != nil {
		return stub()
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeServer) GetHTTPClientCallCount() int {
	fake.getHTTPClientMutex.RLock()
	defer fake.getHTTPClientMutex.RUnlock()
	return len(fake.getHTTPClientArgsForCall)
}

func (fake *FakeServer) GetHTTPClientCalls(stub func() (*http.Client, error)) {
	fake.getHTTPClientMutex.Lock()
	defer fake.getHTTPClientMutex.Unlock()
	fake.GetHTTPClientStub = stub
}

func (fake *FakeServer) GetHTTPClientReturns(result1 *http.Client, result2 error) {
	fake.getHTTPClientMutex.Lock()
	defer fake.getHTTPClientMutex.Unlock()
	fake.GetHTTPClientStub = nil
	fake.getHTTPClientReturns = struct {
		result1 *http.Client
		result2 error
	}{result1, result2}
}

func (fake *FakeServer) GetHTTPClientReturnsOnCall(i int, result1 *http.Client, result2 error) {
	fake.getHTTPClientMutex.Lock()
	defer fake.getHTTPClientMutex.Unlock()
	fake.GetHTTPClientStub = nil
	if fake.getHTTPClientReturnsOnCall == nil {
		fake.getHTTPClientReturnsOnCall = make(map[int]struct {
			result1 *http.Client
			result2 error
		})
	}
	fake.getHTTPClientReturnsOnCall[i] = struct {
		result1 *http.Client
		result2 error
	}{result1, result2}
}

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

func (fake *FakeServer) 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.Server = new(FakeServer)
