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

import (
	"sync"

	"github.com/nginx/nginx-gateway-fabric/v2/internal/controller/provisioner/openshift"
	"k8s.io/client-go/rest"
)

type FakeAPIChecker struct {
	IsOpenshiftStub        func(*rest.Config) (bool, error)
	isOpenshiftMutex       sync.RWMutex
	isOpenshiftArgsForCall []struct {
		arg1 *rest.Config
	}
	isOpenshiftReturns struct {
		result1 bool
		result2 error
	}
	isOpenshiftReturnsOnCall map[int]struct {
		result1 bool
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeAPIChecker) IsOpenshift(arg1 *rest.Config) (bool, error) {
	fake.isOpenshiftMutex.Lock()
	ret, specificReturn := fake.isOpenshiftReturnsOnCall[len(fake.isOpenshiftArgsForCall)]
	fake.isOpenshiftArgsForCall = append(fake.isOpenshiftArgsForCall, struct {
		arg1 *rest.Config
	}{arg1})
	stub := fake.IsOpenshiftStub
	fakeReturns := fake.isOpenshiftReturns
	fake.recordInvocation("IsOpenshift", []interface{}{arg1})
	fake.isOpenshiftMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeAPIChecker) IsOpenshiftCallCount() int {
	fake.isOpenshiftMutex.RLock()
	defer fake.isOpenshiftMutex.RUnlock()
	return len(fake.isOpenshiftArgsForCall)
}

func (fake *FakeAPIChecker) IsOpenshiftCalls(stub func(*rest.Config) (bool, error)) {
	fake.isOpenshiftMutex.Lock()
	defer fake.isOpenshiftMutex.Unlock()
	fake.IsOpenshiftStub = stub
}

func (fake *FakeAPIChecker) IsOpenshiftArgsForCall(i int) *rest.Config {
	fake.isOpenshiftMutex.RLock()
	defer fake.isOpenshiftMutex.RUnlock()
	argsForCall := fake.isOpenshiftArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeAPIChecker) IsOpenshiftReturns(result1 bool, result2 error) {
	fake.isOpenshiftMutex.Lock()
	defer fake.isOpenshiftMutex.Unlock()
	fake.IsOpenshiftStub = nil
	fake.isOpenshiftReturns = struct {
		result1 bool
		result2 error
	}{result1, result2}
}

func (fake *FakeAPIChecker) IsOpenshiftReturnsOnCall(i int, result1 bool, result2 error) {
	fake.isOpenshiftMutex.Lock()
	defer fake.isOpenshiftMutex.Unlock()
	fake.IsOpenshiftStub = nil
	if fake.isOpenshiftReturnsOnCall == nil {
		fake.isOpenshiftReturnsOnCall = make(map[int]struct {
			result1 bool
			result2 error
		})
	}
	fake.isOpenshiftReturnsOnCall[i] = struct {
		result1 bool
		result2 error
	}{result1, result2}
}

func (fake *FakeAPIChecker) 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 *FakeAPIChecker) 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 _ openshift.APIChecker = new(FakeAPIChecker)
