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

import (
	"sync"

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

type FakeBuildpackRepository struct {
	CreateStub        func(string, *int, *bool, *bool) (models.Buildpack, error)
	createMutex       sync.RWMutex
	createArgsForCall []struct {
		arg1 string
		arg2 *int
		arg3 *bool
		arg4 *bool
	}
	createReturns struct {
		result1 models.Buildpack
		result2 error
	}
	createReturnsOnCall map[int]struct {
		result1 models.Buildpack
		result2 error
	}
	DeleteStub        func(string) error
	deleteMutex       sync.RWMutex
	deleteArgsForCall []struct {
		arg1 string
	}
	deleteReturns struct {
		result1 error
	}
	deleteReturnsOnCall map[int]struct {
		result1 error
	}
	FindByNameStub        func(string) (models.Buildpack, error)
	findByNameMutex       sync.RWMutex
	findByNameArgsForCall []struct {
		arg1 string
	}
	findByNameReturns struct {
		result1 models.Buildpack
		result2 error
	}
	findByNameReturnsOnCall map[int]struct {
		result1 models.Buildpack
		result2 error
	}
	FindByNameAndStackStub        func(string, string) (models.Buildpack, error)
	findByNameAndStackMutex       sync.RWMutex
	findByNameAndStackArgsForCall []struct {
		arg1 string
		arg2 string
	}
	findByNameAndStackReturns struct {
		result1 models.Buildpack
		result2 error
	}
	findByNameAndStackReturnsOnCall map[int]struct {
		result1 models.Buildpack
		result2 error
	}
	FindByNameWithNilStackStub        func(string) (models.Buildpack, error)
	findByNameWithNilStackMutex       sync.RWMutex
	findByNameWithNilStackArgsForCall []struct {
		arg1 string
	}
	findByNameWithNilStackReturns struct {
		result1 models.Buildpack
		result2 error
	}
	findByNameWithNilStackReturnsOnCall map[int]struct {
		result1 models.Buildpack
		result2 error
	}
	ListBuildpacksStub        func(func(models.Buildpack) bool) error
	listBuildpacksMutex       sync.RWMutex
	listBuildpacksArgsForCall []struct {
		arg1 func(models.Buildpack) bool
	}
	listBuildpacksReturns struct {
		result1 error
	}
	listBuildpacksReturnsOnCall map[int]struct {
		result1 error
	}
	UpdateStub        func(models.Buildpack) (models.Buildpack, error)
	updateMutex       sync.RWMutex
	updateArgsForCall []struct {
		arg1 models.Buildpack
	}
	updateReturns struct {
		result1 models.Buildpack
		result2 error
	}
	updateReturnsOnCall map[int]struct {
		result1 models.Buildpack
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeBuildpackRepository) Create(arg1 string, arg2 *int, arg3 *bool, arg4 *bool) (models.Buildpack, error) {
	fake.createMutex.Lock()
	ret, specificReturn := fake.createReturnsOnCall[len(fake.createArgsForCall)]
	fake.createArgsForCall = append(fake.createArgsForCall, struct {
		arg1 string
		arg2 *int
		arg3 *bool
		arg4 *bool
	}{arg1, arg2, arg3, arg4})
	fake.recordInvocation("Create", []interface{}{arg1, arg2, arg3, arg4})
	fake.createMutex.Unlock()
	if fake.CreateStub != nil {
		return fake.CreateStub(arg1, arg2, arg3, arg4)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	fakeReturns := fake.createReturns
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeBuildpackRepository) CreateCallCount() int {
	fake.createMutex.RLock()
	defer fake.createMutex.RUnlock()
	return len(fake.createArgsForCall)
}

func (fake *FakeBuildpackRepository) CreateCalls(stub func(string, *int, *bool, *bool) (models.Buildpack, error)) {
	fake.createMutex.Lock()
	defer fake.createMutex.Unlock()
	fake.CreateStub = stub
}

func (fake *FakeBuildpackRepository) CreateArgsForCall(i int) (string, *int, *bool, *bool) {
	fake.createMutex.RLock()
	defer fake.createMutex.RUnlock()
	argsForCall := fake.createArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4
}

func (fake *FakeBuildpackRepository) CreateReturns(result1 models.Buildpack, result2 error) {
	fake.createMutex.Lock()
	defer fake.createMutex.Unlock()
	fake.CreateStub = nil
	fake.createReturns = struct {
		result1 models.Buildpack
		result2 error
	}{result1, result2}
}

func (fake *FakeBuildpackRepository) CreateReturnsOnCall(i int, result1 models.Buildpack, result2 error) {
	fake.createMutex.Lock()
	defer fake.createMutex.Unlock()
	fake.CreateStub = nil
	if fake.createReturnsOnCall == nil {
		fake.createReturnsOnCall = make(map[int]struct {
			result1 models.Buildpack
			result2 error
		})
	}
	fake.createReturnsOnCall[i] = struct {
		result1 models.Buildpack
		result2 error
	}{result1, result2}
}

func (fake *FakeBuildpackRepository) Delete(arg1 string) error {
	fake.deleteMutex.Lock()
	ret, specificReturn := fake.deleteReturnsOnCall[len(fake.deleteArgsForCall)]
	fake.deleteArgsForCall = append(fake.deleteArgsForCall, struct {
		arg1 string
	}{arg1})
	fake.recordInvocation("Delete", []interface{}{arg1})
	fake.deleteMutex.Unlock()
	if fake.DeleteStub != nil {
		return fake.DeleteStub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	fakeReturns := fake.deleteReturns
	return fakeReturns.result1
}

func (fake *FakeBuildpackRepository) DeleteCallCount() int {
	fake.deleteMutex.RLock()
	defer fake.deleteMutex.RUnlock()
	return len(fake.deleteArgsForCall)
}

func (fake *FakeBuildpackRepository) DeleteCalls(stub func(string) error) {
	fake.deleteMutex.Lock()
	defer fake.deleteMutex.Unlock()
	fake.DeleteStub = stub
}

func (fake *FakeBuildpackRepository) DeleteArgsForCall(i int) string {
	fake.deleteMutex.RLock()
	defer fake.deleteMutex.RUnlock()
	argsForCall := fake.deleteArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeBuildpackRepository) DeleteReturns(result1 error) {
	fake.deleteMutex.Lock()
	defer fake.deleteMutex.Unlock()
	fake.DeleteStub = nil
	fake.deleteReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeBuildpackRepository) DeleteReturnsOnCall(i int, result1 error) {
	fake.deleteMutex.Lock()
	defer fake.deleteMutex.Unlock()
	fake.DeleteStub = nil
	if fake.deleteReturnsOnCall == nil {
		fake.deleteReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.deleteReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeBuildpackRepository) FindByName(arg1 string) (models.Buildpack, error) {
	fake.findByNameMutex.Lock()
	ret, specificReturn := fake.findByNameReturnsOnCall[len(fake.findByNameArgsForCall)]
	fake.findByNameArgsForCall = append(fake.findByNameArgsForCall, struct {
		arg1 string
	}{arg1})
	fake.recordInvocation("FindByName", []interface{}{arg1})
	fake.findByNameMutex.Unlock()
	if fake.FindByNameStub != nil {
		return fake.FindByNameStub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	fakeReturns := fake.findByNameReturns
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeBuildpackRepository) FindByNameCallCount() int {
	fake.findByNameMutex.RLock()
	defer fake.findByNameMutex.RUnlock()
	return len(fake.findByNameArgsForCall)
}

func (fake *FakeBuildpackRepository) FindByNameCalls(stub func(string) (models.Buildpack, error)) {
	fake.findByNameMutex.Lock()
	defer fake.findByNameMutex.Unlock()
	fake.FindByNameStub = stub
}

func (fake *FakeBuildpackRepository) FindByNameArgsForCall(i int) string {
	fake.findByNameMutex.RLock()
	defer fake.findByNameMutex.RUnlock()
	argsForCall := fake.findByNameArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeBuildpackRepository) FindByNameReturns(result1 models.Buildpack, result2 error) {
	fake.findByNameMutex.Lock()
	defer fake.findByNameMutex.Unlock()
	fake.FindByNameStub = nil
	fake.findByNameReturns = struct {
		result1 models.Buildpack
		result2 error
	}{result1, result2}
}

func (fake *FakeBuildpackRepository) FindByNameReturnsOnCall(i int, result1 models.Buildpack, result2 error) {
	fake.findByNameMutex.Lock()
	defer fake.findByNameMutex.Unlock()
	fake.FindByNameStub = nil
	if fake.findByNameReturnsOnCall == nil {
		fake.findByNameReturnsOnCall = make(map[int]struct {
			result1 models.Buildpack
			result2 error
		})
	}
	fake.findByNameReturnsOnCall[i] = struct {
		result1 models.Buildpack
		result2 error
	}{result1, result2}
}

func (fake *FakeBuildpackRepository) FindByNameAndStack(arg1 string, arg2 string) (models.Buildpack, error) {
	fake.findByNameAndStackMutex.Lock()
	ret, specificReturn := fake.findByNameAndStackReturnsOnCall[len(fake.findByNameAndStackArgsForCall)]
	fake.findByNameAndStackArgsForCall = append(fake.findByNameAndStackArgsForCall, struct {
		arg1 string
		arg2 string
	}{arg1, arg2})
	fake.recordInvocation("FindByNameAndStack", []interface{}{arg1, arg2})
	fake.findByNameAndStackMutex.Unlock()
	if fake.FindByNameAndStackStub != nil {
		return fake.FindByNameAndStackStub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	fakeReturns := fake.findByNameAndStackReturns
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeBuildpackRepository) FindByNameAndStackCallCount() int {
	fake.findByNameAndStackMutex.RLock()
	defer fake.findByNameAndStackMutex.RUnlock()
	return len(fake.findByNameAndStackArgsForCall)
}

func (fake *FakeBuildpackRepository) FindByNameAndStackCalls(stub func(string, string) (models.Buildpack, error)) {
	fake.findByNameAndStackMutex.Lock()
	defer fake.findByNameAndStackMutex.Unlock()
	fake.FindByNameAndStackStub = stub
}

func (fake *FakeBuildpackRepository) FindByNameAndStackArgsForCall(i int) (string, string) {
	fake.findByNameAndStackMutex.RLock()
	defer fake.findByNameAndStackMutex.RUnlock()
	argsForCall := fake.findByNameAndStackArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeBuildpackRepository) FindByNameAndStackReturns(result1 models.Buildpack, result2 error) {
	fake.findByNameAndStackMutex.Lock()
	defer fake.findByNameAndStackMutex.Unlock()
	fake.FindByNameAndStackStub = nil
	fake.findByNameAndStackReturns = struct {
		result1 models.Buildpack
		result2 error
	}{result1, result2}
}

func (fake *FakeBuildpackRepository) FindByNameAndStackReturnsOnCall(i int, result1 models.Buildpack, result2 error) {
	fake.findByNameAndStackMutex.Lock()
	defer fake.findByNameAndStackMutex.Unlock()
	fake.FindByNameAndStackStub = nil
	if fake.findByNameAndStackReturnsOnCall == nil {
		fake.findByNameAndStackReturnsOnCall = make(map[int]struct {
			result1 models.Buildpack
			result2 error
		})
	}
	fake.findByNameAndStackReturnsOnCall[i] = struct {
		result1 models.Buildpack
		result2 error
	}{result1, result2}
}

func (fake *FakeBuildpackRepository) FindByNameWithNilStack(arg1 string) (models.Buildpack, error) {
	fake.findByNameWithNilStackMutex.Lock()
	ret, specificReturn := fake.findByNameWithNilStackReturnsOnCall[len(fake.findByNameWithNilStackArgsForCall)]
	fake.findByNameWithNilStackArgsForCall = append(fake.findByNameWithNilStackArgsForCall, struct {
		arg1 string
	}{arg1})
	fake.recordInvocation("FindByNameWithNilStack", []interface{}{arg1})
	fake.findByNameWithNilStackMutex.Unlock()
	if fake.FindByNameWithNilStackStub != nil {
		return fake.FindByNameWithNilStackStub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	fakeReturns := fake.findByNameWithNilStackReturns
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeBuildpackRepository) FindByNameWithNilStackCallCount() int {
	fake.findByNameWithNilStackMutex.RLock()
	defer fake.findByNameWithNilStackMutex.RUnlock()
	return len(fake.findByNameWithNilStackArgsForCall)
}

func (fake *FakeBuildpackRepository) FindByNameWithNilStackCalls(stub func(string) (models.Buildpack, error)) {
	fake.findByNameWithNilStackMutex.Lock()
	defer fake.findByNameWithNilStackMutex.Unlock()
	fake.FindByNameWithNilStackStub = stub
}

func (fake *FakeBuildpackRepository) FindByNameWithNilStackArgsForCall(i int) string {
	fake.findByNameWithNilStackMutex.RLock()
	defer fake.findByNameWithNilStackMutex.RUnlock()
	argsForCall := fake.findByNameWithNilStackArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeBuildpackRepository) FindByNameWithNilStackReturns(result1 models.Buildpack, result2 error) {
	fake.findByNameWithNilStackMutex.Lock()
	defer fake.findByNameWithNilStackMutex.Unlock()
	fake.FindByNameWithNilStackStub = nil
	fake.findByNameWithNilStackReturns = struct {
		result1 models.Buildpack
		result2 error
	}{result1, result2}
}

func (fake *FakeBuildpackRepository) FindByNameWithNilStackReturnsOnCall(i int, result1 models.Buildpack, result2 error) {
	fake.findByNameWithNilStackMutex.Lock()
	defer fake.findByNameWithNilStackMutex.Unlock()
	fake.FindByNameWithNilStackStub = nil
	if fake.findByNameWithNilStackReturnsOnCall == nil {
		fake.findByNameWithNilStackReturnsOnCall = make(map[int]struct {
			result1 models.Buildpack
			result2 error
		})
	}
	fake.findByNameWithNilStackReturnsOnCall[i] = struct {
		result1 models.Buildpack
		result2 error
	}{result1, result2}
}

func (fake *FakeBuildpackRepository) ListBuildpacks(arg1 func(models.Buildpack) bool) error {
	fake.listBuildpacksMutex.Lock()
	ret, specificReturn := fake.listBuildpacksReturnsOnCall[len(fake.listBuildpacksArgsForCall)]
	fake.listBuildpacksArgsForCall = append(fake.listBuildpacksArgsForCall, struct {
		arg1 func(models.Buildpack) bool
	}{arg1})
	fake.recordInvocation("ListBuildpacks", []interface{}{arg1})
	fake.listBuildpacksMutex.Unlock()
	if fake.ListBuildpacksStub != nil {
		return fake.ListBuildpacksStub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	fakeReturns := fake.listBuildpacksReturns
	return fakeReturns.result1
}

func (fake *FakeBuildpackRepository) ListBuildpacksCallCount() int {
	fake.listBuildpacksMutex.RLock()
	defer fake.listBuildpacksMutex.RUnlock()
	return len(fake.listBuildpacksArgsForCall)
}

func (fake *FakeBuildpackRepository) ListBuildpacksCalls(stub func(func(models.Buildpack) bool) error) {
	fake.listBuildpacksMutex.Lock()
	defer fake.listBuildpacksMutex.Unlock()
	fake.ListBuildpacksStub = stub
}

func (fake *FakeBuildpackRepository) ListBuildpacksArgsForCall(i int) func(models.Buildpack) bool {
	fake.listBuildpacksMutex.RLock()
	defer fake.listBuildpacksMutex.RUnlock()
	argsForCall := fake.listBuildpacksArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeBuildpackRepository) ListBuildpacksReturns(result1 error) {
	fake.listBuildpacksMutex.Lock()
	defer fake.listBuildpacksMutex.Unlock()
	fake.ListBuildpacksStub = nil
	fake.listBuildpacksReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeBuildpackRepository) ListBuildpacksReturnsOnCall(i int, result1 error) {
	fake.listBuildpacksMutex.Lock()
	defer fake.listBuildpacksMutex.Unlock()
	fake.ListBuildpacksStub = nil
	if fake.listBuildpacksReturnsOnCall == nil {
		fake.listBuildpacksReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.listBuildpacksReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

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

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

func (fake *FakeBuildpackRepository) UpdateCalls(stub func(models.Buildpack) (models.Buildpack, error)) {
	fake.updateMutex.Lock()
	defer fake.updateMutex.Unlock()
	fake.UpdateStub = stub
}

func (fake *FakeBuildpackRepository) UpdateArgsForCall(i int) models.Buildpack {
	fake.updateMutex.RLock()
	defer fake.updateMutex.RUnlock()
	argsForCall := fake.updateArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeBuildpackRepository) UpdateReturns(result1 models.Buildpack, result2 error) {
	fake.updateMutex.Lock()
	defer fake.updateMutex.Unlock()
	fake.UpdateStub = nil
	fake.updateReturns = struct {
		result1 models.Buildpack
		result2 error
	}{result1, result2}
}

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

func (fake *FakeBuildpackRepository) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	fake.createMutex.RLock()
	defer fake.createMutex.RUnlock()
	fake.deleteMutex.RLock()
	defer fake.deleteMutex.RUnlock()
	fake.findByNameMutex.RLock()
	defer fake.findByNameMutex.RUnlock()
	fake.findByNameAndStackMutex.RLock()
	defer fake.findByNameAndStackMutex.RUnlock()
	fake.findByNameWithNilStackMutex.RLock()
	defer fake.findByNameWithNilStackMutex.RUnlock()
	fake.listBuildpacksMutex.RLock()
	defer fake.listBuildpacksMutex.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 *FakeBuildpackRepository) 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.BuildpackRepository = new(FakeBuildpackRepository)
