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

import (
	"context"
	"sync"

	"github.com/ehsaniara/joblet/internal/joblet/domain"
	"github.com/ehsaniara/joblet/internal/joblet/interfaces"
)

type FakeStore struct {
	CreateNewJobStub        func(*domain.Job)
	createNewJobMutex       sync.RWMutex
	createNewJobArgsForCall []struct {
		arg1 *domain.Job
	}
	GetJobStub        func(string) (*domain.Job, bool)
	getJobMutex       sync.RWMutex
	getJobArgsForCall []struct {
		arg1 string
	}
	getJobReturns struct {
		result1 *domain.Job
		result2 bool
	}
	getJobReturnsOnCall map[int]struct {
		result1 *domain.Job
		result2 bool
	}
	GetOutputStub        func(string) ([]byte, bool, error)
	getOutputMutex       sync.RWMutex
	getOutputArgsForCall []struct {
		arg1 string
	}
	getOutputReturns struct {
		result1 []byte
		result2 bool
		result3 error
	}
	getOutputReturnsOnCall map[int]struct {
		result1 []byte
		result2 bool
		result3 error
	}
	ListJobsStub        func() []*domain.Job
	listJobsMutex       sync.RWMutex
	listJobsArgsForCall []struct {
	}
	listJobsReturns struct {
		result1 []*domain.Job
	}
	listJobsReturnsOnCall map[int]struct {
		result1 []*domain.Job
	}
	SendUpdatesToClientStub        func(context.Context, string, interfaces.DomainStreamer) error
	sendUpdatesToClientMutex       sync.RWMutex
	sendUpdatesToClientArgsForCall []struct {
		arg1 context.Context
		arg2 string
		arg3 interfaces.DomainStreamer
	}
	sendUpdatesToClientReturns struct {
		result1 error
	}
	sendUpdatesToClientReturnsOnCall map[int]struct {
		result1 error
	}
	UpdateJobStub        func(*domain.Job)
	updateJobMutex       sync.RWMutex
	updateJobArgsForCall []struct {
		arg1 *domain.Job
	}
	WriteToBufferStub        func(string, []byte)
	writeToBufferMutex       sync.RWMutex
	writeToBufferArgsForCall []struct {
		arg1 string
		arg2 []byte
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeStore) CreateNewJob(arg1 *domain.Job) {
	fake.createNewJobMutex.Lock()
	fake.createNewJobArgsForCall = append(fake.createNewJobArgsForCall, struct {
		arg1 *domain.Job
	}{arg1})
	stub := fake.CreateNewJobStub
	fake.recordInvocation("CreateNewJob", []interface{}{arg1})
	fake.createNewJobMutex.Unlock()
	if stub != nil {
		fake.CreateNewJobStub(arg1)
	}
}

func (fake *FakeStore) CreateNewJobCallCount() int {
	fake.createNewJobMutex.RLock()
	defer fake.createNewJobMutex.RUnlock()
	return len(fake.createNewJobArgsForCall)
}

func (fake *FakeStore) CreateNewJobCalls(stub func(*domain.Job)) {
	fake.createNewJobMutex.Lock()
	defer fake.createNewJobMutex.Unlock()
	fake.CreateNewJobStub = stub
}

func (fake *FakeStore) CreateNewJobArgsForCall(i int) *domain.Job {
	fake.createNewJobMutex.RLock()
	defer fake.createNewJobMutex.RUnlock()
	argsForCall := fake.createNewJobArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeStore) GetJob(arg1 string) (*domain.Job, bool) {
	fake.getJobMutex.Lock()
	ret, specificReturn := fake.getJobReturnsOnCall[len(fake.getJobArgsForCall)]
	fake.getJobArgsForCall = append(fake.getJobArgsForCall, struct {
		arg1 string
	}{arg1})
	stub := fake.GetJobStub
	fakeReturns := fake.getJobReturns
	fake.recordInvocation("GetJob", []interface{}{arg1})
	fake.getJobMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeStore) GetJobCallCount() int {
	fake.getJobMutex.RLock()
	defer fake.getJobMutex.RUnlock()
	return len(fake.getJobArgsForCall)
}

func (fake *FakeStore) GetJobCalls(stub func(string) (*domain.Job, bool)) {
	fake.getJobMutex.Lock()
	defer fake.getJobMutex.Unlock()
	fake.GetJobStub = stub
}

func (fake *FakeStore) GetJobArgsForCall(i int) string {
	fake.getJobMutex.RLock()
	defer fake.getJobMutex.RUnlock()
	argsForCall := fake.getJobArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeStore) GetJobReturns(result1 *domain.Job, result2 bool) {
	fake.getJobMutex.Lock()
	defer fake.getJobMutex.Unlock()
	fake.GetJobStub = nil
	fake.getJobReturns = struct {
		result1 *domain.Job
		result2 bool
	}{result1, result2}
}

func (fake *FakeStore) GetJobReturnsOnCall(i int, result1 *domain.Job, result2 bool) {
	fake.getJobMutex.Lock()
	defer fake.getJobMutex.Unlock()
	fake.GetJobStub = nil
	if fake.getJobReturnsOnCall == nil {
		fake.getJobReturnsOnCall = make(map[int]struct {
			result1 *domain.Job
			result2 bool
		})
	}
	fake.getJobReturnsOnCall[i] = struct {
		result1 *domain.Job
		result2 bool
	}{result1, result2}
}

func (fake *FakeStore) GetOutput(arg1 string) ([]byte, bool, error) {
	fake.getOutputMutex.Lock()
	ret, specificReturn := fake.getOutputReturnsOnCall[len(fake.getOutputArgsForCall)]
	fake.getOutputArgsForCall = append(fake.getOutputArgsForCall, struct {
		arg1 string
	}{arg1})
	stub := fake.GetOutputStub
	fakeReturns := fake.getOutputReturns
	fake.recordInvocation("GetOutput", []interface{}{arg1})
	fake.getOutputMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2, ret.result3
	}
	return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3
}

