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

import (
	"context"
	"sync"

	"code.cloudfoundry.org/korifi/api/actions/shared"
	"code.cloudfoundry.org/korifi/api/authorization"
	"code.cloudfoundry.org/korifi/api/repositories"
)

type CFAppRepository struct {
	CreateAppStub        func(context.Context, authorization.Info, repositories.CreateAppMessage) (repositories.AppRecord, error)
	createAppMutex       sync.RWMutex
	createAppArgsForCall []struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 repositories.CreateAppMessage
	}
	createAppReturns struct {
		result1 repositories.AppRecord
		result2 error
	}
	createAppReturnsOnCall map[int]struct {
		result1 repositories.AppRecord
		result2 error
	}
	GetAppStub        func(context.Context, authorization.Info, string) (repositories.AppRecord, error)
	getAppMutex       sync.RWMutex
	getAppArgsForCall []struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 string
	}
	getAppReturns struct {
		result1 repositories.AppRecord
		result2 error
	}
	getAppReturnsOnCall map[int]struct {
		result1 repositories.AppRecord
		result2 error
	}
	ListAppsStub        func(context.Context, authorization.Info, repositories.ListAppsMessage) (repositories.ListResult[repositories.AppRecord], error)
	listAppsMutex       sync.RWMutex
	listAppsArgsForCall []struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 repositories.ListAppsMessage
	}
	listAppsReturns struct {
		result1 repositories.ListResult[repositories.AppRecord]
		result2 error
	}
	listAppsReturnsOnCall map[int]struct {
		result1 repositories.ListResult[repositories.AppRecord]
		result2 error
	}
	PatchAppStub        func(context.Context, authorization.Info, repositories.PatchAppMessage) (repositories.AppRecord, error)
	patchAppMutex       sync.RWMutex
	patchAppArgsForCall []struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 repositories.PatchAppMessage
	}
	patchAppReturns struct {
		result1 repositories.AppRecord
		result2 error
	}
	patchAppReturnsOnCall map[int]struct {
		result1 repositories.AppRecord
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *CFAppRepository) CreateApp(arg1 context.Context, arg2 authorization.Info, arg3 repositories.CreateAppMessage) (repositories.AppRecord, error) {
	fake.createAppMutex.Lock()
	ret, specificReturn := fake.createAppReturnsOnCall[len(fake.createAppArgsForCall)]
	fake.createAppArgsForCall = append(fake.createAppArgsForCall, struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 repositories.CreateAppMessage
	}{arg1, arg2, arg3})
	stub := fake.CreateAppStub
	fakeReturns := fake.createAppReturns
	fake.recordInvocation("CreateApp", []interface{}{arg1, arg2, arg3})
	fake.createAppMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *CFAppRepository) CreateAppCallCount() int {
	fake.createAppMutex.RLock()
	defer fake.createAppMutex.RUnlock()
	return len(fake.createAppArgsForCall)
}

func (fake *CFAppRepository) CreateAppCalls(stub func(context.Context, authorization.Info, repositories.CreateAppMessage) (repositories.AppRecord, error)) {
	fake.createAppMutex.Lock()
	defer fake.createAppMutex.Unlock()
	fake.CreateAppStub = stub
}

func (fake *CFAppRepository) CreateAppArgsForCall(i int) (context.Context, authorization.Info, repositories.CreateAppMessage) {
	fake.createAppMutex.RLock()
	defer fake.createAppMutex.RUnlock()
	argsForCall := fake.createAppArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *CFAppRepository) CreateAppReturns(result1 repositories.AppRecord, result2 error) {
	fake.createAppMutex.Lock()
	defer fake.createAppMutex.Unlock()
	fake.CreateAppStub = nil
	fake.createAppReturns = struct {
		result1 repositories.AppRecord
		result2 error
	}{result1, result2}
}

