// SPDX-License-Identifier: Apache-2.0
// Copyright Authors of Cilium

// Code generated by lister-gen. DO NOT EDIT.

package v2

import (
	ciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2"
	labels "k8s.io/apimachinery/pkg/labels"
	listers "k8s.io/client-go/listers"
	cache "k8s.io/client-go/tools/cache"
)

// CiliumEndpointLister helps list CiliumEndpoints.
// All objects returned here must be treated as read-only.
type CiliumEndpointLister interface {
	// List lists all CiliumEndpoints in the indexer.
	// Objects returned here must be treated as read-only.
	List(selector labels.Selector) (ret []*ciliumiov2.CiliumEndpoint, err error)
	// CiliumEndpoints returns an object that can list and get CiliumEndpoints.
	CiliumEndpoints(namespace string) CiliumEndpointNamespaceLister
	CiliumEndpointListerExpansion
}

// ciliumEndpointLister implements the CiliumEndpointLister interface.
type ciliumEndpointLister struct {
	listers.ResourceIndexer[*ciliumiov2.CiliumEndpoint]
}

// NewCiliumEndpointLister returns a new CiliumEndpointLister.
func NewCiliumEndpointLister(indexer cache.Indexer) CiliumEndpointLister {
	return &ciliumEndpointLister{listers.New[*ciliumiov2.CiliumEndpoint](indexer, ciliumiov2.Resource("ciliumendpoint"))}
}

// CiliumEndpoints returns an object that can list and get CiliumEndpoints.
func (s *ciliumEndpointLister) CiliumEndpoints(namespace string) CiliumEndpointNamespaceLister {
	return ciliumEndpointNamespaceLister{listers.NewNamespaced[*ciliumiov2.CiliumEndpoint](s.ResourceIndexer, namespace)}
}

// CiliumEndpointNamespaceLister helps list and get CiliumEndpoints.
// All objects returned here must be treated as read-only.
type CiliumEndpointNamespaceLister interface {
	// List lists all CiliumEndpoints in the indexer for a given namespace.
	// Objects returned here must be treated as read-only.
	List(selector labels.Selector) (ret []*ciliumiov2.CiliumEndpoint, err error)
	// Get retrieves the CiliumEndpoint from the indexer for a given namespace and name.
	// Objects returned here must be treated as read-only.
	Get(name string) (*ciliumiov2.CiliumEndpoint, error)
	CiliumEndpointNamespaceListerExpansion
}

// ciliumEndpointNamespaceLister implements the CiliumEndpointNamespaceLister
// interface.
type ciliumEndpointNamespaceLister struct {
	listers.ResourceIndexer[*ciliumiov2.CiliumEndpoint]
}
