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

import (
	"sync"

	"code.cloudfoundry.org/cli/cf/api"
	"code.cloudfoundry.org/cli/cf/models"
)

type FakeRoutingAPIRepository struct {
	ListRouterGroupsStub        func(func(models.RouterGroup) bool) error
	listRouterGroupsMutex       sync.RWMutex
	listRouterGroupsArgsForCall []struct {
		arg1 func(models.RouterGroup) bool
	}
	listRouterGroupsReturns struct {
		result1 error
	}
	listRouterGroupsReturnsOnCall map[int]struct {
		result1 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeRoutingAPIRepository) ListRouterGroups(arg1 func(models.RouterGroup) bool) error {
	fake.listRouterGroupsMutex.Lock()
	ret, specificReturn := fake.listRouterGroupsReturnsOnCall[len(fake.listRouterGroupsArgsForCall)]
	fake.listRouterGroupsArgsForCall = append(fake.listRouterGroupsArgsForCall, struct {
		arg1 func(models.RouterGroup) bool
	}{arg1})
	fake.recordInvocation("ListRouterGroups", []interface{}{arg1})
	fake.listRouterGroupsMutex.Unlock()
	if fake.ListRouterGroupsStub != nil {
		return fake.ListRouterGroupsStub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	fakeReturns := fake.listRouterGroupsReturns
	return fakeReturns.result1
}

func (fake *FakeRoutingAPIRepository) ListRouterGroupsCallCount() int {
	fake.listRouterGroupsMutex.RLock()
	defer fake.listRouterGroupsMutex.RUnlock()
	return len(fake.listRouterGroupsArgsForCall)
}

func (fake *FakeRoutingAPIRepository) ListRouterGroupsCalls(stub func(func(models.RouterGroup) bool) error) {
	fake.listRouterGroupsMutex.Lock()
	defer fake.listRouterGroupsMutex.Unlock()
	fake.ListRouterGroupsStub = stub
}

func (fake *FakeRoutingAPIRepository) ListRouterGroupsArgsForCall(i int) func(models.RouterGroup) bool {
	fake.listRouterGroupsMutex.RLock()
	defer fake.listRouterGroupsMutex.RUnlock()
	argsForCall := fake.listRouterGroupsArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeRoutingAPIRepository) ListRouterGroupsReturns(result1 error) {
	fake.listRouterGroupsMutex.Lock()
	defer fake.listRouterGroupsMutex.Unlock()
	fake.ListRouterGroupsStub = nil
	fake.listRouterGroupsReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeRoutingAPIRepository) ListRouterGroupsReturnsOnCall(i int, result1 error) {
	fake.listRouterGroupsMutex.Lock()
	defer fake.listRouterGroupsMutex.Unlock()
	fake.ListRouterGroupsStub = nil
	if fake.listRouterGroupsReturnsOnCall == nil {
		fake.listRouterGroupsReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.listRouterGroupsReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

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

func (fake *FakeRoutingAPIRepository) 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 _ api.RoutingAPIRepository = new(FakeRoutingAPIRepository)
