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

import (
	"sync"

	"code.cloudfoundry.org/quarks-job/pkg/kube/apis/quarksjob/v1alpha1"
	"code.cloudfoundry.org/quarks-operator/pkg/bosh/converter"
	"code.cloudfoundry.org/quarks-operator/pkg/bosh/manifest"
	"code.cloudfoundry.org/quarks-operator/pkg/kube/controllers/boshdeployment"
)

type FakeJobFactory struct {
	InstanceGroupManifestJobStub        func(string, string, manifest.Manifest, converter.LinkInfos, bool) (*v1alpha1.QuarksJob, error)
	instanceGroupManifestJobMutex       sync.RWMutex
	instanceGroupManifestJobArgsForCall []struct {
		arg1 string
		arg2 string
		arg3 manifest.Manifest
		arg4 converter.LinkInfos
		arg5 bool
	}
	instanceGroupManifestJobReturns struct {
		result1 *v1alpha1.QuarksJob
		result2 error
	}
	instanceGroupManifestJobReturnsOnCall map[int]struct {
		result1 *v1alpha1.QuarksJob
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeJobFactory) InstanceGroupManifestJob(arg1 string, arg2 string, arg3 manifest.Manifest, arg4 converter.LinkInfos, arg5 bool) (*v1alpha1.QuarksJob, error) {
	fake.instanceGroupManifestJobMutex.Lock()
	ret, specificReturn := fake.instanceGroupManifestJobReturnsOnCall[len(fake.instanceGroupManifestJobArgsForCall)]
	fake.instanceGroupManifestJobArgsForCall = append(fake.instanceGroupManifestJobArgsForCall, struct {
		arg1 string
		arg2 string
		arg3 manifest.Manifest
		arg4 converter.LinkInfos
		arg5 bool
	}{arg1, arg2, arg3, arg4, arg5})
	fake.recordInvocation("InstanceGroupManifestJob", []interface{}{arg1, arg2, arg3, arg4, arg5})
	fake.instanceGroupManifestJobMutex.Unlock()
	if fake.InstanceGroupManifestJobStub != nil {
		return fake.InstanceGroupManifestJobStub(arg1, arg2, arg3, arg4, arg5)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	fakeReturns := fake.instanceGroupManifestJobReturns
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeJobFactory) InstanceGroupManifestJobCallCount() int {
	fake.instanceGroupManifestJobMutex.RLock()
	defer fake.instanceGroupManifestJobMutex.RUnlock()
	return len(fake.instanceGroupManifestJobArgsForCall)
}

func (fake *FakeJobFactory) InstanceGroupManifestJobCalls(stub func(string, string, manifest.Manifest, converter.LinkInfos, bool) (*v1alpha1.QuarksJob, error)) {
	fake.instanceGroupManifestJobMutex.Lock()
	defer fake.instanceGroupManifestJobMutex.Unlock()
	fake.InstanceGroupManifestJobStub = stub
}

func (fake *FakeJobFactory) InstanceGroupManifestJobArgsForCall(i int) (string, string, manifest.Manifest, converter.LinkInfos, bool) {
	fake.instanceGroupManifestJobMutex.RLock()
	defer fake.instanceGroupManifestJobMutex.RUnlock()
	argsForCall := fake.instanceGroupManifestJobArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5
}

func (fake *FakeJobFactory) InstanceGroupManifestJobReturns(result1 *v1alpha1.QuarksJob, result2 error) {
	fake.instanceGroupManifestJobMutex.Lock()
	defer fake.instanceGroupManifestJobMutex.Unlock()
	fake.InstanceGroupManifestJobStub = nil
	fake.instanceGroupManifestJobReturns = struct {
		result1 *v1alpha1.QuarksJob
		result2 error
	}{result1, result2}
}

func (fake *FakeJobFactory) InstanceGroupManifestJobReturnsOnCall(i int, result1 *v1alpha1.QuarksJob, result2 error) {
	fake.instanceGroupManifestJobMutex.Lock()
	defer fake.instanceGroupManifestJobMutex.Unlock()
	fake.InstanceGroupManifestJobStub = nil
	if fake.instanceGroupManifestJobReturnsOnCall == nil {
		fake.instanceGroupManifestJobReturnsOnCall = make(map[int]struct {
			result1 *v1alpha1.QuarksJob
			result2 error
		})
	}
	fake.instanceGroupManifestJobReturnsOnCall[i] = struct {
		result1 *v1alpha1.QuarksJob
		result2 error
	}{result1, result2}
}

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

func (fake *FakeJobFactory) 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 _ boshdeployment.JobFactory = new(FakeJobFactory)
