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

import (
	"context"
	"sync"

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

type FakeNetworkManager struct {
	CleanupNetworkingStub        func(context.Context, string) error
	cleanupNetworkingMutex       sync.RWMutex
	cleanupNetworkingArgsForCall []struct {
		arg1 context.Context
		arg2 string
	}
	cleanupNetworkingReturns struct {
		result1 error
	}
	cleanupNetworkingReturnsOnCall map[int]struct {
		result1 error
	}
	ConfigureNetworkNamespaceStub        func(context.Context, string, int) error
	configureNetworkNamespaceMutex       sync.RWMutex
	configureNetworkNamespaceArgsForCall []struct {
		arg1 context.Context
		arg2 string
		arg3 int
	}
	configureNetworkNamespaceReturns struct {
		result1 error
	}
	configureNetworkNamespaceReturnsOnCall map[int]struct {
		result1 error
	}
	SetupNetworkingStub        func(context.Context, string, string) (*execution.NetworkAllocation, error)
	setupNetworkingMutex       sync.RWMutex
	setupNetworkingArgsForCall []struct {
		arg1 context.Context
		arg2 string
		arg3 string
	}
	setupNetworkingReturns struct {
		result1 *execution.NetworkAllocation
		result2 error
	}
	setupNetworkingReturnsOnCall map[int]struct {
		result1 *execution.NetworkAllocation
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeNetworkManager) CleanupNetworking(arg1 context.Context, arg2 string) error {
	fake.cleanupNetworkingMutex.Lock()
	ret, specificReturn := fake.cleanupNetworkingReturnsOnCall[len(fake.cleanupNetworkingArgsForCall)]
	fake.cleanupNetworkingArgsForCall = append(fake.cleanupNetworkingArgsForCall, struct {
		arg1 context.Context
		arg2 string
	}{arg1, arg2})
	stub := fake.CleanupNetworkingStub
	fakeReturns := fake.cleanupNetworkingReturns
	fake.recordInvocation("CleanupNetworking", []interface{}{arg1, arg2})
	fake.cleanupNetworkingMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeNetworkManager) CleanupNetworkingCallCount() int {
	fake.cleanupNetworkingMutex.RLock()
	defer fake.cleanupNetworkingMutex.RUnlock()
	return len(fake.cleanupNetworkingArgsForCall)
}

func (fake *FakeNetworkManager) CleanupNetworkingCalls(stub func(context.Context, string) error) {
	fake.cleanupNetworkingMutex.Lock()
	defer fake.cleanupNetworkingMutex.Unlock()
	fake.CleanupNetworkingStub = stub
}

func (fake *FakeNetworkManager) CleanupNetworkingArgsForCall(i int) (context.Context, string) {
	fake.cleanupNetworkingMutex.RLock()
	defer fake.cleanupNetworkingMutex.RUnlock()
	argsForCall := fake.cleanupNetworkingArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeNetworkManager) CleanupNetworkingReturns(result1 error) {
	fake.cleanupNetworkingMutex.Lock()
	defer fake.cleanupNetworkingMutex.Unlock()
	fake.CleanupNetworkingStub = nil
	fake.cleanupNetworkingReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeNetworkManager) CleanupNetworkingReturnsOnCall(i int, result1 error) {
	fake.cleanupNetworkingMutex.Lock()
	defer fake.cleanupNetworkingMutex.Unlock()
	fake.CleanupNetworkingStub = nil
	if fake.cleanupNetworkingReturnsOnCall == nil {
		fake.cleanupNetworkingReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.cleanupNetworkingReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeNetworkManager) ConfigureNetworkNamespace(arg1 context.Context, arg2 string, arg3 int) error {
	fake.configureNetworkNamespaceMutex.Lock()
	ret, specificReturn := fake.configureNetworkNamespaceReturnsOnCall[len(fake.configureNetworkNamespaceArgsForCall)]
	fake.configureNetworkNamespaceArgsForCall = append(fake.configureNetworkNamespaceArgsForCall, struct {
		arg1 context.Context
		arg2 string
		arg3 int
	}{arg1, arg2, arg3})
	stub := fake.ConfigureNetworkNamespaceStub
	fakeReturns := fake.configureNetworkNamespaceReturns
	fake.recordInvocation("ConfigureNetworkNamespace", []interface{}{arg1, arg2, arg3})
	fake.configureNetworkNamespaceMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeNetworkManager) ConfigureNetworkNamespaceCallCount() int {
	fake.configureNetworkNamespaceMutex.RLock()
	defer fake.configureNetworkNamespaceMutex.RUnlock()
	return len(fake.configureNetworkNamespaceArgsForCall)
}

func (fake *FakeNetworkManager) ConfigureNetworkNamespaceCalls(stub func(context.Context, string, int) error) {
	fake.configureNetworkNamespaceMutex.Lock()
	defer fake.configureNetworkNamespaceMutex.Unlock()
	fake.ConfigureNetworkNamespaceStub = stub
}

func (fake *FakeNetworkManager) ConfigureNetworkNamespaceArgsForCall(i int) (context.Context, string, int) {
	fake.configureNetworkNamespaceMutex.RLock()
	defer fake.configureNetworkNamespaceMutex.RUnlock()
	argsForCall := fake.configureNetworkNamespaceArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *FakeNetworkManager) ConfigureNetworkNamespaceReturns(result1 error) {
	fake.configureNetworkNamespaceMutex.Lock()
	defer fake.configureNetworkNamespaceMutex.Unlock()
	fake.ConfigureNetworkNamespaceStub = nil
	fake.configureNetworkNamespaceReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeNetworkManager) ConfigureNetworkNamespaceReturnsOnCall(i int, result1 error) {
	fake.configureNetworkNamespaceMutex.Lock()
	defer fake.configureNetworkNamespaceMutex.Unlock()
	fake.ConfigureNetworkNamespaceStub = nil
	if fake.configureNetworkNamespaceReturnsOnCall == nil {
		fake.configureNetworkNamespaceReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.configureNetworkNamespaceReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeNetworkManager) SetupNetworking(arg1 context.Context, arg2 string, arg3 string) (*execution.NetworkAllocation, error) {
	fake.setupNetworkingMutex.Lock()
	ret, specificReturn := fake.setupNetworkingReturnsOnCall[len(fake.setupNetworkingArgsForCall)]
	fake.setupNetworkingArgsForCall = append(fake.setupNetworkingArgsForCall, struct {
		arg1 context.Context
		arg2 string
		arg3 string
	}{arg1, arg2, arg3})
	stub := fake.SetupNetworkingStub
	fakeReturns := fake.setupNetworkingReturns
	fake.recordInvocation("SetupNetworking", []interface{}{arg1, arg2, arg3})
	fake.setupNetworkingMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeNetworkManager) SetupNetworkingCallCount() int {
	fake.setupNetworkingMutex.RLock()
	defer fake.setupNetworkingMutex.RUnlock()
	return len(fake.setupNetworkingArgsForCall)
}

func (fake *FakeNetworkManager) SetupNetworkingCalls(stub func(context.Context, string, string) (*execution.NetworkAllocation, error)) {
	fake.setupNetworkingMutex.Lock()
	defer fake.setupNetworkingMutex.Unlock()
	fake.SetupNetworkingStub = stub
}

func (fake *FakeNetworkManager) SetupNetworkingArgsForCall(i int) (context.Context, string, string) {
	fake.setupNetworkingMutex.RLock()
	defer fake.setupNetworkingMutex.RUnlock()
	argsForCall := fake.setupNetworkingArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *FakeNetworkManager) SetupNetworkingReturns(result1 *execution.NetworkAllocation, result2 error) {
	fake.setupNetworkingMutex.Lock()
	defer fake.setupNetworkingMutex.Unlock()
	fake.SetupNetworkingStub = nil
	fake.setupNetworkingReturns = struct {
		result1 *execution.NetworkAllocation
		result2 error
	}{result1, result2}
}

func (fake *FakeNetworkManager) SetupNetworkingReturnsOnCall(i int, result1 *execution.NetworkAllocation, result2 error) {
	fake.setupNetworkingMutex.Lock()
	defer fake.setupNetworkingMutex.Unlock()
	fake.SetupNetworkingStub = nil
	if fake.setupNetworkingReturnsOnCall == nil {
		fake.setupNetworkingReturnsOnCall = make(map[int]struct {
			result1 *execution.NetworkAllocation
			result2 error
		})
	}
	fake.setupNetworkingReturnsOnCall[i] = struct {
		result1 *execution.NetworkAllocation
		result2 error
	}{result1, result2}
}

func (fake *FakeNetworkManager) 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 *FakeNetworkManager) 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 _ execution.NetworkManager = new(FakeNetworkManager)
