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

import (
	"sync"

	"github.com/nginx/nginx-gateway-fabric/v2/internal/controller/state/dataplane"
	"github.com/nginx/nginx-gateway-fabric/v2/internal/controller/telemetry"
)

type FakeConfigurationGetter struct {
	GetLatestConfigurationStub        func() []*dataplane.Configuration
	getLatestConfigurationMutex       sync.RWMutex
	getLatestConfigurationArgsForCall []struct {
	}
	getLatestConfigurationReturns struct {
		result1 []*dataplane.Configuration
	}
	getLatestConfigurationReturnsOnCall map[int]struct {
		result1 []*dataplane.Configuration
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeConfigurationGetter) GetLatestConfiguration() []*dataplane.Configuration {
	fake.getLatestConfigurationMutex.Lock()
	ret, specificReturn := fake.getLatestConfigurationReturnsOnCall[len(fake.getLatestConfigurationArgsForCall)]
	fake.getLatestConfigurationArgsForCall = append(fake.getLatestConfigurationArgsForCall, struct {
	}{})
	stub := fake.GetLatestConfigurationStub
	fakeReturns := fake.getLatestConfigurationReturns
	fake.recordInvocation("GetLatestConfiguration", []interface{}{})
	fake.getLatestConfigurationMutex.Unlock()
	if stub != nil {
		return stub()
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeConfigurationGetter) GetLatestConfigurationCallCount() int {
	fake.getLatestConfigurationMutex.RLock()
	defer fake.getLatestConfigurationMutex.RUnlock()
	return len(fake.getLatestConfigurationArgsForCall)
}

func (fake *FakeConfigurationGetter) GetLatestConfigurationCalls(stub func() []*dataplane.Configuration) {
	fake.getLatestConfigurationMutex.Lock()
	defer fake.getLatestConfigurationMutex.Unlock()
	fake.GetLatestConfigurationStub = stub
}

func (fake *FakeConfigurationGetter) GetLatestConfigurationReturns(result1 []*dataplane.Configuration) {
	fake.getLatestConfigurationMutex.Lock()
	defer fake.getLatestConfigurationMutex.Unlock()
	fake.GetLatestConfigurationStub = nil
	fake.getLatestConfigurationReturns = struct {
		result1 []*dataplane.Configuration
	}{result1}
}

func (fake *FakeConfigurationGetter) GetLatestConfigurationReturnsOnCall(i int, result1 []*dataplane.Configuration) {
	fake.getLatestConfigurationMutex.Lock()
	defer fake.getLatestConfigurationMutex.Unlock()
	fake.GetLatestConfigurationStub = nil
	if fake.getLatestConfigurationReturnsOnCall == nil {
		fake.getLatestConfigurationReturnsOnCall = make(map[int]struct {
			result1 []*dataplane.Configuration
		})
	}
	fake.getLatestConfigurationReturnsOnCall[i] = struct {
		result1 []*dataplane.Configuration
	}{result1}
}

func (fake *FakeConfigurationGetter) 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 *FakeConfigurationGetter) 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 _ telemetry.ConfigurationGetter = new(FakeConfigurationGetter)
