// This file was automatically generated by informer-gen

package v1

import (
	ark_v1 "github.com/heptio/ark/pkg/apis/ark/v1"
	clientset "github.com/heptio/ark/pkg/generated/clientset"
	internalinterfaces "github.com/heptio/ark/pkg/generated/informers/externalversions/internalinterfaces"
	v1 "github.com/heptio/ark/pkg/generated/listers/ark/v1"
	meta_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"
	time "time"
)

// ScheduleInformer provides access to a shared informer and lister for
// Schedules.
type ScheduleInformer interface {
	Informer() cache.SharedIndexInformer
	Lister() v1.ScheduleLister
}

type scheduleInformer struct {
	factory internalinterfaces.SharedInformerFactory
}

func newScheduleInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
	sharedIndexInformer := cache.NewSharedIndexInformer(
		&cache.ListWatch{
			ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
				return client.ArkV1().Schedules(meta_v1.NamespaceAll).List(options)
			},
			WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
				return client.ArkV1().Schedules(meta_v1.NamespaceAll).Watch(options)
			},
		},
		&ark_v1.Schedule{},
		resyncPeriod,
		cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
	)

	return sharedIndexInformer
}

func (f *scheduleInformer) Informer() cache.SharedIndexInformer {
	return f.factory.InformerFor(&ark_v1.Schedule{}, newScheduleInformer)
}

func (f *scheduleInformer) Lister() v1.ScheduleLister {
	return v1.NewScheduleLister(f.Informer().GetIndexer())
}