func (fake *FakeStore) GetOutputCallCount() int {
	fake.getOutputMutex.RLock()
	defer fake.getOutputMutex.RUnlock()
	return len(fake.getOutputArgsForCall)
}

func (fake *FakeStore) GetOutputCalls(stub func(string) ([]byte, bool, error)) {
	fake.getOutputMutex.Lock()
	defer fake.getOutputMutex.Unlock()
	fake.GetOutputStub = stub
}

func (fake *FakeStore) GetOutputArgsForCall(i int) string {
	fake.getOutputMutex.RLock()
	defer fake.getOutputMutex.RUnlock()
	argsForCall := fake.getOutputArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeStore) GetOutputReturns(result1 []byte, result2 bool, result3 error) {
	fake.getOutputMutex.Lock()
	defer fake.getOutputMutex.Unlock()
	fake.GetOutputStub = nil
	fake.getOutputReturns = struct {
		result1 []byte
		result2 bool
		result3 error
	}{result1, result2, result3}
}

func (fake *FakeStore) GetOutputReturnsOnCall(i int, result1 []byte, result2 bool, result3 error) {
	fake.getOutputMutex.Lock()
	defer fake.getOutputMutex.Unlock()
	fake.GetOutputStub = nil
	if fake.getOutputReturnsOnCall == nil {
		fake.getOutputReturnsOnCall = make(map[int]struct {
			result1 []byte
			result2 bool
			result3 error
		})
	}
	fake.getOutputReturnsOnCall[i] = struct {
		result1 []byte
		result2 bool
		result3 error
	}{result1, result2, result3}
}

