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

import (
	"sync"

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

type FakeServicePlanRepository struct {
	ListPlansFromManyServicesStub        func([]string) ([]models.ServicePlanFields, error)
	listPlansFromManyServicesMutex       sync.RWMutex
	listPlansFromManyServicesArgsForCall []struct {
		arg1 []string
	}
	listPlansFromManyServicesReturns struct {
		result1 []models.ServicePlanFields
		result2 error
	}
	listPlansFromManyServicesReturnsOnCall map[int]struct {
		result1 []models.ServicePlanFields
		result2 error
	}
	SearchStub        func(map[string]string) ([]models.ServicePlanFields, error)
	searchMutex       sync.RWMutex
	searchArgsForCall []struct {
		arg1 map[string]string
	}
	searchReturns struct {
		result1 []models.ServicePlanFields
		result2 error
	}
	searchReturnsOnCall map[int]struct {
		result1 []models.ServicePlanFields
		result2 error
	}
	UpdateStub        func(models.ServicePlanFields, string, bool) error
	updateMutex       sync.RWMutex
	updateArgsForCall []struct {
		arg1 models.ServicePlanFields
		arg2 string
		arg3 bool
	}
	updateReturns struct {
		result1 error
	}
	updateReturnsOnCall map[int]struct {
		result1 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeServicePlanRepository) ListPlansFromManyServices(arg1 []string) ([]models.ServicePlanFields, error) {
	var arg1Copy []string
	if arg1 != nil {
		arg1Copy = make([]string, len(arg1))
		copy(arg1Copy, arg1)
	}
	fake.listPlansFromManyServicesMutex.Lock()
	ret, specificReturn := fake.listPlansFromManyServicesReturnsOnCall[len(fake.listPlansFromManyServicesArgsForCall)]
	fake.listPlansFromManyServicesArgsForCall = append(fake.listPlansFromManyServicesArgsForCall, struct {
		arg1 []string
	}{arg1Copy})
	fake.recordInvocation("ListPlansFromManyServices", []interface{}{arg1Copy})
	fake.listPlansFromManyServicesMutex.Unlock()
	if fake.ListPlansFromManyServicesStub != nil {
		return fake.ListPlansFromManyServicesStub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	fakeReturns := fake.listPlansFromManyServicesReturns
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeServicePlanRepository) ListPlansFromManyServicesCallCount() int {
	fake.listPlansFromManyServicesMutex.RLock()
	defer fake.listPlansFromManyServicesMutex.RUnlock()
	return len(fake.listPlansFromManyServicesArgsForCall)
}

func (fake *FakeServicePlanRepository) ListPlansFromManyServicesCalls(stub func([]string) ([]models.ServicePlanFields, error)) {
	fake.listPlansFromManyServicesMutex.Lock()
	defer fake.listPlansFromManyServicesMutex.Unlock()
	fake.ListPlansFromManyServicesStub = stub
}

func (fake *FakeServicePlanRepository) ListPlansFromManyServicesArgsForCall(i int) []string {
	fake.listPlansFromManyServicesMutex.RLock()
	defer fake.listPlansFromManyServicesMutex.RUnlock()
	argsForCall := fake.listPlansFromManyServicesArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeServicePlanRepository) ListPlansFromManyServicesReturns(result1 []models.ServicePlanFields, result2 error) {
	fake.listPlansFromManyServicesMutex.Lock()
	defer fake.listPlansFromManyServicesMutex.Unlock()
	fake.ListPlansFromManyServicesStub = nil
	fake.listPlansFromManyServicesReturns = struct {
		result1 []models.ServicePlanFields
		result2 error
	}{result1, result2}
}

func (fake *FakeServicePlanRepository) ListPlansFromManyServicesReturnsOnCall(i int, result1 []models.ServicePlanFields, result2 error) {
	fake.listPlansFromManyServicesMutex.Lock()
	defer fake.listPlansFromManyServicesMutex.Unlock()
	fake.ListPlansFromManyServicesStub = nil
	if fake.listPlansFromManyServicesReturnsOnCall == nil {
		fake.listPlansFromManyServicesReturnsOnCall = make(map[int]struct {
			result1 []models.ServicePlanFields
			result2 error
		})
	}
	fake.listPlansFromManyServicesReturnsOnCall[i] = struct {
		result1 []models.ServicePlanFields
		result2 error
	}{result1, result2}
}

func (fake *FakeServicePlanRepository) Search(arg1 map[string]string) ([]models.ServicePlanFields, error) {
	fake.searchMutex.Lock()
	ret, specificReturn := fake.searchReturnsOnCall[len(fake.searchArgsForCall)]
	fake.searchArgsForCall = append(fake.searchArgsForCall, struct {
		arg1 map[string]string
	}{arg1})
	fake.recordInvocation("Search", []interface{}{arg1})
	fake.searchMutex.Unlock()
	if fake.SearchStub != nil {
		return fake.SearchStub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	fakeReturns := fake.searchReturns
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeServicePlanRepository) SearchCallCount() int {
	fake.searchMutex.RLock()
	defer fake.searchMutex.RUnlock()
	return len(fake.searchArgsForCall)
}

func (fake *FakeServicePlanRepository) SearchCalls(stub func(map[string]string) ([]models.ServicePlanFields, error)) {
	fake.searchMutex.Lock()
	defer fake.searchMutex.Unlock()
	fake.SearchStub = stub
}

func (fake *FakeServicePlanRepository) SearchArgsForCall(i int) map[string]string {
	fake.searchMutex.RLock()
	defer fake.searchMutex.RUnlock()
	argsForCall := fake.searchArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeServicePlanRepository) SearchReturns(result1 []models.ServicePlanFields, result2 error) {
	fake.searchMutex.Lock()
	defer fake.searchMutex.Unlock()
	fake.SearchStub = nil
	fake.searchReturns = struct {
		result1 []models.ServicePlanFields
		result2 error
	}{result1, result2}
}

func (fake *FakeServicePlanRepository) SearchReturnsOnCall(i int, result1 []models.ServicePlanFields, result2 error) {
	fake.searchMutex.Lock()
	defer fake.searchMutex.Unlock()
	fake.SearchStub = nil
	if fake.searchReturnsOnCall == nil {
		fake.searchReturnsOnCall = make(map[int]struct {
			result1 []models.ServicePlanFields
			result2 error
		})
	}
	fake.searchReturnsOnCall[i] = struct {
		result1 []models.ServicePlanFields
		result2 error
	}{result1, result2}
}

func (fake *FakeServicePlanRepository) Update(arg1 models.ServicePlanFields, arg2 string, arg3 bool) error {
	fake.updateMutex.Lock()
	ret, specificReturn := fake.updateReturnsOnCall[len(fake.updateArgsForCall)]
	fake.updateArgsForCall = append(fake.updateArgsForCall, struct {
		arg1 models.ServicePlanFields
		arg2 string
		arg3 bool
	}{arg1, arg2, arg3})
	fake.recordInvocation("Update", []interface{}{arg1, arg2, arg3})
	fake.updateMutex.Unlock()
	if fake.UpdateStub != nil {
		return fake.UpdateStub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1
	}
	fakeReturns := fake.updateReturns
	return fakeReturns.result1
}

func (fake *FakeServicePlanRepository) UpdateCallCount() int {
	fake.updateMutex.RLock()
	defer fake.updateMutex.RUnlock()
	return len(fake.updateArgsForCall)
}

func (fake *FakeServicePlanRepository) UpdateCalls(stub func(models.ServicePlanFields, string, bool) error) {
	fake.updateMutex.Lock()
	defer fake.updateMutex.Unlock()
	fake.UpdateStub = stub
}

func (fake *FakeServicePlanRepository) UpdateArgsForCall(i int) (models.ServicePlanFields, string, bool) {
	fake.updateMutex.RLock()
	defer fake.updateMutex.RUnlock()
	argsForCall := fake.updateArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *FakeServicePlanRepository) UpdateReturns(result1 error) {
	fake.updateMutex.Lock()
	defer fake.updateMutex.Unlock()
	fake.UpdateStub = nil
	fake.updateReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeServicePlanRepository) UpdateReturnsOnCall(i int, result1 error) {
	fake.updateMutex.Lock()
	defer fake.updateMutex.Unlock()
	fake.UpdateStub = nil
	if fake.updateReturnsOnCall == nil {
		fake.updateReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.updateReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

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

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