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

import (
	"context"
	"sync"

	"code.cloudfoundry.org/korifi/api/authorization"
	"code.cloudfoundry.org/korifi/api/handlers"
	"code.cloudfoundry.org/korifi/api/repositories"
)

type CFTaskRepository struct {
	CancelTaskStub        func(context.Context, authorization.Info, string) (repositories.TaskRecord, error)
	cancelTaskMutex       sync.RWMutex
	cancelTaskArgsForCall []struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 string
	}
	cancelTaskReturns struct {
		result1 repositories.TaskRecord
		result2 error
	}
	cancelTaskReturnsOnCall map[int]struct {
		result1 repositories.TaskRecord
		result2 error
	}
	CreateTaskStub        func(context.Context, authorization.Info, repositories.CreateTaskMessage) (repositories.TaskRecord, error)
	createTaskMutex       sync.RWMutex
	createTaskArgsForCall []struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 repositories.CreateTaskMessage
	}
	createTaskReturns struct {
		result1 repositories.TaskRecord
		result2 error
	}
	createTaskReturnsOnCall map[int]struct {
		result1 repositories.TaskRecord
		result2 error
	}
	GetTaskStub        func(context.Context, authorization.Info, string) (repositories.TaskRecord, error)
	getTaskMutex       sync.RWMutex
	getTaskArgsForCall []struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 string
	}
	getTaskReturns struct {
		result1 repositories.TaskRecord
		result2 error
	}
	getTaskReturnsOnCall map[int]struct {
		result1 repositories.TaskRecord
		result2 error
	}
	ListTasksStub        func(context.Context, authorization.Info, repositories.ListTasksMessage) (repositories.ListResult[repositories.TaskRecord], error)
	listTasksMutex       sync.RWMutex
	listTasksArgsForCall []struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 repositories.ListTasksMessage
	}
	listTasksReturns struct {
		result1 repositories.ListResult[repositories.TaskRecord]
		result2 error
	}
	listTasksReturnsOnCall map[int]struct {
		result1 repositories.ListResult[repositories.TaskRecord]
		result2 error
	}
	PatchTaskMetadataStub        func(context.Context, authorization.Info, repositories.PatchTaskMetadataMessage) (repositories.TaskRecord, error)
	patchTaskMetadataMutex       sync.RWMutex
	patchTaskMetadataArgsForCall []struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 repositories.PatchTaskMetadataMessage
	}
	patchTaskMetadataReturns struct {
		result1 repositories.TaskRecord
		result2 error
	}
	patchTaskMetadataReturnsOnCall map[int]struct {
		result1 repositories.TaskRecord
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *CFTaskRepository) CancelTask(arg1 context.Context, arg2 authorization.Info, arg3 string) (repositories.TaskRecord, error) {
	fake.cancelTaskMutex.Lock()
	ret, specificReturn := fake.cancelTaskReturnsOnCall[len(fake.cancelTaskArgsForCall)]
	fake.cancelTaskArgsForCall = append(fake.cancelTaskArgsForCall, struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 string
	}{arg1, arg2, arg3})
	stub := fake.CancelTaskStub
	fakeReturns := fake.cancelTaskReturns
	fake.recordInvocation("CancelTask", []interface{}{arg1, arg2, arg3})
	fake.cancelTaskMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *CFTaskRepository) CancelTaskCallCount() int {
	fake.cancelTaskMutex.RLock()
	defer fake.cancelTaskMutex.RUnlock()
	return len(fake.cancelTaskArgsForCall)
}

func (fake *CFTaskRepository) CancelTaskCalls(stub func(context.Context, authorization.Info, string) (repositories.TaskRecord, error)) {
	fake.cancelTaskMutex.Lock()
	defer fake.cancelTaskMutex.Unlock()
	fake.CancelTaskStub = stub
}

func (fake *CFTaskRepository) CancelTaskArgsForCall(i int) (context.Context, authorization.Info, string) {
	fake.cancelTaskMutex.RLock()
	defer fake.cancelTaskMutex.RUnlock()
	argsForCall := fake.cancelTaskArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *CFTaskRepository) CancelTaskReturns(result1 repositories.TaskRecord, result2 error) {
	fake.cancelTaskMutex.Lock()
	defer fake.cancelTaskMutex.Unlock()
	fake.CancelTaskStub = nil
	fake.cancelTaskReturns = struct {
		result1 repositories.TaskRecord
		result2 error
	}{result1, result2}
}

func (fake *CFTaskRepository) CancelTaskReturnsOnCall(i int, result1 repositories.TaskRecord, result2 error) {
	fake.cancelTaskMutex.Lock()
	defer fake.cancelTaskMutex.Unlock()
	fake.CancelTaskStub = nil
	if fake.cancelTaskReturnsOnCall == nil {
		fake.cancelTaskReturnsOnCall = make(map[int]struct {
			result1 repositories.TaskRecord
			result2 error
		})
	}
	fake.cancelTaskReturnsOnCall[i] = struct {
		result1 repositories.TaskRecord
		result2 error
	}{result1, result2}
}

