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

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

// eventBusLister implements the EventBusLister interface.
type eventBusLister struct {
	listers.ResourceIndexer[*eventsv1alpha1.EventBus]
}

// NewEventBusLister returns a new EventBusLister.
func NewEventBusLister(indexer cache.Indexer) EventBusLister {
	return &eventBusLister{listers.New[*eventsv1alpha1.EventBus](indexer, eventsv1alpha1.Resource("eventbus"))}
}

// EventBus returns an object that can list and get EventBus.
func (s *eventBusLister) EventBus(namespace string) EventBusNamespaceLister {
	return eventBusNamespaceLister{listers.NewNamespaced[*eventsv1alpha1.EventBus](s.ResourceIndexer, namespace)}
}

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

// eventBusNamespaceLister implements the EventBusNamespaceLister
// interface.
type eventBusNamespaceLister struct {
	listers.ResourceIndexer[*eventsv1alpha1.EventBus]
}
