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

import (
	"context"
	"sync"

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

type ProcessStats struct {
	FetchAppProcessesStatsStub        func(context.Context, authorization.Info, string) ([]actions.PodStatsRecord, error)
	fetchAppProcessesStatsMutex       sync.RWMutex
	fetchAppProcessesStatsArgsForCall []struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 string
	}
	fetchAppProcessesStatsReturns struct {
		result1 []actions.PodStatsRecord
		result2 error
	}
	fetchAppProcessesStatsReturnsOnCall map[int]struct {
		result1 []actions.PodStatsRecord
		result2 error
	}
	FetchStatsStub        func(context.Context, authorization.Info, string) ([]actions.PodStatsRecord, error)
	fetchStatsMutex       sync.RWMutex
	fetchStatsArgsForCall []struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 string
	}
	fetchStatsReturns struct {
		result1 []actions.PodStatsRecord
		result2 error
	}
	fetchStatsReturnsOnCall map[int]struct {
		result1 []actions.PodStatsRecord
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *ProcessStats) FetchAppProcessesStats(arg1 context.Context, arg2 authorization.Info, arg3 string) ([]actions.PodStatsRecord, error) {
	fake.fetchAppProcessesStatsMutex.Lock()
	ret, specificReturn := fake.fetchAppProcessesStatsReturnsOnCall[len(fake.fetchAppProcessesStatsArgsForCall)]
	fake.fetchAppProcessesStatsArgsForCall = append(fake.fetchAppProcessesStatsArgsForCall, struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 string
	}{arg1, arg2, arg3})
	stub := fake.FetchAppProcessesStatsStub
	fakeReturns := fake.fetchAppProcessesStatsReturns
	fake.recordInvocation("FetchAppProcessesStats", []interface{}{arg1, arg2, arg3})
	fake.fetchAppProcessesStatsMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *ProcessStats) FetchAppProcessesStatsCallCount() int {
	fake.fetchAppProcessesStatsMutex.RLock()
	defer fake.fetchAppProcessesStatsMutex.RUnlock()
	return len(fake.fetchAppProcessesStatsArgsForCall)
}

func (fake *ProcessStats) FetchAppProcessesStatsCalls(stub func(context.Context, authorization.Info, string) ([]actions.PodStatsRecord, error)) {
	fake.fetchAppProcessesStatsMutex.Lock()
	defer fake.fetchAppProcessesStatsMutex.Unlock()
	fake.FetchAppProcessesStatsStub = stub
}

func (fake *ProcessStats) FetchAppProcessesStatsArgsForCall(i int) (context.Context, authorization.Info, string) {
	fake.fetchAppProcessesStatsMutex.RLock()
	defer fake.fetchAppProcessesStatsMutex.RUnlock()
	argsForCall := fake.fetchAppProcessesStatsArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *ProcessStats) FetchAppProcessesStatsReturns(result1 []actions.PodStatsRecord, result2 error) {
	fake.fetchAppProcessesStatsMutex.Lock()
	defer fake.fetchAppProcessesStatsMutex.Unlock()
	fake.FetchAppProcessesStatsStub = nil
	fake.fetchAppProcessesStatsReturns = struct {
		result1 []actions.PodStatsRecord
		result2 error
	}{result1, result2}
}

func (fake *ProcessStats) FetchAppProcessesStatsReturnsOnCall(i int, result1 []actions.PodStatsRecord, result2 error) {
	fake.fetchAppProcessesStatsMutex.Lock()
	defer fake.fetchAppProcessesStatsMutex.Unlock()
	fake.FetchAppProcessesStatsStub = nil
	if fake.fetchAppProcessesStatsReturnsOnCall == nil {
		fake.fetchAppProcessesStatsReturnsOnCall = make(map[int]struct {
			result1 []actions.PodStatsRecord
			result2 error
		})
	}
	fake.fetchAppProcessesStatsReturnsOnCall[i] = struct {
		result1 []actions.PodStatsRecord
		result2 error
	}{result1, result2}
}

func (fake *ProcessStats) FetchStats(arg1 context.Context, arg2 authorization.Info, arg3 string) ([]actions.PodStatsRecord, error) {
	fake.fetchStatsMutex.Lock()
	ret, specificReturn := fake.fetchStatsReturnsOnCall[len(fake.fetchStatsArgsForCall)]
	fake.fetchStatsArgsForCall = append(fake.fetchStatsArgsForCall, struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 string
	}{arg1, arg2, arg3})
	stub := fake.FetchStatsStub
	fakeReturns := fake.fetchStatsReturns
	fake.recordInvocation("FetchStats", []interface{}{arg1, arg2, arg3})
	fake.fetchStatsMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *ProcessStats) FetchStatsCallCount() int {
	fake.fetchStatsMutex.RLock()
	defer fake.fetchStatsMutex.RUnlock()
	return len(fake.fetchStatsArgsForCall)
}

func (fake *ProcessStats) FetchStatsCalls(stub func(context.Context, authorization.Info, string) ([]actions.PodStatsRecord, error)) {
	fake.fetchStatsMutex.Lock()
	defer fake.fetchStatsMutex.Unlock()
	fake.FetchStatsStub = stub
}

func (fake *ProcessStats) FetchStatsArgsForCall(i int) (context.Context, authorization.Info, string) {
	fake.fetchStatsMutex.RLock()
	defer fake.fetchStatsMutex.RUnlock()
	argsForCall := fake.fetchStatsArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *ProcessStats) FetchStatsReturns(result1 []actions.PodStatsRecord, result2 error) {
	fake.fetchStatsMutex.Lock()
	defer fake.fetchStatsMutex.Unlock()
	fake.FetchStatsStub = nil
	fake.fetchStatsReturns = struct {
		result1 []actions.PodStatsRecord
		result2 error
	}{result1, result2}
}

func (fake *ProcessStats) FetchStatsReturnsOnCall(i int, result1 []actions.PodStatsRecord, result2 error) {
	fake.fetchStatsMutex.Lock()
	defer fake.fetchStatsMutex.Unlock()
	fake.FetchStatsStub = nil
	if fake.fetchStatsReturnsOnCall == nil {
		fake.fetchStatsReturnsOnCall = make(map[int]struct {
			result1 []actions.PodStatsRecord
			result2 error
		})
	}
	fake.fetchStatsReturnsOnCall[i] = struct {
		result1 []actions.PodStatsRecord
		result2 error
	}{result1, result2}
}

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