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

import (
	"sync"

	"code.cloudfoundry.org/policy-server/store"
)

type SecurityGroupsStore struct {
	BySpaceGuidsStub        func([]string, store.Page) ([]store.SecurityGroup, store.Pagination, error)
	bySpaceGuidsMutex       sync.RWMutex
	bySpaceGuidsArgsForCall []struct {
		arg1 []string
		arg2 store.Page
	}
	bySpaceGuidsReturns struct {
		result1 []store.SecurityGroup
		result2 store.Pagination
		result3 error
	}
	bySpaceGuidsReturnsOnCall map[int]struct {
		result1 []store.SecurityGroup
		result2 store.Pagination
		result3 error
	}
	LastUpdatedStub        func() (int, error)
	lastUpdatedMutex       sync.RWMutex
	lastUpdatedArgsForCall []struct {
	}
	lastUpdatedReturns struct {
		result1 int
		result2 error
	}
	lastUpdatedReturnsOnCall map[int]struct {
		result1 int
		result2 error
	}
	ReplaceStub        func([]store.SecurityGroup) error
	replaceMutex       sync.RWMutex
	replaceArgsForCall []struct {
		arg1 []store.SecurityGroup
	}
	replaceReturns struct {
		result1 error
	}
	replaceReturnsOnCall map[int]struct {
		result1 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *SecurityGroupsStore) BySpaceGuids(arg1 []string, arg2 store.Page) ([]store.SecurityGroup, store.Pagination, error) {
	var arg1Copy []string
	if arg1 != nil {
		arg1Copy = make([]string, len(arg1))
		copy(arg1Copy, arg1)
	}
	fake.bySpaceGuidsMutex.Lock()
	ret, specificReturn := fake.bySpaceGuidsReturnsOnCall[len(fake.bySpaceGuidsArgsForCall)]
	fake.bySpaceGuidsArgsForCall = append(fake.bySpaceGuidsArgsForCall, struct {
		arg1 []string
		arg2 store.Page
	}{arg1Copy, arg2})
	stub := fake.BySpaceGuidsStub
	fakeReturns := fake.bySpaceGuidsReturns
	fake.recordInvocation("BySpaceGuids", []interface{}{arg1Copy, arg2})
	fake.bySpaceGuidsMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1, ret.result2, ret.result3
	}
	return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3
}

func (fake *SecurityGroupsStore) BySpaceGuidsCallCount() int {
	fake.bySpaceGuidsMutex.RLock()
	defer fake.bySpaceGuidsMutex.RUnlock()
	return len(fake.bySpaceGuidsArgsForCall)
}

func (fake *SecurityGroupsStore) BySpaceGuidsCalls(stub func([]string, store.Page) ([]store.SecurityGroup, store.Pagination, error)) {
	fake.bySpaceGuidsMutex.Lock()
	defer fake.bySpaceGuidsMutex.Unlock()
	fake.BySpaceGuidsStub = stub
}

func (fake *SecurityGroupsStore) BySpaceGuidsArgsForCall(i int) ([]string, store.Page) {
	fake.bySpaceGuidsMutex.RLock()
	defer fake.bySpaceGuidsMutex.RUnlock()
	argsForCall := fake.bySpaceGuidsArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *SecurityGroupsStore) BySpaceGuidsReturns(result1 []store.SecurityGroup, result2 store.Pagination, result3 error) {
	fake.bySpaceGuidsMutex.Lock()
	defer fake.bySpaceGuidsMutex.Unlock()
	fake.BySpaceGuidsStub = nil
	fake.bySpaceGuidsReturns = struct {
		result1 []store.SecurityGroup
		result2 store.Pagination
		result3 error
	}{result1, result2, result3}
}

func (fake *SecurityGroupsStore) BySpaceGuidsReturnsOnCall(i int, result1 []store.SecurityGroup, result2 store.Pagination, result3 error) {
	fake.bySpaceGuidsMutex.Lock()
	defer fake.bySpaceGuidsMutex.Unlock()
	fake.BySpaceGuidsStub = nil
	if fake.bySpaceGuidsReturnsOnCall == nil {
		fake.bySpaceGuidsReturnsOnCall = make(map[int]struct {
			result1 []store.SecurityGroup
			result2 store.Pagination
			result3 error
		})
	}
	fake.bySpaceGuidsReturnsOnCall[i] = struct {
		result1 []store.SecurityGroup
		result2 store.Pagination
		result3 error
	}{result1, result2, result3}
}