func (fake *FakeStore) ListJobs() []*domain.Job {
	fake.listJobsMutex.Lock()
	ret, specificReturn := fake.listJobsReturnsOnCall[len(fake.listJobsArgsForCall)]
	fake.listJobsArgsForCall = append(fake.listJobsArgsForCall, struct {
	}{})
	stub := fake.ListJobsStub
	fakeReturns := fake.listJobsReturns
	fake.recordInvocation("ListJobs", []interface{}{})
	fake.listJobsMutex.Unlock()
	if stub != nil {
		return stub()
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeStore) ListJobsCallCount() int {
	fake.listJobsMutex.RLock()
	defer fake.listJobsMutex.RUnlock()
	return len(fake.listJobsArgsForCall)
}

func (fake *FakeStore) ListJobsCalls(stub func() []*domain.Job) {
	fake.listJobsMutex.Lock()
	defer fake.listJobsMutex.Unlock()
	fake.ListJobsStub = stub
}

func (fake *FakeStore) ListJobsReturns(result1 []*domain.Job) {
	fake.listJobsMutex.Lock()
	defer fake.listJobsMutex.Unlock()
	fake.ListJobsStub = nil
	fake.listJobsReturns = struct {
		result1 []*domain.Job
	}{result1}
}

func (fake *FakeStore) ListJobsReturnsOnCall(i int, result1 []*domain.Job) {
	fake.listJobsMutex.Lock()
	defer fake.listJobsMutex.Unlock()
	fake.ListJobsStub = nil
	if fake.listJobsReturnsOnCall == nil {
		fake.listJobsReturnsOnCall = make(map[int]struct {
			result1 []*domain.Job
		})
	}
	fake.listJobsReturnsOnCall[i] = struct {
		result1 []*domain.Job
	}{result1}
}

func (fake *FakeStore) SendUpdatesToClient(arg1 context.Context, arg2 string, arg3 interfaces.DomainStreamer) error {
	fake.sendUpdatesToClientMutex.Lock()
	ret, specificReturn := fake.sendUpdatesToClientReturnsOnCall[len(fake.sendUpdatesToClientArgsForCall)]
	fake.sendUpdatesToClientArgsForCall = append(fake.sendUpdatesToClientArgsForCall, struct {
		arg1 context.Context
		arg2 string
		arg3 interfaces.DomainStreamer
	}{arg1, arg2, arg3})
	stub := fake.SendUpdatesToClientStub
	fakeReturns := fake.sendUpdatesToClientReturns
	fake.recordInvocation("SendUpdatesToClient", []interface{}{arg1, arg2, arg3})
	fake.sendUpdatesToClientMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeStore) SendUpdatesToClientCallCount() int {
	fake.sendUpdatesToClientMutex.RLock()
	defer fake.sendUpdatesToClientMutex.RUnlock()
	return len(fake.sendUpdatesToClientArgsForCall)
}

func (fake *FakeStore) SendUpdatesToClientCalls(stub func(context.Context, string, interfaces.DomainStreamer) error) {
	fake.sendUpdatesToClientMutex.Lock()
	defer fake.sendUpdatesToClientMutex.Unlock()
	fake.SendUpdatesToClientStub = stub
}

func (fake *FakeStore) SendUpdatesToClientArgsForCall(i int) (context.Context, string, interfaces.DomainStreamer) {
	fake.sendUpdatesToClientMutex.RLock()
	defer fake.sendUpdatesToClientMutex.RUnlock()
	argsForCall := fake.sendUpdatesToClientArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *FakeStore) SendUpdatesToClientReturns(result1 error) {
	fake.sendUpdatesToClientMutex.Lock()
	defer fake.sendUpdatesToClientMutex.Unlock()
	fake.SendUpdatesToClientStub = nil
	fake.sendUpdatesToClientReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeStore) SendUpdatesToClientReturnsOnCall(i int, result1 error) {
	fake.sendUpdatesToClientMutex.Lock()
	defer fake.sendUpdatesToClientMutex.Unlock()
	fake.SendUpdatesToClientStub = nil
	if fake.sendUpdatesToClientReturnsOnCall == nil {
		fake.sendUpdatesToClientReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.sendUpdatesToClientReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeStore) UpdateJob(arg1 *domain.Job) {
	fake.updateJobMutex.Lock()
	fake.updateJobArgsForCall = append(fake.updateJobArgsForCall, struct {
		arg1 *domain.Job
	}{arg1})
	stub := fake.UpdateJobStub
	fake.recordInvocation("UpdateJob", []interface{}{arg1})
	fake.updateJobMutex.Unlock()
	if stub != nil {
		fake.UpdateJobStub(arg1)
	}
}

func (fake *FakeStore) UpdateJobCallCount() int {
	fake.updateJobMutex.RLock()
	defer fake.updateJobMutex.RUnlock()
	return len(fake.updateJobArgsForCall)
}

func (fake *FakeStore) UpdateJobCalls(stub func(*domain.Job)) {
	fake.updateJobMutex.Lock()
	defer fake.updateJobMutex.Unlock()
	fake.UpdateJobStub = stub
}

func (fake *FakeStore) UpdateJobArgsForCall(i int) *domain.Job {
	fake.updateJobMutex.RLock()
	defer fake.updateJobMutex.RUnlock()
	argsForCall := fake.updateJobArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeStore) WriteToBuffer(arg1 string, arg2 []byte) {
	var arg2Copy []byte
	if arg2 != nil {
		arg2Copy = make([]byte, len(arg2))
		copy(arg2Copy, arg2)
	}
	fake.writeToBufferMutex.Lock()
	fake.writeToBufferArgsForCall = append(fake.writeToBufferArgsForCall, struct {
		arg1 string
		arg2 []byte
	}{arg1, arg2Copy})
	stub := fake.WriteToBufferStub
	fake.recordInvocation("WriteToBuffer", []interface{}{arg1, arg2Copy})
	fake.writeToBufferMutex.Unlock()
	if stub != nil {
		fake.WriteToBufferStub(arg1, arg2)
	}
}

func (fake *FakeStore) WriteToBufferCallCount() int {
	fake.writeToBufferMutex.RLock()
	defer fake.writeToBufferMutex.RUnlock()
	return len(fake.writeToBufferArgsForCall)
}

func (fake *FakeStore) WriteToBufferCalls(stub func(string, []byte)) {
	fake.writeToBufferMutex.Lock()
	defer fake.writeToBufferMutex.Unlock()
	fake.WriteToBufferStub = stub
}

func (fake *FakeStore) WriteToBufferArgsForCall(i int) (string, []byte) {
	fake.writeToBufferMutex.RLock()
	defer fake.writeToBufferMutex.RUnlock()
	argsForCall := fake.writeToBufferArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeStore) 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 *FakeStore) 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 _ interfaces.Store = new(FakeStore)
