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

import (
	"sync"

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

type FakeServiceKeyRepository struct {
	CreateServiceKeyStub        func(string, string, map[string]interface{}) error
	createServiceKeyMutex       sync.RWMutex
	createServiceKeyArgsForCall []struct {
		arg1 string
		arg2 string
		arg3 map[string]interface{}
	}
	createServiceKeyReturns struct {
		result1 error
	}
	createServiceKeyReturnsOnCall map[int]struct {
		result1 error
	}
	DeleteServiceKeyStub        func(string) error
	deleteServiceKeyMutex       sync.RWMutex
	deleteServiceKeyArgsForCall []struct {
		arg1 string
	}
	deleteServiceKeyReturns struct {
		result1 error
	}
	deleteServiceKeyReturnsOnCall map[int]struct {
		result1 error
	}
	GetServiceKeyStub        func(string, string) (models.ServiceKey, error)
	getServiceKeyMutex       sync.RWMutex
	getServiceKeyArgsForCall []struct {
		arg1 string
		arg2 string
	}
	getServiceKeyReturns struct {
		result1 models.ServiceKey
		result2 error
	}
	getServiceKeyReturnsOnCall map[int]struct {
		result1 models.ServiceKey
		result2 error
	}
	ListServiceKeysStub        func(string) ([]models.ServiceKey, error)
	listServiceKeysMutex       sync.RWMutex
	listServiceKeysArgsForCall []struct {
		arg1 string
	}
	listServiceKeysReturns struct {
		result1 []models.ServiceKey
		result2 error
	}
	listServiceKeysReturnsOnCall map[int]struct {
		result1 []models.ServiceKey
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeServiceKeyRepository) CreateServiceKey(arg1 string, arg2 string, arg3 map[string]interface{}) error {
	fake.createServiceKeyMutex.Lock()
	ret, specificReturn := fake.createServiceKeyReturnsOnCall[len(fake.createServiceKeyArgsForCall)]
	fake.createServiceKeyArgsForCall = append(fake.createServiceKeyArgsForCall, struct {
		arg1 string
		arg2 string
		arg3 map[string]interface{}
	}{arg1, arg2, arg3})
	fake.recordInvocation("CreateServiceKey", []interface{}{arg1, arg2, arg3})
	fake.createServiceKeyMutex.Unlock()
	if fake.CreateServiceKeyStub != nil {
		return fake.CreateServiceKeyStub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1
	}
	fakeReturns := fake.createServiceKeyReturns
	return fakeReturns.result1
}

func (fake *FakeServiceKeyRepository) CreateServiceKeyCallCount() int {
	fake.createServiceKeyMutex.RLock()
	defer fake.createServiceKeyMutex.RUnlock()
	return len(fake.createServiceKeyArgsForCall)
}

func (fake *FakeServiceKeyRepository) CreateServiceKeyCalls(stub func(string, string, map[string]interface{}) error) {
	fake.createServiceKeyMutex.Lock()
	defer fake.createServiceKeyMutex.Unlock()
	fake.CreateServiceKeyStub = stub
}

func (fake *FakeServiceKeyRepository) CreateServiceKeyArgsForCall(i int) (string, string, map[string]interface{}) {
	fake.createServiceKeyMutex.RLock()
	defer fake.createServiceKeyMutex.RUnlock()
	argsForCall := fake.createServiceKeyArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *FakeServiceKeyRepository) CreateServiceKeyReturns(result1 error) {
	fake.createServiceKeyMutex.Lock()
	defer fake.createServiceKeyMutex.Unlock()
	fake.CreateServiceKeyStub = nil
	fake.createServiceKeyReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeServiceKeyRepository) CreateServiceKeyReturnsOnCall(i int, result1 error) {
	fake.createServiceKeyMutex.Lock()
	defer fake.createServiceKeyMutex.Unlock()
	fake.CreateServiceKeyStub = nil
	if fake.createServiceKeyReturnsOnCall == nil {
		fake.createServiceKeyReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.createServiceKeyReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeServiceKeyRepository) DeleteServiceKey(arg1 string) error {
	fake.deleteServiceKeyMutex.Lock()
	ret, specificReturn := fake.deleteServiceKeyReturnsOnCall[len(fake.deleteServiceKeyArgsForCall)]
	fake.deleteServiceKeyArgsForCall = append(fake.deleteServiceKeyArgsForCall, struct {
		arg1 string
	}{arg1})
	fake.recordInvocation("DeleteServiceKey", []interface{}{arg1})
	fake.deleteServiceKeyMutex.Unlock()
	if fake.DeleteServiceKeyStub != nil {
		return fake.DeleteServiceKeyStub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	fakeReturns := fake.deleteServiceKeyReturns
	return fakeReturns.result1
}

func (fake *FakeServiceKeyRepository) DeleteServiceKeyCallCount() int {
	fake.deleteServiceKeyMutex.RLock()
	defer fake.deleteServiceKeyMutex.RUnlock()
	return len(fake.deleteServiceKeyArgsForCall)
}

func (fake *FakeServiceKeyRepository) DeleteServiceKeyCalls(stub func(string) error) {
	fake.deleteServiceKeyMutex.Lock()
	defer fake.deleteServiceKeyMutex.Unlock()
	fake.DeleteServiceKeyStub = stub
}

func (fake *FakeServiceKeyRepository) DeleteServiceKeyArgsForCall(i int) string {
	fake.deleteServiceKeyMutex.RLock()
	defer fake.deleteServiceKeyMutex.RUnlock()
	argsForCall := fake.deleteServiceKeyArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeServiceKeyRepository) DeleteServiceKeyReturns(result1 error) {
	fake.deleteServiceKeyMutex.Lock()
	defer fake.deleteServiceKeyMutex.Unlock()
	fake.DeleteServiceKeyStub = nil
	fake.deleteServiceKeyReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeServiceKeyRepository) DeleteServiceKeyReturnsOnCall(i int, result1 error) {
	fake.deleteServiceKeyMutex.Lock()
	defer fake.deleteServiceKeyMutex.Unlock()
	fake.DeleteServiceKeyStub = nil
	if fake.deleteServiceKeyReturnsOnCall == nil {
		fake.deleteServiceKeyReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.deleteServiceKeyReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeServiceKeyRepository) GetServiceKey(arg1 string, arg2 string) (models.ServiceKey, error) {
	fake.getServiceKeyMutex.Lock()
	ret, specificReturn := fake.getServiceKeyReturnsOnCall[len(fake.getServiceKeyArgsForCall)]
	fake.getServiceKeyArgsForCall = append(fake.getServiceKeyArgsForCall, struct {
		arg1 string
		arg2 string
	}{arg1, arg2})
	fake.recordInvocation("GetServiceKey", []interface{}{arg1, arg2})
	fake.getServiceKeyMutex.Unlock()
	if fake.GetServiceKeyStub != nil {
		return fake.GetServiceKeyStub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	fakeReturns := fake.getServiceKeyReturns
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeServiceKeyRepository) GetServiceKeyCallCount() int {
	fake.getServiceKeyMutex.RLock()
	defer fake.getServiceKeyMutex.RUnlock()
	return len(fake.getServiceKeyArgsForCall)
}

func (fake *FakeServiceKeyRepository) GetServiceKeyCalls(stub func(string, string) (models.ServiceKey, error)) {
	fake.getServiceKeyMutex.Lock()
	defer fake.getServiceKeyMutex.Unlock()
	fake.GetServiceKeyStub = stub
}

func (fake *FakeServiceKeyRepository) GetServiceKeyArgsForCall(i int) (string, string) {
	fake.getServiceKeyMutex.RLock()
	defer fake.getServiceKeyMutex.RUnlock()
	argsForCall := fake.getServiceKeyArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeServiceKeyRepository) GetServiceKeyReturns(result1 models.ServiceKey, result2 error) {
	fake.getServiceKeyMutex.Lock()
	defer fake.getServiceKeyMutex.Unlock()
	fake.GetServiceKeyStub = nil
	fake.getServiceKeyReturns = struct {
		result1 models.ServiceKey
		result2 error
	}{result1, result2}
}

func (fake *FakeServiceKeyRepository) GetServiceKeyReturnsOnCall(i int, result1 models.ServiceKey, result2 error) {
	fake.getServiceKeyMutex.Lock()
	defer fake.getServiceKeyMutex.Unlock()
	fake.GetServiceKeyStub = nil
	if fake.getServiceKeyReturnsOnCall == nil {
		fake.getServiceKeyReturnsOnCall = make(map[int]struct {
			result1 models.ServiceKey
			result2 error
		})
	}
	fake.getServiceKeyReturnsOnCall[i] = struct {
		result1 models.ServiceKey
		result2 error
	}{result1, result2}
}

func (fake *FakeServiceKeyRepository) ListServiceKeys(arg1 string) ([]models.ServiceKey, error) {
	fake.listServiceKeysMutex.Lock()
	ret, specificReturn := fake.listServiceKeysReturnsOnCall[len(fake.listServiceKeysArgsForCall)]
	fake.listServiceKeysArgsForCall = append(fake.listServiceKeysArgsForCall, struct {
		arg1 string
	}{arg1})
	fake.recordInvocation("ListServiceKeys", []interface{}{arg1})
	fake.listServiceKeysMutex.Unlock()
	if fake.ListServiceKeysStub != nil {
		return fake.ListServiceKeysStub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	fakeReturns := fake.listServiceKeysReturns
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeServiceKeyRepository) ListServiceKeysCallCount() int {
	fake.listServiceKeysMutex.RLock()
	defer fake.listServiceKeysMutex.RUnlock()
	return len(fake.listServiceKeysArgsForCall)
}

func (fake *FakeServiceKeyRepository) ListServiceKeysCalls(stub func(string) ([]models.ServiceKey, error)) {
	fake.listServiceKeysMutex.Lock()
	defer fake.listServiceKeysMutex.Unlock()
	fake.ListServiceKeysStub = stub
}

func (fake *FakeServiceKeyRepository) ListServiceKeysArgsForCall(i int) string {
	fake.listServiceKeysMutex.RLock()
	defer fake.listServiceKeysMutex.RUnlock()
	argsForCall := fake.listServiceKeysArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeServiceKeyRepository) ListServiceKeysReturns(result1 []models.ServiceKey, result2 error) {
	fake.listServiceKeysMutex.Lock()
	defer fake.listServiceKeysMutex.Unlock()
	fake.ListServiceKeysStub = nil
	fake.listServiceKeysReturns = struct {
		result1 []models.ServiceKey
		result2 error
	}{result1, result2}
}

func (fake *FakeServiceKeyRepository) ListServiceKeysReturnsOnCall(i int, result1 []models.ServiceKey, result2 error) {
	fake.listServiceKeysMutex.Lock()
	defer fake.listServiceKeysMutex.Unlock()
	fake.ListServiceKeysStub = nil
	if fake.listServiceKeysReturnsOnCall == nil {
		fake.listServiceKeysReturnsOnCall = make(map[int]struct {
			result1 []models.ServiceKey
			result2 error
		})
	}
	fake.listServiceKeysReturnsOnCall[i] = struct {
		result1 []models.ServiceKey
		result2 error
	}{result1, result2}
}

func (fake *FakeServiceKeyRepository) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	fake.createServiceKeyMutex.RLock()
	defer fake.createServiceKeyMutex.RUnlock()
	fake.deleteServiceKeyMutex.RLock()
	defer fake.deleteServiceKeyMutex.RUnlock()
	fake.getServiceKeyMutex.RLock()
	defer fake.getServiceKeyMutex.RUnlock()
	fake.listServiceKeysMutex.RLock()
	defer fake.listServiceKeysMutex.RUnlock()
	copiedInvocations := map[string][][]interface{}{}
	for key, value := range fake.invocations {
		copiedInvocations[key] = value
	}
	return copiedInvocations
}

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