// 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 CFDomainRepository struct {
	CreateDomainStub        func(context.Context, authorization.Info, repositories.CreateDomainMessage) (repositories.DomainRecord, error)
	createDomainMutex       sync.RWMutex
	createDomainArgsForCall []struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 repositories.CreateDomainMessage
	}
	createDomainReturns struct {
		result1 repositories.DomainRecord
		result2 error
	}
	createDomainReturnsOnCall map[int]struct {
		result1 repositories.DomainRecord
		result2 error
	}
	DeleteDomainStub        func(context.Context, authorization.Info, string) error
	deleteDomainMutex       sync.RWMutex
	deleteDomainArgsForCall []struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 string
	}
	deleteDomainReturns struct {
		result1 error
	}
	deleteDomainReturnsOnCall map[int]struct {
		result1 error
	}
	GetDomainStub        func(context.Context, authorization.Info, string) (repositories.DomainRecord, error)
	getDomainMutex       sync.RWMutex
	getDomainArgsForCall []struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 string
	}
	getDomainReturns struct {
		result1 repositories.DomainRecord
		result2 error
	}
	getDomainReturnsOnCall map[int]struct {
		result1 repositories.DomainRecord
		result2 error
	}
	ListDomainsStub        func(context.Context, authorization.Info, repositories.ListDomainsMessage) (repositories.ListResult[repositories.DomainRecord], error)
	listDomainsMutex       sync.RWMutex
	listDomainsArgsForCall []struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 repositories.ListDomainsMessage
	}
	listDomainsReturns struct {
		result1 repositories.ListResult[repositories.DomainRecord]
		result2 error
	}
	listDomainsReturnsOnCall map[int]struct {
		result1 repositories.ListResult[repositories.DomainRecord]
		result2 error
	}
	UpdateDomainStub        func(context.Context, authorization.Info, repositories.UpdateDomainMessage) (repositories.DomainRecord, error)
	updateDomainMutex       sync.RWMutex
	updateDomainArgsForCall []struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 repositories.UpdateDomainMessage
	}
	updateDomainReturns struct {
		result1 repositories.DomainRecord
		result2 error
	}
	updateDomainReturnsOnCall map[int]struct {
		result1 repositories.DomainRecord
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *CFDomainRepository) CreateDomain(arg1 context.Context, arg2 authorization.Info, arg3 repositories.CreateDomainMessage) (repositories.DomainRecord, error) {
	fake.createDomainMutex.Lock()
	ret, specificReturn := fake.createDomainReturnsOnCall[len(fake.createDomainArgsForCall)]
	fake.createDomainArgsForCall = append(fake.createDomainArgsForCall, struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 repositories.CreateDomainMessage
	}{arg1, arg2, arg3})
	stub := fake.CreateDomainStub
	fakeReturns := fake.createDomainReturns
	fake.recordInvocation("CreateDomain", []interface{}{arg1, arg2, arg3})
	fake.createDomainMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *CFDomainRepository) CreateDomainCallCount() int {
	fake.createDomainMutex.RLock()
	defer fake.createDomainMutex.RUnlock()
	return len(fake.createDomainArgsForCall)
}

func (fake *CFDomainRepository) CreateDomainCalls(stub func(context.Context, authorization.Info, repositories.CreateDomainMessage) (repositories.DomainRecord, error)) {
	fake.createDomainMutex.Lock()
	defer fake.createDomainMutex.Unlock()
	fake.CreateDomainStub = stub
}

func (fake *CFDomainRepository) CreateDomainArgsForCall(i int) (context.Context, authorization.Info, repositories.CreateDomainMessage) {
	fake.createDomainMutex.RLock()
	defer fake.createDomainMutex.RUnlock()
	argsForCall := fake.createDomainArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *CFDomainRepository) CreateDomainReturns(result1 repositories.DomainRecord, result2 error) {
	fake.createDomainMutex.Lock()
	defer fake.createDomainMutex.Unlock()
	fake.CreateDomainStub = nil
	fake.createDomainReturns = struct {
		result1 repositories.DomainRecord
		result2 error
	}{result1, result2}
}

func (fake *CFDomainRepository) CreateDomainReturnsOnCall(i int, result1 repositories.DomainRecord, result2 error) {
	fake.createDomainMutex.Lock()
	defer fake.createDomainMutex.Unlock()
	fake.CreateDomainStub = nil
	if fake.createDomainReturnsOnCall == nil {
		fake.createDomainReturnsOnCall = make(map[int]struct {
			result1 repositories.DomainRecord
			result2 error
		})
	}
	fake.createDomainReturnsOnCall[i] = struct {
		result1 repositories.DomainRecord
		result2 error
	}{result1, result2}
}

