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

import (
	"context"
	"sync"
	"time"

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

type CFOrgRepository struct {
	CreateOrgStub        func(context.Context, authorization.Info, repositories.CreateOrgMessage) (repositories.OrgRecord, error)
	createOrgMutex       sync.RWMutex
	createOrgArgsForCall []struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 repositories.CreateOrgMessage
	}
	createOrgReturns struct {
		result1 repositories.OrgRecord
		result2 error
	}
	createOrgReturnsOnCall map[int]struct {
		result1 repositories.OrgRecord
		result2 error
	}
	DeleteOrgStub        func(context.Context, authorization.Info, repositories.DeleteOrgMessage) error
	deleteOrgMutex       sync.RWMutex
	deleteOrgArgsForCall []struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 repositories.DeleteOrgMessage
	}
	deleteOrgReturns struct {
		result1 error
	}
	deleteOrgReturnsOnCall map[int]struct {
		result1 error
	}
	GetDeletedAtStub        func(context.Context, authorization.Info, string) (*time.Time, error)
	getDeletedAtMutex       sync.RWMutex
	getDeletedAtArgsForCall []struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 string
	}
	getDeletedAtReturns struct {
		result1 *time.Time
		result2 error
	}
	getDeletedAtReturnsOnCall map[int]struct {
		result1 *time.Time
		result2 error
	}
	GetOrgStub        func(context.Context, authorization.Info, string) (repositories.OrgRecord, error)
	getOrgMutex       sync.RWMutex
	getOrgArgsForCall []struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 string
	}
	getOrgReturns struct {
		result1 repositories.OrgRecord
		result2 error
	}
	getOrgReturnsOnCall map[int]struct {
		result1 repositories.OrgRecord
		result2 error
	}
	ListOrgsStub        func(context.Context, authorization.Info, repositories.ListOrgsMessage) (repositories.ListResult[repositories.OrgRecord], error)
	listOrgsMutex       sync.RWMutex
	listOrgsArgsForCall []struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 repositories.ListOrgsMessage
	}
	listOrgsReturns struct {
		result1 repositories.ListResult[repositories.OrgRecord]
		result2 error
	}
	listOrgsReturnsOnCall map[int]struct {
		result1 repositories.ListResult[repositories.OrgRecord]
		result2 error
	}
	PatchOrgStub        func(context.Context, authorization.Info, repositories.PatchOrgMessage) (repositories.OrgRecord, error)
	patchOrgMutex       sync.RWMutex
	patchOrgArgsForCall []struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 repositories.PatchOrgMessage
	}
	patchOrgReturns struct {
		result1 repositories.OrgRecord
		result2 error
	}
	patchOrgReturnsOnCall map[int]struct {
		result1 repositories.OrgRecord
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *CFOrgRepository) CreateOrg(arg1 context.Context, arg2 authorization.Info, arg3 repositories.CreateOrgMessage) (repositories.OrgRecord, error) {
	fake.createOrgMutex.Lock()
	ret, specificReturn := fake.createOrgReturnsOnCall[len(fake.createOrgArgsForCall)]
	fake.createOrgArgsForCall = append(fake.createOrgArgsForCall, struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 repositories.CreateOrgMessage
	}{arg1, arg2, arg3})
	stub := fake.CreateOrgStub
	fakeReturns := fake.createOrgReturns
	fake.recordInvocation("CreateOrg", []interface{}{arg1, arg2, arg3})
	fake.createOrgMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *CFOrgRepository) CreateOrgCallCount() int {
	fake.createOrgMutex.RLock()
	defer fake.createOrgMutex.RUnlock()
	return len(fake.createOrgArgsForCall)
}

func (fake *CFOrgRepository) CreateOrgCalls(stub func(context.Context, authorization.Info, repositories.CreateOrgMessage) (repositories.OrgRecord, error)) {
	fake.createOrgMutex.Lock()
	defer fake.createOrgMutex.Unlock()
	fake.CreateOrgStub = stub
}

func (fake *CFOrgRepository) CreateOrgArgsForCall(i int) (context.Context, authorization.Info, repositories.CreateOrgMessage) {
	fake.createOrgMutex.RLock()
	defer fake.createOrgMutex.RUnlock()
	argsForCall := fake.createOrgArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *CFOrgRepository) CreateOrgReturns(result1 repositories.OrgRecord, result2 error) {
	fake.createOrgMutex.Lock()
	defer fake.createOrgMutex.Unlock()
	fake.CreateOrgStub = nil
	fake.createOrgReturns = struct {
		result1 repositories.OrgRecord
		result2 error
	}{result1, result2}
}

