// 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"
)

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

// ciliumNetworkPolicyLister implements the CiliumNetworkPolicyLister interface.
type ciliumNetworkPolicyLister struct {
	listers.ResourceIndexer[*ciliumiov2.CiliumNetworkPolicy]
}

// NewCiliumNetworkPolicyLister returns a new CiliumNetworkPolicyLister.
func NewCiliumNetworkPolicyLister(indexer cache.Indexer) CiliumNetworkPolicyLister {
	return &ciliumNetworkPolicyLister{listers.New[*ciliumiov2.CiliumNetworkPolicy](indexer, ciliumiov2.Resource("ciliumnetworkpolicy"))}
}

// CiliumNetworkPolicies returns an object that can list and get CiliumNetworkPolicies.
func (s *ciliumNetworkPolicyLister) CiliumNetworkPolicies(namespace string) CiliumNetworkPolicyNamespaceLister {
	return ciliumNetworkPolicyNamespaceLister{listers.NewNamespaced[*ciliumiov2.CiliumNetworkPolicy](s.ResourceIndexer, namespace)}
}

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

// ciliumNetworkPolicyNamespaceLister implements the CiliumNetworkPolicyNamespaceLister
// interface.
type ciliumNetworkPolicyNamespaceLister struct {
	listers.ResourceIndexer[*ciliumiov2.CiliumNetworkPolicy]
}
