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

package v1alpha1

import (
	time "time"

	webconsole_v1alpha1 "github.com/openshift/origin/pkg/cmd/openshift-operators/apis/webconsole/v1alpha1"
	versioned "github.com/openshift/origin/pkg/cmd/openshift-operators/generated/clientset/versioned"
	internalinterfaces "github.com/openshift/origin/pkg/cmd/openshift-operators/generated/informers/externalversions/internalinterfaces"
	v1alpha1 "github.com/openshift/origin/pkg/cmd/openshift-operators/generated/listers/webconsole/v1alpha1"
	v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	runtime "k8s.io/apimachinery/pkg/runtime"
	watch "k8s.io/apimachinery/pkg/watch"
	cache "k8s.io/client-go/tools/cache"
)

// OpenShiftWebConsoleConfigInformer provides access to a shared informer and lister for
// OpenShiftWebConsoleConfigs.
type OpenShiftWebConsoleConfigInformer interface {
	Informer() cache.SharedIndexInformer
	Lister() v1alpha1.OpenShiftWebConsoleConfigLister
}

type openShiftWebConsoleConfigInformer struct {
	factory          internalinterfaces.SharedInformerFactory
	tweakListOptions internalinterfaces.TweakListOptionsFunc
}

// NewOpenShiftWebConsoleConfigInformer constructs a new informer for OpenShiftWebConsoleConfig type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewOpenShiftWebConsoleConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
	return NewFilteredOpenShiftWebConsoleConfigInformer(client, resyncPeriod, indexers, nil)
}

// NewFilteredOpenShiftWebConsoleConfigInformer constructs a new informer for OpenShiftWebConsoleConfig type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewFilteredOpenShiftWebConsoleConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
	return cache.NewSharedIndexInformer(
		&cache.ListWatch{
			ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
				if tweakListOptions != nil {
					tweakListOptions(&options)
				}
				return client.WebconsoleV1alpha1().OpenShiftWebConsoleConfigs().List(options)
			},
			WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
				if tweakListOptions != nil {
					tweakListOptions(&options)
				}
				return client.WebconsoleV1alpha1().OpenShiftWebConsoleConfigs().Watch(options)
			},
		},
		&webconsole_v1alpha1.OpenShiftWebConsoleConfig{},
		resyncPeriod,
		indexers,
	)
}

func (f *openShiftWebConsoleConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
	return NewFilteredOpenShiftWebConsoleConfigInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}

func (f *openShiftWebConsoleConfigInformer) Informer() cache.SharedIndexInformer {
	return f.factory.InformerFor(&webconsole_v1alpha1.OpenShiftWebConsoleConfig{}, f.defaultInformer)
}

func (f *openShiftWebConsoleConfigInformer) Lister() v1alpha1.OpenShiftWebConsoleConfigLister {
	return v1alpha1.NewOpenShiftWebConsoleConfigLister(f.Informer().GetIndexer())
}