func (fake *CFDomainRepository) DeleteDomain(arg1 context.Context, arg2 authorization.Info, arg3 string) error {
	fake.deleteDomainMutex.Lock()
	ret, specificReturn := fake.deleteDomainReturnsOnCall[len(fake.deleteDomainArgsForCall)]
	fake.deleteDomainArgsForCall = append(fake.deleteDomainArgsForCall, struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 string
	}{arg1, arg2, arg3})
	stub := fake.DeleteDomainStub
	fakeReturns := fake.deleteDomainReturns
	fake.recordInvocation("DeleteDomain", []interface{}{arg1, arg2, arg3})
	fake.deleteDomainMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *CFDomainRepository) DeleteDomainCallCount() int {
	fake.deleteDomainMutex.RLock()
	defer fake.deleteDomainMutex.RUnlock()
	return len(fake.deleteDomainArgsForCall)
}

func (fake *CFDomainRepository) DeleteDomainCalls(stub func(context.Context, authorization.Info, string) error) {
	fake.deleteDomainMutex.Lock()
	defer fake.deleteDomainMutex.Unlock()
	fake.DeleteDomainStub = stub
}

func (fake *CFDomainRepository) DeleteDomainArgsForCall(i int) (context.Context, authorization.Info, string) {
	fake.deleteDomainMutex.RLock()
	defer fake.deleteDomainMutex.RUnlock()
	argsForCall := fake.deleteDomainArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *CFDomainRepository) DeleteDomainReturns(result1 error) {
	fake.deleteDomainMutex.Lock()
	defer fake.deleteDomainMutex.Unlock()
	fake.DeleteDomainStub = nil
	fake.deleteDomainReturns = struct {
		result1 error
	}{result1}
}

func (fake *CFDomainRepository) DeleteDomainReturnsOnCall(i int, result1 error) {
	fake.deleteDomainMutex.Lock()
	defer fake.deleteDomainMutex.Unlock()
	fake.DeleteDomainStub = nil
	if fake.deleteDomainReturnsOnCall == nil {
		fake.deleteDomainReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.deleteDomainReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *CFDomainRepository) GetDomain(arg1 context.Context, arg2 authorization.Info, arg3 string) (repositories.DomainRecord, error) {
	fake.getDomainMutex.Lock()
	ret, specificReturn := fake.getDomainReturnsOnCall[len(fake.getDomainArgsForCall)]
	fake.getDomainArgsForCall = append(fake.getDomainArgsForCall, struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 string
	}{arg1, arg2, arg3})
	stub := fake.GetDomainStub
	fakeReturns := fake.getDomainReturns
	fake.recordInvocation("GetDomain", []interface{}{arg1, arg2, arg3})
	fake.getDomainMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *CFDomainRepository) GetDomainCallCount() int {
	fake.getDomainMutex.RLock()
	defer fake.getDomainMutex.RUnlock()
	return len(fake.getDomainArgsForCall)
}

func (fake *CFDomainRepository) GetDomainCalls(stub func(context.Context, authorization.Info, string) (repositories.DomainRecord, error)) {
	fake.getDomainMutex.Lock()
	defer fake.getDomainMutex.Unlock()
	fake.GetDomainStub = stub
}

func (fake *CFDomainRepository) GetDomainArgsForCall(i int) (context.Context, authorization.Info, string) {
	fake.getDomainMutex.RLock()
	defer fake.getDomainMutex.RUnlock()
	argsForCall := fake.getDomainArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *CFDomainRepository) GetDomainReturns(result1 repositories.DomainRecord, result2 error) {
	fake.getDomainMutex.Lock()
	defer fake.getDomainMutex.Unlock()
	fake.GetDomainStub = nil
	fake.getDomainReturns = struct {
		result1 repositories.DomainRecord
		result2 error
	}{result1, result2}
}

func (fake *CFDomainRepository) GetDomainReturnsOnCall(i int, result1 repositories.DomainRecord, result2 error) {
	fake.getDomainMutex.Lock()
	defer fake.getDomainMutex.Unlock()
	fake.GetDomainStub = nil
	if fake.getDomainReturnsOnCall == nil {
		fake.getDomainReturnsOnCall = make(map[int]struct {
			result1 repositories.DomainRecord
			result2 error
		})
	}
	fake.getDomainReturnsOnCall[i] = struct {
		result1 repositories.DomainRecord
		result2 error
	}{result1, result2}
}

