// Code generated by mockery v2.52.4. DO NOT EDIT.

package mocks

import (
	context "context"

	cache "github.com/argoproj/gitops-engine/pkg/cache"

	controllercache "github.com/argoproj/argo-cd/v3/controller/cache"

	kube "github.com/argoproj/gitops-engine/pkg/utils/kube"

	mock "github.com/stretchr/testify/mock"

	schema "k8s.io/apimachinery/pkg/runtime/schema"

	unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"

	v1alpha1 "github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1"
)

// LiveStateCache is an autogenerated mock type for the LiveStateCache type
type LiveStateCache struct {
	mock.Mock
}

// GetClusterCache provides a mock function with given fields: server
func (_m *LiveStateCache) GetClusterCache(server *v1alpha1.Cluster) (cache.ClusterCache, error) {
	ret := _m.Called(server)

	if len(ret) == 0 {
		panic("no return value specified for GetClusterCache")
	}

	var r0 cache.ClusterCache
	var r1 error
	if rf, ok := ret.Get(0).(func(*v1alpha1.Cluster) (cache.ClusterCache, error)); ok {
		return rf(server)
	}
	if rf, ok := ret.Get(0).(func(*v1alpha1.Cluster) cache.ClusterCache); ok {
		r0 = rf(server)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(cache.ClusterCache)
		}
	}

	if rf, ok := ret.Get(1).(func(*v1alpha1.Cluster) error); ok {
		r1 = rf(server)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// GetClustersInfo provides a mock function with no fields
func (_m *LiveStateCache) GetClustersInfo() []cache.ClusterInfo {
	ret := _m.Called()

	if len(ret) == 0 {
		panic("no return value specified for GetClustersInfo")
	}

	var r0 []cache.ClusterInfo
	if rf, ok := ret.Get(0).(func() []cache.ClusterInfo); ok {
		r0 = rf()
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([]cache.ClusterInfo)
		}
	}

	return r0
}