func (fake *CFTaskRepository) CreateTask(arg1 context.Context, arg2 authorization.Info, arg3 repositories.CreateTaskMessage) (repositories.TaskRecord, error) {
	fake.createTaskMutex.Lock()
	ret, specificReturn := fake.createTaskReturnsOnCall[len(fake.createTaskArgsForCall)]
	fake.createTaskArgsForCall = append(fake.createTaskArgsForCall, struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 repositories.CreateTaskMessage
	}{arg1, arg2, arg3})
	stub := fake.CreateTaskStub
	fakeReturns := fake.createTaskReturns
	fake.recordInvocation("CreateTask", []interface{}{arg1, arg2, arg3})
	fake.createTaskMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *CFTaskRepository) CreateTaskCallCount() int {
	fake.createTaskMutex.RLock()
	defer fake.createTaskMutex.RUnlock()
	return len(fake.createTaskArgsForCall)
}

func (fake *CFTaskRepository) CreateTaskCalls(stub func(context.Context, authorization.Info, repositories.CreateTaskMessage) (repositories.TaskRecord, error)) {
	fake.createTaskMutex.Lock()
	defer fake.createTaskMutex.Unlock()
	fake.CreateTaskStub = stub
}

func (fake *CFTaskRepository) CreateTaskArgsForCall(i int) (context.Context, authorization.Info, repositories.CreateTaskMessage) {
	fake.createTaskMutex.RLock()
	defer fake.createTaskMutex.RUnlock()
	argsForCall := fake.createTaskArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *CFTaskRepository) CreateTaskReturns(result1 repositories.TaskRecord, result2 error) {
	fake.createTaskMutex.Lock()
	defer fake.createTaskMutex.Unlock()
	fake.CreateTaskStub = nil
	fake.createTaskReturns = struct {
		result1 repositories.TaskRecord
		result2 error
	}{result1, result2}
}

func (fake *CFTaskRepository) CreateTaskReturnsOnCall(i int, result1 repositories.TaskRecord, result2 error) {
	fake.createTaskMutex.Lock()
	defer fake.createTaskMutex.Unlock()
	fake.CreateTaskStub = nil
	if fake.createTaskReturnsOnCall == nil {
		fake.createTaskReturnsOnCall = make(map[int]struct {
			result1 repositories.TaskRecord
			result2 error
		})
	}
	fake.createTaskReturnsOnCall[i] = struct {
		result1 repositories.TaskRecord
		result2 error
	}{result1, result2}
}

func (fake *CFTaskRepository) GetTask(arg1 context.Context, arg2 authorization.Info, arg3 string) (repositories.TaskRecord, error) {
	fake.getTaskMutex.Lock()
	ret, specificReturn := fake.getTaskReturnsOnCall[len(fake.getTaskArgsForCall)]
	fake.getTaskArgsForCall = append(fake.getTaskArgsForCall, struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 string
	}{arg1, arg2, arg3})
	stub := fake.GetTaskStub
	fakeReturns := fake.getTaskReturns
	fake.recordInvocation("GetTask", []interface{}{arg1, arg2, arg3})
	fake.getTaskMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *CFTaskRepository) GetTaskCallCount() int {
	fake.getTaskMutex.RLock()
	defer fake.getTaskMutex.RUnlock()
	return len(fake.getTaskArgsForCall)
}

func (fake *CFTaskRepository) GetTaskCalls(stub func(context.Context, authorization.Info, string) (repositories.TaskRecord, error)) {
	fake.getTaskMutex.Lock()
	defer fake.getTaskMutex.Unlock()
	fake.GetTaskStub = stub
}

func (fake *CFTaskRepository) GetTaskArgsForCall(i int) (context.Context, authorization.Info, string) {
	fake.getTaskMutex.RLock()
	defer fake.getTaskMutex.RUnlock()
	argsForCall := fake.getTaskArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *CFTaskRepository) GetTaskReturns(result1 repositories.TaskRecord, result2 error) {
	fake.getTaskMutex.Lock()
	defer fake.getTaskMutex.Unlock()
	fake.GetTaskStub = nil
	fake.getTaskReturns = struct {
		result1 repositories.TaskRecord
		result2 error
	}{result1, result2}
}

func (fake *CFTaskRepository) GetTaskReturnsOnCall(i int, result1 repositories.TaskRecord, result2 error) {
	fake.getTaskMutex.Lock()
	defer fake.getTaskMutex.Unlock()
	fake.GetTaskStub = nil
	if fake.getTaskReturnsOnCall == nil {
		fake.getTaskReturnsOnCall = make(map[int]struct {
			result1 repositories.TaskRecord
			result2 error
		})
	}
	fake.getTaskReturnsOnCall[i] = struct {
		result1 repositories.TaskRecord
		result2 error
	}{result1, result2}
}

