/*
Copyright 2021 The Argoproj Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

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

package v1alpha1

import (
	eventsv1alpha1 "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1"
	labels "k8s.io/apimachinery/pkg/labels"
	listers "k8s.io/client-go/listers"
	cache "k8s.io/client-go/tools/cache"
)

// EventSourceLister helps list EventSources.
// All objects returned here must be treated as read-only.
type EventSourceLister interface {
	// List lists all EventSources in the indexer.
	// Objects returned here must be treated as read-only.
	List(selector labels.Selector) (ret []*eventsv1alpha1.EventSource, err error)
	// EventSources returns an object that can list and get EventSources.
	EventSources(namespace string) EventSourceNamespaceLister
	EventSourceListerExpansion
}

// eventSourceLister implements the EventSourceLister interface.
type eventSourceLister struct {
	listers.ResourceIndexer[*eventsv1alpha1.EventSource]
}

// NewEventSourceLister returns a new EventSourceLister.
func NewEventSourceLister(indexer cache.Indexer) EventSourceLister {
	return &eventSourceLister{listers.New[*eventsv1alpha1.EventSource](indexer, eventsv1alpha1.Resource("eventsource"))}
}

// EventSources returns an object that can list and get EventSources.
func (s *eventSourceLister) EventSources(namespace string) EventSourceNamespaceLister {
	return eventSourceNamespaceLister{listers.NewNamespaced[*eventsv1alpha1.EventSource](s.ResourceIndexer, namespace)}
}

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

// eventSourceNamespaceLister implements the EventSourceNamespaceLister
// interface.
type eventSourceNamespaceLister struct {
	listers.ResourceIndexer[*eventsv1alpha1.EventSource]
}
