// Copyright 2025 Microsoft Corporation
//
// 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"

	sessiongatev1alpha1 "github.com/Azure/ARO-HCP/sessiongate/pkg/apis/sessiongate/v1alpha1"
)

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

// sessionLister implements the SessionLister interface.
type sessionLister struct {
	listers.ResourceIndexer[*sessiongatev1alpha1.Session]
}

// NewSessionLister returns a new SessionLister.
func NewSessionLister(indexer cache.Indexer) SessionLister {
	return &sessionLister{listers.New[*sessiongatev1alpha1.Session](indexer, sessiongatev1alpha1.Resource("session"))}
}

// Sessions returns an object that can list and get Sessions.
func (s *sessionLister) Sessions(namespace string) SessionNamespaceLister {
	return sessionNamespaceLister{listers.NewNamespaced[*sessiongatev1alpha1.Session](s.ResourceIndexer, namespace)}
}

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

// sessionNamespaceLister implements the SessionNamespaceLister
// interface.
type sessionNamespaceLister struct {
	listers.ResourceIndexer[*sessiongatev1alpha1.Session]
}
