/*
Copyright The Karmada 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 (
	v1alpha1 "github.com/karmada-io/karmada/pkg/apis/policy/v1alpha1"
	"k8s.io/apimachinery/pkg/labels"
	"k8s.io/client-go/listers"
	"k8s.io/client-go/tools/cache"
)

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

// overridePolicyLister implements the OverridePolicyLister interface.
type overridePolicyLister struct {
	listers.ResourceIndexer[*v1alpha1.OverridePolicy]
}

// NewOverridePolicyLister returns a new OverridePolicyLister.
func NewOverridePolicyLister(indexer cache.Indexer) OverridePolicyLister {
	return &overridePolicyLister{listers.New[*v1alpha1.OverridePolicy](indexer, v1alpha1.Resource("overridepolicy"))}
}

// OverridePolicies returns an object that can list and get OverridePolicies.
func (s *overridePolicyLister) OverridePolicies(namespace string) OverridePolicyNamespaceLister {
	return overridePolicyNamespaceLister{listers.NewNamespaced[*v1alpha1.OverridePolicy](s.ResourceIndexer, namespace)}
}

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

// overridePolicyNamespaceLister implements the OverridePolicyNamespaceLister
// interface.
type overridePolicyNamespaceLister struct {
	listers.ResourceIndexer[*v1alpha1.OverridePolicy]
}