func (fake *CFOrgRepository) CreateOrgReturnsOnCall(i int, result1 repositories.OrgRecord, result2 error) {
	fake.createOrgMutex.Lock()
	defer fake.createOrgMutex.Unlock()
	fake.CreateOrgStub = nil
	if fake.createOrgReturnsOnCall == nil {
		fake.createOrgReturnsOnCall = make(map[int]struct {
			result1 repositories.OrgRecord
			result2 error
		})
	}
	fake.createOrgReturnsOnCall[i] = struct {
		result1 repositories.OrgRecord
		result2 error
	}{result1, result2}
}

func (fake *CFOrgRepository) DeleteOrg(arg1 context.Context, arg2 authorization.Info, arg3 repositories.DeleteOrgMessage) error {
	fake.deleteOrgMutex.Lock()
	ret, specificReturn := fake.deleteOrgReturnsOnCall[len(fake.deleteOrgArgsForCall)]
	fake.deleteOrgArgsForCall = append(fake.deleteOrgArgsForCall, struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 repositories.DeleteOrgMessage
	}{arg1, arg2, arg3})
	stub := fake.DeleteOrgStub
	fakeReturns := fake.deleteOrgReturns
	fake.recordInvocation("DeleteOrg", []interface{}{arg1, arg2, arg3})
	fake.deleteOrgMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *CFOrgRepository) DeleteOrgCallCount() int {
	fake.deleteOrgMutex.RLock()
	defer fake.deleteOrgMutex.RUnlock()
	return len(fake.deleteOrgArgsForCall)
}

func (fake *CFOrgRepository) DeleteOrgCalls(stub func(context.Context, authorization.Info, repositories.DeleteOrgMessage) error) {
	fake.deleteOrgMutex.Lock()
	defer fake.deleteOrgMutex.Unlock()
	fake.DeleteOrgStub = stub
}

func (fake *CFOrgRepository) DeleteOrgArgsForCall(i int) (context.Context, authorization.Info, repositories.DeleteOrgMessage) {
	fake.deleteOrgMutex.RLock()
	defer fake.deleteOrgMutex.RUnlock()
	argsForCall := fake.deleteOrgArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *CFOrgRepository) DeleteOrgReturns(result1 error) {
	fake.deleteOrgMutex.Lock()
	defer fake.deleteOrgMutex.Unlock()
	fake.DeleteOrgStub = nil
	fake.deleteOrgReturns = struct {
		result1 error
	}{result1}
}

func (fake *CFOrgRepository) DeleteOrgReturnsOnCall(i int, result1 error) {
	fake.deleteOrgMutex.Lock()
	defer fake.deleteOrgMutex.Unlock()
	fake.DeleteOrgStub = nil
	if fake.deleteOrgReturnsOnCall == nil {
		fake.deleteOrgReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.deleteOrgReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *CFOrgRepository) GetDeletedAt(arg1 context.Context, arg2 authorization.Info, arg3 string) (*time.Time, error) {
	fake.getDeletedAtMutex.Lock()
	ret, specificReturn := fake.getDeletedAtReturnsOnCall[len(fake.getDeletedAtArgsForCall)]
	fake.getDeletedAtArgsForCall = append(fake.getDeletedAtArgsForCall, struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 string
	}{arg1, arg2, arg3})
	stub := fake.GetDeletedAtStub
	fakeReturns := fake.getDeletedAtReturns
	fake.recordInvocation("GetDeletedAt", []interface{}{arg1, arg2, arg3})
	fake.getDeletedAtMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *CFOrgRepository) GetDeletedAtCallCount() int {
	fake.getDeletedAtMutex.RLock()
	defer fake.getDeletedAtMutex.RUnlock()
	return len(fake.getDeletedAtArgsForCall)
}

func (fake *CFOrgRepository) GetDeletedAtCalls(stub func(context.Context, authorization.Info, string) (*time.Time, error)) {
	fake.getDeletedAtMutex.Lock()
	defer fake.getDeletedAtMutex.Unlock()
	fake.GetDeletedAtStub = stub
}

