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

package v1alpha1

import (
	v1alpha1 "github.com/openshift/api/operatorcontrolplane/v1alpha1"
	"k8s.io/apimachinery/pkg/api/errors"
	"k8s.io/apimachinery/pkg/labels"
	"k8s.io/client-go/tools/cache"
)

// PodNetworkConnectivityCheckLister helps list PodNetworkConnectivityChecks.
// All objects returned here must be treated as read-only.
type PodNetworkConnectivityCheckLister interface {
	// List lists all PodNetworkConnectivityChecks in the indexer.
	// Objects returned here must be treated as read-only.
	List(selector labels.Selector) (ret []*v1alpha1.PodNetworkConnectivityCheck, err error)
	// PodNetworkConnectivityChecks returns an object that can list and get PodNetworkConnectivityChecks.
	PodNetworkConnectivityChecks(namespace string) PodNetworkConnectivityCheckNamespaceLister
	PodNetworkConnectivityCheckListerExpansion
}

// podNetworkConnectivityCheckLister implements the PodNetworkConnectivityCheckLister interface.
type podNetworkConnectivityCheckLister struct {
	indexer cache.Indexer
}

// NewPodNetworkConnectivityCheckLister returns a new PodNetworkConnectivityCheckLister.
func NewPodNetworkConnectivityCheckLister(indexer cache.Indexer) PodNetworkConnectivityCheckLister {
	return &podNetworkConnectivityCheckLister{indexer: indexer}
}

// List lists all PodNetworkConnectivityChecks in the indexer.
func (s *podNetworkConnectivityCheckLister) List(selector labels.Selector) (ret []*v1alpha1.PodNetworkConnectivityCheck, err error) {
	err = cache.ListAll(s.indexer, selector, func(m interface{}) {
		ret = append(ret, m.(*v1alpha1.PodNetworkConnectivityCheck))
	})
	return ret, err
}

// PodNetworkConnectivityChecks returns an object that can list and get PodNetworkConnectivityChecks.
func (s *podNetworkConnectivityCheckLister) PodNetworkConnectivityChecks(namespace string) PodNetworkConnectivityCheckNamespaceLister {
	return podNetworkConnectivityCheckNamespaceLister{indexer: s.indexer, namespace: namespace}
}

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

// podNetworkConnectivityCheckNamespaceLister implements the PodNetworkConnectivityCheckNamespaceLister
// interface.
type podNetworkConnectivityCheckNamespaceLister struct {
	indexer   cache.Indexer
	namespace string
}

// List lists all PodNetworkConnectivityChecks in the indexer for a given namespace.
func (s podNetworkConnectivityCheckNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.PodNetworkConnectivityCheck, err error) {
	err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
		ret = append(ret, m.(*v1alpha1.PodNetworkConnectivityCheck))
	})
	return ret, err
}

// Get retrieves the PodNetworkConnectivityCheck from the indexer for a given namespace and name.
func (s podNetworkConnectivityCheckNamespaceLister) Get(name string) (*v1alpha1.PodNetworkConnectivityCheck, error) {
	obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
	if err != nil {
		return nil, err
	}
	if !exists {
		return nil, errors.NewNotFound(v1alpha1.Resource("podnetworkconnectivitycheck"), name)
	}
	return obj.(*v1alpha1.PodNetworkConnectivityCheck), nil
}