func (fake *SecurityGroupsStore) LastUpdated() (int, error) {
	fake.lastUpdatedMutex.Lock()
	ret, specificReturn := fake.lastUpdatedReturnsOnCall[len(fake.lastUpdatedArgsForCall)]
	fake.lastUpdatedArgsForCall = append(fake.lastUpdatedArgsForCall, struct {
	}{})
	stub := fake.LastUpdatedStub
	fakeReturns := fake.lastUpdatedReturns
	fake.recordInvocation("LastUpdated", []interface{}{})
	fake.lastUpdatedMutex.Unlock()
	if stub != nil {
		return stub()
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *SecurityGroupsStore) LastUpdatedCallCount() int {
	fake.lastUpdatedMutex.RLock()
	defer fake.lastUpdatedMutex.RUnlock()
	return len(fake.lastUpdatedArgsForCall)
}

func (fake *SecurityGroupsStore) LastUpdatedCalls(stub func() (int, error)) {
	fake.lastUpdatedMutex.Lock()
	defer fake.lastUpdatedMutex.Unlock()
	fake.LastUpdatedStub = stub
}

func (fake *SecurityGroupsStore) LastUpdatedReturns(result1 int, result2 error) {
	fake.lastUpdatedMutex.Lock()
	defer fake.lastUpdatedMutex.Unlock()
	fake.LastUpdatedStub = nil
	fake.lastUpdatedReturns = struct {
		result1 int
		result2 error
	}{result1, result2}
}

func (fake *SecurityGroupsStore) LastUpdatedReturnsOnCall(i int, result1 int, result2 error) {
	fake.lastUpdatedMutex.Lock()
	defer fake.lastUpdatedMutex.Unlock()
	fake.LastUpdatedStub = nil
	if fake.lastUpdatedReturnsOnCall == nil {
		fake.lastUpdatedReturnsOnCall = make(map[int]struct {
			result1 int
			result2 error
		})
	}
	fake.lastUpdatedReturnsOnCall[i] = struct {
		result1 int
		result2 error
	}{result1, result2}
}

func (fake *SecurityGroupsStore) Replace(arg1 []store.SecurityGroup) error {
	var arg1Copy []store.SecurityGroup
	if arg1 != nil {
		arg1Copy = make([]store.SecurityGroup, len(arg1))
		copy(arg1Copy, arg1)
	}
	fake.replaceMutex.Lock()
	ret, specificReturn := fake.replaceReturnsOnCall[len(fake.replaceArgsForCall)]
	fake.replaceArgsForCall = append(fake.replaceArgsForCall, struct {
		arg1 []store.SecurityGroup
	}{arg1Copy})
	stub := fake.ReplaceStub
	fakeReturns := fake.replaceReturns
	fake.recordInvocation("Replace", []interface{}{arg1Copy})
	fake.replaceMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *SecurityGroupsStore) ReplaceCallCount() int {
	fake.replaceMutex.RLock()
	defer fake.replaceMutex.RUnlock()
	return len(fake.replaceArgsForCall)
}

func (fake *SecurityGroupsStore) ReplaceCalls(stub func([]store.SecurityGroup) error) {
	fake.replaceMutex.Lock()
	defer fake.replaceMutex.Unlock()
	fake.ReplaceStub = stub
}

func (fake *SecurityGroupsStore) ReplaceArgsForCall(i int) []store.SecurityGroup {
	fake.replaceMutex.RLock()
	defer fake.replaceMutex.RUnlock()
	argsForCall := fake.replaceArgsForCall[i]
	return argsForCall.arg1
}

func (fake *SecurityGroupsStore) ReplaceReturns(result1 error) {
	fake.replaceMutex.Lock()
	defer fake.replaceMutex.Unlock()
	fake.ReplaceStub = nil
	fake.replaceReturns = struct {
		result1 error
	}{result1}
}

func (fake *SecurityGroupsStore) ReplaceReturnsOnCall(i int, result1 error) {
	fake.replaceMutex.Lock()
	defer fake.replaceMutex.Unlock()
	fake.ReplaceStub = nil
	if fake.replaceReturnsOnCall == nil {
		fake.replaceReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.replaceReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

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

func (fake *SecurityGroupsStore) 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 _ store.SecurityGroupsStore = new(SecurityGroupsStore)
