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

import (
	"sync"

	"code.cloudfoundry.org/cli/actor/v7action"
	"code.cloudfoundry.org/cli/api/router"
)

type FakeRoutingClient struct {
	GetRouterGroupByNameStub        func(string) (router.RouterGroup, error)
	getRouterGroupByNameMutex       sync.RWMutex
	getRouterGroupByNameArgsForCall []struct {
		arg1 string
	}
	getRouterGroupByNameReturns struct {
		result1 router.RouterGroup
		result2 error
	}
	getRouterGroupByNameReturnsOnCall map[int]struct {
		result1 router.RouterGroup
		result2 error
	}
	GetRouterGroupsStub        func() ([]router.RouterGroup, error)
	getRouterGroupsMutex       sync.RWMutex
	getRouterGroupsArgsForCall []struct {
	}
	getRouterGroupsReturns struct {
		result1 []router.RouterGroup
		result2 error
	}
	getRouterGroupsReturnsOnCall map[int]struct {
		result1 []router.RouterGroup
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeRoutingClient) GetRouterGroupByName(arg1 string) (router.RouterGroup, error) {
	fake.getRouterGroupByNameMutex.Lock()
	ret, specificReturn := fake.getRouterGroupByNameReturnsOnCall[len(fake.getRouterGroupByNameArgsForCall)]
	fake.getRouterGroupByNameArgsForCall = append(fake.getRouterGroupByNameArgsForCall, struct {
		arg1 string
	}{arg1})
	fake.recordInvocation("GetRouterGroupByName", []interface{}{arg1})
	fake.getRouterGroupByNameMutex.Unlock()
	if fake.GetRouterGroupByNameStub != nil {
		return fake.GetRouterGroupByNameStub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	fakeReturns := fake.getRouterGroupByNameReturns
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeRoutingClient) GetRouterGroupByNameCallCount() int {
	fake.getRouterGroupByNameMutex.RLock()
	defer fake.getRouterGroupByNameMutex.RUnlock()
	return len(fake.getRouterGroupByNameArgsForCall)
}

func (fake *FakeRoutingClient) GetRouterGroupByNameCalls(stub func(string) (router.RouterGroup, error)) {
	fake.getRouterGroupByNameMutex.Lock()
	defer fake.getRouterGroupByNameMutex.Unlock()
	fake.GetRouterGroupByNameStub = stub
}

func (fake *FakeRoutingClient) GetRouterGroupByNameArgsForCall(i int) string {
	fake.getRouterGroupByNameMutex.RLock()
	defer fake.getRouterGroupByNameMutex.RUnlock()
	argsForCall := fake.getRouterGroupByNameArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeRoutingClient) GetRouterGroupByNameReturns(result1 router.RouterGroup, result2 error) {
	fake.getRouterGroupByNameMutex.Lock()
	defer fake.getRouterGroupByNameMutex.Unlock()
	fake.GetRouterGroupByNameStub = nil
	fake.getRouterGroupByNameReturns = struct {
		result1 router.RouterGroup
		result2 error
	}{result1, result2}
}

func (fake *FakeRoutingClient) GetRouterGroupByNameReturnsOnCall(i int, result1 router.RouterGroup, result2 error) {
	fake.getRouterGroupByNameMutex.Lock()
	defer fake.getRouterGroupByNameMutex.Unlock()
	fake.GetRouterGroupByNameStub = nil
	if fake.getRouterGroupByNameReturnsOnCall == nil {
		fake.getRouterGroupByNameReturnsOnCall = make(map[int]struct {
			result1 router.RouterGroup
			result2 error
		})
	}
	fake.getRouterGroupByNameReturnsOnCall[i] = struct {
		result1 router.RouterGroup
		result2 error
	}{result1, result2}
}

func (fake *FakeRoutingClient) GetRouterGroups() ([]router.RouterGroup, error) {
	fake.getRouterGroupsMutex.Lock()
	ret, specificReturn := fake.getRouterGroupsReturnsOnCall[len(fake.getRouterGroupsArgsForCall)]
	fake.getRouterGroupsArgsForCall = append(fake.getRouterGroupsArgsForCall, struct {
	}{})
	fake.recordInvocation("GetRouterGroups", []interface{}{})
	fake.getRouterGroupsMutex.Unlock()
	if fake.GetRouterGroupsStub != nil {
		return fake.GetRouterGroupsStub()
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	fakeReturns := fake.getRouterGroupsReturns
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeRoutingClient) GetRouterGroupsCallCount() int {
	fake.getRouterGroupsMutex.RLock()
	defer fake.getRouterGroupsMutex.RUnlock()
	return len(fake.getRouterGroupsArgsForCall)
}

func (fake *FakeRoutingClient) GetRouterGroupsCalls(stub func() ([]router.RouterGroup, error)) {
	fake.getRouterGroupsMutex.Lock()
	defer fake.getRouterGroupsMutex.Unlock()
	fake.GetRouterGroupsStub = stub
}

func (fake *FakeRoutingClient) GetRouterGroupsReturns(result1 []router.RouterGroup, result2 error) {
	fake.getRouterGroupsMutex.Lock()
	defer fake.getRouterGroupsMutex.Unlock()
	fake.GetRouterGroupsStub = nil
	fake.getRouterGroupsReturns = struct {
		result1 []router.RouterGroup
		result2 error
	}{result1, result2}
}

func (fake *FakeRoutingClient) GetRouterGroupsReturnsOnCall(i int, result1 []router.RouterGroup, result2 error) {
	fake.getRouterGroupsMutex.Lock()
	defer fake.getRouterGroupsMutex.Unlock()
	fake.GetRouterGroupsStub = nil
	if fake.getRouterGroupsReturnsOnCall == nil {
		fake.getRouterGroupsReturnsOnCall = make(map[int]struct {
			result1 []router.RouterGroup
			result2 error
		})
	}
	fake.getRouterGroupsReturnsOnCall[i] = struct {
		result1 []router.RouterGroup
		result2 error
	}{result1, result2}
}

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

func (fake *FakeRoutingClient) 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 _ v7action.RoutingClient = new(FakeRoutingClient)