func (fake *CFAppRepository) CreateAppReturnsOnCall(i int, result1 repositories.AppRecord, result2 error) {
	fake.createAppMutex.Lock()
	defer fake.createAppMutex.Unlock()
	fake.CreateAppStub = nil
	if fake.createAppReturnsOnCall == nil {
		fake.createAppReturnsOnCall = make(map[int]struct {
			result1 repositories.AppRecord
			result2 error
		})
	}
	fake.createAppReturnsOnCall[i] = struct {
		result1 repositories.AppRecord
		result2 error
	}{result1, result2}
}

func (fake *CFAppRepository) GetApp(arg1 context.Context, arg2 authorization.Info, arg3 string) (repositories.AppRecord, error) {
	fake.getAppMutex.Lock()
	ret, specificReturn := fake.getAppReturnsOnCall[len(fake.getAppArgsForCall)]
	fake.getAppArgsForCall = append(fake.getAppArgsForCall, struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 string
	}{arg1, arg2, arg3})
	stub := fake.GetAppStub
	fakeReturns := fake.getAppReturns
	fake.recordInvocation("GetApp", []interface{}{arg1, arg2, arg3})
	fake.getAppMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *CFAppRepository) GetAppCallCount() int {
	fake.getAppMutex.RLock()
	defer fake.getAppMutex.RUnlock()
	return len(fake.getAppArgsForCall)
}

func (fake *CFAppRepository) GetAppCalls(stub func(context.Context, authorization.Info, string) (repositories.AppRecord, error)) {
	fake.getAppMutex.Lock()
	defer fake.getAppMutex.Unlock()
	fake.GetAppStub = stub
}

func (fake *CFAppRepository) GetAppArgsForCall(i int) (context.Context, authorization.Info, string) {
	fake.getAppMutex.RLock()
	defer fake.getAppMutex.RUnlock()
	argsForCall := fake.getAppArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *CFAppRepository) GetAppReturns(result1 repositories.AppRecord, result2 error) {
	fake.getAppMutex.Lock()
	defer fake.getAppMutex.Unlock()
	fake.GetAppStub = nil
	fake.getAppReturns = struct {
		result1 repositories.AppRecord
		result2 error
	}{result1, result2}
}

func (fake *CFAppRepository) GetAppReturnsOnCall(i int, result1 repositories.AppRecord, result2 error) {
	fake.getAppMutex.Lock()
	defer fake.getAppMutex.Unlock()
	fake.GetAppStub = nil
	if fake.getAppReturnsOnCall == nil {
		fake.getAppReturnsOnCall = make(map[int]struct {
			result1 repositories.AppRecord
			result2 error
		})
	}
	fake.getAppReturnsOnCall[i] = struct {
		result1 repositories.AppRecord
		result2 error
	}{result1, result2}
}

func (fake *CFAppRepository) ListApps(arg1 context.Context, arg2 authorization.Info, arg3 repositories.ListAppsMessage) (repositories.ListResult[repositories.AppRecord], error) {
	fake.listAppsMutex.Lock()
	ret, specificReturn := fake.listAppsReturnsOnCall[len(fake.listAppsArgsForCall)]
	fake.listAppsArgsForCall = append(fake.listAppsArgsForCall, struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 repositories.ListAppsMessage
	}{arg1, arg2, arg3})
	stub := fake.ListAppsStub
	fakeReturns := fake.listAppsReturns
	fake.recordInvocation("ListApps", []interface{}{arg1, arg2, arg3})
	fake.listAppsMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *CFAppRepository) ListAppsCallCount() int {
	fake.listAppsMutex.RLock()
	defer fake.listAppsMutex.RUnlock()
	return len(fake.listAppsArgsForCall)
}

func (fake *CFAppRepository) ListAppsCalls(stub func(context.Context, authorization.Info, repositories.ListAppsMessage) (repositories.ListResult[repositories.AppRecord], error)) {
	fake.listAppsMutex.Lock()
	defer fake.listAppsMutex.Unlock()
	fake.ListAppsStub = stub
}

