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

import (
	"io"
	"sync"

	"github.com/orange-cloudfoundry/terraform-provider-cloudfoundry/bitsmanager"
)

type FakeApplicationBitsRepository struct {
	GetApplicationSha1Stub        func(appGUID string) (string, error)
	getApplicationSha1Mutex       sync.RWMutex
	getApplicationSha1ArgsForCall []struct {
		appGUID string
	}
	getApplicationSha1Returns struct {
		result1 string
		result2 error
	}
	getApplicationSha1ReturnsOnCall map[int]struct {
		result1 string
		result2 error
	}
	IsDiffStub        func(appGUID string, currentSha1 string) (bool, string, error)
	isDiffMutex       sync.RWMutex
	isDiffArgsForCall []struct {
		appGUID     string
		currentSha1 string
	}
	isDiffReturns struct {
		result1 bool
		result2 string
		result3 error
	}
	isDiffReturnsOnCall map[int]struct {
		result1 bool
		result2 string
		result3 error
	}
	UploadBitsStub        func(appGUID string, zipFile io.ReadCloser, fileSize int64) (apiErr error)
	uploadBitsMutex       sync.RWMutex
	uploadBitsArgsForCall []struct {
		appGUID  string
		zipFile  io.ReadCloser
		fileSize int64
	}
	uploadBitsReturns struct {
		result1 error
	}
	uploadBitsReturnsOnCall map[int]struct {
		result1 error
	}
	CopyBitsStub        func(origAppGuid string, newAppGuid string) error
	copyBitsMutex       sync.RWMutex
	copyBitsArgsForCall []struct {
		origAppGuid string
		newAppGuid  string
	}
	copyBitsReturns struct {
		result1 error
	}
	copyBitsReturnsOnCall map[int]struct {
		result1 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeApplicationBitsRepository) GetApplicationSha1(appGUID string) (string, error) {
	fake.getApplicationSha1Mutex.Lock()
	ret, specificReturn := fake.getApplicationSha1ReturnsOnCall[len(fake.getApplicationSha1ArgsForCall)]
	fake.getApplicationSha1ArgsForCall = append(fake.getApplicationSha1ArgsForCall, struct {
		appGUID string
	}{appGUID})
	fake.recordInvocation("GetApplicationSha1", []interface{}{appGUID})
	fake.getApplicationSha1Mutex.Unlock()
	if fake.GetApplicationSha1Stub != nil {
		return fake.GetApplicationSha1Stub(appGUID)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fake.getApplicationSha1Returns.result1, fake.getApplicationSha1Returns.result2
}

func (fake *FakeApplicationBitsRepository) GetApplicationSha1CallCount() int {
	fake.getApplicationSha1Mutex.RLock()
	defer fake.getApplicationSha1Mutex.RUnlock()
	return len(fake.getApplicationSha1ArgsForCall)
}

func (fake *FakeApplicationBitsRepository) GetApplicationSha1ArgsForCall(i int) string {
	fake.getApplicationSha1Mutex.RLock()
	defer fake.getApplicationSha1Mutex.RUnlock()
	return fake.getApplicationSha1ArgsForCall[i].appGUID
}

func (fake *FakeApplicationBitsRepository) GetApplicationSha1Returns(result1 string, result2 error) {
	fake.GetApplicationSha1Stub = nil
	fake.getApplicationSha1Returns = struct {
		result1 string
		result2 error
	}{result1, result2}
}

func (fake *FakeApplicationBitsRepository) GetApplicationSha1ReturnsOnCall(i int, result1 string, result2 error) {
	fake.GetApplicationSha1Stub = nil
	if fake.getApplicationSha1ReturnsOnCall == nil {
		fake.getApplicationSha1ReturnsOnCall = make(map[int]struct {
			result1 string
			result2 error
		})
	}
	fake.getApplicationSha1ReturnsOnCall[i] = struct {
		result1 string
		result2 error
	}{result1, result2}
}

func (fake *FakeApplicationBitsRepository) IsDiff(appGUID string, currentSha1 string) (bool, string, error) {
	fake.isDiffMutex.Lock()
	ret, specificReturn := fake.isDiffReturnsOnCall[len(fake.isDiffArgsForCall)]
	fake.isDiffArgsForCall = append(fake.isDiffArgsForCall, struct {
		appGUID     string
		currentSha1 string
	}{appGUID, currentSha1})
	fake.recordInvocation("IsDiff", []interface{}{appGUID, currentSha1})
	fake.isDiffMutex.Unlock()
	if fake.IsDiffStub != nil {
		return fake.IsDiffStub(appGUID, currentSha1)
	}
	if specificReturn {
		return ret.result1, ret.result2, ret.result3
	}
	return fake.isDiffReturns.result1, fake.isDiffReturns.result2, fake.isDiffReturns.result3
}

func (fake *FakeApplicationBitsRepository) IsDiffCallCount() int {
	fake.isDiffMutex.RLock()
	defer fake.isDiffMutex.RUnlock()
	return len(fake.isDiffArgsForCall)
}

func (fake *FakeApplicationBitsRepository) IsDiffArgsForCall(i int) (string, string) {
	fake.isDiffMutex.RLock()
	defer fake.isDiffMutex.RUnlock()
	return fake.isDiffArgsForCall[i].appGUID, fake.isDiffArgsForCall[i].currentSha1
}

func (fake *FakeApplicationBitsRepository) IsDiffReturns(result1 bool, result2 string, result3 error) {
	fake.IsDiffStub = nil
	fake.isDiffReturns = struct {
		result1 bool
		result2 string
		result3 error
	}{result1, result2, result3}
}

func (fake *FakeApplicationBitsRepository) IsDiffReturnsOnCall(i int, result1 bool, result2 string, result3 error) {
	fake.IsDiffStub = nil
	if fake.isDiffReturnsOnCall == nil {
		fake.isDiffReturnsOnCall = make(map[int]struct {
			result1 bool
			result2 string
			result3 error
		})
	}
	fake.isDiffReturnsOnCall[i] = struct {
		result1 bool
		result2 string
		result3 error
	}{result1, result2, result3}
}

func (fake *FakeApplicationBitsRepository) UploadBits(appGUID string, zipFile io.ReadCloser, fileSize int64) (apiErr error) {
	fake.uploadBitsMutex.Lock()
	ret, specificReturn := fake.uploadBitsReturnsOnCall[len(fake.uploadBitsArgsForCall)]
	fake.uploadBitsArgsForCall = append(fake.uploadBitsArgsForCall, struct {
		appGUID  string
		zipFile  io.ReadCloser
		fileSize int64
	}{appGUID, zipFile, fileSize})
	fake.recordInvocation("UploadBits", []interface{}{appGUID, zipFile, fileSize})
	fake.uploadBitsMutex.Unlock()
	if fake.UploadBitsStub != nil {
		return fake.UploadBitsStub(appGUID, zipFile, fileSize)
	}
	if specificReturn {
		return ret.result1
	}
	return fake.uploadBitsReturns.result1
}

func (fake *FakeApplicationBitsRepository) UploadBitsCallCount() int {
	fake.uploadBitsMutex.RLock()
	defer fake.uploadBitsMutex.RUnlock()
	return len(fake.uploadBitsArgsForCall)
}

func (fake *FakeApplicationBitsRepository) UploadBitsArgsForCall(i int) (string, io.ReadCloser, int64) {
	fake.uploadBitsMutex.RLock()
	defer fake.uploadBitsMutex.RUnlock()
	return fake.uploadBitsArgsForCall[i].appGUID, fake.uploadBitsArgsForCall[i].zipFile, fake.uploadBitsArgsForCall[i].fileSize
}

func (fake *FakeApplicationBitsRepository) UploadBitsReturns(result1 error) {
	fake.UploadBitsStub = nil
	fake.uploadBitsReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeApplicationBitsRepository) UploadBitsReturnsOnCall(i int, result1 error) {
	fake.UploadBitsStub = nil
	if fake.uploadBitsReturnsOnCall == nil {
		fake.uploadBitsReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.uploadBitsReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeApplicationBitsRepository) CopyBits(origAppGuid string, newAppGuid string) error {
	fake.copyBitsMutex.Lock()
	ret, specificReturn := fake.copyBitsReturnsOnCall[len(fake.copyBitsArgsForCall)]
	fake.copyBitsArgsForCall = append(fake.copyBitsArgsForCall, struct {
		origAppGuid string
		newAppGuid  string
	}{origAppGuid, newAppGuid})
	fake.recordInvocation("CopyBits", []interface{}{origAppGuid, newAppGuid})
	fake.copyBitsMutex.Unlock()
	if fake.CopyBitsStub != nil {
		return fake.CopyBitsStub(origAppGuid, newAppGuid)
	}
	if specificReturn {
		return ret.result1
	}
	return fake.copyBitsReturns.result1
}

func (fake *FakeApplicationBitsRepository) CopyBitsCallCount() int {
	fake.copyBitsMutex.RLock()
	defer fake.copyBitsMutex.RUnlock()
	return len(fake.copyBitsArgsForCall)
}

func (fake *FakeApplicationBitsRepository) CopyBitsArgsForCall(i int) (string, string) {
	fake.copyBitsMutex.RLock()
	defer fake.copyBitsMutex.RUnlock()
	return fake.copyBitsArgsForCall[i].origAppGuid, fake.copyBitsArgsForCall[i].newAppGuid
}

func (fake *FakeApplicationBitsRepository) CopyBitsReturns(result1 error) {
	fake.CopyBitsStub = nil
	fake.copyBitsReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeApplicationBitsRepository) CopyBitsReturnsOnCall(i int, result1 error) {
	fake.CopyBitsStub = nil
	if fake.copyBitsReturnsOnCall == nil {
		fake.copyBitsReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.copyBitsReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

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

func (fake *FakeApplicationBitsRepository) 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 _ bitsmanager.ApplicationBitsRepository = new(FakeApplicationBitsRepository)