func (fake *CFOrgRepository) GetDeletedAtArgsForCall(i int) (context.Context, authorization.Info, string) {
	fake.getDeletedAtMutex.RLock()
	defer fake.getDeletedAtMutex.RUnlock()
	argsForCall := fake.getDeletedAtArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *CFOrgRepository) GetDeletedAtReturns(result1 *time.Time, result2 error) {
	fake.getDeletedAtMutex.Lock()
	defer fake.getDeletedAtMutex.Unlock()
	fake.GetDeletedAtStub = nil
	fake.getDeletedAtReturns = struct {
		result1 *time.Time
		result2 error
	}{result1, result2}
}

func (fake *CFOrgRepository) GetDeletedAtReturnsOnCall(i int, result1 *time.Time, result2 error) {
	fake.getDeletedAtMutex.Lock()
	defer fake.getDeletedAtMutex.Unlock()
	fake.GetDeletedAtStub = nil
	if fake.getDeletedAtReturnsOnCall == nil {
		fake.getDeletedAtReturnsOnCall = make(map[int]struct {
			result1 *time.Time
			result2 error
		})
	}
	fake.getDeletedAtReturnsOnCall[i] = struct {
		result1 *time.Time
		result2 error
	}{result1, result2}
}

func (fake *CFOrgRepository) GetOrg(arg1 context.Context, arg2 authorization.Info, arg3 string) (repositories.OrgRecord, error) {
	fake.getOrgMutex.Lock()
	ret, specificReturn := fake.getOrgReturnsOnCall[len(fake.getOrgArgsForCall)]
	fake.getOrgArgsForCall = append(fake.getOrgArgsForCall, struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 string
	}{arg1, arg2, arg3})
	stub := fake.GetOrgStub
	fakeReturns := fake.getOrgReturns
	fake.recordInvocation("GetOrg", []interface{}{arg1, arg2, arg3})
	fake.getOrgMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *CFOrgRepository) GetOrgCallCount() int {
	fake.getOrgMutex.RLock()
	defer fake.getOrgMutex.RUnlock()
	return len(fake.getOrgArgsForCall)
}

func (fake *CFOrgRepository) GetOrgCalls(stub func(context.Context, authorization.Info, string) (repositories.OrgRecord, error)) {
	fake.getOrgMutex.Lock()
	defer fake.getOrgMutex.Unlock()
	fake.GetOrgStub = stub
}

func (fake *CFOrgRepository) GetOrgArgsForCall(i int) (context.Context, authorization.Info, string) {
	fake.getOrgMutex.RLock()
	defer fake.getOrgMutex.RUnlock()
	argsForCall := fake.getOrgArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *CFOrgRepository) GetOrgReturns(result1 repositories.OrgRecord, result2 error) {
	fake.getOrgMutex.Lock()
	defer fake.getOrgMutex.Unlock()
	fake.GetOrgStub = nil
	fake.getOrgReturns = struct {
		result1 repositories.OrgRecord
		result2 error
	}{result1, result2}
}

func (fake *CFOrgRepository) GetOrgReturnsOnCall(i int, result1 repositories.OrgRecord, result2 error) {
	fake.getOrgMutex.Lock()
	defer fake.getOrgMutex.Unlock()
	fake.GetOrgStub = nil
	if fake.getOrgReturnsOnCall == nil {
		fake.getOrgReturnsOnCall = make(map[int]struct {
			result1 repositories.OrgRecord
			result2 error
		})
	}
	fake.getOrgReturnsOnCall[i] = struct {
		result1 repositories.OrgRecord
		result2 error
	}{result1, result2}
}

func (fake *CFOrgRepository) ListOrgs(arg1 context.Context, arg2 authorization.Info, arg3 repositories.ListOrgsMessage) (repositories.ListResult[repositories.OrgRecord], error) {
	fake.listOrgsMutex.Lock()
	ret, specificReturn := fake.listOrgsReturnsOnCall[len(fake.listOrgsArgsForCall)]
	fake.listOrgsArgsForCall = append(fake.listOrgsArgsForCall, struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 repositories.ListOrgsMessage
	}{arg1, arg2, arg3})
	stub := fake.ListOrgsStub
	fakeReturns := fake.listOrgsReturns
	fake.recordInvocation("ListOrgs", []interface{}{arg1, arg2, arg3})
	fake.listOrgsMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *CFOrgRepository) ListOrgsCallCount() int {
	fake.listOrgsMutex.RLock()
	defer fake.listOrgsMutex.RUnlock()
	return len(fake.listOrgsArgsForCall)
}