func (fake *CFAppRepository) ListAppsArgsForCall(i int) (context.Context, authorization.Info, repositories.ListAppsMessage) {
	fake.listAppsMutex.RLock()
	defer fake.listAppsMutex.RUnlock()
	argsForCall := fake.listAppsArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *CFAppRepository) ListAppsReturns(result1 repositories.ListResult[repositories.AppRecord], result2 error) {
	fake.listAppsMutex.Lock()
	defer fake.listAppsMutex.Unlock()
	fake.ListAppsStub = nil
	fake.listAppsReturns = struct {
		result1 repositories.ListResult[repositories.AppRecord]
		result2 error
	}{result1, result2}
}

func (fake *CFAppRepository) ListAppsReturnsOnCall(i int, result1 repositories.ListResult[repositories.AppRecord], result2 error) {
	fake.listAppsMutex.Lock()
	defer fake.listAppsMutex.Unlock()
	fake.ListAppsStub = nil
	if fake.listAppsReturnsOnCall == nil {
		fake.listAppsReturnsOnCall = make(map[int]struct {
			result1 repositories.ListResult[repositories.AppRecord]
			result2 error
		})
	}
	fake.listAppsReturnsOnCall[i] = struct {
		result1 repositories.ListResult[repositories.AppRecord]
		result2 error
	}{result1, result2}
}

func (fake *CFAppRepository) PatchApp(arg1 context.Context, arg2 authorization.Info, arg3 repositories.PatchAppMessage) (repositories.AppRecord, error) {
	fake.patchAppMutex.Lock()
	ret, specificReturn := fake.patchAppReturnsOnCall[len(fake.patchAppArgsForCall)]
	fake.patchAppArgsForCall = append(fake.patchAppArgsForCall, struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 repositories.PatchAppMessage
	}{arg1, arg2, arg3})
	stub := fake.PatchAppStub
	fakeReturns := fake.patchAppReturns
	fake.recordInvocation("PatchApp", []interface{}{arg1, arg2, arg3})
	fake.patchAppMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *CFAppRepository) PatchAppCallCount() int {
	fake.patchAppMutex.RLock()
	defer fake.patchAppMutex.RUnlock()
	return len(fake.patchAppArgsForCall)
}

func (fake *CFAppRepository) PatchAppCalls(stub func(context.Context, authorization.Info, repositories.PatchAppMessage) (repositories.AppRecord, error)) {
	fake.patchAppMutex.Lock()
	defer fake.patchAppMutex.Unlock()
	fake.PatchAppStub = stub
}

func (fake *CFAppRepository) PatchAppArgsForCall(i int) (context.Context, authorization.Info, repositories.PatchAppMessage) {
	fake.patchAppMutex.RLock()
	defer fake.patchAppMutex.RUnlock()
	argsForCall := fake.patchAppArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *CFAppRepository) PatchAppReturns(result1 repositories.AppRecord, result2 error) {
	fake.patchAppMutex.Lock()
	defer fake.patchAppMutex.Unlock()
	fake.PatchAppStub = nil
	fake.patchAppReturns = struct {
		result1 repositories.AppRecord
		result2 error
	}{result1, result2}
}

func (fake *CFAppRepository) PatchAppReturnsOnCall(i int, result1 repositories.AppRecord, result2 error) {
	fake.patchAppMutex.Lock()
	defer fake.patchAppMutex.Unlock()
	fake.PatchAppStub = nil
	if fake.patchAppReturnsOnCall == nil {
		fake.patchAppReturnsOnCall = make(map[int]struct {
			result1 repositories.AppRecord
			result2 error
		})
	}
	fake.patchAppReturnsOnCall[i] = struct {
		result1 repositories.AppRecord
		result2 error
	}{result1, result2}
}

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

func (fake *CFAppRepository) 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 _ shared.CFAppRepository = new(CFAppRepository)
