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

import (
	"sync"

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

type FakeServiceBindingRepository struct {
	CreateStub        func(string, string, map[string]interface{}) error
	createMutex       sync.RWMutex
	createArgsForCall []struct {
		arg1 string
		arg2 string
		arg3 map[string]interface{}
	}
	createReturns struct {
		result1 error
	}
	createReturnsOnCall map[int]struct {
		result1 error
	}
	DeleteStub        func(models.ServiceInstance, string) (bool, error)
	deleteMutex       sync.RWMutex
	deleteArgsForCall []struct {
		arg1 models.ServiceInstance
		arg2 string
	}
	deleteReturns struct {
		result1 bool
		result2 error
	}
	deleteReturnsOnCall map[int]struct {
		result1 bool
		result2 error
	}
	ListAllForServiceStub        func(string) ([]models.ServiceBindingFields, error)
	listAllForServiceMutex       sync.RWMutex
	listAllForServiceArgsForCall []struct {
		arg1 string
	}
	listAllForServiceReturns struct {
		result1 []models.ServiceBindingFields
		result2 error
	}
	listAllForServiceReturnsOnCall map[int]struct {
		result1 []models.ServiceBindingFields
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

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

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

func (fake *FakeServiceBindingRepository) CreateCalls(stub func(string, string, map[string]interface{}) error) {
	fake.createMutex.Lock()
	defer fake.createMutex.Unlock()
	fake.CreateStub = stub
}

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

func (fake *FakeServiceBindingRepository) CreateReturns(result1 error) {
	fake.createMutex.Lock()
	defer fake.createMutex.Unlock()
	fake.CreateStub = nil
	fake.createReturns = struct {
		result1 error
	}{result1}
}

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

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

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

func (fake *FakeServiceBindingRepository) DeleteCalls(stub func(models.ServiceInstance, string) (bool, error)) {
	fake.deleteMutex.Lock()
	defer fake.deleteMutex.Unlock()
	fake.DeleteStub = stub
}

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

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

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

func (fake *FakeServiceBindingRepository) ListAllForService(arg1 string) ([]models.ServiceBindingFields, error) {
	fake.listAllForServiceMutex.Lock()
	ret, specificReturn := fake.listAllForServiceReturnsOnCall[len(fake.listAllForServiceArgsForCall)]
	fake.listAllForServiceArgsForCall = append(fake.listAllForServiceArgsForCall, struct {
		arg1 string
	}{arg1})
	fake.recordInvocation("ListAllForService", []interface{}{arg1})
	fake.listAllForServiceMutex.Unlock()
	if fake.ListAllForServiceStub != nil {
		return fake.ListAllForServiceStub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	fakeReturns := fake.listAllForServiceReturns
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeServiceBindingRepository) ListAllForServiceCallCount() int {
	fake.listAllForServiceMutex.RLock()
	defer fake.listAllForServiceMutex.RUnlock()
	return len(fake.listAllForServiceArgsForCall)
}

func (fake *FakeServiceBindingRepository) ListAllForServiceCalls(stub func(string) ([]models.ServiceBindingFields, error)) {
	fake.listAllForServiceMutex.Lock()
	defer fake.listAllForServiceMutex.Unlock()
	fake.ListAllForServiceStub = stub
}

func (fake *FakeServiceBindingRepository) ListAllForServiceArgsForCall(i int) string {
	fake.listAllForServiceMutex.RLock()
	defer fake.listAllForServiceMutex.RUnlock()
	argsForCall := fake.listAllForServiceArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeServiceBindingRepository) ListAllForServiceReturns(result1 []models.ServiceBindingFields, result2 error) {
	fake.listAllForServiceMutex.Lock()
	defer fake.listAllForServiceMutex.Unlock()
	fake.ListAllForServiceStub = nil
	fake.listAllForServiceReturns = struct {
		result1 []models.ServiceBindingFields
		result2 error
	}{result1, result2}
}

func (fake *FakeServiceBindingRepository) ListAllForServiceReturnsOnCall(i int, result1 []models.ServiceBindingFields, result2 error) {
	fake.listAllForServiceMutex.Lock()
	defer fake.listAllForServiceMutex.Unlock()
	fake.ListAllForServiceStub = nil
	if fake.listAllForServiceReturnsOnCall == nil {
		fake.listAllForServiceReturnsOnCall = make(map[int]struct {
			result1 []models.ServiceBindingFields
			result2 error
		})
	}
	fake.listAllForServiceReturnsOnCall[i] = struct {
		result1 []models.ServiceBindingFields
		result2 error
	}{result1, result2}
}

func (fake *FakeServiceBindingRepository) 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.listAllForServiceMutex.RLock()
	defer fake.listAllForServiceMutex.RUnlock()
	copiedInvocations := map[string][][]interface{}{}
	for key, value := range fake.invocations {
		copiedInvocations[key] = value
	}
	return copiedInvocations
}

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