// GetManagedLiveObjs provides a mock function with given fields: destCluster, a, targetObjs
func (_m *LiveStateCache) GetManagedLiveObjs(destCluster *v1alpha1.Cluster, a *v1alpha1.Application, targetObjs []*unstructured.Unstructured) (map[kube.ResourceKey]*unstructured.Unstructured, error) {
	ret := _m.Called(destCluster, a, targetObjs)

	if len(ret) == 0 {
		panic("no return value specified for GetManagedLiveObjs")
	}

	var r0 map[kube.ResourceKey]*unstructured.Unstructured
	var r1 error
	if rf, ok := ret.Get(0).(func(*v1alpha1.Cluster, *v1alpha1.Application, []*unstructured.Unstructured) (map[kube.ResourceKey]*unstructured.Unstructured, error)); ok {
		return rf(destCluster, a, targetObjs)
	}
	if rf, ok := ret.Get(0).(func(*v1alpha1.Cluster, *v1alpha1.Application, []*unstructured.Unstructured) map[kube.ResourceKey]*unstructured.Unstructured); ok {
		r0 = rf(destCluster, a, targetObjs)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(map[kube.ResourceKey]*unstructured.Unstructured)
		}
	}

	if rf, ok := ret.Get(1).(func(*v1alpha1.Cluster, *v1alpha1.Application, []*unstructured.Unstructured) error); ok {
		r1 = rf(destCluster, a, targetObjs)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// GetNamespaceTopLevelResources provides a mock function with given fields: server, namespace
func (_m *LiveStateCache) GetNamespaceTopLevelResources(server *v1alpha1.Cluster, namespace string) (map[kube.ResourceKey]v1alpha1.ResourceNode, error) {
	ret := _m.Called(server, namespace)

	if len(ret) == 0 {
		panic("no return value specified for GetNamespaceTopLevelResources")
	}

	var r0 map[kube.ResourceKey]v1alpha1.ResourceNode
	var r1 error
	if rf, ok := ret.Get(0).(func(*v1alpha1.Cluster, string) (map[kube.ResourceKey]v1alpha1.ResourceNode, error)); ok {
		return rf(server, namespace)
	}
	if rf, ok := ret.Get(0).(func(*v1alpha1.Cluster, string) map[kube.ResourceKey]v1alpha1.ResourceNode); ok {
		r0 = rf(server, namespace)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(map[kube.ResourceKey]v1alpha1.ResourceNode)
		}
	}

	if rf, ok := ret.Get(1).(func(*v1alpha1.Cluster, string) error); ok {
		r1 = rf(server, namespace)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// GetVersionsInfo provides a mock function with given fields: server
func (_m *LiveStateCache) GetVersionsInfo(server *v1alpha1.Cluster) (string, []kube.APIResourceInfo, error) {
	ret := _m.Called(server)

	if len(ret) == 0 {
		panic("no return value specified for GetVersionsInfo")
	}

	var r0 string
	var r1 []kube.APIResourceInfo
	var r2 error
	if rf, ok := ret.Get(0).(func(*v1alpha1.Cluster) (string, []kube.APIResourceInfo, error)); ok {
		return rf(server)
	}
	if rf, ok := ret.Get(0).(func(*v1alpha1.Cluster) string); ok {
		r0 = rf(server)
	} else {
		r0 = ret.Get(0).(string)
	}

	if rf, ok := ret.Get(1).(func(*v1alpha1.Cluster) []kube.APIResourceInfo); ok {
		r1 = rf(server)
	} else {
		if ret.Get(1) != nil {
			r1 = ret.Get(1).([]kube.APIResourceInfo)
		}
	}

	if rf, ok := ret.Get(2).(func(*v1alpha1.Cluster) error); ok {
		r2 = rf(server)
	} else {
		r2 = ret.Error(2)
	}

	return r0, r1, r2
}

// Init provides a mock function with no fields
func (_m *LiveStateCache) Init() error {
	ret := _m.Called()

	if len(ret) == 0 {
		panic("no return value specified for Init")
	}

	var r0 error
	if rf, ok := ret.Get(0).(func() error); ok {
		r0 = rf()
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// IsNamespaced provides a mock function with given fields: server, gk
func (_m *LiveStateCache) IsNamespaced(server *v1alpha1.Cluster, gk schema.GroupKind) (bool, error) {
	ret := _m.Called(server, gk)

	if len(ret) == 0 {
		panic("no return value specified for IsNamespaced")
	}

	var r0 bool
	var r1 error
	if rf, ok := ret.Get(0).(func(*v1alpha1.Cluster, schema.GroupKind) (bool, error)); ok {
		return rf(server, gk)
	}
	if rf, ok := ret.Get(0).(func(*v1alpha1.Cluster, schema.GroupKind) bool); ok {
		r0 = rf(server, gk)
	} else {
		r0 = ret.Get(0).(bool)
	}

	if rf, ok := ret.Get(1).(func(*v1alpha1.Cluster, schema.GroupKind) error); ok {
		r1 = rf(server, gk)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// IterateHierarchy provides a mock function with given fields: server, key, action
func (_m *LiveStateCache) IterateHierarchy(server *v1alpha1.Cluster, key kube.ResourceKey, action func(v1alpha1.ResourceNode, string) bool) error {
	ret := _m.Called(server, key, action)

	if len(ret) == 0 {
		panic("no return value specified for IterateHierarchy")
	}

	var r0 error
	if rf, ok := ret.Get(0).(func(*v1alpha1.Cluster, kube.ResourceKey, func(v1alpha1.ResourceNode, string) bool) error); ok {
		r0 = rf(server, key, action)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// IterateHierarchyV2 provides a mock function with given fields: server, keys, action
func (_m *LiveStateCache) IterateHierarchyV2(server *v1alpha1.Cluster, keys []kube.ResourceKey, action func(v1alpha1.ResourceNode, string) bool) error {
	ret := _m.Called(server, keys, action)

	if len(ret) == 0 {
		panic("no return value specified for IterateHierarchyV2")
	}

	var r0 error
	if rf, ok := ret.Get(0).(func(*v1alpha1.Cluster, []kube.ResourceKey, func(v1alpha1.ResourceNode, string) bool) error); ok {
		r0 = rf(server, keys, action)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// IterateResources provides a mock function with given fields: server, callback
func (_m *LiveStateCache) IterateResources(server *v1alpha1.Cluster, callback func(*cache.Resource, *controllercache.ResourceInfo)) error {
	ret := _m.Called(server, callback)

	if len(ret) == 0 {
		panic("no return value specified for IterateResources")
	}

	var r0 error
	if rf, ok := ret.Get(0).(func(*v1alpha1.Cluster, func(*cache.Resource, *controllercache.ResourceInfo)) error); ok {
		r0 = rf(server, callback)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// Run provides a mock function with given fields: ctx
func (_m *LiveStateCache) Run(ctx context.Context) error {
	ret := _m.Called(ctx)

	if len(ret) == 0 {
		panic("no return value specified for Run")
	}

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context) error); ok {
		r0 = rf(ctx)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// UpdateShard provides a mock function with given fields: shard
func (_m *LiveStateCache) UpdateShard(shard int) bool {
	ret := _m.Called(shard)

	if len(ret) == 0 {
		panic("no return value specified for UpdateShard")
	}

	var r0 bool
	if rf, ok := ret.Get(0).(func(int) bool); ok {
		r0 = rf(shard)
	} else {
		r0 = ret.Get(0).(bool)
	}

	return r0
}

// NewLiveStateCache creates a new instance of LiveStateCache. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewLiveStateCache(t interface {
	mock.TestingT
	Cleanup(func())
}) *LiveStateCache {
	mock := &LiveStateCache{}
	mock.Mock.Test(t)

	t.Cleanup(func() { mock.AssertExpectations(t) })

	return mock
}
