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

package v1

import (
	"context"
	time "time"

	cloudnetworkv1 "github.com/openshift/api/cloudnetwork/v1"
	versioned "github.com/openshift/client-go/cloudnetwork/clientset/versioned"
	internalinterfaces "github.com/openshift/client-go/cloudnetwork/informers/externalversions/internalinterfaces"
	v1 "github.com/openshift/client-go/cloudnetwork/listers/cloudnetwork/v1"
	metav1 "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"
)

// CloudPrivateIPConfigInformer provides access to a shared informer and lister for
// CloudPrivateIPConfigs.
type CloudPrivateIPConfigInformer interface {
	Informer() cache.SharedIndexInformer
	Lister() v1.CloudPrivateIPConfigLister
}

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

// NewCloudPrivateIPConfigInformer constructs a new informer for CloudPrivateIPConfig 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 NewCloudPrivateIPConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
	return NewFilteredCloudPrivateIPConfigInformer(client, resyncPeriod, indexers, nil)
}

// NewFilteredCloudPrivateIPConfigInformer constructs a new informer for CloudPrivateIPConfig 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 NewFilteredCloudPrivateIPConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
	return cache.NewSharedIndexInformer(
		&cache.ListWatch{
			ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
				if tweakListOptions != nil {
					tweakListOptions(&options)
				}
				return client.CloudV1().CloudPrivateIPConfigs().List(context.TODO(), options)
			},
			WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
				if tweakListOptions != nil {
					tweakListOptions(&options)
				}
				return client.CloudV1().CloudPrivateIPConfigs().Watch(context.TODO(), options)
			},
		},
		&cloudnetworkv1.CloudPrivateIPConfig{},
		resyncPeriod,
		indexers,
	)
}

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

func (f *cloudPrivateIPConfigInformer) Informer() cache.SharedIndexInformer {
	return f.factory.InformerFor(&cloudnetworkv1.CloudPrivateIPConfig{}, f.defaultInformer)
}

func (f *cloudPrivateIPConfigInformer) Lister() v1.CloudPrivateIPConfigLister {
	return v1.NewCloudPrivateIPConfigLister(f.Informer().GetIndexer())
}