func (fake *CFOrgRepository) ListOrgsCalls(stub func(context.Context, authorization.Info, repositories.ListOrgsMessage) (repositories.ListResult[repositories.OrgRecord], error)) {
	fake.listOrgsMutex.Lock()
	defer fake.listOrgsMutex.Unlock()
	fake.ListOrgsStub = stub
}

func (fake *CFOrgRepository) ListOrgsArgsForCall(i int) (context.Context, authorization.Info, repositories.ListOrgsMessage) {
	fake.listOrgsMutex.RLock()
	defer fake.listOrgsMutex.RUnlock()
	argsForCall := fake.listOrgsArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *CFOrgRepository) ListOrgsReturns(result1 repositories.ListResult[repositories.OrgRecord], result2 error) {
	fake.listOrgsMutex.Lock()
	defer fake.listOrgsMutex.Unlock()
	fake.ListOrgsStub = nil
	fake.listOrgsReturns = struct {
		result1 repositories.ListResult[repositories.OrgRecord]
		result2 error
	}{result1, result2}
}

func (fake *CFOrgRepository) ListOrgsReturnsOnCall(i int, result1 repositories.ListResult[repositories.OrgRecord], result2 error) {
	fake.listOrgsMutex.Lock()
	defer fake.listOrgsMutex.Unlock()
	fake.ListOrgsStub = nil
	if fake.listOrgsReturnsOnCall == nil {
		fake.listOrgsReturnsOnCall = make(map[int]struct {
			result1 repositories.ListResult[repositories.OrgRecord]
			result2 error
		})
	}
	fake.listOrgsReturnsOnCall[i] = struct {
		result1 repositories.ListResult[repositories.OrgRecord]
		result2 error
	}{result1, result2}
}

func (fake *CFOrgRepository) PatchOrg(arg1 context.Context, arg2 authorization.Info, arg3 repositories.PatchOrgMessage) (repositories.OrgRecord, error) {
	fake.patchOrgMutex.Lock()
	ret, specificReturn := fake.patchOrgReturnsOnCall[len(fake.patchOrgArgsForCall)]
	fake.patchOrgArgsForCall = append(fake.patchOrgArgsForCall, struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 repositories.PatchOrgMessage
	}{arg1, arg2, arg3})
	stub := fake.PatchOrgStub
	fakeReturns := fake.patchOrgReturns
	fake.recordInvocation("PatchOrg", []interface{}{arg1, arg2, arg3})
	fake.patchOrgMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *CFOrgRepository) PatchOrgCallCount() int {
	fake.patchOrgMutex.RLock()
	defer fake.patchOrgMutex.RUnlock()
	return len(fake.patchOrgArgsForCall)
}

func (fake *CFOrgRepository) PatchOrgCalls(stub func(context.Context, authorization.Info, repositories.PatchOrgMessage) (repositories.OrgRecord, error)) {
	fake.patchOrgMutex.Lock()
	defer fake.patchOrgMutex.Unlock()
	fake.PatchOrgStub = stub
}

func (fake *CFOrgRepository) PatchOrgArgsForCall(i int) (context.Context, authorization.Info, repositories.PatchOrgMessage) {
	fake.patchOrgMutex.RLock()
	defer fake.patchOrgMutex.RUnlock()
	argsForCall := fake.patchOrgArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *CFOrgRepository) PatchOrgReturns(result1 repositories.OrgRecord, result2 error) {
	fake.patchOrgMutex.Lock()
	defer fake.patchOrgMutex.Unlock()
	fake.PatchOrgStub = nil
	fake.patchOrgReturns = struct {
		result1 repositories.OrgRecord
		result2 error
	}{result1, result2}
}

func (fake *CFOrgRepository) PatchOrgReturnsOnCall(i int, result1 repositories.OrgRecord, result2 error) {
	fake.patchOrgMutex.Lock()
	defer fake.patchOrgMutex.Unlock()
	fake.PatchOrgStub = nil
	if fake.patchOrgReturnsOnCall == nil {
		fake.patchOrgReturnsOnCall = make(map[int]struct {
			result1 repositories.OrgRecord
			result2 error
		})
	}
	fake.patchOrgReturnsOnCall[i] = struct {
		result1 repositories.OrgRecord
		result2 error
	}{result1, result2}
}

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