// This file was generated by counterfeiter
package fakes

import (
	"sync"

	"github.com/containernetworking/cni/libcni"
	"github.com/containernetworking/cni/pkg/types"
)

type CNILibrary struct {
	AddNetworkListStub        func(net *libcni.NetworkConfigList, rt *libcni.RuntimeConf) (types.Result, error)
	addNetworkListMutex       sync.RWMutex
	addNetworkListArgsForCall []struct {
		net *libcni.NetworkConfigList
		rt  *libcni.RuntimeConf
	}
	addNetworkListReturns struct {
		result1 types.Result
		result2 error
	}
	addNetworkListReturnsOnCall map[int]struct {
		result1 types.Result
		result2 error
	}
	DelNetworkListStub        func(net *libcni.NetworkConfigList, rt *libcni.RuntimeConf) error
	delNetworkListMutex       sync.RWMutex
	delNetworkListArgsForCall []struct {
		net *libcni.NetworkConfigList
		rt  *libcni.RuntimeConf
	}
	delNetworkListReturns struct {
		result1 error
	}
	delNetworkListReturnsOnCall map[int]struct {
		result1 error
	}
	AddNetworkStub        func(net *libcni.NetworkConfig, rt *libcni.RuntimeConf) (types.Result, error)
	addNetworkMutex       sync.RWMutex
	addNetworkArgsForCall []struct {
		net *libcni.NetworkConfig
		rt  *libcni.RuntimeConf
	}
	addNetworkReturns struct {
		result1 types.Result
		result2 error
	}
	addNetworkReturnsOnCall map[int]struct {
		result1 types.Result
		result2 error
	}
	DelNetworkStub        func(net *libcni.NetworkConfig, rt *libcni.RuntimeConf) error
	delNetworkMutex       sync.RWMutex
	delNetworkArgsForCall []struct {
		net *libcni.NetworkConfig
		rt  *libcni.RuntimeConf
	}
	delNetworkReturns struct {
		result1 error
	}
	delNetworkReturnsOnCall map[int]struct {
		result1 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *CNILibrary) AddNetworkList(net *libcni.NetworkConfigList, rt *libcni.RuntimeConf) (types.Result, error) {
	fake.addNetworkListMutex.Lock()
	ret, specificReturn := fake.addNetworkListReturnsOnCall[len(fake.addNetworkListArgsForCall)]
	fake.addNetworkListArgsForCall = append(fake.addNetworkListArgsForCall, struct {
		net *libcni.NetworkConfigList
		rt  *libcni.RuntimeConf
	}{net, rt})
	fake.recordInvocation("AddNetworkList", []interface{}{net, rt})
	fake.addNetworkListMutex.Unlock()
	if fake.AddNetworkListStub != nil {
		return fake.AddNetworkListStub(net, rt)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fake.addNetworkListReturns.result1, fake.addNetworkListReturns.result2
}

func (fake *CNILibrary) AddNetworkListCallCount() int {
	fake.addNetworkListMutex.RLock()
	defer fake.addNetworkListMutex.RUnlock()
	return len(fake.addNetworkListArgsForCall)
}

func (fake *CNILibrary) AddNetworkListArgsForCall(i int) (*libcni.NetworkConfigList, *libcni.RuntimeConf) {
	fake.addNetworkListMutex.RLock()
	defer fake.addNetworkListMutex.RUnlock()
	return fake.addNetworkListArgsForCall[i].net, fake.addNetworkListArgsForCall[i].rt
}

func (fake *CNILibrary) AddNetworkListReturns(result1 types.Result, result2 error) {
	fake.AddNetworkListStub = nil
	fake.addNetworkListReturns = struct {
		result1 types.Result
		result2 error
	}{result1, result2}
}

func (fake *CNILibrary) AddNetworkListReturnsOnCall(i int, result1 types.Result, result2 error) {
	fake.AddNetworkListStub = nil
	if fake.addNetworkListReturnsOnCall == nil {
		fake.addNetworkListReturnsOnCall = make(map[int]struct {
			result1 types.Result
			result2 error
		})
	}
	fake.addNetworkListReturnsOnCall[i] = struct {
		result1 types.Result
		result2 error
	}{result1, result2}
}

func (fake *CNILibrary) DelNetworkList(net *libcni.NetworkConfigList, rt *libcni.RuntimeConf) error {
	fake.delNetworkListMutex.Lock()
	ret, specificReturn := fake.delNetworkListReturnsOnCall[len(fake.delNetworkListArgsForCall)]
	fake.delNetworkListArgsForCall = append(fake.delNetworkListArgsForCall, struct {
		net *libcni.NetworkConfigList
		rt  *libcni.RuntimeConf
	}{net, rt})
	fake.recordInvocation("DelNetworkList", []interface{}{net, rt})
	fake.delNetworkListMutex.Unlock()
	if fake.DelNetworkListStub != nil {
		return fake.DelNetworkListStub(net, rt)
	}
	if specificReturn {
		return ret.result1
	}
	return fake.delNetworkListReturns.result1
}

func (fake *CNILibrary) DelNetworkListCallCount() int {
	fake.delNetworkListMutex.RLock()
	defer fake.delNetworkListMutex.RUnlock()
	return len(fake.delNetworkListArgsForCall)
}

func (fake *CNILibrary) DelNetworkListArgsForCall(i int) (*libcni.NetworkConfigList, *libcni.RuntimeConf) {
	fake.delNetworkListMutex.RLock()
	defer fake.delNetworkListMutex.RUnlock()
	return fake.delNetworkListArgsForCall[i].net, fake.delNetworkListArgsForCall[i].rt
}

func (fake *CNILibrary) DelNetworkListReturns(result1 error) {
	fake.DelNetworkListStub = nil
	fake.delNetworkListReturns = struct {
		result1 error
	}{result1}
}

func (fake *CNILibrary) DelNetworkListReturnsOnCall(i int, result1 error) {
	fake.DelNetworkListStub = nil
	if fake.delNetworkListReturnsOnCall == nil {
		fake.delNetworkListReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.delNetworkListReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *CNILibrary) AddNetwork(net *libcni.NetworkConfig, rt *libcni.RuntimeConf) (types.Result, error) {
	fake.addNetworkMutex.Lock()
	ret, specificReturn := fake.addNetworkReturnsOnCall[len(fake.addNetworkArgsForCall)]
	fake.addNetworkArgsForCall = append(fake.addNetworkArgsForCall, struct {
		net *libcni.NetworkConfig
		rt  *libcni.RuntimeConf
	}{net, rt})
	fake.recordInvocation("AddNetwork", []interface{}{net, rt})
	fake.addNetworkMutex.Unlock()
	if fake.AddNetworkStub != nil {
		return fake.AddNetworkStub(net, rt)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fake.addNetworkReturns.result1, fake.addNetworkReturns.result2
}

func (fake *CNILibrary) AddNetworkCallCount() int {
	fake.addNetworkMutex.RLock()
	defer fake.addNetworkMutex.RUnlock()
	return len(fake.addNetworkArgsForCall)
}

func (fake *CNILibrary) AddNetworkArgsForCall(i int) (*libcni.NetworkConfig, *libcni.RuntimeConf) {
	fake.addNetworkMutex.RLock()
	defer fake.addNetworkMutex.RUnlock()
	return fake.addNetworkArgsForCall[i].net, fake.addNetworkArgsForCall[i].rt
}

func (fake *CNILibrary) AddNetworkReturns(result1 types.Result, result2 error) {
	fake.AddNetworkStub = nil
	fake.addNetworkReturns = struct {
		result1 types.Result
		result2 error
	}{result1, result2}
}

func (fake *CNILibrary) AddNetworkReturnsOnCall(i int, result1 types.Result, result2 error) {
	fake.AddNetworkStub = nil
	if fake.addNetworkReturnsOnCall == nil {
		fake.addNetworkReturnsOnCall = make(map[int]struct {
			result1 types.Result
			result2 error
		})
	}
	fake.addNetworkReturnsOnCall[i] = struct {
		result1 types.Result
		result2 error
	}{result1, result2}
}

func (fake *CNILibrary) DelNetwork(net *libcni.NetworkConfig, rt *libcni.RuntimeConf) error {
	fake.delNetworkMutex.Lock()
	ret, specificReturn := fake.delNetworkReturnsOnCall[len(fake.delNetworkArgsForCall)]
	fake.delNetworkArgsForCall = append(fake.delNetworkArgsForCall, struct {
		net *libcni.NetworkConfig
		rt  *libcni.RuntimeConf
	}{net, rt})
	fake.recordInvocation("DelNetwork", []interface{}{net, rt})
	fake.delNetworkMutex.Unlock()
	if fake.DelNetworkStub != nil {
		return fake.DelNetworkStub(net, rt)
	}
	if specificReturn {
		return ret.result1
	}
	return fake.delNetworkReturns.result1
}

func (fake *CNILibrary) DelNetworkCallCount() int {
	fake.delNetworkMutex.RLock()
	defer fake.delNetworkMutex.RUnlock()
	return len(fake.delNetworkArgsForCall)
}

func (fake *CNILibrary) DelNetworkArgsForCall(i int) (*libcni.NetworkConfig, *libcni.RuntimeConf) {
	fake.delNetworkMutex.RLock()
	defer fake.delNetworkMutex.RUnlock()
	return fake.delNetworkArgsForCall[i].net, fake.delNetworkArgsForCall[i].rt
}

func (fake *CNILibrary) DelNetworkReturns(result1 error) {
	fake.DelNetworkStub = nil
	fake.delNetworkReturns = struct {
		result1 error
	}{result1}
}

func (fake *CNILibrary) DelNetworkReturnsOnCall(i int, result1 error) {
	fake.DelNetworkStub = nil
	if fake.delNetworkReturnsOnCall == nil {
		fake.delNetworkReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.delNetworkReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *CNILibrary) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	fake.addNetworkListMutex.RLock()
	defer fake.addNetworkListMutex.RUnlock()
	fake.delNetworkListMutex.RLock()
	defer fake.delNetworkListMutex.RUnlock()
	fake.addNetworkMutex.RLock()
	defer fake.addNetworkMutex.RUnlock()
	fake.delNetworkMutex.RLock()
	defer fake.delNetworkMutex.RUnlock()
	return fake.invocations
}

func (fake *CNILibrary) 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)
}