func (fake *CFDomainRepository) ListDomains(arg1 context.Context, arg2 authorization.Info, arg3 repositories.ListDomainsMessage) (repositories.ListResult[repositories.DomainRecord], error) {
	fake.listDomainsMutex.Lock()
	ret, specificReturn := fake.listDomainsReturnsOnCall[len(fake.listDomainsArgsForCall)]
	fake.listDomainsArgsForCall = append(fake.listDomainsArgsForCall, struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 repositories.ListDomainsMessage
	}{arg1, arg2, arg3})
	stub := fake.ListDomainsStub
	fakeReturns := fake.listDomainsReturns
	fake.recordInvocation("ListDomains", []interface{}{arg1, arg2, arg3})
	fake.listDomainsMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *CFDomainRepository) ListDomainsCallCount() int {
	fake.listDomainsMutex.RLock()
	defer fake.listDomainsMutex.RUnlock()
	return len(fake.listDomainsArgsForCall)
}

func (fake *CFDomainRepository) ListDomainsCalls(stub func(context.Context, authorization.Info, repositories.ListDomainsMessage) (repositories.ListResult[repositories.DomainRecord], error)) {
	fake.listDomainsMutex.Lock()
	defer fake.listDomainsMutex.Unlock()
	fake.ListDomainsStub = stub
}

func (fake *CFDomainRepository) ListDomainsArgsForCall(i int) (context.Context, authorization.Info, repositories.ListDomainsMessage) {
	fake.listDomainsMutex.RLock()
	defer fake.listDomainsMutex.RUnlock()
	argsForCall := fake.listDomainsArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *CFDomainRepository) ListDomainsReturns(result1 repositories.ListResult[repositories.DomainRecord], result2 error) {
	fake.listDomainsMutex.Lock()
	defer fake.listDomainsMutex.Unlock()
	fake.ListDomainsStub = nil
	fake.listDomainsReturns = struct {
		result1 repositories.ListResult[repositories.DomainRecord]
		result2 error
	}{result1, result2}
}

func (fake *CFDomainRepository) ListDomainsReturnsOnCall(i int, result1 repositories.ListResult[repositories.DomainRecord], result2 error) {
	fake.listDomainsMutex.Lock()
	defer fake.listDomainsMutex.Unlock()
	fake.ListDomainsStub = nil
	if fake.listDomainsReturnsOnCall == nil {
		fake.listDomainsReturnsOnCall = make(map[int]struct {
			result1 repositories.ListResult[repositories.DomainRecord]
			result2 error
		})
	}
	fake.listDomainsReturnsOnCall[i] = struct {
		result1 repositories.ListResult[repositories.DomainRecord]
		result2 error
	}{result1, result2}
}

func (fake *CFDomainRepository) UpdateDomain(arg1 context.Context, arg2 authorization.Info, arg3 repositories.UpdateDomainMessage) (repositories.DomainRecord, error) {
	fake.updateDomainMutex.Lock()
	ret, specificReturn := fake.updateDomainReturnsOnCall[len(fake.updateDomainArgsForCall)]
	fake.updateDomainArgsForCall = append(fake.updateDomainArgsForCall, struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 repositories.UpdateDomainMessage
	}{arg1, arg2, arg3})
	stub := fake.UpdateDomainStub
	fakeReturns := fake.updateDomainReturns
	fake.recordInvocation("UpdateDomain", []interface{}{arg1, arg2, arg3})
	fake.updateDomainMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *CFDomainRepository) UpdateDomainCallCount() int {
	fake.updateDomainMutex.RLock()
	defer fake.updateDomainMutex.RUnlock()
	return len(fake.updateDomainArgsForCall)
}

func (fake *CFDomainRepository) UpdateDomainCalls(stub func(context.Context, authorization.Info, repositories.UpdateDomainMessage) (repositories.DomainRecord, error)) {
	fake.updateDomainMutex.Lock()
	defer fake.updateDomainMutex.Unlock()
	fake.UpdateDomainStub = stub
}

func (fake *CFDomainRepository) UpdateDomainArgsForCall(i int) (context.Context, authorization.Info, repositories.UpdateDomainMessage) {
	fake.updateDomainMutex.RLock()
	defer fake.updateDomainMutex.RUnlock()
	argsForCall := fake.updateDomainArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *CFDomainRepository) UpdateDomainReturns(result1 repositories.DomainRecord, result2 error) {
	fake.updateDomainMutex.Lock()
	defer fake.updateDomainMutex.Unlock()
	fake.UpdateDomainStub = nil
	fake.updateDomainReturns = struct {
		result1 repositories.DomainRecord
		result2 error
	}{result1, result2}
}

func (fake *CFDomainRepository) UpdateDomainReturnsOnCall(i int, result1 repositories.DomainRecord, result2 error) {
	fake.updateDomainMutex.Lock()
	defer fake.updateDomainMutex.Unlock()
	fake.UpdateDomainStub = nil
	if fake.updateDomainReturnsOnCall == nil {
		fake.updateDomainReturnsOnCall = make(map[int]struct {
			result1 repositories.DomainRecord
			result2 error
		})
	}
	fake.updateDomainReturnsOnCall[i] = struct {
		result1 repositories.DomainRecord
		result2 error
	}{result1, result2}
}

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