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

import (
	"context"
	"sync"

	"code.cloudfoundry.org/korifi/api/authorization"
	"code.cloudfoundry.org/korifi/api/handlers"
	"code.cloudfoundry.org/korifi/api/repositories"
)

type CFSecurityGroupRepository struct {
	CreateSecurityGroupStub        func(context.Context, authorization.Info, repositories.CreateSecurityGroupMessage) (repositories.SecurityGroupRecord, error)
	createSecurityGroupMutex       sync.RWMutex
	createSecurityGroupArgsForCall []struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 repositories.CreateSecurityGroupMessage
	}
	createSecurityGroupReturns struct {
		result1 repositories.SecurityGroupRecord
		result2 error
	}
	createSecurityGroupReturnsOnCall map[int]struct {
		result1 repositories.SecurityGroupRecord
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *CFSecurityGroupRepository) CreateSecurityGroup(arg1 context.Context, arg2 authorization.Info, arg3 repositories.CreateSecurityGroupMessage) (repositories.SecurityGroupRecord, error) {
	fake.createSecurityGroupMutex.Lock()
	ret, specificReturn := fake.createSecurityGroupReturnsOnCall[len(fake.createSecurityGroupArgsForCall)]
	fake.createSecurityGroupArgsForCall = append(fake.createSecurityGroupArgsForCall, struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 repositories.CreateSecurityGroupMessage
	}{arg1, arg2, arg3})
	stub := fake.CreateSecurityGroupStub
	fakeReturns := fake.createSecurityGroupReturns
	fake.recordInvocation("CreateSecurityGroup", []interface{}{arg1, arg2, arg3})
	fake.createSecurityGroupMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *CFSecurityGroupRepository) CreateSecurityGroupCallCount() int {
	fake.createSecurityGroupMutex.RLock()
	defer fake.createSecurityGroupMutex.RUnlock()
	return len(fake.createSecurityGroupArgsForCall)
}

func (fake *CFSecurityGroupRepository) CreateSecurityGroupCalls(stub func(context.Context, authorization.Info, repositories.CreateSecurityGroupMessage) (repositories.SecurityGroupRecord, error)) {
	fake.createSecurityGroupMutex.Lock()
	defer fake.createSecurityGroupMutex.Unlock()
	fake.CreateSecurityGroupStub = stub
}

func (fake *CFSecurityGroupRepository) CreateSecurityGroupArgsForCall(i int) (context.Context, authorization.Info, repositories.CreateSecurityGroupMessage) {
	fake.createSecurityGroupMutex.RLock()
	defer fake.createSecurityGroupMutex.RUnlock()
	argsForCall := fake.createSecurityGroupArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *CFSecurityGroupRepository) CreateSecurityGroupReturns(result1 repositories.SecurityGroupRecord, result2 error) {
	fake.createSecurityGroupMutex.Lock()
	defer fake.createSecurityGroupMutex.Unlock()
	fake.CreateSecurityGroupStub = nil
	fake.createSecurityGroupReturns = struct {
		result1 repositories.SecurityGroupRecord
		result2 error
	}{result1, result2}
}

func (fake *CFSecurityGroupRepository) CreateSecurityGroupReturnsOnCall(i int, result1 repositories.SecurityGroupRecord, result2 error) {
	fake.createSecurityGroupMutex.Lock()
	defer fake.createSecurityGroupMutex.Unlock()
	fake.CreateSecurityGroupStub = nil
	if fake.createSecurityGroupReturnsOnCall == nil {
		fake.createSecurityGroupReturnsOnCall = make(map[int]struct {
			result1 repositories.SecurityGroupRecord
			result2 error
		})
	}
	fake.createSecurityGroupReturnsOnCall[i] = struct {
		result1 repositories.SecurityGroupRecord
		result2 error
	}{result1, result2}
}

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