/*
Copyright 2020 The Knative 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 (
	labels "k8s.io/apimachinery/pkg/labels"
	listers "k8s.io/client-go/listers"
	cache "k8s.io/client-go/tools/cache"
	networkingv1alpha1 "knative.dev/networking/pkg/apis/networking/v1alpha1"
)

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

// serverlessServiceLister implements the ServerlessServiceLister interface.
type serverlessServiceLister struct {
	listers.ResourceIndexer[*networkingv1alpha1.ServerlessService]
}

// NewServerlessServiceLister returns a new ServerlessServiceLister.
func NewServerlessServiceLister(indexer cache.Indexer) ServerlessServiceLister {
	return &serverlessServiceLister{listers.New[*networkingv1alpha1.ServerlessService](indexer, networkingv1alpha1.Resource("serverlessservice"))}
}

// ServerlessServices returns an object that can list and get ServerlessServices.
func (s *serverlessServiceLister) ServerlessServices(namespace string) ServerlessServiceNamespaceLister {
	return serverlessServiceNamespaceLister{listers.NewNamespaced[*networkingv1alpha1.ServerlessService](s.ResourceIndexer, namespace)}
}

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

// serverlessServiceNamespaceLister implements the ServerlessServiceNamespaceLister
// interface.
type serverlessServiceNamespaceLister struct {
	listers.ResourceIndexer[*networkingv1alpha1.ServerlessService]
}
