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

import (
	"os"
	"sync"

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

type FakeBuildpackBitsRepository struct {
	CreateBuildpackZipFileStub        func(string) (*os.File, string, error)
	createBuildpackZipFileMutex       sync.RWMutex
	createBuildpackZipFileArgsForCall []struct {
		arg1 string
	}
	createBuildpackZipFileReturns struct {
		result1 *os.File
		result2 string
		result3 error
	}
	createBuildpackZipFileReturnsOnCall map[int]struct {
		result1 *os.File
		result2 string
		result3 error
	}
	UploadBuildpackStub        func(models.Buildpack, *os.File, string) error
	uploadBuildpackMutex       sync.RWMutex
	uploadBuildpackArgsForCall []struct {
		arg1 models.Buildpack
		arg2 *os.File
		arg3 string
	}
	uploadBuildpackReturns struct {
		result1 error
	}
	uploadBuildpackReturnsOnCall map[int]struct {
		result1 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeBuildpackBitsRepository) CreateBuildpackZipFile(arg1 string) (*os.File, string, error) {
	fake.createBuildpackZipFileMutex.Lock()
	ret, specificReturn := fake.createBuildpackZipFileReturnsOnCall[len(fake.createBuildpackZipFileArgsForCall)]
	fake.createBuildpackZipFileArgsForCall = append(fake.createBuildpackZipFileArgsForCall, struct {
		arg1 string
	}{arg1})
	fake.recordInvocation("CreateBuildpackZipFile", []interface{}{arg1})
	fake.createBuildpackZipFileMutex.Unlock()
	if fake.CreateBuildpackZipFileStub != nil {
		return fake.CreateBuildpackZipFileStub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2, ret.result3
	}
	fakeReturns := fake.createBuildpackZipFileReturns
	return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3
}

func (fake *FakeBuildpackBitsRepository) CreateBuildpackZipFileCallCount() int {
	fake.createBuildpackZipFileMutex.RLock()
	defer fake.createBuildpackZipFileMutex.RUnlock()
	return len(fake.createBuildpackZipFileArgsForCall)
}

func (fake *FakeBuildpackBitsRepository) CreateBuildpackZipFileCalls(stub func(string) (*os.File, string, error)) {
	fake.createBuildpackZipFileMutex.Lock()
	defer fake.createBuildpackZipFileMutex.Unlock()
	fake.CreateBuildpackZipFileStub = stub
}

func (fake *FakeBuildpackBitsRepository) CreateBuildpackZipFileArgsForCall(i int) string {
	fake.createBuildpackZipFileMutex.RLock()
	defer fake.createBuildpackZipFileMutex.RUnlock()
	argsForCall := fake.createBuildpackZipFileArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeBuildpackBitsRepository) CreateBuildpackZipFileReturns(result1 *os.File, result2 string, result3 error) {
	fake.createBuildpackZipFileMutex.Lock()
	defer fake.createBuildpackZipFileMutex.Unlock()
	fake.CreateBuildpackZipFileStub = nil
	fake.createBuildpackZipFileReturns = struct {
		result1 *os.File
		result2 string
		result3 error
	}{result1, result2, result3}
}

func (fake *FakeBuildpackBitsRepository) CreateBuildpackZipFileReturnsOnCall(i int, result1 *os.File, result2 string, result3 error) {
	fake.createBuildpackZipFileMutex.Lock()
	defer fake.createBuildpackZipFileMutex.Unlock()
	fake.CreateBuildpackZipFileStub = nil
	if fake.createBuildpackZipFileReturnsOnCall == nil {
		fake.createBuildpackZipFileReturnsOnCall = make(map[int]struct {
			result1 *os.File
			result2 string
			result3 error
		})
	}
	fake.createBuildpackZipFileReturnsOnCall[i] = struct {
		result1 *os.File
		result2 string
		result3 error
	}{result1, result2, result3}
}

func (fake *FakeBuildpackBitsRepository) UploadBuildpack(arg1 models.Buildpack, arg2 *os.File, arg3 string) error {
	fake.uploadBuildpackMutex.Lock()
	ret, specificReturn := fake.uploadBuildpackReturnsOnCall[len(fake.uploadBuildpackArgsForCall)]
	fake.uploadBuildpackArgsForCall = append(fake.uploadBuildpackArgsForCall, struct {
		arg1 models.Buildpack
		arg2 *os.File
		arg3 string
	}{arg1, arg2, arg3})
	fake.recordInvocation("UploadBuildpack", []interface{}{arg1, arg2, arg3})
	fake.uploadBuildpackMutex.Unlock()
	if fake.UploadBuildpackStub != nil {
		return fake.UploadBuildpackStub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1
	}
	fakeReturns := fake.uploadBuildpackReturns
	return fakeReturns.result1
}

func (fake *FakeBuildpackBitsRepository) UploadBuildpackCallCount() int {
	fake.uploadBuildpackMutex.RLock()
	defer fake.uploadBuildpackMutex.RUnlock()
	return len(fake.uploadBuildpackArgsForCall)
}

func (fake *FakeBuildpackBitsRepository) UploadBuildpackCalls(stub func(models.Buildpack, *os.File, string) error) {
	fake.uploadBuildpackMutex.Lock()
	defer fake.uploadBuildpackMutex.Unlock()
	fake.UploadBuildpackStub = stub
}

func (fake *FakeBuildpackBitsRepository) UploadBuildpackArgsForCall(i int) (models.Buildpack, *os.File, string) {
	fake.uploadBuildpackMutex.RLock()
	defer fake.uploadBuildpackMutex.RUnlock()
	argsForCall := fake.uploadBuildpackArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *FakeBuildpackBitsRepository) UploadBuildpackReturns(result1 error) {
	fake.uploadBuildpackMutex.Lock()
	defer fake.uploadBuildpackMutex.Unlock()
	fake.UploadBuildpackStub = nil
	fake.uploadBuildpackReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeBuildpackBitsRepository) UploadBuildpackReturnsOnCall(i int, result1 error) {
	fake.uploadBuildpackMutex.Lock()
	defer fake.uploadBuildpackMutex.Unlock()
	fake.UploadBuildpackStub = nil
	if fake.uploadBuildpackReturnsOnCall == nil {
		fake.uploadBuildpackReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.uploadBuildpackReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

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

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