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

package v1alpha2

import (
	v1alpha2 "istio.io/client-go/pkg/apis/config/v1alpha2"
	"k8s.io/apimachinery/pkg/api/errors"
	"k8s.io/apimachinery/pkg/labels"
	"k8s.io/client-go/tools/cache"
)

// HTTPAPISpecBindingLister helps list HTTPAPISpecBindings.
type HTTPAPISpecBindingLister interface {
	// List lists all HTTPAPISpecBindings in the indexer.
	List(selector labels.Selector) (ret []*v1alpha2.HTTPAPISpecBinding, err error)
	// HTTPAPISpecBindings returns an object that can list and get HTTPAPISpecBindings.
	HTTPAPISpecBindings(namespace string) HTTPAPISpecBindingNamespaceLister
	HTTPAPISpecBindingListerExpansion
}

// hTTPAPISpecBindingLister implements the HTTPAPISpecBindingLister interface.
type hTTPAPISpecBindingLister struct {
	indexer cache.Indexer
}

// NewHTTPAPISpecBindingLister returns a new HTTPAPISpecBindingLister.
func NewHTTPAPISpecBindingLister(indexer cache.Indexer) HTTPAPISpecBindingLister {
	return &hTTPAPISpecBindingLister{indexer: indexer}
}

// List lists all HTTPAPISpecBindings in the indexer.
func (s *hTTPAPISpecBindingLister) List(selector labels.Selector) (ret []*v1alpha2.HTTPAPISpecBinding, err error) {
	err = cache.ListAll(s.indexer, selector, func(m interface{}) {
		ret = append(ret, m.(*v1alpha2.HTTPAPISpecBinding))
	})
	return ret, err
}

// HTTPAPISpecBindings returns an object that can list and get HTTPAPISpecBindings.
func (s *hTTPAPISpecBindingLister) HTTPAPISpecBindings(namespace string) HTTPAPISpecBindingNamespaceLister {
	return hTTPAPISpecBindingNamespaceLister{indexer: s.indexer, namespace: namespace}
}

// HTTPAPISpecBindingNamespaceLister helps list and get HTTPAPISpecBindings.
type HTTPAPISpecBindingNamespaceLister interface {
	// List lists all HTTPAPISpecBindings in the indexer for a given namespace.
	List(selector labels.Selector) (ret []*v1alpha2.HTTPAPISpecBinding, err error)
	// Get retrieves the HTTPAPISpecBinding from the indexer for a given namespace and name.
	Get(name string) (*v1alpha2.HTTPAPISpecBinding, error)
	HTTPAPISpecBindingNamespaceListerExpansion
}

// hTTPAPISpecBindingNamespaceLister implements the HTTPAPISpecBindingNamespaceLister
// interface.
type hTTPAPISpecBindingNamespaceLister struct {
	indexer   cache.Indexer
	namespace string
}

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

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