func (fake *CFTaskRepository) ListTasks(arg1 context.Context, arg2 authorization.Info, arg3 repositories.ListTasksMessage) (repositories.ListResult[repositories.TaskRecord], error) {
	fake.listTasksMutex.Lock()
	ret, specificReturn := fake.listTasksReturnsOnCall[len(fake.listTasksArgsForCall)]
	fake.listTasksArgsForCall = append(fake.listTasksArgsForCall, struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 repositories.ListTasksMessage
	}{arg1, arg2, arg3})
	stub := fake.ListTasksStub
	fakeReturns := fake.listTasksReturns
	fake.recordInvocation("ListTasks", []interface{}{arg1, arg2, arg3})
	fake.listTasksMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *CFTaskRepository) ListTasksCallCount() int {
	fake.listTasksMutex.RLock()
	defer fake.listTasksMutex.RUnlock()
	return len(fake.listTasksArgsForCall)
}

func (fake *CFTaskRepository) ListTasksCalls(stub func(context.Context, authorization.Info, repositories.ListTasksMessage) (repositories.ListResult[repositories.TaskRecord], error)) {
	fake.listTasksMutex.Lock()
	defer fake.listTasksMutex.Unlock()
	fake.ListTasksStub = stub
}

func (fake *CFTaskRepository) ListTasksArgsForCall(i int) (context.Context, authorization.Info, repositories.ListTasksMessage) {
	fake.listTasksMutex.RLock()
	defer fake.listTasksMutex.RUnlock()
	argsForCall := fake.listTasksArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *CFTaskRepository) ListTasksReturns(result1 repositories.ListResult[repositories.TaskRecord], result2 error) {
	fake.listTasksMutex.Lock()
	defer fake.listTasksMutex.Unlock()
	fake.ListTasksStub = nil
	fake.listTasksReturns = struct {
		result1 repositories.ListResult[repositories.TaskRecord]
		result2 error
	}{result1, result2}
}

func (fake *CFTaskRepository) ListTasksReturnsOnCall(i int, result1 repositories.ListResult[repositories.TaskRecord], result2 error) {
	fake.listTasksMutex.Lock()
	defer fake.listTasksMutex.Unlock()
	fake.ListTasksStub = nil
	if fake.listTasksReturnsOnCall == nil {
		fake.listTasksReturnsOnCall = make(map[int]struct {
			result1 repositories.ListResult[repositories.TaskRecord]
			result2 error
		})
	}
	fake.listTasksReturnsOnCall[i] = struct {
		result1 repositories.ListResult[repositories.TaskRecord]
		result2 error
	}{result1, result2}
}

func (fake *CFTaskRepository) PatchTaskMetadata(arg1 context.Context, arg2 authorization.Info, arg3 repositories.PatchTaskMetadataMessage) (repositories.TaskRecord, error) {
	fake.patchTaskMetadataMutex.Lock()
	ret, specificReturn := fake.patchTaskMetadataReturnsOnCall[len(fake.patchTaskMetadataArgsForCall)]
	fake.patchTaskMetadataArgsForCall = append(fake.patchTaskMetadataArgsForCall, struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 repositories.PatchTaskMetadataMessage
	}{arg1, arg2, arg3})
	stub := fake.PatchTaskMetadataStub
	fakeReturns := fake.patchTaskMetadataReturns
	fake.recordInvocation("PatchTaskMetadata", []interface{}{arg1, arg2, arg3})
	fake.patchTaskMetadataMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *CFTaskRepository) PatchTaskMetadataCallCount() int {
	fake.patchTaskMetadataMutex.RLock()
	defer fake.patchTaskMetadataMutex.RUnlock()
	return len(fake.patchTaskMetadataArgsForCall)
}

func (fake *CFTaskRepository) PatchTaskMetadataCalls(stub func(context.Context, authorization.Info, repositories.PatchTaskMetadataMessage) (repositories.TaskRecord, error)) {
	fake.patchTaskMetadataMutex.Lock()
	defer fake.patchTaskMetadataMutex.Unlock()
	fake.PatchTaskMetadataStub = stub
}

func (fake *CFTaskRepository) PatchTaskMetadataArgsForCall(i int) (context.Context, authorization.Info, repositories.PatchTaskMetadataMessage) {
	fake.patchTaskMetadataMutex.RLock()
	defer fake.patchTaskMetadataMutex.RUnlock()
	argsForCall := fake.patchTaskMetadataArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *CFTaskRepository) PatchTaskMetadataReturns(result1 repositories.TaskRecord, result2 error) {
	fake.patchTaskMetadataMutex.Lock()
	defer fake.patchTaskMetadataMutex.Unlock()
	fake.PatchTaskMetadataStub = nil
	fake.patchTaskMetadataReturns = struct {
		result1 repositories.TaskRecord
		result2 error
	}{result1, result2}
}

func (fake *CFTaskRepository) PatchTaskMetadataReturnsOnCall(i int, result1 repositories.TaskRecord, result2 error) {
	fake.patchTaskMetadataMutex.Lock()
	defer fake.patchTaskMetadataMutex.Unlock()
	fake.PatchTaskMetadataStub = nil
	if fake.patchTaskMetadataReturnsOnCall == nil {
		fake.patchTaskMetadataReturnsOnCall = make(map[int]struct {
			result1 repositories.TaskRecord
			result2 error
		})
	}
	fake.patchTaskMetadataReturnsOnCall[i] = struct {
		result1 repositories.TaskRecord
		result2 error
	}{result1, result2}
}

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