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

import (
	"context"
	"sync"

	"code.cloudfoundry.org/korifi/api/actions"
	"code.cloudfoundry.org/korifi/api/actions/manifest"
	"code.cloudfoundry.org/korifi/api/authorization"
)

type StateCollector struct {
	CollectStateStub        func(context.Context, authorization.Info, string, string) (manifest.AppState, error)
	collectStateMutex       sync.RWMutex
	collectStateArgsForCall []struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 string
		arg4 string
	}
	collectStateReturns struct {
		result1 manifest.AppState
		result2 error
	}
	collectStateReturnsOnCall map[int]struct {
		result1 manifest.AppState
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *StateCollector) CollectState(arg1 context.Context, arg2 authorization.Info, arg3 string, arg4 string) (manifest.AppState, error) {
	fake.collectStateMutex.Lock()
	ret, specificReturn := fake.collectStateReturnsOnCall[len(fake.collectStateArgsForCall)]
	fake.collectStateArgsForCall = append(fake.collectStateArgsForCall, struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 string
		arg4 string
	}{arg1, arg2, arg3, arg4})
	stub := fake.CollectStateStub
	fakeReturns := fake.collectStateReturns
	fake.recordInvocation("CollectState", []interface{}{arg1, arg2, arg3, arg4})
	fake.collectStateMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3, arg4)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *StateCollector) CollectStateCallCount() int {
	fake.collectStateMutex.RLock()
	defer fake.collectStateMutex.RUnlock()
	return len(fake.collectStateArgsForCall)
}

func (fake *StateCollector) CollectStateCalls(stub func(context.Context, authorization.Info, string, string) (manifest.AppState, error)) {
	fake.collectStateMutex.Lock()
	defer fake.collectStateMutex.Unlock()
	fake.CollectStateStub = stub
}

func (fake *StateCollector) CollectStateArgsForCall(i int) (context.Context, authorization.Info, string, string) {
	fake.collectStateMutex.RLock()
	defer fake.collectStateMutex.RUnlock()
	argsForCall := fake.collectStateArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4
}

func (fake *StateCollector) CollectStateReturns(result1 manifest.AppState, result2 error) {
	fake.collectStateMutex.Lock()
	defer fake.collectStateMutex.Unlock()
	fake.CollectStateStub = nil
	fake.collectStateReturns = struct {
		result1 manifest.AppState
		result2 error
	}{result1, result2}
}

func (fake *StateCollector) CollectStateReturnsOnCall(i int, result1 manifest.AppState, result2 error) {
	fake.collectStateMutex.Lock()
	defer fake.collectStateMutex.Unlock()
	fake.CollectStateStub = nil
	if fake.collectStateReturnsOnCall == nil {
		fake.collectStateReturnsOnCall = make(map[int]struct {
			result1 manifest.AppState
			result2 error
		})
	}
	fake.collectStateReturnsOnCall[i] = struct {
		result1 manifest.AppState
		result2 error
	}{result1, result2}
}

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