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

import (
	"sync"

	"github.com/ehsaniara/joblet/internal/joblet/core/resource"
)

type FakeResource struct {
	AddProcessToCgroupStub        func(string, int) error
	addProcessToCgroupMutex       sync.RWMutex
	addProcessToCgroupArgsForCall []struct {
		arg1 string
		arg2 int
	}
	addProcessToCgroupReturns struct {
		result1 error
	}
	addProcessToCgroupReturnsOnCall map[int]struct {
		result1 error
	}
	CleanupCgroupStub        func(string)
	cleanupCgroupMutex       sync.RWMutex
	cleanupCgroupArgsForCall []struct {
		arg1 string
	}
	CreateStub        func(string, int32, int32, int32) error
	createMutex       sync.RWMutex
	createArgsForCall []struct {
		arg1 string
		arg2 int32
		arg3 int32
		arg4 int32
	}
	createReturns struct {
		result1 error
	}
	createReturnsOnCall map[int]struct {
		result1 error
	}
	EnsureControllersStub        func() error
	ensureControllersMutex       sync.RWMutex
	ensureControllersArgsForCall []struct {
	}
	ensureControllersReturns struct {
		result1 error
	}
	ensureControllersReturnsOnCall map[int]struct {
		result1 error
	}
	SetCPUCoresStub        func(string, string) error
	setCPUCoresMutex       sync.RWMutex
	setCPUCoresArgsForCall []struct {
		arg1 string
		arg2 string
	}
	setCPUCoresReturns struct {
		result1 error
	}
	setCPUCoresReturnsOnCall map[int]struct {
		result1 error
	}
	SetCPULimitStub        func(string, int) error
	setCPULimitMutex       sync.RWMutex
	setCPULimitArgsForCall []struct {
		arg1 string
		arg2 int
	}
	setCPULimitReturns struct {
		result1 error
	}
	setCPULimitReturnsOnCall map[int]struct {
		result1 error
	}
	SetGPUDevicesStub        func(string, []int) error
	setGPUDevicesMutex       sync.RWMutex
	setGPUDevicesArgsForCall []struct {
		arg1 string
		arg2 []int
	}
	setGPUDevicesReturns struct {
		result1 error
	}
	setGPUDevicesReturnsOnCall map[int]struct {
		result1 error
	}
	SetIOLimitStub        func(string, int) error
	setIOLimitMutex       sync.RWMutex
	setIOLimitArgsForCall []struct {
		arg1 string
		arg2 int
	}
	setIOLimitReturns struct {
		result1 error
	}
	setIOLimitReturnsOnCall map[int]struct {
		result1 error
	}
	SetMemoryLimitStub        func(string, int) error
	setMemoryLimitMutex       sync.RWMutex
	setMemoryLimitArgsForCall []struct {
		arg1 string
		arg2 int
	}
	setMemoryLimitReturns struct {
		result1 error
	}
	setMemoryLimitReturnsOnCall map[int]struct {
		result1 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeResource) AddProcessToCgroup(arg1 string, arg2 int) error {
	fake.addProcessToCgroupMutex.Lock()
	ret, specificReturn := fake.addProcessToCgroupReturnsOnCall[len(fake.addProcessToCgroupArgsForCall)]
	fake.addProcessToCgroupArgsForCall = append(fake.addProcessToCgroupArgsForCall, struct {
		arg1 string
		arg2 int
	}{arg1, arg2})
	stub := fake.AddProcessToCgroupStub
	fakeReturns := fake.addProcessToCgroupReturns
	fake.recordInvocation("AddProcessToCgroup", []interface{}{arg1, arg2})
	fake.addProcessToCgroupMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeResource) AddProcessToCgroupCallCount() int {
	fake.addProcessToCgroupMutex.RLock()
	defer fake.addProcessToCgroupMutex.RUnlock()
	return len(fake.addProcessToCgroupArgsForCall)
}

func (fake *FakeResource) AddProcessToCgroupCalls(stub func(string, int) error) {
	fake.addProcessToCgroupMutex.Lock()
	defer fake.addProcessToCgroupMutex.Unlock()
	fake.AddProcessToCgroupStub = stub
}

func (fake *FakeResource) AddProcessToCgroupArgsForCall(i int) (string, int) {
	fake.addProcessToCgroupMutex.RLock()
	defer fake.addProcessToCgroupMutex.RUnlock()
	argsForCall := fake.addProcessToCgroupArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeResource) AddProcessToCgroupReturns(result1 error) {
	fake.addProcessToCgroupMutex.Lock()
	defer fake.addProcessToCgroupMutex.Unlock()
	fake.AddProcessToCgroupStub = nil
	fake.addProcessToCgroupReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeResource) AddProcessToCgroupReturnsOnCall(i int, result1 error) {
	fake.addProcessToCgroupMutex.Lock()
	defer fake.addProcessToCgroupMutex.Unlock()
	fake.AddProcessToCgroupStub = nil
	if fake.addProcessToCgroupReturnsOnCall == nil {
		fake.addProcessToCgroupReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.addProcessToCgroupReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeResource) CleanupCgroup(arg1 string) {
	fake.cleanupCgroupMutex.Lock()
	fake.cleanupCgroupArgsForCall = append(fake.cleanupCgroupArgsForCall, struct {
		arg1 string
	}{arg1})
	stub := fake.CleanupCgroupStub
	fake.recordInvocation("CleanupCgroup", []interface{}{arg1})
	fake.cleanupCgroupMutex.Unlock()
	if stub != nil {
		fake.CleanupCgroupStub(arg1)
	}
}

func (fake *FakeResource) CleanupCgroupCallCount() int {
	fake.cleanupCgroupMutex.RLock()
	defer fake.cleanupCgroupMutex.RUnlock()
	return len(fake.cleanupCgroupArgsForCall)
}

func (fake *FakeResource) CleanupCgroupCalls(stub func(string)) {
	fake.cleanupCgroupMutex.Lock()
	defer fake.cleanupCgroupMutex.Unlock()
	fake.CleanupCgroupStub = stub
}

func (fake *FakeResource) CleanupCgroupArgsForCall(i int) string {
	fake.cleanupCgroupMutex.RLock()
	defer fake.cleanupCgroupMutex.RUnlock()
	argsForCall := fake.cleanupCgroupArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeResource) Create(arg1 string, arg2 int32, arg3 int32, arg4 int32) error {
	fake.createMutex.Lock()
	ret, specificReturn := fake.createReturnsOnCall[len(fake.createArgsForCall)]
	fake.createArgsForCall = append(fake.createArgsForCall, struct {
		arg1 string
		arg2 int32
		arg3 int32
		arg4 int32
	}{arg1, arg2, arg3, arg4})
	stub := fake.CreateStub
	fakeReturns := fake.createReturns
	fake.recordInvocation("Create", []interface{}{arg1, arg2, arg3, arg4})
	fake.createMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3, arg4)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeResource) CreateCallCount() int {
	fake.createMutex.RLock()
	defer fake.createMutex.RUnlock()
	return len(fake.createArgsForCall)
}

func (fake *FakeResource) CreateCalls(stub func(string, int32, int32, int32) error) {
	fake.createMutex.Lock()
	defer fake.createMutex.Unlock()
	fake.CreateStub = stub
}

func (fake *FakeResource) CreateArgsForCall(i int) (string, int32, int32, int32) {
	fake.createMutex.RLock()
	defer fake.createMutex.RUnlock()
	argsForCall := fake.createArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4
}

func (fake *FakeResource) CreateReturns(result1 error) {
	fake.createMutex.Lock()
	defer fake.createMutex.Unlock()
	fake.CreateStub = nil
	fake.createReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeResource) CreateReturnsOnCall(i int, result1 error) {
	fake.createMutex.Lock()
	defer fake.createMutex.Unlock()
	fake.CreateStub = nil
	if fake.createReturnsOnCall == nil {
		fake.createReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.createReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeResource) EnsureControllers() error {
	fake.ensureControllersMutex.Lock()
	ret, specificReturn := fake.ensureControllersReturnsOnCall[len(fake.ensureControllersArgsForCall)]
	fake.ensureControllersArgsForCall = append(fake.ensureControllersArgsForCall, struct {
	}{})
	stub := fake.EnsureControllersStub
	fakeReturns := fake.ensureControllersReturns
	fake.recordInvocation("EnsureControllers", []interface{}{})
	fake.ensureControllersMutex.Unlock()
	if stub != nil {
		return stub()
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeResource) EnsureControllersCallCount() int {
	fake.ensureControllersMutex.RLock()
	defer fake.ensureControllersMutex.RUnlock()
	return len(fake.ensureControllersArgsForCall)
}

func (fake *FakeResource) EnsureControllersCalls(stub func() error) {
	fake.ensureControllersMutex.Lock()
	defer fake.ensureControllersMutex.Unlock()
	fake.EnsureControllersStub = stub
}

func (fake *FakeResource) EnsureControllersReturns(result1 error) {
	fake.ensureControllersMutex.Lock()
	defer fake.ensureControllersMutex.Unlock()
	fake.EnsureControllersStub = nil
	fake.ensureControllersReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeResource) EnsureControllersReturnsOnCall(i int, result1 error) {
	fake.ensureControllersMutex.Lock()
	defer fake.ensureControllersMutex.Unlock()
	fake.EnsureControllersStub = nil
	if fake.ensureControllersReturnsOnCall == nil {
		fake.ensureControllersReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.ensureControllersReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeResource) SetCPUCores(arg1 string, arg2 string) error {
	fake.setCPUCoresMutex.Lock()
	ret, specificReturn := fake.setCPUCoresReturnsOnCall[len(fake.setCPUCoresArgsForCall)]
	fake.setCPUCoresArgsForCall = append(fake.setCPUCoresArgsForCall, struct {
		arg1 string
		arg2 string
	}{arg1, arg2})
	stub := fake.SetCPUCoresStub
	fakeReturns := fake.setCPUCoresReturns
	fake.recordInvocation("SetCPUCores", []interface{}{arg1, arg2})
	fake.setCPUCoresMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeResource) SetCPUCoresCallCount() int {
	fake.setCPUCoresMutex.RLock()
	defer fake.setCPUCoresMutex.RUnlock()
	return len(fake.setCPUCoresArgsForCall)
}

func (fake *FakeResource) SetCPUCoresCalls(stub func(string, string) error) {
	fake.setCPUCoresMutex.Lock()
	defer fake.setCPUCoresMutex.Unlock()
	fake.SetCPUCoresStub = stub
}

func (fake *FakeResource) SetCPUCoresArgsForCall(i int) (string, string) {
	fake.setCPUCoresMutex.RLock()
	defer fake.setCPUCoresMutex.RUnlock()
	argsForCall := fake.setCPUCoresArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeResource) SetCPUCoresReturns(result1 error) {
	fake.setCPUCoresMutex.Lock()
	defer fake.setCPUCoresMutex.Unlock()
	fake.SetCPUCoresStub = nil
	fake.setCPUCoresReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeResource) SetCPUCoresReturnsOnCall(i int, result1 error) {
	fake.setCPUCoresMutex.Lock()
	defer fake.setCPUCoresMutex.Unlock()
	fake.SetCPUCoresStub = nil
	if fake.setCPUCoresReturnsOnCall == nil {
		fake.setCPUCoresReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.setCPUCoresReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeResource) SetCPULimit(arg1 string, arg2 int) error {
	fake.setCPULimitMutex.Lock()
	ret, specificReturn := fake.setCPULimitReturnsOnCall[len(fake.setCPULimitArgsForCall)]
	fake.setCPULimitArgsForCall = append(fake.setCPULimitArgsForCall, struct {
		arg1 string
		arg2 int
	}{arg1, arg2})
	stub := fake.SetCPULimitStub
	fakeReturns := fake.setCPULimitReturns
	fake.recordInvocation("SetCPULimit", []interface{}{arg1, arg2})
	fake.setCPULimitMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeResource) SetCPULimitCallCount() int {
	fake.setCPULimitMutex.RLock()
	defer fake.setCPULimitMutex.RUnlock()
	return len(fake.setCPULimitArgsForCall)
}

func (fake *FakeResource) SetCPULimitCalls(stub func(string, int) error) {
	fake.setCPULimitMutex.Lock()
	defer fake.setCPULimitMutex.Unlock()
	fake.SetCPULimitStub = stub
}

func (fake *FakeResource) SetCPULimitArgsForCall(i int) (string, int) {
	fake.setCPULimitMutex.RLock()
	defer fake.setCPULimitMutex.RUnlock()
	argsForCall := fake.setCPULimitArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeResource) SetCPULimitReturns(result1 error) {
	fake.setCPULimitMutex.Lock()
	defer fake.setCPULimitMutex.Unlock()
	fake.SetCPULimitStub = nil
	fake.setCPULimitReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeResource) SetCPULimitReturnsOnCall(i int, result1 error) {
	fake.setCPULimitMutex.Lock()
	defer fake.setCPULimitMutex.Unlock()
	fake.SetCPULimitStub = nil
	if fake.setCPULimitReturnsOnCall == nil {
		fake.setCPULimitReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.setCPULimitReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeResource) SetGPUDevices(arg1 string, arg2 []int) error {
	var arg2Copy []int
	if arg2 != nil {
		arg2Copy = make([]int, len(arg2))
		copy(arg2Copy, arg2)
	}
	fake.setGPUDevicesMutex.Lock()
	ret, specificReturn := fake.setGPUDevicesReturnsOnCall[len(fake.setGPUDevicesArgsForCall)]
	fake.setGPUDevicesArgsForCall = append(fake.setGPUDevicesArgsForCall, struct {
		arg1 string
		arg2 []int
	}{arg1, arg2Copy})
	stub := fake.SetGPUDevicesStub
	fakeReturns := fake.setGPUDevicesReturns
	fake.recordInvocation("SetGPUDevices", []interface{}{arg1, arg2Copy})
	fake.setGPUDevicesMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeResource) SetGPUDevicesCallCount() int {
	fake.setGPUDevicesMutex.RLock()
	defer fake.setGPUDevicesMutex.RUnlock()
	return len(fake.setGPUDevicesArgsForCall)
}

func (fake *FakeResource) SetGPUDevicesCalls(stub func(string, []int) error) {
	fake.setGPUDevicesMutex.Lock()
	defer fake.setGPUDevicesMutex.Unlock()
	fake.SetGPUDevicesStub = stub
}

func (fake *FakeResource) SetGPUDevicesArgsForCall(i int) (string, []int) {
	fake.setGPUDevicesMutex.RLock()
	defer fake.setGPUDevicesMutex.RUnlock()
	argsForCall := fake.setGPUDevicesArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeResource) SetGPUDevicesReturns(result1 error) {
	fake.setGPUDevicesMutex.Lock()
	defer fake.setGPUDevicesMutex.Unlock()
	fake.SetGPUDevicesStub = nil
	fake.setGPUDevicesReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeResource) SetGPUDevicesReturnsOnCall(i int, result1 error) {
	fake.setGPUDevicesMutex.Lock()
	defer fake.setGPUDevicesMutex.Unlock()
	fake.SetGPUDevicesStub = nil
	if fake.setGPUDevicesReturnsOnCall == nil {
		fake.setGPUDevicesReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.setGPUDevicesReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeResource) SetIOLimit(arg1 string, arg2 int) error {
	fake.setIOLimitMutex.Lock()
	ret, specificReturn := fake.setIOLimitReturnsOnCall[len(fake.setIOLimitArgsForCall)]
	fake.setIOLimitArgsForCall = append(fake.setIOLimitArgsForCall, struct {
		arg1 string
		arg2 int
	}{arg1, arg2})
	stub := fake.SetIOLimitStub
	fakeReturns := fake.setIOLimitReturns
	fake.recordInvocation("SetIOLimit", []interface{}{arg1, arg2})
	fake.setIOLimitMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeResource) SetIOLimitCallCount() int {
	fake.setIOLimitMutex.RLock()
	defer fake.setIOLimitMutex.RUnlock()
	return len(fake.setIOLimitArgsForCall)
}

func (fake *FakeResource) SetIOLimitCalls(stub func(string, int) error) {
	fake.setIOLimitMutex.Lock()
	defer fake.setIOLimitMutex.Unlock()
	fake.SetIOLimitStub = stub
}

func (fake *FakeResource) SetIOLimitArgsForCall(i int) (string, int) {
	fake.setIOLimitMutex.RLock()
	defer fake.setIOLimitMutex.RUnlock()
	argsForCall := fake.setIOLimitArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeResource) SetIOLimitReturns(result1 error) {
	fake.setIOLimitMutex.Lock()
	defer fake.setIOLimitMutex.Unlock()
	fake.SetIOLimitStub = nil
	fake.setIOLimitReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeResource) SetIOLimitReturnsOnCall(i int, result1 error) {
	fake.setIOLimitMutex.Lock()
	defer fake.setIOLimitMutex.Unlock()
	fake.SetIOLimitStub = nil
	if fake.setIOLimitReturnsOnCall == nil {
		fake.setIOLimitReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.setIOLimitReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeResource) SetMemoryLimit(arg1 string, arg2 int) error {
	fake.setMemoryLimitMutex.Lock()
	ret, specificReturn := fake.setMemoryLimitReturnsOnCall[len(fake.setMemoryLimitArgsForCall)]
	fake.setMemoryLimitArgsForCall = append(fake.setMemoryLimitArgsForCall, struct {
		arg1 string
		arg2 int
	}{arg1, arg2})
	stub := fake.SetMemoryLimitStub
	fakeReturns := fake.setMemoryLimitReturns
	fake.recordInvocation("SetMemoryLimit", []interface{}{arg1, arg2})
	fake.setMemoryLimitMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeResource) SetMemoryLimitCallCount() int {
	fake.setMemoryLimitMutex.RLock()
	defer fake.setMemoryLimitMutex.RUnlock()
	return len(fake.setMemoryLimitArgsForCall)
}

func (fake *FakeResource) SetMemoryLimitCalls(stub func(string, int) error) {
	fake.setMemoryLimitMutex.Lock()
	defer fake.setMemoryLimitMutex.Unlock()
	fake.SetMemoryLimitStub = stub
}

func (fake *FakeResource) SetMemoryLimitArgsForCall(i int) (string, int) {
	fake.setMemoryLimitMutex.RLock()
	defer fake.setMemoryLimitMutex.RUnlock()
	argsForCall := fake.setMemoryLimitArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeResource) SetMemoryLimitReturns(result1 error) {
	fake.setMemoryLimitMutex.Lock()
	defer fake.setMemoryLimitMutex.Unlock()
	fake.SetMemoryLimitStub = nil
	fake.setMemoryLimitReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeResource) SetMemoryLimitReturnsOnCall(i int, result1 error) {
	fake.setMemoryLimitMutex.Lock()
	defer fake.setMemoryLimitMutex.Unlock()
	fake.SetMemoryLimitStub = nil
	if fake.setMemoryLimitReturnsOnCall == nil {
		fake.setMemoryLimitReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.setMemoryLimitReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeResource) 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 *FakeResource) 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 _ resource.Resource = new(FakeResource)
