diff --git a/go.mod b/go.mod index fc27f3a6..836c5b35 100644 --- a/go.mod +++ b/go.mod @@ -18,6 +18,6 @@ require ( k8s.io/client-go v0.20.7 k8s.io/code-generator v0.20.7 k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd - knative.dev/hack v0.0.0-20210622141627-e28525d8d260 - knative.dev/pkg v0.0.0-20210803160015-21eb4c167cc5 + knative.dev/hack v0.0.0-20210806075220-815cd312d65c + knative.dev/pkg v0.0.0-20210818135208-7b5ecbc0e477 ) diff --git a/go.sum b/go.sum index c71f0d8d..27c4b53b 100644 --- a/go.sum +++ b/go.sum @@ -1060,10 +1060,11 @@ k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd h1:sOHNzJIkytDF6qadMNKhhD k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= k8s.io/utils v0.0.0-20201110183641-67b214c5f920 h1:CbnUZsM497iRC5QMVkHwyl8s2tB3g7yaSHkYPkpgelw= k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -knative.dev/hack v0.0.0-20210622141627-e28525d8d260 h1:f2eMtOubAOc/Q7JlvFPDKXiPlJVK+VpX2Cot8hRzCgQ= knative.dev/hack v0.0.0-20210622141627-e28525d8d260/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI= -knative.dev/pkg v0.0.0-20210803160015-21eb4c167cc5 h1:jpOTmAXg1oLS8u5HPBrFP1XsOSFCQIvlTRxP8TDGg2E= -knative.dev/pkg v0.0.0-20210803160015-21eb4c167cc5/go.mod h1:RPk5txNA3apR9X40D4MpUOP9/VqOG8CrtABWfOwGVS4= +knative.dev/hack v0.0.0-20210806075220-815cd312d65c h1:nOXoDWAAItwr4o0dp3nHr6skgpVD4IvME/UX84YNl5k= +knative.dev/hack v0.0.0-20210806075220-815cd312d65c/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI= +knative.dev/pkg v0.0.0-20210818135208-7b5ecbc0e477 h1:oHKwxMz8dV5pKXTAUOMbmZA0kgLkXKR11ISysegU/L8= +knative.dev/pkg v0.0.0-20210818135208-7b5ecbc0e477/go.mod h1:RPk5txNA3apR9X40D4MpUOP9/VqOG8CrtABWfOwGVS4= pgregory.net/rapid v0.3.3/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= diff --git a/pkg/client/injection/client/client.go b/pkg/client/injection/client/client.go index 2c36f4d3..ee1bc87d 100644 --- a/pkg/client/injection/client/client.go +++ b/pkg/client/injection/client/client.go @@ -20,27 +20,46 @@ package client import ( context "context" + json "encoding/json" + errors "errors" + fmt "fmt" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + discovery "k8s.io/client-go/discovery" + dynamic "k8s.io/client-go/dynamic" rest "k8s.io/client-go/rest" + v1alpha1 "knative.dev/caching/pkg/apis/caching/v1alpha1" versioned "knative.dev/caching/pkg/client/clientset/versioned" + typedcachingv1alpha1 "knative.dev/caching/pkg/client/clientset/versioned/typed/caching/v1alpha1" injection "knative.dev/pkg/injection" + dynamicclient "knative.dev/pkg/injection/clients/dynamicclient" logging "knative.dev/pkg/logging" ) func init() { - injection.Default.RegisterClient(withClient) + injection.Default.RegisterClient(withClientFromConfig) injection.Default.RegisterClientFetcher(func(ctx context.Context) interface{} { return Get(ctx) }) + injection.Dynamic.RegisterDynamicClient(withClientFromDynamic) } // Key is used as the key for associating information with a context.Context. type Key struct{} -func withClient(ctx context.Context, cfg *rest.Config) context.Context { +func withClientFromConfig(ctx context.Context, cfg *rest.Config) context.Context { return context.WithValue(ctx, Key{}, versioned.NewForConfigOrDie(cfg)) } +func withClientFromDynamic(ctx context.Context) context.Context { + return context.WithValue(ctx, Key{}, &wrapClient{dyn: dynamicclient.Get(ctx)}) +} + // Get extracts the versioned.Interface client from the context. func Get(ctx context.Context) versioned.Interface { untyped := ctx.Value(Key{}) @@ -55,3 +74,170 @@ func Get(ctx context.Context) versioned.Interface { } return untyped.(versioned.Interface) } + +type wrapClient struct { + dyn dynamic.Interface +} + +var _ versioned.Interface = (*wrapClient)(nil) + +func (w *wrapClient) Discovery() discovery.DiscoveryInterface { + panic("Discovery called on dynamic client!") +} + +func convert(from interface{}, to runtime.Object) error { + bs, err := json.Marshal(from) + if err != nil { + return fmt.Errorf("Marshal() = %w", err) + } + if err := json.Unmarshal(bs, to); err != nil { + return fmt.Errorf("Unmarshal() = %w", err) + } + return nil +} + +// CachingV1alpha1 retrieves the CachingV1alpha1Client +func (w *wrapClient) CachingV1alpha1() typedcachingv1alpha1.CachingV1alpha1Interface { + return &wrapCachingV1alpha1{ + dyn: w.dyn, + } +} + +type wrapCachingV1alpha1 struct { + dyn dynamic.Interface +} + +func (w *wrapCachingV1alpha1) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapCachingV1alpha1) Images(namespace string) typedcachingv1alpha1.ImageInterface { + return &wrapCachingV1alpha1ImageImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "caching.internal.knative.dev", + Version: "v1alpha1", + Resource: "images", + }), + + namespace: namespace, + } +} + +type wrapCachingV1alpha1ImageImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedcachingv1alpha1.ImageInterface = (*wrapCachingV1alpha1ImageImpl)(nil) + +func (w *wrapCachingV1alpha1ImageImpl) Create(ctx context.Context, in *v1alpha1.Image, opts v1.CreateOptions) (*v1alpha1.Image, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "caching.internal.knative.dev", + Version: "v1alpha1", + Kind: "Image", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &v1alpha1.Image{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCachingV1alpha1ImageImpl) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapCachingV1alpha1ImageImpl) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapCachingV1alpha1ImageImpl) Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.Image, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &v1alpha1.Image{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCachingV1alpha1ImageImpl) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ImageList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &v1alpha1.ImageList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCachingV1alpha1ImageImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Image, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &v1alpha1.Image{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCachingV1alpha1ImageImpl) Update(ctx context.Context, in *v1alpha1.Image, opts v1.UpdateOptions) (*v1alpha1.Image, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "caching.internal.knative.dev", + Version: "v1alpha1", + Kind: "Image", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &v1alpha1.Image{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCachingV1alpha1ImageImpl) UpdateStatus(ctx context.Context, in *v1alpha1.Image, opts v1.UpdateOptions) (*v1alpha1.Image, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "caching.internal.knative.dev", + Version: "v1alpha1", + Kind: "Image", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &v1alpha1.Image{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCachingV1alpha1ImageImpl) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} diff --git a/pkg/client/injection/informers/caching/v1alpha1/image/filtered/image.go b/pkg/client/injection/informers/caching/v1alpha1/image/filtered/image.go index 5c247816..a3717095 100644 --- a/pkg/client/injection/informers/caching/v1alpha1/image/filtered/image.go +++ b/pkg/client/injection/informers/caching/v1alpha1/image/filtered/image.go @@ -21,8 +21,15 @@ package filtered import ( context "context" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + cache "k8s.io/client-go/tools/cache" + apiscachingv1alpha1 "knative.dev/caching/pkg/apis/caching/v1alpha1" + versioned "knative.dev/caching/pkg/client/clientset/versioned" v1alpha1 "knative.dev/caching/pkg/client/informers/externalversions/caching/v1alpha1" + client "knative.dev/caching/pkg/client/injection/client" filtered "knative.dev/caching/pkg/client/injection/informers/factory/filtered" + cachingv1alpha1 "knative.dev/caching/pkg/client/listers/caching/v1alpha1" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" logging "knative.dev/pkg/logging" @@ -30,6 +37,7 @@ import ( func init() { injection.Default.RegisterFilteredInformers(withInformer) + injection.Dynamic.RegisterDynamicInformer(withDynamicInformer) } // Key is used for associating the Informer inside the context.Context. @@ -54,6 +62,20 @@ func withInformer(ctx context.Context) (context.Context, []controller.Informer) return ctx, infs } +func withDynamicInformer(ctx context.Context) context.Context { + untyped := ctx.Value(filtered.LabelKey{}) + if untyped == nil { + logging.FromContext(ctx).Panic( + "Unable to fetch labelkey from context.") + } + labelSelectors := untyped.([]string) + for _, selector := range labelSelectors { + inf := &wrapper{client: client.Get(ctx), selector: selector} + ctx = context.WithValue(ctx, Key{Selector: selector}, inf) + } + return ctx +} + // Get extracts the typed informer from the context. func Get(ctx context.Context, selector string) v1alpha1.ImageInformer { untyped := ctx.Value(Key{Selector: selector}) @@ -63,3 +85,52 @@ func Get(ctx context.Context, selector string) v1alpha1.ImageInformer { } return untyped.(v1alpha1.ImageInformer) } + +type wrapper struct { + client versioned.Interface + + namespace string + + selector string +} + +var _ v1alpha1.ImageInformer = (*wrapper)(nil) +var _ cachingv1alpha1.ImageLister = (*wrapper)(nil) + +func (w *wrapper) Informer() cache.SharedIndexInformer { + return cache.NewSharedIndexInformer(nil, &apiscachingv1alpha1.Image{}, 0, nil) +} + +func (w *wrapper) Lister() cachingv1alpha1.ImageLister { + return w +} + +func (w *wrapper) Images(namespace string) cachingv1alpha1.ImageNamespaceLister { + return &wrapper{client: w.client, namespace: namespace, selector: w.selector} +} + +func (w *wrapper) List(selector labels.Selector) (ret []*apiscachingv1alpha1.Image, err error) { + reqs, err := labels.ParseToRequirements(w.selector) + if err != nil { + return nil, err + } + selector = selector.Add(reqs...) + lo, err := w.client.CachingV1alpha1().Images(w.namespace).List(context.TODO(), v1.ListOptions{ + LabelSelector: selector.String(), + // TODO(mattmoor): Incorporate resourceVersion bounds based on staleness criteria. + }) + if err != nil { + return nil, err + } + for idx := range lo.Items { + ret = append(ret, &lo.Items[idx]) + } + return ret, nil +} + +func (w *wrapper) Get(name string) (*apiscachingv1alpha1.Image, error) { + // TODO(mattmoor): Check that the fetched object matches the selector. + return w.client.CachingV1alpha1().Images(w.namespace).Get(context.TODO(), name, v1.GetOptions{ + // TODO(mattmoor): Incorporate resourceVersion bounds based on staleness criteria. + }) +} diff --git a/pkg/client/injection/informers/caching/v1alpha1/image/image.go b/pkg/client/injection/informers/caching/v1alpha1/image/image.go index a1bc38a4..4b143b1f 100644 --- a/pkg/client/injection/informers/caching/v1alpha1/image/image.go +++ b/pkg/client/injection/informers/caching/v1alpha1/image/image.go @@ -21,8 +21,15 @@ package image import ( context "context" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + cache "k8s.io/client-go/tools/cache" + apiscachingv1alpha1 "knative.dev/caching/pkg/apis/caching/v1alpha1" + versioned "knative.dev/caching/pkg/client/clientset/versioned" v1alpha1 "knative.dev/caching/pkg/client/informers/externalversions/caching/v1alpha1" + client "knative.dev/caching/pkg/client/injection/client" factory "knative.dev/caching/pkg/client/injection/informers/factory" + cachingv1alpha1 "knative.dev/caching/pkg/client/listers/caching/v1alpha1" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" logging "knative.dev/pkg/logging" @@ -30,6 +37,7 @@ import ( func init() { injection.Default.RegisterInformer(withInformer) + injection.Dynamic.RegisterDynamicInformer(withDynamicInformer) } // Key is used for associating the Informer inside the context.Context. @@ -41,6 +49,11 @@ func withInformer(ctx context.Context) (context.Context, controller.Informer) { return context.WithValue(ctx, Key{}, inf), inf.Informer() } +func withDynamicInformer(ctx context.Context) context.Context { + inf := &wrapper{client: client.Get(ctx)} + return context.WithValue(ctx, Key{}, inf) +} + // Get extracts the typed informer from the context. func Get(ctx context.Context) v1alpha1.ImageInformer { untyped := ctx.Value(Key{}) @@ -50,3 +63,44 @@ func Get(ctx context.Context) v1alpha1.ImageInformer { } return untyped.(v1alpha1.ImageInformer) } + +type wrapper struct { + client versioned.Interface + + namespace string +} + +var _ v1alpha1.ImageInformer = (*wrapper)(nil) +var _ cachingv1alpha1.ImageLister = (*wrapper)(nil) + +func (w *wrapper) Informer() cache.SharedIndexInformer { + return cache.NewSharedIndexInformer(nil, &apiscachingv1alpha1.Image{}, 0, nil) +} + +func (w *wrapper) Lister() cachingv1alpha1.ImageLister { + return w +} + +func (w *wrapper) Images(namespace string) cachingv1alpha1.ImageNamespaceLister { + return &wrapper{client: w.client, namespace: namespace} +} + +func (w *wrapper) List(selector labels.Selector) (ret []*apiscachingv1alpha1.Image, err error) { + lo, err := w.client.CachingV1alpha1().Images(w.namespace).List(context.TODO(), v1.ListOptions{ + LabelSelector: selector.String(), + // TODO(mattmoor): Incorporate resourceVersion bounds based on staleness criteria. + }) + if err != nil { + return nil, err + } + for idx := range lo.Items { + ret = append(ret, &lo.Items[idx]) + } + return ret, nil +} + +func (w *wrapper) Get(name string) (*apiscachingv1alpha1.Image, error) { + return w.client.CachingV1alpha1().Images(w.namespace).Get(context.TODO(), name, v1.GetOptions{ + // TODO(mattmoor): Incorporate resourceVersion bounds based on staleness criteria. + }) +} diff --git a/vendor/knative.dev/hack/release.sh b/vendor/knative.dev/hack/release.sh index 98a20e8a..80b035fb 100644 --- a/vendor/knative.dev/hack/release.sh +++ b/vendor/knative.dev/hack/release.sh @@ -610,7 +610,6 @@ function publish_to_github() { [[ -n "${RELEASE_BRANCH}" ]] && commitish="--commitish=${RELEASE_BRANCH}" for i in {2..0}; do hub_tool release create \ - --prerelease \ ${attachments[@]} \ --file="${description}" \ "${commitish}" \ diff --git a/vendor/knative.dev/pkg/apis/interfaces.go b/vendor/knative.dev/pkg/apis/interfaces.go index b4d350f8..d706c275 100644 --- a/vendor/knative.dev/pkg/apis/interfaces.go +++ b/vendor/knative.dev/pkg/apis/interfaces.go @@ -53,7 +53,8 @@ type Listable interface { } // Annotatable indicates that a particular type applies various annotations. -// DEPRECATED: Use WithUserInfo / GetUserInfo from within SetDefaults instead. +// +// Deprecated: Use WithUserInfo / GetUserInfo from within SetDefaults instead. // The webhook functionality for this has been turned down, which is why this // interface is empty. type Annotatable interface{} diff --git a/vendor/knative.dev/pkg/client/injection/kube/client/client.go b/vendor/knative.dev/pkg/client/injection/kube/client/client.go index 2c7be6d3..f37e2929 100644 --- a/vendor/knative.dev/pkg/client/injection/kube/client/client.go +++ b/vendor/knative.dev/pkg/client/injection/kube/client/client.go @@ -20,27 +20,130 @@ package client import ( context "context" + json "encoding/json" + errors "errors" + fmt "fmt" + v1 "k8s.io/api/admissionregistration/v1" + v1beta1 "k8s.io/api/admissionregistration/v1beta1" + v1alpha1 "k8s.io/api/apiserverinternal/v1alpha1" + appsv1 "k8s.io/api/apps/v1" + appsv1beta1 "k8s.io/api/apps/v1beta1" + v1beta2 "k8s.io/api/apps/v1beta2" + authenticationv1 "k8s.io/api/authentication/v1" + authenticationv1beta1 "k8s.io/api/authentication/v1beta1" + authorizationv1 "k8s.io/api/authorization/v1" + authorizationv1beta1 "k8s.io/api/authorization/v1beta1" + autoscalingv1 "k8s.io/api/autoscaling/v1" + v2beta1 "k8s.io/api/autoscaling/v2beta1" + v2beta2 "k8s.io/api/autoscaling/v2beta2" + batchv1 "k8s.io/api/batch/v1" + batchv1beta1 "k8s.io/api/batch/v1beta1" + v2alpha1 "k8s.io/api/batch/v2alpha1" + certificatesv1 "k8s.io/api/certificates/v1" + certificatesv1beta1 "k8s.io/api/certificates/v1beta1" + coordinationv1 "k8s.io/api/coordination/v1" + coordinationv1beta1 "k8s.io/api/coordination/v1beta1" + corev1 "k8s.io/api/core/v1" + discoveryv1alpha1 "k8s.io/api/discovery/v1alpha1" + discoveryv1beta1 "k8s.io/api/discovery/v1beta1" + eventsv1 "k8s.io/api/events/v1" + eventsv1beta1 "k8s.io/api/events/v1beta1" + extensionsv1beta1 "k8s.io/api/extensions/v1beta1" + flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1" + flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1" + networkingv1 "k8s.io/api/networking/v1" + networkingv1beta1 "k8s.io/api/networking/v1beta1" + nodev1 "k8s.io/api/node/v1" + nodev1alpha1 "k8s.io/api/node/v1alpha1" + nodev1beta1 "k8s.io/api/node/v1beta1" + policyv1beta1 "k8s.io/api/policy/v1beta1" + rbacv1 "k8s.io/api/rbac/v1" + rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" + rbacv1beta1 "k8s.io/api/rbac/v1beta1" + schedulingv1 "k8s.io/api/scheduling/v1" + schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1" + schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" + storagev1 "k8s.io/api/storage/v1" + storagev1alpha1 "k8s.io/api/storage/v1alpha1" + storagev1beta1 "k8s.io/api/storage/v1beta1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + discovery "k8s.io/client-go/discovery" + dynamic "k8s.io/client-go/dynamic" kubernetes "k8s.io/client-go/kubernetes" + typedadmissionregistrationv1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1" + typedadmissionregistrationv1beta1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1" + typedinternalv1alpha1 "k8s.io/client-go/kubernetes/typed/apiserverinternal/v1alpha1" + typedappsv1 "k8s.io/client-go/kubernetes/typed/apps/v1" + typedappsv1beta1 "k8s.io/client-go/kubernetes/typed/apps/v1beta1" + typedappsv1beta2 "k8s.io/client-go/kubernetes/typed/apps/v1beta2" + typedauthenticationv1 "k8s.io/client-go/kubernetes/typed/authentication/v1" + typedauthenticationv1beta1 "k8s.io/client-go/kubernetes/typed/authentication/v1beta1" + typedauthorizationv1 "k8s.io/client-go/kubernetes/typed/authorization/v1" + typedauthorizationv1beta1 "k8s.io/client-go/kubernetes/typed/authorization/v1beta1" + typedautoscalingv1 "k8s.io/client-go/kubernetes/typed/autoscaling/v1" + typedautoscalingv2beta1 "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1" + typedautoscalingv2beta2 "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2" + typedbatchv1 "k8s.io/client-go/kubernetes/typed/batch/v1" + typedbatchv1beta1 "k8s.io/client-go/kubernetes/typed/batch/v1beta1" + typedbatchv2alpha1 "k8s.io/client-go/kubernetes/typed/batch/v2alpha1" + typedcertificatesv1 "k8s.io/client-go/kubernetes/typed/certificates/v1" + typedcertificatesv1beta1 "k8s.io/client-go/kubernetes/typed/certificates/v1beta1" + typedcoordinationv1 "k8s.io/client-go/kubernetes/typed/coordination/v1" + typedcoordinationv1beta1 "k8s.io/client-go/kubernetes/typed/coordination/v1beta1" + typedcorev1 "k8s.io/client-go/kubernetes/typed/core/v1" + typeddiscoveryv1alpha1 "k8s.io/client-go/kubernetes/typed/discovery/v1alpha1" + typeddiscoveryv1beta1 "k8s.io/client-go/kubernetes/typed/discovery/v1beta1" + typedeventsv1 "k8s.io/client-go/kubernetes/typed/events/v1" + typedeventsv1beta1 "k8s.io/client-go/kubernetes/typed/events/v1beta1" + typedextensionsv1beta1 "k8s.io/client-go/kubernetes/typed/extensions/v1beta1" + typedflowcontrolv1alpha1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1" + typedflowcontrolv1beta1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1" + typednetworkingv1 "k8s.io/client-go/kubernetes/typed/networking/v1" + typednetworkingv1beta1 "k8s.io/client-go/kubernetes/typed/networking/v1beta1" + typednodev1 "k8s.io/client-go/kubernetes/typed/node/v1" + typednodev1alpha1 "k8s.io/client-go/kubernetes/typed/node/v1alpha1" + typednodev1beta1 "k8s.io/client-go/kubernetes/typed/node/v1beta1" + typedpolicyv1beta1 "k8s.io/client-go/kubernetes/typed/policy/v1beta1" + typedrbacv1 "k8s.io/client-go/kubernetes/typed/rbac/v1" + typedrbacv1alpha1 "k8s.io/client-go/kubernetes/typed/rbac/v1alpha1" + typedrbacv1beta1 "k8s.io/client-go/kubernetes/typed/rbac/v1beta1" + typedschedulingv1 "k8s.io/client-go/kubernetes/typed/scheduling/v1" + typedschedulingv1alpha1 "k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1" + typedschedulingv1beta1 "k8s.io/client-go/kubernetes/typed/scheduling/v1beta1" + typedstoragev1 "k8s.io/client-go/kubernetes/typed/storage/v1" + typedstoragev1alpha1 "k8s.io/client-go/kubernetes/typed/storage/v1alpha1" + typedstoragev1beta1 "k8s.io/client-go/kubernetes/typed/storage/v1beta1" rest "k8s.io/client-go/rest" injection "knative.dev/pkg/injection" + dynamicclient "knative.dev/pkg/injection/clients/dynamicclient" logging "knative.dev/pkg/logging" ) func init() { - injection.Default.RegisterClient(withClient) + injection.Default.RegisterClient(withClientFromConfig) injection.Default.RegisterClientFetcher(func(ctx context.Context) interface{} { return Get(ctx) }) + injection.Dynamic.RegisterDynamicClient(withClientFromDynamic) } // Key is used as the key for associating information with a context.Context. type Key struct{} -func withClient(ctx context.Context, cfg *rest.Config) context.Context { +func withClientFromConfig(ctx context.Context, cfg *rest.Config) context.Context { return context.WithValue(ctx, Key{}, kubernetes.NewForConfigOrDie(cfg)) } +func withClientFromDynamic(ctx context.Context) context.Context { + return context.WithValue(ctx, Key{}, &wrapClient{dyn: dynamicclient.Get(ctx)}) +} + // Get extracts the kubernetes.Interface client from the context. func Get(ctx context.Context) kubernetes.Interface { untyped := ctx.Value(Key{}) @@ -55,3 +158,13154 @@ func Get(ctx context.Context) kubernetes.Interface { } return untyped.(kubernetes.Interface) } + +type wrapClient struct { + dyn dynamic.Interface +} + +var _ kubernetes.Interface = (*wrapClient)(nil) + +func (w *wrapClient) Discovery() discovery.DiscoveryInterface { + panic("Discovery called on dynamic client!") +} + +func convert(from interface{}, to runtime.Object) error { + bs, err := json.Marshal(from) + if err != nil { + return fmt.Errorf("Marshal() = %w", err) + } + if err := json.Unmarshal(bs, to); err != nil { + return fmt.Errorf("Unmarshal() = %w", err) + } + return nil +} + +// AdmissionregistrationV1 retrieves the AdmissionregistrationV1Client +func (w *wrapClient) AdmissionregistrationV1() typedadmissionregistrationv1.AdmissionregistrationV1Interface { + return &wrapAdmissionregistrationV1{ + dyn: w.dyn, + } +} + +type wrapAdmissionregistrationV1 struct { + dyn dynamic.Interface +} + +func (w *wrapAdmissionregistrationV1) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapAdmissionregistrationV1) MutatingWebhookConfigurations() typedadmissionregistrationv1.MutatingWebhookConfigurationInterface { + return &wrapAdmissionregistrationV1MutatingWebhookConfigurationImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "admissionregistration.k8s.io", + Version: "v1", + Resource: "mutatingwebhookconfigurations", + }), + } +} + +type wrapAdmissionregistrationV1MutatingWebhookConfigurationImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedadmissionregistrationv1.MutatingWebhookConfigurationInterface = (*wrapAdmissionregistrationV1MutatingWebhookConfigurationImpl)(nil) + +func (w *wrapAdmissionregistrationV1MutatingWebhookConfigurationImpl) Create(ctx context.Context, in *v1.MutatingWebhookConfiguration, opts metav1.CreateOptions) (*v1.MutatingWebhookConfiguration, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "admissionregistration.k8s.io", + Version: "v1", + Kind: "MutatingWebhookConfiguration", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &v1.MutatingWebhookConfiguration{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAdmissionregistrationV1MutatingWebhookConfigurationImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Delete(ctx, name, opts) +} + +func (w *wrapAdmissionregistrationV1MutatingWebhookConfigurationImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapAdmissionregistrationV1MutatingWebhookConfigurationImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.MutatingWebhookConfiguration, error) { + uo, err := w.dyn.Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &v1.MutatingWebhookConfiguration{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAdmissionregistrationV1MutatingWebhookConfigurationImpl) List(ctx context.Context, opts metav1.ListOptions) (*v1.MutatingWebhookConfigurationList, error) { + uo, err := w.dyn.List(ctx, opts) + if err != nil { + return nil, err + } + out := &v1.MutatingWebhookConfigurationList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAdmissionregistrationV1MutatingWebhookConfigurationImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.MutatingWebhookConfiguration, err error) { + uo, err := w.dyn.Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &v1.MutatingWebhookConfiguration{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAdmissionregistrationV1MutatingWebhookConfigurationImpl) Update(ctx context.Context, in *v1.MutatingWebhookConfiguration, opts metav1.UpdateOptions) (*v1.MutatingWebhookConfiguration, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "admissionregistration.k8s.io", + Version: "v1", + Kind: "MutatingWebhookConfiguration", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &v1.MutatingWebhookConfiguration{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAdmissionregistrationV1MutatingWebhookConfigurationImpl) UpdateStatus(ctx context.Context, in *v1.MutatingWebhookConfiguration, opts metav1.UpdateOptions) (*v1.MutatingWebhookConfiguration, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "admissionregistration.k8s.io", + Version: "v1", + Kind: "MutatingWebhookConfiguration", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &v1.MutatingWebhookConfiguration{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAdmissionregistrationV1MutatingWebhookConfigurationImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapAdmissionregistrationV1) ValidatingWebhookConfigurations() typedadmissionregistrationv1.ValidatingWebhookConfigurationInterface { + return &wrapAdmissionregistrationV1ValidatingWebhookConfigurationImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "admissionregistration.k8s.io", + Version: "v1", + Resource: "validatingwebhookconfigurations", + }), + } +} + +type wrapAdmissionregistrationV1ValidatingWebhookConfigurationImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedadmissionregistrationv1.ValidatingWebhookConfigurationInterface = (*wrapAdmissionregistrationV1ValidatingWebhookConfigurationImpl)(nil) + +func (w *wrapAdmissionregistrationV1ValidatingWebhookConfigurationImpl) Create(ctx context.Context, in *v1.ValidatingWebhookConfiguration, opts metav1.CreateOptions) (*v1.ValidatingWebhookConfiguration, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "admissionregistration.k8s.io", + Version: "v1", + Kind: "ValidatingWebhookConfiguration", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &v1.ValidatingWebhookConfiguration{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAdmissionregistrationV1ValidatingWebhookConfigurationImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Delete(ctx, name, opts) +} + +func (w *wrapAdmissionregistrationV1ValidatingWebhookConfigurationImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapAdmissionregistrationV1ValidatingWebhookConfigurationImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ValidatingWebhookConfiguration, error) { + uo, err := w.dyn.Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &v1.ValidatingWebhookConfiguration{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAdmissionregistrationV1ValidatingWebhookConfigurationImpl) List(ctx context.Context, opts metav1.ListOptions) (*v1.ValidatingWebhookConfigurationList, error) { + uo, err := w.dyn.List(ctx, opts) + if err != nil { + return nil, err + } + out := &v1.ValidatingWebhookConfigurationList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAdmissionregistrationV1ValidatingWebhookConfigurationImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ValidatingWebhookConfiguration, err error) { + uo, err := w.dyn.Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &v1.ValidatingWebhookConfiguration{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAdmissionregistrationV1ValidatingWebhookConfigurationImpl) Update(ctx context.Context, in *v1.ValidatingWebhookConfiguration, opts metav1.UpdateOptions) (*v1.ValidatingWebhookConfiguration, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "admissionregistration.k8s.io", + Version: "v1", + Kind: "ValidatingWebhookConfiguration", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &v1.ValidatingWebhookConfiguration{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAdmissionregistrationV1ValidatingWebhookConfigurationImpl) UpdateStatus(ctx context.Context, in *v1.ValidatingWebhookConfiguration, opts metav1.UpdateOptions) (*v1.ValidatingWebhookConfiguration, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "admissionregistration.k8s.io", + Version: "v1", + Kind: "ValidatingWebhookConfiguration", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &v1.ValidatingWebhookConfiguration{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAdmissionregistrationV1ValidatingWebhookConfigurationImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +// AdmissionregistrationV1beta1 retrieves the AdmissionregistrationV1beta1Client +func (w *wrapClient) AdmissionregistrationV1beta1() typedadmissionregistrationv1beta1.AdmissionregistrationV1beta1Interface { + return &wrapAdmissionregistrationV1beta1{ + dyn: w.dyn, + } +} + +type wrapAdmissionregistrationV1beta1 struct { + dyn dynamic.Interface +} + +func (w *wrapAdmissionregistrationV1beta1) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapAdmissionregistrationV1beta1) MutatingWebhookConfigurations() typedadmissionregistrationv1beta1.MutatingWebhookConfigurationInterface { + return &wrapAdmissionregistrationV1beta1MutatingWebhookConfigurationImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "admissionregistration.k8s.io", + Version: "v1beta1", + Resource: "mutatingwebhookconfigurations", + }), + } +} + +type wrapAdmissionregistrationV1beta1MutatingWebhookConfigurationImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedadmissionregistrationv1beta1.MutatingWebhookConfigurationInterface = (*wrapAdmissionregistrationV1beta1MutatingWebhookConfigurationImpl)(nil) + +func (w *wrapAdmissionregistrationV1beta1MutatingWebhookConfigurationImpl) Create(ctx context.Context, in *v1beta1.MutatingWebhookConfiguration, opts metav1.CreateOptions) (*v1beta1.MutatingWebhookConfiguration, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "admissionregistration.k8s.io", + Version: "v1beta1", + Kind: "MutatingWebhookConfiguration", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &v1beta1.MutatingWebhookConfiguration{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAdmissionregistrationV1beta1MutatingWebhookConfigurationImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Delete(ctx, name, opts) +} + +func (w *wrapAdmissionregistrationV1beta1MutatingWebhookConfigurationImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapAdmissionregistrationV1beta1MutatingWebhookConfigurationImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1beta1.MutatingWebhookConfiguration, error) { + uo, err := w.dyn.Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &v1beta1.MutatingWebhookConfiguration{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAdmissionregistrationV1beta1MutatingWebhookConfigurationImpl) List(ctx context.Context, opts metav1.ListOptions) (*v1beta1.MutatingWebhookConfigurationList, error) { + uo, err := w.dyn.List(ctx, opts) + if err != nil { + return nil, err + } + out := &v1beta1.MutatingWebhookConfigurationList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAdmissionregistrationV1beta1MutatingWebhookConfigurationImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1beta1.MutatingWebhookConfiguration, err error) { + uo, err := w.dyn.Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &v1beta1.MutatingWebhookConfiguration{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAdmissionregistrationV1beta1MutatingWebhookConfigurationImpl) Update(ctx context.Context, in *v1beta1.MutatingWebhookConfiguration, opts metav1.UpdateOptions) (*v1beta1.MutatingWebhookConfiguration, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "admissionregistration.k8s.io", + Version: "v1beta1", + Kind: "MutatingWebhookConfiguration", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &v1beta1.MutatingWebhookConfiguration{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAdmissionregistrationV1beta1MutatingWebhookConfigurationImpl) UpdateStatus(ctx context.Context, in *v1beta1.MutatingWebhookConfiguration, opts metav1.UpdateOptions) (*v1beta1.MutatingWebhookConfiguration, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "admissionregistration.k8s.io", + Version: "v1beta1", + Kind: "MutatingWebhookConfiguration", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &v1beta1.MutatingWebhookConfiguration{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAdmissionregistrationV1beta1MutatingWebhookConfigurationImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapAdmissionregistrationV1beta1) ValidatingWebhookConfigurations() typedadmissionregistrationv1beta1.ValidatingWebhookConfigurationInterface { + return &wrapAdmissionregistrationV1beta1ValidatingWebhookConfigurationImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "admissionregistration.k8s.io", + Version: "v1beta1", + Resource: "validatingwebhookconfigurations", + }), + } +} + +type wrapAdmissionregistrationV1beta1ValidatingWebhookConfigurationImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedadmissionregistrationv1beta1.ValidatingWebhookConfigurationInterface = (*wrapAdmissionregistrationV1beta1ValidatingWebhookConfigurationImpl)(nil) + +func (w *wrapAdmissionregistrationV1beta1ValidatingWebhookConfigurationImpl) Create(ctx context.Context, in *v1beta1.ValidatingWebhookConfiguration, opts metav1.CreateOptions) (*v1beta1.ValidatingWebhookConfiguration, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "admissionregistration.k8s.io", + Version: "v1beta1", + Kind: "ValidatingWebhookConfiguration", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &v1beta1.ValidatingWebhookConfiguration{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAdmissionregistrationV1beta1ValidatingWebhookConfigurationImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Delete(ctx, name, opts) +} + +func (w *wrapAdmissionregistrationV1beta1ValidatingWebhookConfigurationImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapAdmissionregistrationV1beta1ValidatingWebhookConfigurationImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1beta1.ValidatingWebhookConfiguration, error) { + uo, err := w.dyn.Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &v1beta1.ValidatingWebhookConfiguration{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAdmissionregistrationV1beta1ValidatingWebhookConfigurationImpl) List(ctx context.Context, opts metav1.ListOptions) (*v1beta1.ValidatingWebhookConfigurationList, error) { + uo, err := w.dyn.List(ctx, opts) + if err != nil { + return nil, err + } + out := &v1beta1.ValidatingWebhookConfigurationList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAdmissionregistrationV1beta1ValidatingWebhookConfigurationImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1beta1.ValidatingWebhookConfiguration, err error) { + uo, err := w.dyn.Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &v1beta1.ValidatingWebhookConfiguration{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAdmissionregistrationV1beta1ValidatingWebhookConfigurationImpl) Update(ctx context.Context, in *v1beta1.ValidatingWebhookConfiguration, opts metav1.UpdateOptions) (*v1beta1.ValidatingWebhookConfiguration, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "admissionregistration.k8s.io", + Version: "v1beta1", + Kind: "ValidatingWebhookConfiguration", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &v1beta1.ValidatingWebhookConfiguration{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAdmissionregistrationV1beta1ValidatingWebhookConfigurationImpl) UpdateStatus(ctx context.Context, in *v1beta1.ValidatingWebhookConfiguration, opts metav1.UpdateOptions) (*v1beta1.ValidatingWebhookConfiguration, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "admissionregistration.k8s.io", + Version: "v1beta1", + Kind: "ValidatingWebhookConfiguration", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &v1beta1.ValidatingWebhookConfiguration{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAdmissionregistrationV1beta1ValidatingWebhookConfigurationImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +// InternalV1alpha1 retrieves the InternalV1alpha1Client +func (w *wrapClient) InternalV1alpha1() typedinternalv1alpha1.InternalV1alpha1Interface { + return &wrapInternalV1alpha1{ + dyn: w.dyn, + } +} + +type wrapInternalV1alpha1 struct { + dyn dynamic.Interface +} + +func (w *wrapInternalV1alpha1) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapInternalV1alpha1) StorageVersions() typedinternalv1alpha1.StorageVersionInterface { + return &wrapInternalV1alpha1StorageVersionImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "internal.apiserver.k8s.io", + Version: "v1alpha1", + Resource: "storageversions", + }), + } +} + +type wrapInternalV1alpha1StorageVersionImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedinternalv1alpha1.StorageVersionInterface = (*wrapInternalV1alpha1StorageVersionImpl)(nil) + +func (w *wrapInternalV1alpha1StorageVersionImpl) Create(ctx context.Context, in *v1alpha1.StorageVersion, opts metav1.CreateOptions) (*v1alpha1.StorageVersion, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "internal.apiserver.k8s.io", + Version: "v1alpha1", + Kind: "StorageVersion", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &v1alpha1.StorageVersion{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapInternalV1alpha1StorageVersionImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Delete(ctx, name, opts) +} + +func (w *wrapInternalV1alpha1StorageVersionImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapInternalV1alpha1StorageVersionImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1alpha1.StorageVersion, error) { + uo, err := w.dyn.Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &v1alpha1.StorageVersion{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapInternalV1alpha1StorageVersionImpl) List(ctx context.Context, opts metav1.ListOptions) (*v1alpha1.StorageVersionList, error) { + uo, err := w.dyn.List(ctx, opts) + if err != nil { + return nil, err + } + out := &v1alpha1.StorageVersionList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapInternalV1alpha1StorageVersionImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1alpha1.StorageVersion, err error) { + uo, err := w.dyn.Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &v1alpha1.StorageVersion{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapInternalV1alpha1StorageVersionImpl) Update(ctx context.Context, in *v1alpha1.StorageVersion, opts metav1.UpdateOptions) (*v1alpha1.StorageVersion, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "internal.apiserver.k8s.io", + Version: "v1alpha1", + Kind: "StorageVersion", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &v1alpha1.StorageVersion{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapInternalV1alpha1StorageVersionImpl) UpdateStatus(ctx context.Context, in *v1alpha1.StorageVersion, opts metav1.UpdateOptions) (*v1alpha1.StorageVersion, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "internal.apiserver.k8s.io", + Version: "v1alpha1", + Kind: "StorageVersion", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &v1alpha1.StorageVersion{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapInternalV1alpha1StorageVersionImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +// AppsV1 retrieves the AppsV1Client +func (w *wrapClient) AppsV1() typedappsv1.AppsV1Interface { + return &wrapAppsV1{ + dyn: w.dyn, + } +} + +type wrapAppsV1 struct { + dyn dynamic.Interface +} + +func (w *wrapAppsV1) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapAppsV1) ControllerRevisions(namespace string) typedappsv1.ControllerRevisionInterface { + return &wrapAppsV1ControllerRevisionImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "apps", + Version: "v1", + Resource: "controllerrevisions", + }), + + namespace: namespace, + } +} + +type wrapAppsV1ControllerRevisionImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedappsv1.ControllerRevisionInterface = (*wrapAppsV1ControllerRevisionImpl)(nil) + +func (w *wrapAppsV1ControllerRevisionImpl) Create(ctx context.Context, in *appsv1.ControllerRevision, opts metav1.CreateOptions) (*appsv1.ControllerRevision, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "apps", + Version: "v1", + Kind: "ControllerRevision", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &appsv1.ControllerRevision{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1ControllerRevisionImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapAppsV1ControllerRevisionImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapAppsV1ControllerRevisionImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*appsv1.ControllerRevision, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &appsv1.ControllerRevision{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1ControllerRevisionImpl) List(ctx context.Context, opts metav1.ListOptions) (*appsv1.ControllerRevisionList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &appsv1.ControllerRevisionList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1ControllerRevisionImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *appsv1.ControllerRevision, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &appsv1.ControllerRevision{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1ControllerRevisionImpl) Update(ctx context.Context, in *appsv1.ControllerRevision, opts metav1.UpdateOptions) (*appsv1.ControllerRevision, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "apps", + Version: "v1", + Kind: "ControllerRevision", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &appsv1.ControllerRevision{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1ControllerRevisionImpl) UpdateStatus(ctx context.Context, in *appsv1.ControllerRevision, opts metav1.UpdateOptions) (*appsv1.ControllerRevision, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "apps", + Version: "v1", + Kind: "ControllerRevision", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &appsv1.ControllerRevision{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1ControllerRevisionImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapAppsV1) DaemonSets(namespace string) typedappsv1.DaemonSetInterface { + return &wrapAppsV1DaemonSetImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "apps", + Version: "v1", + Resource: "daemonsets", + }), + + namespace: namespace, + } +} + +type wrapAppsV1DaemonSetImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedappsv1.DaemonSetInterface = (*wrapAppsV1DaemonSetImpl)(nil) + +func (w *wrapAppsV1DaemonSetImpl) Create(ctx context.Context, in *appsv1.DaemonSet, opts metav1.CreateOptions) (*appsv1.DaemonSet, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "apps", + Version: "v1", + Kind: "DaemonSet", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &appsv1.DaemonSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1DaemonSetImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapAppsV1DaemonSetImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapAppsV1DaemonSetImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*appsv1.DaemonSet, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &appsv1.DaemonSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1DaemonSetImpl) List(ctx context.Context, opts metav1.ListOptions) (*appsv1.DaemonSetList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &appsv1.DaemonSetList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1DaemonSetImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *appsv1.DaemonSet, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &appsv1.DaemonSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1DaemonSetImpl) Update(ctx context.Context, in *appsv1.DaemonSet, opts metav1.UpdateOptions) (*appsv1.DaemonSet, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "apps", + Version: "v1", + Kind: "DaemonSet", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &appsv1.DaemonSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1DaemonSetImpl) UpdateStatus(ctx context.Context, in *appsv1.DaemonSet, opts metav1.UpdateOptions) (*appsv1.DaemonSet, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "apps", + Version: "v1", + Kind: "DaemonSet", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &appsv1.DaemonSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1DaemonSetImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapAppsV1) Deployments(namespace string) typedappsv1.DeploymentInterface { + return &wrapAppsV1DeploymentImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "apps", + Version: "v1", + Resource: "deployments", + }), + + namespace: namespace, + } +} + +type wrapAppsV1DeploymentImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedappsv1.DeploymentInterface = (*wrapAppsV1DeploymentImpl)(nil) + +func (w *wrapAppsV1DeploymentImpl) Create(ctx context.Context, in *appsv1.Deployment, opts metav1.CreateOptions) (*appsv1.Deployment, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "apps", + Version: "v1", + Kind: "Deployment", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &appsv1.Deployment{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1DeploymentImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapAppsV1DeploymentImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapAppsV1DeploymentImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*appsv1.Deployment, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &appsv1.Deployment{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1DeploymentImpl) List(ctx context.Context, opts metav1.ListOptions) (*appsv1.DeploymentList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &appsv1.DeploymentList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1DeploymentImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *appsv1.Deployment, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &appsv1.Deployment{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1DeploymentImpl) Update(ctx context.Context, in *appsv1.Deployment, opts metav1.UpdateOptions) (*appsv1.Deployment, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "apps", + Version: "v1", + Kind: "Deployment", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &appsv1.Deployment{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1DeploymentImpl) UpdateStatus(ctx context.Context, in *appsv1.Deployment, opts metav1.UpdateOptions) (*appsv1.Deployment, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "apps", + Version: "v1", + Kind: "Deployment", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &appsv1.Deployment{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1DeploymentImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapAppsV1DeploymentImpl) GetScale(ctx context.Context, name string, opts metav1.GetOptions) (*autoscalingv1.Scale, error) { + panic("NYI") +} + +func (w *wrapAppsV1DeploymentImpl) UpdateScale(ctx context.Context, _ string, in *autoscalingv1.Scale, opts metav1.UpdateOptions) (*autoscalingv1.Scale, error) { + panic("NYI") +} + +func (w *wrapAppsV1) ReplicaSets(namespace string) typedappsv1.ReplicaSetInterface { + return &wrapAppsV1ReplicaSetImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "apps", + Version: "v1", + Resource: "replicasets", + }), + + namespace: namespace, + } +} + +type wrapAppsV1ReplicaSetImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedappsv1.ReplicaSetInterface = (*wrapAppsV1ReplicaSetImpl)(nil) + +func (w *wrapAppsV1ReplicaSetImpl) Create(ctx context.Context, in *appsv1.ReplicaSet, opts metav1.CreateOptions) (*appsv1.ReplicaSet, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "apps", + Version: "v1", + Kind: "ReplicaSet", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &appsv1.ReplicaSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1ReplicaSetImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapAppsV1ReplicaSetImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapAppsV1ReplicaSetImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*appsv1.ReplicaSet, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &appsv1.ReplicaSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1ReplicaSetImpl) List(ctx context.Context, opts metav1.ListOptions) (*appsv1.ReplicaSetList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &appsv1.ReplicaSetList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1ReplicaSetImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *appsv1.ReplicaSet, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &appsv1.ReplicaSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1ReplicaSetImpl) Update(ctx context.Context, in *appsv1.ReplicaSet, opts metav1.UpdateOptions) (*appsv1.ReplicaSet, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "apps", + Version: "v1", + Kind: "ReplicaSet", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &appsv1.ReplicaSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1ReplicaSetImpl) UpdateStatus(ctx context.Context, in *appsv1.ReplicaSet, opts metav1.UpdateOptions) (*appsv1.ReplicaSet, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "apps", + Version: "v1", + Kind: "ReplicaSet", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &appsv1.ReplicaSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1ReplicaSetImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapAppsV1ReplicaSetImpl) GetScale(ctx context.Context, name string, opts metav1.GetOptions) (*autoscalingv1.Scale, error) { + panic("NYI") +} + +func (w *wrapAppsV1ReplicaSetImpl) UpdateScale(ctx context.Context, _ string, in *autoscalingv1.Scale, opts metav1.UpdateOptions) (*autoscalingv1.Scale, error) { + panic("NYI") +} + +func (w *wrapAppsV1) StatefulSets(namespace string) typedappsv1.StatefulSetInterface { + return &wrapAppsV1StatefulSetImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "apps", + Version: "v1", + Resource: "statefulsets", + }), + + namespace: namespace, + } +} + +type wrapAppsV1StatefulSetImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedappsv1.StatefulSetInterface = (*wrapAppsV1StatefulSetImpl)(nil) + +func (w *wrapAppsV1StatefulSetImpl) Create(ctx context.Context, in *appsv1.StatefulSet, opts metav1.CreateOptions) (*appsv1.StatefulSet, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "apps", + Version: "v1", + Kind: "StatefulSet", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &appsv1.StatefulSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1StatefulSetImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapAppsV1StatefulSetImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapAppsV1StatefulSetImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*appsv1.StatefulSet, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &appsv1.StatefulSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1StatefulSetImpl) List(ctx context.Context, opts metav1.ListOptions) (*appsv1.StatefulSetList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &appsv1.StatefulSetList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1StatefulSetImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *appsv1.StatefulSet, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &appsv1.StatefulSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1StatefulSetImpl) Update(ctx context.Context, in *appsv1.StatefulSet, opts metav1.UpdateOptions) (*appsv1.StatefulSet, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "apps", + Version: "v1", + Kind: "StatefulSet", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &appsv1.StatefulSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1StatefulSetImpl) UpdateStatus(ctx context.Context, in *appsv1.StatefulSet, opts metav1.UpdateOptions) (*appsv1.StatefulSet, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "apps", + Version: "v1", + Kind: "StatefulSet", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &appsv1.StatefulSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1StatefulSetImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapAppsV1StatefulSetImpl) GetScale(ctx context.Context, name string, opts metav1.GetOptions) (*autoscalingv1.Scale, error) { + panic("NYI") +} + +func (w *wrapAppsV1StatefulSetImpl) UpdateScale(ctx context.Context, _ string, in *autoscalingv1.Scale, opts metav1.UpdateOptions) (*autoscalingv1.Scale, error) { + panic("NYI") +} + +// AppsV1beta1 retrieves the AppsV1beta1Client +func (w *wrapClient) AppsV1beta1() typedappsv1beta1.AppsV1beta1Interface { + return &wrapAppsV1beta1{ + dyn: w.dyn, + } +} + +type wrapAppsV1beta1 struct { + dyn dynamic.Interface +} + +func (w *wrapAppsV1beta1) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapAppsV1beta1) ControllerRevisions(namespace string) typedappsv1beta1.ControllerRevisionInterface { + return &wrapAppsV1beta1ControllerRevisionImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "apps", + Version: "v1beta1", + Resource: "controllerrevisions", + }), + + namespace: namespace, + } +} + +type wrapAppsV1beta1ControllerRevisionImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedappsv1beta1.ControllerRevisionInterface = (*wrapAppsV1beta1ControllerRevisionImpl)(nil) + +func (w *wrapAppsV1beta1ControllerRevisionImpl) Create(ctx context.Context, in *appsv1beta1.ControllerRevision, opts metav1.CreateOptions) (*appsv1beta1.ControllerRevision, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "apps", + Version: "v1beta1", + Kind: "ControllerRevision", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &appsv1beta1.ControllerRevision{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta1ControllerRevisionImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapAppsV1beta1ControllerRevisionImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapAppsV1beta1ControllerRevisionImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*appsv1beta1.ControllerRevision, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &appsv1beta1.ControllerRevision{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta1ControllerRevisionImpl) List(ctx context.Context, opts metav1.ListOptions) (*appsv1beta1.ControllerRevisionList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &appsv1beta1.ControllerRevisionList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta1ControllerRevisionImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *appsv1beta1.ControllerRevision, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &appsv1beta1.ControllerRevision{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta1ControllerRevisionImpl) Update(ctx context.Context, in *appsv1beta1.ControllerRevision, opts metav1.UpdateOptions) (*appsv1beta1.ControllerRevision, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "apps", + Version: "v1beta1", + Kind: "ControllerRevision", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &appsv1beta1.ControllerRevision{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta1ControllerRevisionImpl) UpdateStatus(ctx context.Context, in *appsv1beta1.ControllerRevision, opts metav1.UpdateOptions) (*appsv1beta1.ControllerRevision, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "apps", + Version: "v1beta1", + Kind: "ControllerRevision", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &appsv1beta1.ControllerRevision{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta1ControllerRevisionImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapAppsV1beta1) Deployments(namespace string) typedappsv1beta1.DeploymentInterface { + return &wrapAppsV1beta1DeploymentImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "apps", + Version: "v1beta1", + Resource: "deployments", + }), + + namespace: namespace, + } +} + +type wrapAppsV1beta1DeploymentImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedappsv1beta1.DeploymentInterface = (*wrapAppsV1beta1DeploymentImpl)(nil) + +func (w *wrapAppsV1beta1DeploymentImpl) Create(ctx context.Context, in *appsv1beta1.Deployment, opts metav1.CreateOptions) (*appsv1beta1.Deployment, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "apps", + Version: "v1beta1", + Kind: "Deployment", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &appsv1beta1.Deployment{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta1DeploymentImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapAppsV1beta1DeploymentImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapAppsV1beta1DeploymentImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*appsv1beta1.Deployment, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &appsv1beta1.Deployment{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta1DeploymentImpl) List(ctx context.Context, opts metav1.ListOptions) (*appsv1beta1.DeploymentList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &appsv1beta1.DeploymentList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta1DeploymentImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *appsv1beta1.Deployment, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &appsv1beta1.Deployment{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta1DeploymentImpl) Update(ctx context.Context, in *appsv1beta1.Deployment, opts metav1.UpdateOptions) (*appsv1beta1.Deployment, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "apps", + Version: "v1beta1", + Kind: "Deployment", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &appsv1beta1.Deployment{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta1DeploymentImpl) UpdateStatus(ctx context.Context, in *appsv1beta1.Deployment, opts metav1.UpdateOptions) (*appsv1beta1.Deployment, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "apps", + Version: "v1beta1", + Kind: "Deployment", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &appsv1beta1.Deployment{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta1DeploymentImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapAppsV1beta1) StatefulSets(namespace string) typedappsv1beta1.StatefulSetInterface { + return &wrapAppsV1beta1StatefulSetImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "apps", + Version: "v1beta1", + Resource: "statefulsets", + }), + + namespace: namespace, + } +} + +type wrapAppsV1beta1StatefulSetImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedappsv1beta1.StatefulSetInterface = (*wrapAppsV1beta1StatefulSetImpl)(nil) + +func (w *wrapAppsV1beta1StatefulSetImpl) Create(ctx context.Context, in *appsv1beta1.StatefulSet, opts metav1.CreateOptions) (*appsv1beta1.StatefulSet, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "apps", + Version: "v1beta1", + Kind: "StatefulSet", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &appsv1beta1.StatefulSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta1StatefulSetImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapAppsV1beta1StatefulSetImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapAppsV1beta1StatefulSetImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*appsv1beta1.StatefulSet, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &appsv1beta1.StatefulSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta1StatefulSetImpl) List(ctx context.Context, opts metav1.ListOptions) (*appsv1beta1.StatefulSetList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &appsv1beta1.StatefulSetList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta1StatefulSetImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *appsv1beta1.StatefulSet, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &appsv1beta1.StatefulSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta1StatefulSetImpl) Update(ctx context.Context, in *appsv1beta1.StatefulSet, opts metav1.UpdateOptions) (*appsv1beta1.StatefulSet, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "apps", + Version: "v1beta1", + Kind: "StatefulSet", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &appsv1beta1.StatefulSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta1StatefulSetImpl) UpdateStatus(ctx context.Context, in *appsv1beta1.StatefulSet, opts metav1.UpdateOptions) (*appsv1beta1.StatefulSet, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "apps", + Version: "v1beta1", + Kind: "StatefulSet", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &appsv1beta1.StatefulSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta1StatefulSetImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +// AppsV1beta2 retrieves the AppsV1beta2Client +func (w *wrapClient) AppsV1beta2() typedappsv1beta2.AppsV1beta2Interface { + return &wrapAppsV1beta2{ + dyn: w.dyn, + } +} + +type wrapAppsV1beta2 struct { + dyn dynamic.Interface +} + +func (w *wrapAppsV1beta2) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapAppsV1beta2) ControllerRevisions(namespace string) typedappsv1beta2.ControllerRevisionInterface { + return &wrapAppsV1beta2ControllerRevisionImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "apps", + Version: "v1beta2", + Resource: "controllerrevisions", + }), + + namespace: namespace, + } +} + +type wrapAppsV1beta2ControllerRevisionImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedappsv1beta2.ControllerRevisionInterface = (*wrapAppsV1beta2ControllerRevisionImpl)(nil) + +func (w *wrapAppsV1beta2ControllerRevisionImpl) Create(ctx context.Context, in *v1beta2.ControllerRevision, opts metav1.CreateOptions) (*v1beta2.ControllerRevision, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "apps", + Version: "v1beta2", + Kind: "ControllerRevision", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &v1beta2.ControllerRevision{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta2ControllerRevisionImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapAppsV1beta2ControllerRevisionImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapAppsV1beta2ControllerRevisionImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1beta2.ControllerRevision, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &v1beta2.ControllerRevision{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta2ControllerRevisionImpl) List(ctx context.Context, opts metav1.ListOptions) (*v1beta2.ControllerRevisionList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &v1beta2.ControllerRevisionList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta2ControllerRevisionImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1beta2.ControllerRevision, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &v1beta2.ControllerRevision{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta2ControllerRevisionImpl) Update(ctx context.Context, in *v1beta2.ControllerRevision, opts metav1.UpdateOptions) (*v1beta2.ControllerRevision, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "apps", + Version: "v1beta2", + Kind: "ControllerRevision", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &v1beta2.ControllerRevision{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta2ControllerRevisionImpl) UpdateStatus(ctx context.Context, in *v1beta2.ControllerRevision, opts metav1.UpdateOptions) (*v1beta2.ControllerRevision, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "apps", + Version: "v1beta2", + Kind: "ControllerRevision", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &v1beta2.ControllerRevision{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta2ControllerRevisionImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapAppsV1beta2) DaemonSets(namespace string) typedappsv1beta2.DaemonSetInterface { + return &wrapAppsV1beta2DaemonSetImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "apps", + Version: "v1beta2", + Resource: "daemonsets", + }), + + namespace: namespace, + } +} + +type wrapAppsV1beta2DaemonSetImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedappsv1beta2.DaemonSetInterface = (*wrapAppsV1beta2DaemonSetImpl)(nil) + +func (w *wrapAppsV1beta2DaemonSetImpl) Create(ctx context.Context, in *v1beta2.DaemonSet, opts metav1.CreateOptions) (*v1beta2.DaemonSet, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "apps", + Version: "v1beta2", + Kind: "DaemonSet", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &v1beta2.DaemonSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta2DaemonSetImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapAppsV1beta2DaemonSetImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapAppsV1beta2DaemonSetImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1beta2.DaemonSet, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &v1beta2.DaemonSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta2DaemonSetImpl) List(ctx context.Context, opts metav1.ListOptions) (*v1beta2.DaemonSetList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &v1beta2.DaemonSetList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta2DaemonSetImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1beta2.DaemonSet, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &v1beta2.DaemonSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta2DaemonSetImpl) Update(ctx context.Context, in *v1beta2.DaemonSet, opts metav1.UpdateOptions) (*v1beta2.DaemonSet, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "apps", + Version: "v1beta2", + Kind: "DaemonSet", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &v1beta2.DaemonSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta2DaemonSetImpl) UpdateStatus(ctx context.Context, in *v1beta2.DaemonSet, opts metav1.UpdateOptions) (*v1beta2.DaemonSet, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "apps", + Version: "v1beta2", + Kind: "DaemonSet", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &v1beta2.DaemonSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta2DaemonSetImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapAppsV1beta2) Deployments(namespace string) typedappsv1beta2.DeploymentInterface { + return &wrapAppsV1beta2DeploymentImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "apps", + Version: "v1beta2", + Resource: "deployments", + }), + + namespace: namespace, + } +} + +type wrapAppsV1beta2DeploymentImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedappsv1beta2.DeploymentInterface = (*wrapAppsV1beta2DeploymentImpl)(nil) + +func (w *wrapAppsV1beta2DeploymentImpl) Create(ctx context.Context, in *v1beta2.Deployment, opts metav1.CreateOptions) (*v1beta2.Deployment, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "apps", + Version: "v1beta2", + Kind: "Deployment", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &v1beta2.Deployment{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta2DeploymentImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapAppsV1beta2DeploymentImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapAppsV1beta2DeploymentImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1beta2.Deployment, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &v1beta2.Deployment{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta2DeploymentImpl) List(ctx context.Context, opts metav1.ListOptions) (*v1beta2.DeploymentList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &v1beta2.DeploymentList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta2DeploymentImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1beta2.Deployment, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &v1beta2.Deployment{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta2DeploymentImpl) Update(ctx context.Context, in *v1beta2.Deployment, opts metav1.UpdateOptions) (*v1beta2.Deployment, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "apps", + Version: "v1beta2", + Kind: "Deployment", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &v1beta2.Deployment{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta2DeploymentImpl) UpdateStatus(ctx context.Context, in *v1beta2.Deployment, opts metav1.UpdateOptions) (*v1beta2.Deployment, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "apps", + Version: "v1beta2", + Kind: "Deployment", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &v1beta2.Deployment{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta2DeploymentImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapAppsV1beta2) ReplicaSets(namespace string) typedappsv1beta2.ReplicaSetInterface { + return &wrapAppsV1beta2ReplicaSetImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "apps", + Version: "v1beta2", + Resource: "replicasets", + }), + + namespace: namespace, + } +} + +type wrapAppsV1beta2ReplicaSetImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedappsv1beta2.ReplicaSetInterface = (*wrapAppsV1beta2ReplicaSetImpl)(nil) + +func (w *wrapAppsV1beta2ReplicaSetImpl) Create(ctx context.Context, in *v1beta2.ReplicaSet, opts metav1.CreateOptions) (*v1beta2.ReplicaSet, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "apps", + Version: "v1beta2", + Kind: "ReplicaSet", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &v1beta2.ReplicaSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta2ReplicaSetImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapAppsV1beta2ReplicaSetImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapAppsV1beta2ReplicaSetImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1beta2.ReplicaSet, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &v1beta2.ReplicaSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta2ReplicaSetImpl) List(ctx context.Context, opts metav1.ListOptions) (*v1beta2.ReplicaSetList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &v1beta2.ReplicaSetList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta2ReplicaSetImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1beta2.ReplicaSet, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &v1beta2.ReplicaSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta2ReplicaSetImpl) Update(ctx context.Context, in *v1beta2.ReplicaSet, opts metav1.UpdateOptions) (*v1beta2.ReplicaSet, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "apps", + Version: "v1beta2", + Kind: "ReplicaSet", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &v1beta2.ReplicaSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta2ReplicaSetImpl) UpdateStatus(ctx context.Context, in *v1beta2.ReplicaSet, opts metav1.UpdateOptions) (*v1beta2.ReplicaSet, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "apps", + Version: "v1beta2", + Kind: "ReplicaSet", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &v1beta2.ReplicaSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta2ReplicaSetImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapAppsV1beta2) StatefulSets(namespace string) typedappsv1beta2.StatefulSetInterface { + return &wrapAppsV1beta2StatefulSetImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "apps", + Version: "v1beta2", + Resource: "statefulsets", + }), + + namespace: namespace, + } +} + +type wrapAppsV1beta2StatefulSetImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedappsv1beta2.StatefulSetInterface = (*wrapAppsV1beta2StatefulSetImpl)(nil) + +func (w *wrapAppsV1beta2StatefulSetImpl) Create(ctx context.Context, in *v1beta2.StatefulSet, opts metav1.CreateOptions) (*v1beta2.StatefulSet, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "apps", + Version: "v1beta2", + Kind: "StatefulSet", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &v1beta2.StatefulSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta2StatefulSetImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapAppsV1beta2StatefulSetImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapAppsV1beta2StatefulSetImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1beta2.StatefulSet, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &v1beta2.StatefulSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta2StatefulSetImpl) List(ctx context.Context, opts metav1.ListOptions) (*v1beta2.StatefulSetList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &v1beta2.StatefulSetList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta2StatefulSetImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1beta2.StatefulSet, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &v1beta2.StatefulSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta2StatefulSetImpl) Update(ctx context.Context, in *v1beta2.StatefulSet, opts metav1.UpdateOptions) (*v1beta2.StatefulSet, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "apps", + Version: "v1beta2", + Kind: "StatefulSet", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &v1beta2.StatefulSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta2StatefulSetImpl) UpdateStatus(ctx context.Context, in *v1beta2.StatefulSet, opts metav1.UpdateOptions) (*v1beta2.StatefulSet, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "apps", + Version: "v1beta2", + Kind: "StatefulSet", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &v1beta2.StatefulSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAppsV1beta2StatefulSetImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapAppsV1beta2StatefulSetImpl) GetScale(ctx context.Context, name string, opts metav1.GetOptions) (*v1beta2.Scale, error) { + panic("NYI") +} + +func (w *wrapAppsV1beta2StatefulSetImpl) UpdateScale(ctx context.Context, _ string, in *v1beta2.Scale, opts metav1.UpdateOptions) (*v1beta2.Scale, error) { + panic("NYI") +} + +// AuthenticationV1 retrieves the AuthenticationV1Client +func (w *wrapClient) AuthenticationV1() typedauthenticationv1.AuthenticationV1Interface { + return &wrapAuthenticationV1{ + dyn: w.dyn, + } +} + +type wrapAuthenticationV1 struct { + dyn dynamic.Interface +} + +func (w *wrapAuthenticationV1) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapAuthenticationV1) TokenReviews() typedauthenticationv1.TokenReviewInterface { + return &wrapAuthenticationV1TokenReviewImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "authentication.k8s.io", + Version: "v1", + Resource: "tokenreviews", + }), + } +} + +type wrapAuthenticationV1TokenReviewImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedauthenticationv1.TokenReviewInterface = (*wrapAuthenticationV1TokenReviewImpl)(nil) + +func (w *wrapAuthenticationV1TokenReviewImpl) Create(ctx context.Context, in *authenticationv1.TokenReview, opts metav1.CreateOptions) (*authenticationv1.TokenReview, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "authentication.k8s.io", + Version: "v1", + Kind: "TokenReview", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &authenticationv1.TokenReview{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +// AuthenticationV1beta1 retrieves the AuthenticationV1beta1Client +func (w *wrapClient) AuthenticationV1beta1() typedauthenticationv1beta1.AuthenticationV1beta1Interface { + return &wrapAuthenticationV1beta1{ + dyn: w.dyn, + } +} + +type wrapAuthenticationV1beta1 struct { + dyn dynamic.Interface +} + +func (w *wrapAuthenticationV1beta1) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapAuthenticationV1beta1) TokenReviews() typedauthenticationv1beta1.TokenReviewInterface { + return &wrapAuthenticationV1beta1TokenReviewImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "authentication.k8s.io", + Version: "v1beta1", + Resource: "tokenreviews", + }), + } +} + +type wrapAuthenticationV1beta1TokenReviewImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedauthenticationv1beta1.TokenReviewInterface = (*wrapAuthenticationV1beta1TokenReviewImpl)(nil) + +func (w *wrapAuthenticationV1beta1TokenReviewImpl) Create(ctx context.Context, in *authenticationv1beta1.TokenReview, opts metav1.CreateOptions) (*authenticationv1beta1.TokenReview, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "authentication.k8s.io", + Version: "v1beta1", + Kind: "TokenReview", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &authenticationv1beta1.TokenReview{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +// AuthorizationV1 retrieves the AuthorizationV1Client +func (w *wrapClient) AuthorizationV1() typedauthorizationv1.AuthorizationV1Interface { + return &wrapAuthorizationV1{ + dyn: w.dyn, + } +} + +type wrapAuthorizationV1 struct { + dyn dynamic.Interface +} + +func (w *wrapAuthorizationV1) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapAuthorizationV1) LocalSubjectAccessReviews(namespace string) typedauthorizationv1.LocalSubjectAccessReviewInterface { + return &wrapAuthorizationV1LocalSubjectAccessReviewImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "authorization.k8s.io", + Version: "v1", + Resource: "localsubjectaccessreviews", + }), + + namespace: namespace, + } +} + +type wrapAuthorizationV1LocalSubjectAccessReviewImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedauthorizationv1.LocalSubjectAccessReviewInterface = (*wrapAuthorizationV1LocalSubjectAccessReviewImpl)(nil) + +func (w *wrapAuthorizationV1LocalSubjectAccessReviewImpl) Create(ctx context.Context, in *authorizationv1.LocalSubjectAccessReview, opts metav1.CreateOptions) (*authorizationv1.LocalSubjectAccessReview, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "authorization.k8s.io", + Version: "v1", + Kind: "LocalSubjectAccessReview", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &authorizationv1.LocalSubjectAccessReview{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAuthorizationV1) SelfSubjectAccessReviews() typedauthorizationv1.SelfSubjectAccessReviewInterface { + return &wrapAuthorizationV1SelfSubjectAccessReviewImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "authorization.k8s.io", + Version: "v1", + Resource: "selfsubjectaccessreviews", + }), + } +} + +type wrapAuthorizationV1SelfSubjectAccessReviewImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedauthorizationv1.SelfSubjectAccessReviewInterface = (*wrapAuthorizationV1SelfSubjectAccessReviewImpl)(nil) + +func (w *wrapAuthorizationV1SelfSubjectAccessReviewImpl) Create(ctx context.Context, in *authorizationv1.SelfSubjectAccessReview, opts metav1.CreateOptions) (*authorizationv1.SelfSubjectAccessReview, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "authorization.k8s.io", + Version: "v1", + Kind: "SelfSubjectAccessReview", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &authorizationv1.SelfSubjectAccessReview{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAuthorizationV1) SelfSubjectRulesReviews() typedauthorizationv1.SelfSubjectRulesReviewInterface { + return &wrapAuthorizationV1SelfSubjectRulesReviewImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "authorization.k8s.io", + Version: "v1", + Resource: "selfsubjectrulesreviews", + }), + } +} + +type wrapAuthorizationV1SelfSubjectRulesReviewImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedauthorizationv1.SelfSubjectRulesReviewInterface = (*wrapAuthorizationV1SelfSubjectRulesReviewImpl)(nil) + +func (w *wrapAuthorizationV1SelfSubjectRulesReviewImpl) Create(ctx context.Context, in *authorizationv1.SelfSubjectRulesReview, opts metav1.CreateOptions) (*authorizationv1.SelfSubjectRulesReview, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "authorization.k8s.io", + Version: "v1", + Kind: "SelfSubjectRulesReview", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &authorizationv1.SelfSubjectRulesReview{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAuthorizationV1) SubjectAccessReviews() typedauthorizationv1.SubjectAccessReviewInterface { + return &wrapAuthorizationV1SubjectAccessReviewImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "authorization.k8s.io", + Version: "v1", + Resource: "subjectaccessreviews", + }), + } +} + +type wrapAuthorizationV1SubjectAccessReviewImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedauthorizationv1.SubjectAccessReviewInterface = (*wrapAuthorizationV1SubjectAccessReviewImpl)(nil) + +func (w *wrapAuthorizationV1SubjectAccessReviewImpl) Create(ctx context.Context, in *authorizationv1.SubjectAccessReview, opts metav1.CreateOptions) (*authorizationv1.SubjectAccessReview, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "authorization.k8s.io", + Version: "v1", + Kind: "SubjectAccessReview", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &authorizationv1.SubjectAccessReview{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +// AuthorizationV1beta1 retrieves the AuthorizationV1beta1Client +func (w *wrapClient) AuthorizationV1beta1() typedauthorizationv1beta1.AuthorizationV1beta1Interface { + return &wrapAuthorizationV1beta1{ + dyn: w.dyn, + } +} + +type wrapAuthorizationV1beta1 struct { + dyn dynamic.Interface +} + +func (w *wrapAuthorizationV1beta1) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapAuthorizationV1beta1) LocalSubjectAccessReviews(namespace string) typedauthorizationv1beta1.LocalSubjectAccessReviewInterface { + return &wrapAuthorizationV1beta1LocalSubjectAccessReviewImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "authorization.k8s.io", + Version: "v1beta1", + Resource: "localsubjectaccessreviews", + }), + + namespace: namespace, + } +} + +type wrapAuthorizationV1beta1LocalSubjectAccessReviewImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedauthorizationv1beta1.LocalSubjectAccessReviewInterface = (*wrapAuthorizationV1beta1LocalSubjectAccessReviewImpl)(nil) + +func (w *wrapAuthorizationV1beta1LocalSubjectAccessReviewImpl) Create(ctx context.Context, in *authorizationv1beta1.LocalSubjectAccessReview, opts metav1.CreateOptions) (*authorizationv1beta1.LocalSubjectAccessReview, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "authorization.k8s.io", + Version: "v1beta1", + Kind: "LocalSubjectAccessReview", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &authorizationv1beta1.LocalSubjectAccessReview{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAuthorizationV1beta1) SelfSubjectAccessReviews() typedauthorizationv1beta1.SelfSubjectAccessReviewInterface { + return &wrapAuthorizationV1beta1SelfSubjectAccessReviewImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "authorization.k8s.io", + Version: "v1beta1", + Resource: "selfsubjectaccessreviews", + }), + } +} + +type wrapAuthorizationV1beta1SelfSubjectAccessReviewImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedauthorizationv1beta1.SelfSubjectAccessReviewInterface = (*wrapAuthorizationV1beta1SelfSubjectAccessReviewImpl)(nil) + +func (w *wrapAuthorizationV1beta1SelfSubjectAccessReviewImpl) Create(ctx context.Context, in *authorizationv1beta1.SelfSubjectAccessReview, opts metav1.CreateOptions) (*authorizationv1beta1.SelfSubjectAccessReview, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "authorization.k8s.io", + Version: "v1beta1", + Kind: "SelfSubjectAccessReview", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &authorizationv1beta1.SelfSubjectAccessReview{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAuthorizationV1beta1) SelfSubjectRulesReviews() typedauthorizationv1beta1.SelfSubjectRulesReviewInterface { + return &wrapAuthorizationV1beta1SelfSubjectRulesReviewImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "authorization.k8s.io", + Version: "v1beta1", + Resource: "selfsubjectrulesreviews", + }), + } +} + +type wrapAuthorizationV1beta1SelfSubjectRulesReviewImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedauthorizationv1beta1.SelfSubjectRulesReviewInterface = (*wrapAuthorizationV1beta1SelfSubjectRulesReviewImpl)(nil) + +func (w *wrapAuthorizationV1beta1SelfSubjectRulesReviewImpl) Create(ctx context.Context, in *authorizationv1beta1.SelfSubjectRulesReview, opts metav1.CreateOptions) (*authorizationv1beta1.SelfSubjectRulesReview, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "authorization.k8s.io", + Version: "v1beta1", + Kind: "SelfSubjectRulesReview", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &authorizationv1beta1.SelfSubjectRulesReview{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAuthorizationV1beta1) SubjectAccessReviews() typedauthorizationv1beta1.SubjectAccessReviewInterface { + return &wrapAuthorizationV1beta1SubjectAccessReviewImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "authorization.k8s.io", + Version: "v1beta1", + Resource: "subjectaccessreviews", + }), + } +} + +type wrapAuthorizationV1beta1SubjectAccessReviewImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedauthorizationv1beta1.SubjectAccessReviewInterface = (*wrapAuthorizationV1beta1SubjectAccessReviewImpl)(nil) + +func (w *wrapAuthorizationV1beta1SubjectAccessReviewImpl) Create(ctx context.Context, in *authorizationv1beta1.SubjectAccessReview, opts metav1.CreateOptions) (*authorizationv1beta1.SubjectAccessReview, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "authorization.k8s.io", + Version: "v1beta1", + Kind: "SubjectAccessReview", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &authorizationv1beta1.SubjectAccessReview{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +// AutoscalingV1 retrieves the AutoscalingV1Client +func (w *wrapClient) AutoscalingV1() typedautoscalingv1.AutoscalingV1Interface { + return &wrapAutoscalingV1{ + dyn: w.dyn, + } +} + +type wrapAutoscalingV1 struct { + dyn dynamic.Interface +} + +func (w *wrapAutoscalingV1) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapAutoscalingV1) HorizontalPodAutoscalers(namespace string) typedautoscalingv1.HorizontalPodAutoscalerInterface { + return &wrapAutoscalingV1HorizontalPodAutoscalerImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "autoscaling", + Version: "v1", + Resource: "horizontalpodautoscalers", + }), + + namespace: namespace, + } +} + +type wrapAutoscalingV1HorizontalPodAutoscalerImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedautoscalingv1.HorizontalPodAutoscalerInterface = (*wrapAutoscalingV1HorizontalPodAutoscalerImpl)(nil) + +func (w *wrapAutoscalingV1HorizontalPodAutoscalerImpl) Create(ctx context.Context, in *autoscalingv1.HorizontalPodAutoscaler, opts metav1.CreateOptions) (*autoscalingv1.HorizontalPodAutoscaler, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "autoscaling", + Version: "v1", + Kind: "HorizontalPodAutoscaler", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &autoscalingv1.HorizontalPodAutoscaler{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAutoscalingV1HorizontalPodAutoscalerImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapAutoscalingV1HorizontalPodAutoscalerImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapAutoscalingV1HorizontalPodAutoscalerImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*autoscalingv1.HorizontalPodAutoscaler, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &autoscalingv1.HorizontalPodAutoscaler{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAutoscalingV1HorizontalPodAutoscalerImpl) List(ctx context.Context, opts metav1.ListOptions) (*autoscalingv1.HorizontalPodAutoscalerList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &autoscalingv1.HorizontalPodAutoscalerList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAutoscalingV1HorizontalPodAutoscalerImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *autoscalingv1.HorizontalPodAutoscaler, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &autoscalingv1.HorizontalPodAutoscaler{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAutoscalingV1HorizontalPodAutoscalerImpl) Update(ctx context.Context, in *autoscalingv1.HorizontalPodAutoscaler, opts metav1.UpdateOptions) (*autoscalingv1.HorizontalPodAutoscaler, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "autoscaling", + Version: "v1", + Kind: "HorizontalPodAutoscaler", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &autoscalingv1.HorizontalPodAutoscaler{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAutoscalingV1HorizontalPodAutoscalerImpl) UpdateStatus(ctx context.Context, in *autoscalingv1.HorizontalPodAutoscaler, opts metav1.UpdateOptions) (*autoscalingv1.HorizontalPodAutoscaler, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "autoscaling", + Version: "v1", + Kind: "HorizontalPodAutoscaler", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &autoscalingv1.HorizontalPodAutoscaler{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAutoscalingV1HorizontalPodAutoscalerImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +// AutoscalingV2beta1 retrieves the AutoscalingV2beta1Client +func (w *wrapClient) AutoscalingV2beta1() typedautoscalingv2beta1.AutoscalingV2beta1Interface { + return &wrapAutoscalingV2beta1{ + dyn: w.dyn, + } +} + +type wrapAutoscalingV2beta1 struct { + dyn dynamic.Interface +} + +func (w *wrapAutoscalingV2beta1) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapAutoscalingV2beta1) HorizontalPodAutoscalers(namespace string) typedautoscalingv2beta1.HorizontalPodAutoscalerInterface { + return &wrapAutoscalingV2beta1HorizontalPodAutoscalerImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "autoscaling", + Version: "v2beta1", + Resource: "horizontalpodautoscalers", + }), + + namespace: namespace, + } +} + +type wrapAutoscalingV2beta1HorizontalPodAutoscalerImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedautoscalingv2beta1.HorizontalPodAutoscalerInterface = (*wrapAutoscalingV2beta1HorizontalPodAutoscalerImpl)(nil) + +func (w *wrapAutoscalingV2beta1HorizontalPodAutoscalerImpl) Create(ctx context.Context, in *v2beta1.HorizontalPodAutoscaler, opts metav1.CreateOptions) (*v2beta1.HorizontalPodAutoscaler, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "autoscaling", + Version: "v2beta1", + Kind: "HorizontalPodAutoscaler", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &v2beta1.HorizontalPodAutoscaler{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAutoscalingV2beta1HorizontalPodAutoscalerImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapAutoscalingV2beta1HorizontalPodAutoscalerImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapAutoscalingV2beta1HorizontalPodAutoscalerImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*v2beta1.HorizontalPodAutoscaler, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &v2beta1.HorizontalPodAutoscaler{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAutoscalingV2beta1HorizontalPodAutoscalerImpl) List(ctx context.Context, opts metav1.ListOptions) (*v2beta1.HorizontalPodAutoscalerList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &v2beta1.HorizontalPodAutoscalerList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAutoscalingV2beta1HorizontalPodAutoscalerImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v2beta1.HorizontalPodAutoscaler, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &v2beta1.HorizontalPodAutoscaler{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAutoscalingV2beta1HorizontalPodAutoscalerImpl) Update(ctx context.Context, in *v2beta1.HorizontalPodAutoscaler, opts metav1.UpdateOptions) (*v2beta1.HorizontalPodAutoscaler, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "autoscaling", + Version: "v2beta1", + Kind: "HorizontalPodAutoscaler", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &v2beta1.HorizontalPodAutoscaler{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAutoscalingV2beta1HorizontalPodAutoscalerImpl) UpdateStatus(ctx context.Context, in *v2beta1.HorizontalPodAutoscaler, opts metav1.UpdateOptions) (*v2beta1.HorizontalPodAutoscaler, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "autoscaling", + Version: "v2beta1", + Kind: "HorizontalPodAutoscaler", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &v2beta1.HorizontalPodAutoscaler{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAutoscalingV2beta1HorizontalPodAutoscalerImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +// AutoscalingV2beta2 retrieves the AutoscalingV2beta2Client +func (w *wrapClient) AutoscalingV2beta2() typedautoscalingv2beta2.AutoscalingV2beta2Interface { + return &wrapAutoscalingV2beta2{ + dyn: w.dyn, + } +} + +type wrapAutoscalingV2beta2 struct { + dyn dynamic.Interface +} + +func (w *wrapAutoscalingV2beta2) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapAutoscalingV2beta2) HorizontalPodAutoscalers(namespace string) typedautoscalingv2beta2.HorizontalPodAutoscalerInterface { + return &wrapAutoscalingV2beta2HorizontalPodAutoscalerImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "autoscaling", + Version: "v2beta2", + Resource: "horizontalpodautoscalers", + }), + + namespace: namespace, + } +} + +type wrapAutoscalingV2beta2HorizontalPodAutoscalerImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedautoscalingv2beta2.HorizontalPodAutoscalerInterface = (*wrapAutoscalingV2beta2HorizontalPodAutoscalerImpl)(nil) + +func (w *wrapAutoscalingV2beta2HorizontalPodAutoscalerImpl) Create(ctx context.Context, in *v2beta2.HorizontalPodAutoscaler, opts metav1.CreateOptions) (*v2beta2.HorizontalPodAutoscaler, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "autoscaling", + Version: "v2beta2", + Kind: "HorizontalPodAutoscaler", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &v2beta2.HorizontalPodAutoscaler{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAutoscalingV2beta2HorizontalPodAutoscalerImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapAutoscalingV2beta2HorizontalPodAutoscalerImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapAutoscalingV2beta2HorizontalPodAutoscalerImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*v2beta2.HorizontalPodAutoscaler, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &v2beta2.HorizontalPodAutoscaler{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAutoscalingV2beta2HorizontalPodAutoscalerImpl) List(ctx context.Context, opts metav1.ListOptions) (*v2beta2.HorizontalPodAutoscalerList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &v2beta2.HorizontalPodAutoscalerList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAutoscalingV2beta2HorizontalPodAutoscalerImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v2beta2.HorizontalPodAutoscaler, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &v2beta2.HorizontalPodAutoscaler{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAutoscalingV2beta2HorizontalPodAutoscalerImpl) Update(ctx context.Context, in *v2beta2.HorizontalPodAutoscaler, opts metav1.UpdateOptions) (*v2beta2.HorizontalPodAutoscaler, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "autoscaling", + Version: "v2beta2", + Kind: "HorizontalPodAutoscaler", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &v2beta2.HorizontalPodAutoscaler{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAutoscalingV2beta2HorizontalPodAutoscalerImpl) UpdateStatus(ctx context.Context, in *v2beta2.HorizontalPodAutoscaler, opts metav1.UpdateOptions) (*v2beta2.HorizontalPodAutoscaler, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "autoscaling", + Version: "v2beta2", + Kind: "HorizontalPodAutoscaler", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &v2beta2.HorizontalPodAutoscaler{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapAutoscalingV2beta2HorizontalPodAutoscalerImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +// BatchV1 retrieves the BatchV1Client +func (w *wrapClient) BatchV1() typedbatchv1.BatchV1Interface { + return &wrapBatchV1{ + dyn: w.dyn, + } +} + +type wrapBatchV1 struct { + dyn dynamic.Interface +} + +func (w *wrapBatchV1) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapBatchV1) Jobs(namespace string) typedbatchv1.JobInterface { + return &wrapBatchV1JobImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "batch", + Version: "v1", + Resource: "jobs", + }), + + namespace: namespace, + } +} + +type wrapBatchV1JobImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedbatchv1.JobInterface = (*wrapBatchV1JobImpl)(nil) + +func (w *wrapBatchV1JobImpl) Create(ctx context.Context, in *batchv1.Job, opts metav1.CreateOptions) (*batchv1.Job, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "batch", + Version: "v1", + Kind: "Job", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &batchv1.Job{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapBatchV1JobImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapBatchV1JobImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapBatchV1JobImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*batchv1.Job, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &batchv1.Job{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapBatchV1JobImpl) List(ctx context.Context, opts metav1.ListOptions) (*batchv1.JobList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &batchv1.JobList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapBatchV1JobImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *batchv1.Job, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &batchv1.Job{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapBatchV1JobImpl) Update(ctx context.Context, in *batchv1.Job, opts metav1.UpdateOptions) (*batchv1.Job, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "batch", + Version: "v1", + Kind: "Job", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &batchv1.Job{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapBatchV1JobImpl) UpdateStatus(ctx context.Context, in *batchv1.Job, opts metav1.UpdateOptions) (*batchv1.Job, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "batch", + Version: "v1", + Kind: "Job", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &batchv1.Job{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapBatchV1JobImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +// BatchV1beta1 retrieves the BatchV1beta1Client +func (w *wrapClient) BatchV1beta1() typedbatchv1beta1.BatchV1beta1Interface { + return &wrapBatchV1beta1{ + dyn: w.dyn, + } +} + +type wrapBatchV1beta1 struct { + dyn dynamic.Interface +} + +func (w *wrapBatchV1beta1) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapBatchV1beta1) CronJobs(namespace string) typedbatchv1beta1.CronJobInterface { + return &wrapBatchV1beta1CronJobImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "batch", + Version: "v1beta1", + Resource: "cronjobs", + }), + + namespace: namespace, + } +} + +type wrapBatchV1beta1CronJobImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedbatchv1beta1.CronJobInterface = (*wrapBatchV1beta1CronJobImpl)(nil) + +func (w *wrapBatchV1beta1CronJobImpl) Create(ctx context.Context, in *batchv1beta1.CronJob, opts metav1.CreateOptions) (*batchv1beta1.CronJob, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "batch", + Version: "v1beta1", + Kind: "CronJob", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &batchv1beta1.CronJob{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapBatchV1beta1CronJobImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapBatchV1beta1CronJobImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapBatchV1beta1CronJobImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*batchv1beta1.CronJob, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &batchv1beta1.CronJob{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapBatchV1beta1CronJobImpl) List(ctx context.Context, opts metav1.ListOptions) (*batchv1beta1.CronJobList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &batchv1beta1.CronJobList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapBatchV1beta1CronJobImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *batchv1beta1.CronJob, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &batchv1beta1.CronJob{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapBatchV1beta1CronJobImpl) Update(ctx context.Context, in *batchv1beta1.CronJob, opts metav1.UpdateOptions) (*batchv1beta1.CronJob, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "batch", + Version: "v1beta1", + Kind: "CronJob", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &batchv1beta1.CronJob{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapBatchV1beta1CronJobImpl) UpdateStatus(ctx context.Context, in *batchv1beta1.CronJob, opts metav1.UpdateOptions) (*batchv1beta1.CronJob, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "batch", + Version: "v1beta1", + Kind: "CronJob", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &batchv1beta1.CronJob{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapBatchV1beta1CronJobImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +// BatchV2alpha1 retrieves the BatchV2alpha1Client +func (w *wrapClient) BatchV2alpha1() typedbatchv2alpha1.BatchV2alpha1Interface { + return &wrapBatchV2alpha1{ + dyn: w.dyn, + } +} + +type wrapBatchV2alpha1 struct { + dyn dynamic.Interface +} + +func (w *wrapBatchV2alpha1) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapBatchV2alpha1) CronJobs(namespace string) typedbatchv2alpha1.CronJobInterface { + return &wrapBatchV2alpha1CronJobImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "batch", + Version: "v2alpha1", + Resource: "cronjobs", + }), + + namespace: namespace, + } +} + +type wrapBatchV2alpha1CronJobImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedbatchv2alpha1.CronJobInterface = (*wrapBatchV2alpha1CronJobImpl)(nil) + +func (w *wrapBatchV2alpha1CronJobImpl) Create(ctx context.Context, in *v2alpha1.CronJob, opts metav1.CreateOptions) (*v2alpha1.CronJob, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "batch", + Version: "v2alpha1", + Kind: "CronJob", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &v2alpha1.CronJob{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapBatchV2alpha1CronJobImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapBatchV2alpha1CronJobImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapBatchV2alpha1CronJobImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*v2alpha1.CronJob, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &v2alpha1.CronJob{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapBatchV2alpha1CronJobImpl) List(ctx context.Context, opts metav1.ListOptions) (*v2alpha1.CronJobList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &v2alpha1.CronJobList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapBatchV2alpha1CronJobImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v2alpha1.CronJob, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &v2alpha1.CronJob{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapBatchV2alpha1CronJobImpl) Update(ctx context.Context, in *v2alpha1.CronJob, opts metav1.UpdateOptions) (*v2alpha1.CronJob, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "batch", + Version: "v2alpha1", + Kind: "CronJob", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &v2alpha1.CronJob{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapBatchV2alpha1CronJobImpl) UpdateStatus(ctx context.Context, in *v2alpha1.CronJob, opts metav1.UpdateOptions) (*v2alpha1.CronJob, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "batch", + Version: "v2alpha1", + Kind: "CronJob", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &v2alpha1.CronJob{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapBatchV2alpha1CronJobImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +// CertificatesV1 retrieves the CertificatesV1Client +func (w *wrapClient) CertificatesV1() typedcertificatesv1.CertificatesV1Interface { + return &wrapCertificatesV1{ + dyn: w.dyn, + } +} + +type wrapCertificatesV1 struct { + dyn dynamic.Interface +} + +func (w *wrapCertificatesV1) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapCertificatesV1) CertificateSigningRequests() typedcertificatesv1.CertificateSigningRequestInterface { + return &wrapCertificatesV1CertificateSigningRequestImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "certificates.k8s.io", + Version: "v1", + Resource: "certificatesigningrequests", + }), + } +} + +type wrapCertificatesV1CertificateSigningRequestImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedcertificatesv1.CertificateSigningRequestInterface = (*wrapCertificatesV1CertificateSigningRequestImpl)(nil) + +func (w *wrapCertificatesV1CertificateSigningRequestImpl) Create(ctx context.Context, in *certificatesv1.CertificateSigningRequest, opts metav1.CreateOptions) (*certificatesv1.CertificateSigningRequest, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "certificates.k8s.io", + Version: "v1", + Kind: "CertificateSigningRequest", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &certificatesv1.CertificateSigningRequest{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCertificatesV1CertificateSigningRequestImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Delete(ctx, name, opts) +} + +func (w *wrapCertificatesV1CertificateSigningRequestImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapCertificatesV1CertificateSigningRequestImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*certificatesv1.CertificateSigningRequest, error) { + uo, err := w.dyn.Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &certificatesv1.CertificateSigningRequest{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCertificatesV1CertificateSigningRequestImpl) List(ctx context.Context, opts metav1.ListOptions) (*certificatesv1.CertificateSigningRequestList, error) { + uo, err := w.dyn.List(ctx, opts) + if err != nil { + return nil, err + } + out := &certificatesv1.CertificateSigningRequestList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCertificatesV1CertificateSigningRequestImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *certificatesv1.CertificateSigningRequest, err error) { + uo, err := w.dyn.Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &certificatesv1.CertificateSigningRequest{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCertificatesV1CertificateSigningRequestImpl) Update(ctx context.Context, in *certificatesv1.CertificateSigningRequest, opts metav1.UpdateOptions) (*certificatesv1.CertificateSigningRequest, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "certificates.k8s.io", + Version: "v1", + Kind: "CertificateSigningRequest", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &certificatesv1.CertificateSigningRequest{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCertificatesV1CertificateSigningRequestImpl) UpdateStatus(ctx context.Context, in *certificatesv1.CertificateSigningRequest, opts metav1.UpdateOptions) (*certificatesv1.CertificateSigningRequest, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "certificates.k8s.io", + Version: "v1", + Kind: "CertificateSigningRequest", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &certificatesv1.CertificateSigningRequest{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCertificatesV1CertificateSigningRequestImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapCertificatesV1CertificateSigningRequestImpl) UpdateApproval(ctx context.Context, _ string, in *certificatesv1.CertificateSigningRequest, opts metav1.UpdateOptions) (*certificatesv1.CertificateSigningRequest, error) { + panic("NYI") +} + +// CertificatesV1beta1 retrieves the CertificatesV1beta1Client +func (w *wrapClient) CertificatesV1beta1() typedcertificatesv1beta1.CertificatesV1beta1Interface { + return &wrapCertificatesV1beta1{ + dyn: w.dyn, + } +} + +type wrapCertificatesV1beta1 struct { + dyn dynamic.Interface +} + +func (w *wrapCertificatesV1beta1) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapCertificatesV1beta1) CertificateSigningRequests() typedcertificatesv1beta1.CertificateSigningRequestInterface { + return &wrapCertificatesV1beta1CertificateSigningRequestImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "certificates.k8s.io", + Version: "v1beta1", + Resource: "certificatesigningrequests", + }), + } +} + +type wrapCertificatesV1beta1CertificateSigningRequestImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedcertificatesv1beta1.CertificateSigningRequestInterface = (*wrapCertificatesV1beta1CertificateSigningRequestImpl)(nil) + +func (w *wrapCertificatesV1beta1CertificateSigningRequestImpl) Create(ctx context.Context, in *certificatesv1beta1.CertificateSigningRequest, opts metav1.CreateOptions) (*certificatesv1beta1.CertificateSigningRequest, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "certificates.k8s.io", + Version: "v1beta1", + Kind: "CertificateSigningRequest", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &certificatesv1beta1.CertificateSigningRequest{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCertificatesV1beta1CertificateSigningRequestImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Delete(ctx, name, opts) +} + +func (w *wrapCertificatesV1beta1CertificateSigningRequestImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapCertificatesV1beta1CertificateSigningRequestImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*certificatesv1beta1.CertificateSigningRequest, error) { + uo, err := w.dyn.Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &certificatesv1beta1.CertificateSigningRequest{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCertificatesV1beta1CertificateSigningRequestImpl) List(ctx context.Context, opts metav1.ListOptions) (*certificatesv1beta1.CertificateSigningRequestList, error) { + uo, err := w.dyn.List(ctx, opts) + if err != nil { + return nil, err + } + out := &certificatesv1beta1.CertificateSigningRequestList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCertificatesV1beta1CertificateSigningRequestImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *certificatesv1beta1.CertificateSigningRequest, err error) { + uo, err := w.dyn.Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &certificatesv1beta1.CertificateSigningRequest{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCertificatesV1beta1CertificateSigningRequestImpl) Update(ctx context.Context, in *certificatesv1beta1.CertificateSigningRequest, opts metav1.UpdateOptions) (*certificatesv1beta1.CertificateSigningRequest, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "certificates.k8s.io", + Version: "v1beta1", + Kind: "CertificateSigningRequest", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &certificatesv1beta1.CertificateSigningRequest{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCertificatesV1beta1CertificateSigningRequestImpl) UpdateStatus(ctx context.Context, in *certificatesv1beta1.CertificateSigningRequest, opts metav1.UpdateOptions) (*certificatesv1beta1.CertificateSigningRequest, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "certificates.k8s.io", + Version: "v1beta1", + Kind: "CertificateSigningRequest", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &certificatesv1beta1.CertificateSigningRequest{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCertificatesV1beta1CertificateSigningRequestImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +// CoordinationV1 retrieves the CoordinationV1Client +func (w *wrapClient) CoordinationV1() typedcoordinationv1.CoordinationV1Interface { + return &wrapCoordinationV1{ + dyn: w.dyn, + } +} + +type wrapCoordinationV1 struct { + dyn dynamic.Interface +} + +func (w *wrapCoordinationV1) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapCoordinationV1) Leases(namespace string) typedcoordinationv1.LeaseInterface { + return &wrapCoordinationV1LeaseImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "coordination.k8s.io", + Version: "v1", + Resource: "leases", + }), + + namespace: namespace, + } +} + +type wrapCoordinationV1LeaseImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedcoordinationv1.LeaseInterface = (*wrapCoordinationV1LeaseImpl)(nil) + +func (w *wrapCoordinationV1LeaseImpl) Create(ctx context.Context, in *coordinationv1.Lease, opts metav1.CreateOptions) (*coordinationv1.Lease, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "coordination.k8s.io", + Version: "v1", + Kind: "Lease", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &coordinationv1.Lease{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoordinationV1LeaseImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapCoordinationV1LeaseImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapCoordinationV1LeaseImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*coordinationv1.Lease, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &coordinationv1.Lease{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoordinationV1LeaseImpl) List(ctx context.Context, opts metav1.ListOptions) (*coordinationv1.LeaseList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &coordinationv1.LeaseList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoordinationV1LeaseImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *coordinationv1.Lease, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &coordinationv1.Lease{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoordinationV1LeaseImpl) Update(ctx context.Context, in *coordinationv1.Lease, opts metav1.UpdateOptions) (*coordinationv1.Lease, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "coordination.k8s.io", + Version: "v1", + Kind: "Lease", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &coordinationv1.Lease{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoordinationV1LeaseImpl) UpdateStatus(ctx context.Context, in *coordinationv1.Lease, opts metav1.UpdateOptions) (*coordinationv1.Lease, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "coordination.k8s.io", + Version: "v1", + Kind: "Lease", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &coordinationv1.Lease{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoordinationV1LeaseImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +// CoordinationV1beta1 retrieves the CoordinationV1beta1Client +func (w *wrapClient) CoordinationV1beta1() typedcoordinationv1beta1.CoordinationV1beta1Interface { + return &wrapCoordinationV1beta1{ + dyn: w.dyn, + } +} + +type wrapCoordinationV1beta1 struct { + dyn dynamic.Interface +} + +func (w *wrapCoordinationV1beta1) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapCoordinationV1beta1) Leases(namespace string) typedcoordinationv1beta1.LeaseInterface { + return &wrapCoordinationV1beta1LeaseImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "coordination.k8s.io", + Version: "v1beta1", + Resource: "leases", + }), + + namespace: namespace, + } +} + +type wrapCoordinationV1beta1LeaseImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedcoordinationv1beta1.LeaseInterface = (*wrapCoordinationV1beta1LeaseImpl)(nil) + +func (w *wrapCoordinationV1beta1LeaseImpl) Create(ctx context.Context, in *coordinationv1beta1.Lease, opts metav1.CreateOptions) (*coordinationv1beta1.Lease, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "coordination.k8s.io", + Version: "v1beta1", + Kind: "Lease", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &coordinationv1beta1.Lease{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoordinationV1beta1LeaseImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapCoordinationV1beta1LeaseImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapCoordinationV1beta1LeaseImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*coordinationv1beta1.Lease, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &coordinationv1beta1.Lease{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoordinationV1beta1LeaseImpl) List(ctx context.Context, opts metav1.ListOptions) (*coordinationv1beta1.LeaseList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &coordinationv1beta1.LeaseList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoordinationV1beta1LeaseImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *coordinationv1beta1.Lease, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &coordinationv1beta1.Lease{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoordinationV1beta1LeaseImpl) Update(ctx context.Context, in *coordinationv1beta1.Lease, opts metav1.UpdateOptions) (*coordinationv1beta1.Lease, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "coordination.k8s.io", + Version: "v1beta1", + Kind: "Lease", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &coordinationv1beta1.Lease{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoordinationV1beta1LeaseImpl) UpdateStatus(ctx context.Context, in *coordinationv1beta1.Lease, opts metav1.UpdateOptions) (*coordinationv1beta1.Lease, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "coordination.k8s.io", + Version: "v1beta1", + Kind: "Lease", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &coordinationv1beta1.Lease{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoordinationV1beta1LeaseImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +// CoreV1 retrieves the CoreV1Client +func (w *wrapClient) CoreV1() typedcorev1.CoreV1Interface { + return &wrapCoreV1{ + dyn: w.dyn, + } +} + +type wrapCoreV1 struct { + dyn dynamic.Interface +} + +func (w *wrapCoreV1) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapCoreV1) ComponentStatuses() typedcorev1.ComponentStatusInterface { + return &wrapCoreV1ComponentStatusImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "", + Version: "v1", + Resource: "componentstatuses", + }), + } +} + +type wrapCoreV1ComponentStatusImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedcorev1.ComponentStatusInterface = (*wrapCoreV1ComponentStatusImpl)(nil) + +func (w *wrapCoreV1ComponentStatusImpl) Create(ctx context.Context, in *corev1.ComponentStatus, opts metav1.CreateOptions) (*corev1.ComponentStatus, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "ComponentStatus", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.ComponentStatus{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1ComponentStatusImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Delete(ctx, name, opts) +} + +func (w *wrapCoreV1ComponentStatusImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapCoreV1ComponentStatusImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*corev1.ComponentStatus, error) { + uo, err := w.dyn.Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &corev1.ComponentStatus{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1ComponentStatusImpl) List(ctx context.Context, opts metav1.ListOptions) (*corev1.ComponentStatusList, error) { + uo, err := w.dyn.List(ctx, opts) + if err != nil { + return nil, err + } + out := &corev1.ComponentStatusList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1ComponentStatusImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *corev1.ComponentStatus, err error) { + uo, err := w.dyn.Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &corev1.ComponentStatus{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1ComponentStatusImpl) Update(ctx context.Context, in *corev1.ComponentStatus, opts metav1.UpdateOptions) (*corev1.ComponentStatus, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "ComponentStatus", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.ComponentStatus{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1ComponentStatusImpl) UpdateStatus(ctx context.Context, in *corev1.ComponentStatus, opts metav1.UpdateOptions) (*corev1.ComponentStatus, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "ComponentStatus", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.ComponentStatus{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1ComponentStatusImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapCoreV1) ConfigMaps(namespace string) typedcorev1.ConfigMapInterface { + return &wrapCoreV1ConfigMapImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "", + Version: "v1", + Resource: "configmaps", + }), + + namespace: namespace, + } +} + +type wrapCoreV1ConfigMapImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedcorev1.ConfigMapInterface = (*wrapCoreV1ConfigMapImpl)(nil) + +func (w *wrapCoreV1ConfigMapImpl) Create(ctx context.Context, in *corev1.ConfigMap, opts metav1.CreateOptions) (*corev1.ConfigMap, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "ConfigMap", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.ConfigMap{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1ConfigMapImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapCoreV1ConfigMapImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapCoreV1ConfigMapImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*corev1.ConfigMap, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &corev1.ConfigMap{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1ConfigMapImpl) List(ctx context.Context, opts metav1.ListOptions) (*corev1.ConfigMapList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &corev1.ConfigMapList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1ConfigMapImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *corev1.ConfigMap, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &corev1.ConfigMap{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1ConfigMapImpl) Update(ctx context.Context, in *corev1.ConfigMap, opts metav1.UpdateOptions) (*corev1.ConfigMap, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "ConfigMap", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.ConfigMap{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1ConfigMapImpl) UpdateStatus(ctx context.Context, in *corev1.ConfigMap, opts metav1.UpdateOptions) (*corev1.ConfigMap, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "ConfigMap", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.ConfigMap{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1ConfigMapImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapCoreV1) Endpoints(namespace string) typedcorev1.EndpointsInterface { + return &wrapCoreV1EndpointsImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "", + Version: "v1", + Resource: "endpoints", + }), + + namespace: namespace, + } +} + +type wrapCoreV1EndpointsImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedcorev1.EndpointsInterface = (*wrapCoreV1EndpointsImpl)(nil) + +func (w *wrapCoreV1EndpointsImpl) Create(ctx context.Context, in *corev1.Endpoints, opts metav1.CreateOptions) (*corev1.Endpoints, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Endpoints", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.Endpoints{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1EndpointsImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapCoreV1EndpointsImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapCoreV1EndpointsImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*corev1.Endpoints, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &corev1.Endpoints{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1EndpointsImpl) List(ctx context.Context, opts metav1.ListOptions) (*corev1.EndpointsList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &corev1.EndpointsList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1EndpointsImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *corev1.Endpoints, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &corev1.Endpoints{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1EndpointsImpl) Update(ctx context.Context, in *corev1.Endpoints, opts metav1.UpdateOptions) (*corev1.Endpoints, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Endpoints", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.Endpoints{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1EndpointsImpl) UpdateStatus(ctx context.Context, in *corev1.Endpoints, opts metav1.UpdateOptions) (*corev1.Endpoints, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Endpoints", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.Endpoints{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1EndpointsImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapCoreV1) Events(namespace string) typedcorev1.EventInterface { + return &wrapCoreV1EventImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "", + Version: "v1", + Resource: "events", + }), + + namespace: namespace, + } +} + +type wrapCoreV1EventImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedcorev1.EventInterface = (*wrapCoreV1EventImpl)(nil) + +func (w *wrapCoreV1EventImpl) Create(ctx context.Context, in *corev1.Event, opts metav1.CreateOptions) (*corev1.Event, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Event", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.Event{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1EventImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapCoreV1EventImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapCoreV1EventImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*corev1.Event, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &corev1.Event{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1EventImpl) List(ctx context.Context, opts metav1.ListOptions) (*corev1.EventList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &corev1.EventList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1EventImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *corev1.Event, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &corev1.Event{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1EventImpl) Update(ctx context.Context, in *corev1.Event, opts metav1.UpdateOptions) (*corev1.Event, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Event", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.Event{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1EventImpl) UpdateStatus(ctx context.Context, in *corev1.Event, opts metav1.UpdateOptions) (*corev1.Event, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Event", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.Event{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1EventImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapCoreV1) LimitRanges(namespace string) typedcorev1.LimitRangeInterface { + return &wrapCoreV1LimitRangeImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "", + Version: "v1", + Resource: "limitranges", + }), + + namespace: namespace, + } +} + +type wrapCoreV1LimitRangeImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedcorev1.LimitRangeInterface = (*wrapCoreV1LimitRangeImpl)(nil) + +func (w *wrapCoreV1LimitRangeImpl) Create(ctx context.Context, in *corev1.LimitRange, opts metav1.CreateOptions) (*corev1.LimitRange, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "LimitRange", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.LimitRange{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1LimitRangeImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapCoreV1LimitRangeImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapCoreV1LimitRangeImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*corev1.LimitRange, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &corev1.LimitRange{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1LimitRangeImpl) List(ctx context.Context, opts metav1.ListOptions) (*corev1.LimitRangeList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &corev1.LimitRangeList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1LimitRangeImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *corev1.LimitRange, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &corev1.LimitRange{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1LimitRangeImpl) Update(ctx context.Context, in *corev1.LimitRange, opts metav1.UpdateOptions) (*corev1.LimitRange, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "LimitRange", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.LimitRange{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1LimitRangeImpl) UpdateStatus(ctx context.Context, in *corev1.LimitRange, opts metav1.UpdateOptions) (*corev1.LimitRange, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "LimitRange", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.LimitRange{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1LimitRangeImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapCoreV1) Namespaces() typedcorev1.NamespaceInterface { + return &wrapCoreV1NamespaceImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "", + Version: "v1", + Resource: "namespaces", + }), + } +} + +type wrapCoreV1NamespaceImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedcorev1.NamespaceInterface = (*wrapCoreV1NamespaceImpl)(nil) + +func (w *wrapCoreV1NamespaceImpl) Create(ctx context.Context, in *corev1.Namespace, opts metav1.CreateOptions) (*corev1.Namespace, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Namespace", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.Namespace{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1NamespaceImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Delete(ctx, name, opts) +} + +func (w *wrapCoreV1NamespaceImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*corev1.Namespace, error) { + uo, err := w.dyn.Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &corev1.Namespace{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1NamespaceImpl) List(ctx context.Context, opts metav1.ListOptions) (*corev1.NamespaceList, error) { + uo, err := w.dyn.List(ctx, opts) + if err != nil { + return nil, err + } + out := &corev1.NamespaceList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1NamespaceImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *corev1.Namespace, err error) { + uo, err := w.dyn.Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &corev1.Namespace{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1NamespaceImpl) Update(ctx context.Context, in *corev1.Namespace, opts metav1.UpdateOptions) (*corev1.Namespace, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Namespace", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.Namespace{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1NamespaceImpl) UpdateStatus(ctx context.Context, in *corev1.Namespace, opts metav1.UpdateOptions) (*corev1.Namespace, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Namespace", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.Namespace{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1NamespaceImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapCoreV1) Nodes() typedcorev1.NodeInterface { + return &wrapCoreV1NodeImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "", + Version: "v1", + Resource: "nodes", + }), + } +} + +type wrapCoreV1NodeImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedcorev1.NodeInterface = (*wrapCoreV1NodeImpl)(nil) + +func (w *wrapCoreV1NodeImpl) Create(ctx context.Context, in *corev1.Node, opts metav1.CreateOptions) (*corev1.Node, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Node", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.Node{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1NodeImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Delete(ctx, name, opts) +} + +func (w *wrapCoreV1NodeImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapCoreV1NodeImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*corev1.Node, error) { + uo, err := w.dyn.Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &corev1.Node{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1NodeImpl) List(ctx context.Context, opts metav1.ListOptions) (*corev1.NodeList, error) { + uo, err := w.dyn.List(ctx, opts) + if err != nil { + return nil, err + } + out := &corev1.NodeList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1NodeImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *corev1.Node, err error) { + uo, err := w.dyn.Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &corev1.Node{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1NodeImpl) Update(ctx context.Context, in *corev1.Node, opts metav1.UpdateOptions) (*corev1.Node, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Node", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.Node{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1NodeImpl) UpdateStatus(ctx context.Context, in *corev1.Node, opts metav1.UpdateOptions) (*corev1.Node, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Node", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.Node{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1NodeImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapCoreV1) PersistentVolumes() typedcorev1.PersistentVolumeInterface { + return &wrapCoreV1PersistentVolumeImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "", + Version: "v1", + Resource: "persistentvolumes", + }), + } +} + +type wrapCoreV1PersistentVolumeImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedcorev1.PersistentVolumeInterface = (*wrapCoreV1PersistentVolumeImpl)(nil) + +func (w *wrapCoreV1PersistentVolumeImpl) Create(ctx context.Context, in *corev1.PersistentVolume, opts metav1.CreateOptions) (*corev1.PersistentVolume, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "PersistentVolume", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.PersistentVolume{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1PersistentVolumeImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Delete(ctx, name, opts) +} + +func (w *wrapCoreV1PersistentVolumeImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapCoreV1PersistentVolumeImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*corev1.PersistentVolume, error) { + uo, err := w.dyn.Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &corev1.PersistentVolume{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1PersistentVolumeImpl) List(ctx context.Context, opts metav1.ListOptions) (*corev1.PersistentVolumeList, error) { + uo, err := w.dyn.List(ctx, opts) + if err != nil { + return nil, err + } + out := &corev1.PersistentVolumeList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1PersistentVolumeImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *corev1.PersistentVolume, err error) { + uo, err := w.dyn.Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &corev1.PersistentVolume{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1PersistentVolumeImpl) Update(ctx context.Context, in *corev1.PersistentVolume, opts metav1.UpdateOptions) (*corev1.PersistentVolume, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "PersistentVolume", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.PersistentVolume{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1PersistentVolumeImpl) UpdateStatus(ctx context.Context, in *corev1.PersistentVolume, opts metav1.UpdateOptions) (*corev1.PersistentVolume, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "PersistentVolume", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.PersistentVolume{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1PersistentVolumeImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapCoreV1) PersistentVolumeClaims(namespace string) typedcorev1.PersistentVolumeClaimInterface { + return &wrapCoreV1PersistentVolumeClaimImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "", + Version: "v1", + Resource: "persistentvolumeclaims", + }), + + namespace: namespace, + } +} + +type wrapCoreV1PersistentVolumeClaimImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedcorev1.PersistentVolumeClaimInterface = (*wrapCoreV1PersistentVolumeClaimImpl)(nil) + +func (w *wrapCoreV1PersistentVolumeClaimImpl) Create(ctx context.Context, in *corev1.PersistentVolumeClaim, opts metav1.CreateOptions) (*corev1.PersistentVolumeClaim, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "PersistentVolumeClaim", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.PersistentVolumeClaim{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1PersistentVolumeClaimImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapCoreV1PersistentVolumeClaimImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapCoreV1PersistentVolumeClaimImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*corev1.PersistentVolumeClaim, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &corev1.PersistentVolumeClaim{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1PersistentVolumeClaimImpl) List(ctx context.Context, opts metav1.ListOptions) (*corev1.PersistentVolumeClaimList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &corev1.PersistentVolumeClaimList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1PersistentVolumeClaimImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *corev1.PersistentVolumeClaim, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &corev1.PersistentVolumeClaim{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1PersistentVolumeClaimImpl) Update(ctx context.Context, in *corev1.PersistentVolumeClaim, opts metav1.UpdateOptions) (*corev1.PersistentVolumeClaim, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "PersistentVolumeClaim", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.PersistentVolumeClaim{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1PersistentVolumeClaimImpl) UpdateStatus(ctx context.Context, in *corev1.PersistentVolumeClaim, opts metav1.UpdateOptions) (*corev1.PersistentVolumeClaim, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "PersistentVolumeClaim", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.PersistentVolumeClaim{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1PersistentVolumeClaimImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapCoreV1) Pods(namespace string) typedcorev1.PodInterface { + return &wrapCoreV1PodImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "", + Version: "v1", + Resource: "pods", + }), + + namespace: namespace, + } +} + +type wrapCoreV1PodImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedcorev1.PodInterface = (*wrapCoreV1PodImpl)(nil) + +func (w *wrapCoreV1PodImpl) Create(ctx context.Context, in *corev1.Pod, opts metav1.CreateOptions) (*corev1.Pod, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Pod", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.Pod{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1PodImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapCoreV1PodImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapCoreV1PodImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*corev1.Pod, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &corev1.Pod{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1PodImpl) List(ctx context.Context, opts metav1.ListOptions) (*corev1.PodList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &corev1.PodList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1PodImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *corev1.Pod, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &corev1.Pod{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1PodImpl) Update(ctx context.Context, in *corev1.Pod, opts metav1.UpdateOptions) (*corev1.Pod, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Pod", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.Pod{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1PodImpl) UpdateStatus(ctx context.Context, in *corev1.Pod, opts metav1.UpdateOptions) (*corev1.Pod, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Pod", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.Pod{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1PodImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapCoreV1PodImpl) GetEphemeralContainers(ctx context.Context, name string, opts metav1.GetOptions) (*corev1.EphemeralContainers, error) { + panic("NYI") +} + +func (w *wrapCoreV1PodImpl) UpdateEphemeralContainers(ctx context.Context, _ string, in *corev1.EphemeralContainers, opts metav1.UpdateOptions) (*corev1.EphemeralContainers, error) { + panic("NYI") +} + +func (w *wrapCoreV1) PodTemplates(namespace string) typedcorev1.PodTemplateInterface { + return &wrapCoreV1PodTemplateImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "", + Version: "v1", + Resource: "podtemplates", + }), + + namespace: namespace, + } +} + +type wrapCoreV1PodTemplateImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedcorev1.PodTemplateInterface = (*wrapCoreV1PodTemplateImpl)(nil) + +func (w *wrapCoreV1PodTemplateImpl) Create(ctx context.Context, in *corev1.PodTemplate, opts metav1.CreateOptions) (*corev1.PodTemplate, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "PodTemplate", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.PodTemplate{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1PodTemplateImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapCoreV1PodTemplateImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapCoreV1PodTemplateImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*corev1.PodTemplate, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &corev1.PodTemplate{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1PodTemplateImpl) List(ctx context.Context, opts metav1.ListOptions) (*corev1.PodTemplateList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &corev1.PodTemplateList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1PodTemplateImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *corev1.PodTemplate, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &corev1.PodTemplate{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1PodTemplateImpl) Update(ctx context.Context, in *corev1.PodTemplate, opts metav1.UpdateOptions) (*corev1.PodTemplate, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "PodTemplate", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.PodTemplate{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1PodTemplateImpl) UpdateStatus(ctx context.Context, in *corev1.PodTemplate, opts metav1.UpdateOptions) (*corev1.PodTemplate, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "PodTemplate", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.PodTemplate{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1PodTemplateImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapCoreV1) ReplicationControllers(namespace string) typedcorev1.ReplicationControllerInterface { + return &wrapCoreV1ReplicationControllerImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "", + Version: "v1", + Resource: "replicationcontrollers", + }), + + namespace: namespace, + } +} + +type wrapCoreV1ReplicationControllerImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedcorev1.ReplicationControllerInterface = (*wrapCoreV1ReplicationControllerImpl)(nil) + +func (w *wrapCoreV1ReplicationControllerImpl) Create(ctx context.Context, in *corev1.ReplicationController, opts metav1.CreateOptions) (*corev1.ReplicationController, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "ReplicationController", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.ReplicationController{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1ReplicationControllerImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapCoreV1ReplicationControllerImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapCoreV1ReplicationControllerImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*corev1.ReplicationController, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &corev1.ReplicationController{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1ReplicationControllerImpl) List(ctx context.Context, opts metav1.ListOptions) (*corev1.ReplicationControllerList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &corev1.ReplicationControllerList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1ReplicationControllerImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *corev1.ReplicationController, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &corev1.ReplicationController{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1ReplicationControllerImpl) Update(ctx context.Context, in *corev1.ReplicationController, opts metav1.UpdateOptions) (*corev1.ReplicationController, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "ReplicationController", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.ReplicationController{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1ReplicationControllerImpl) UpdateStatus(ctx context.Context, in *corev1.ReplicationController, opts metav1.UpdateOptions) (*corev1.ReplicationController, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "ReplicationController", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.ReplicationController{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1ReplicationControllerImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapCoreV1ReplicationControllerImpl) GetScale(ctx context.Context, name string, opts metav1.GetOptions) (*autoscalingv1.Scale, error) { + panic("NYI") +} + +func (w *wrapCoreV1ReplicationControllerImpl) UpdateScale(ctx context.Context, _ string, in *autoscalingv1.Scale, opts metav1.UpdateOptions) (*autoscalingv1.Scale, error) { + panic("NYI") +} + +func (w *wrapCoreV1) ResourceQuotas(namespace string) typedcorev1.ResourceQuotaInterface { + return &wrapCoreV1ResourceQuotaImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "", + Version: "v1", + Resource: "resourcequotas", + }), + + namespace: namespace, + } +} + +type wrapCoreV1ResourceQuotaImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedcorev1.ResourceQuotaInterface = (*wrapCoreV1ResourceQuotaImpl)(nil) + +func (w *wrapCoreV1ResourceQuotaImpl) Create(ctx context.Context, in *corev1.ResourceQuota, opts metav1.CreateOptions) (*corev1.ResourceQuota, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "ResourceQuota", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.ResourceQuota{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1ResourceQuotaImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapCoreV1ResourceQuotaImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapCoreV1ResourceQuotaImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*corev1.ResourceQuota, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &corev1.ResourceQuota{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1ResourceQuotaImpl) List(ctx context.Context, opts metav1.ListOptions) (*corev1.ResourceQuotaList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &corev1.ResourceQuotaList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1ResourceQuotaImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *corev1.ResourceQuota, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &corev1.ResourceQuota{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1ResourceQuotaImpl) Update(ctx context.Context, in *corev1.ResourceQuota, opts metav1.UpdateOptions) (*corev1.ResourceQuota, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "ResourceQuota", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.ResourceQuota{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1ResourceQuotaImpl) UpdateStatus(ctx context.Context, in *corev1.ResourceQuota, opts metav1.UpdateOptions) (*corev1.ResourceQuota, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "ResourceQuota", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.ResourceQuota{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1ResourceQuotaImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapCoreV1) Secrets(namespace string) typedcorev1.SecretInterface { + return &wrapCoreV1SecretImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "", + Version: "v1", + Resource: "secrets", + }), + + namespace: namespace, + } +} + +type wrapCoreV1SecretImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedcorev1.SecretInterface = (*wrapCoreV1SecretImpl)(nil) + +func (w *wrapCoreV1SecretImpl) Create(ctx context.Context, in *corev1.Secret, opts metav1.CreateOptions) (*corev1.Secret, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Secret", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.Secret{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1SecretImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapCoreV1SecretImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapCoreV1SecretImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*corev1.Secret, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &corev1.Secret{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1SecretImpl) List(ctx context.Context, opts metav1.ListOptions) (*corev1.SecretList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &corev1.SecretList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1SecretImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *corev1.Secret, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &corev1.Secret{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1SecretImpl) Update(ctx context.Context, in *corev1.Secret, opts metav1.UpdateOptions) (*corev1.Secret, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Secret", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.Secret{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1SecretImpl) UpdateStatus(ctx context.Context, in *corev1.Secret, opts metav1.UpdateOptions) (*corev1.Secret, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Secret", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.Secret{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1SecretImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapCoreV1) Services(namespace string) typedcorev1.ServiceInterface { + return &wrapCoreV1ServiceImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "", + Version: "v1", + Resource: "services", + }), + + namespace: namespace, + } +} + +type wrapCoreV1ServiceImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedcorev1.ServiceInterface = (*wrapCoreV1ServiceImpl)(nil) + +func (w *wrapCoreV1ServiceImpl) Create(ctx context.Context, in *corev1.Service, opts metav1.CreateOptions) (*corev1.Service, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Service", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.Service{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1ServiceImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapCoreV1ServiceImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*corev1.Service, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &corev1.Service{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1ServiceImpl) List(ctx context.Context, opts metav1.ListOptions) (*corev1.ServiceList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &corev1.ServiceList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1ServiceImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *corev1.Service, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &corev1.Service{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1ServiceImpl) Update(ctx context.Context, in *corev1.Service, opts metav1.UpdateOptions) (*corev1.Service, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Service", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.Service{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1ServiceImpl) UpdateStatus(ctx context.Context, in *corev1.Service, opts metav1.UpdateOptions) (*corev1.Service, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Service", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.Service{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1ServiceImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapCoreV1) ServiceAccounts(namespace string) typedcorev1.ServiceAccountInterface { + return &wrapCoreV1ServiceAccountImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "", + Version: "v1", + Resource: "serviceaccounts", + }), + + namespace: namespace, + } +} + +type wrapCoreV1ServiceAccountImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedcorev1.ServiceAccountInterface = (*wrapCoreV1ServiceAccountImpl)(nil) + +func (w *wrapCoreV1ServiceAccountImpl) Create(ctx context.Context, in *corev1.ServiceAccount, opts metav1.CreateOptions) (*corev1.ServiceAccount, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "ServiceAccount", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.ServiceAccount{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1ServiceAccountImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapCoreV1ServiceAccountImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapCoreV1ServiceAccountImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*corev1.ServiceAccount, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &corev1.ServiceAccount{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1ServiceAccountImpl) List(ctx context.Context, opts metav1.ListOptions) (*corev1.ServiceAccountList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &corev1.ServiceAccountList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1ServiceAccountImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *corev1.ServiceAccount, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &corev1.ServiceAccount{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1ServiceAccountImpl) Update(ctx context.Context, in *corev1.ServiceAccount, opts metav1.UpdateOptions) (*corev1.ServiceAccount, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "ServiceAccount", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.ServiceAccount{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1ServiceAccountImpl) UpdateStatus(ctx context.Context, in *corev1.ServiceAccount, opts metav1.UpdateOptions) (*corev1.ServiceAccount, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "ServiceAccount", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &corev1.ServiceAccount{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapCoreV1ServiceAccountImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapCoreV1ServiceAccountImpl) CreateToken(ctx context.Context, _ string, in *authenticationv1.TokenRequest, opts metav1.CreateOptions) (*authenticationv1.TokenRequest, error) { + panic("NYI") +} + +// DiscoveryV1alpha1 retrieves the DiscoveryV1alpha1Client +func (w *wrapClient) DiscoveryV1alpha1() typeddiscoveryv1alpha1.DiscoveryV1alpha1Interface { + return &wrapDiscoveryV1alpha1{ + dyn: w.dyn, + } +} + +type wrapDiscoveryV1alpha1 struct { + dyn dynamic.Interface +} + +func (w *wrapDiscoveryV1alpha1) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapDiscoveryV1alpha1) EndpointSlices(namespace string) typeddiscoveryv1alpha1.EndpointSliceInterface { + return &wrapDiscoveryV1alpha1EndpointSliceImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "discovery.k8s.io", + Version: "v1alpha1", + Resource: "endpointslices", + }), + + namespace: namespace, + } +} + +type wrapDiscoveryV1alpha1EndpointSliceImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typeddiscoveryv1alpha1.EndpointSliceInterface = (*wrapDiscoveryV1alpha1EndpointSliceImpl)(nil) + +func (w *wrapDiscoveryV1alpha1EndpointSliceImpl) Create(ctx context.Context, in *discoveryv1alpha1.EndpointSlice, opts metav1.CreateOptions) (*discoveryv1alpha1.EndpointSlice, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "discovery.k8s.io", + Version: "v1alpha1", + Kind: "EndpointSlice", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &discoveryv1alpha1.EndpointSlice{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapDiscoveryV1alpha1EndpointSliceImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapDiscoveryV1alpha1EndpointSliceImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapDiscoveryV1alpha1EndpointSliceImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*discoveryv1alpha1.EndpointSlice, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &discoveryv1alpha1.EndpointSlice{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapDiscoveryV1alpha1EndpointSliceImpl) List(ctx context.Context, opts metav1.ListOptions) (*discoveryv1alpha1.EndpointSliceList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &discoveryv1alpha1.EndpointSliceList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapDiscoveryV1alpha1EndpointSliceImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *discoveryv1alpha1.EndpointSlice, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &discoveryv1alpha1.EndpointSlice{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapDiscoveryV1alpha1EndpointSliceImpl) Update(ctx context.Context, in *discoveryv1alpha1.EndpointSlice, opts metav1.UpdateOptions) (*discoveryv1alpha1.EndpointSlice, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "discovery.k8s.io", + Version: "v1alpha1", + Kind: "EndpointSlice", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &discoveryv1alpha1.EndpointSlice{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapDiscoveryV1alpha1EndpointSliceImpl) UpdateStatus(ctx context.Context, in *discoveryv1alpha1.EndpointSlice, opts metav1.UpdateOptions) (*discoveryv1alpha1.EndpointSlice, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "discovery.k8s.io", + Version: "v1alpha1", + Kind: "EndpointSlice", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &discoveryv1alpha1.EndpointSlice{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapDiscoveryV1alpha1EndpointSliceImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +// DiscoveryV1beta1 retrieves the DiscoveryV1beta1Client +func (w *wrapClient) DiscoveryV1beta1() typeddiscoveryv1beta1.DiscoveryV1beta1Interface { + return &wrapDiscoveryV1beta1{ + dyn: w.dyn, + } +} + +type wrapDiscoveryV1beta1 struct { + dyn dynamic.Interface +} + +func (w *wrapDiscoveryV1beta1) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapDiscoveryV1beta1) EndpointSlices(namespace string) typeddiscoveryv1beta1.EndpointSliceInterface { + return &wrapDiscoveryV1beta1EndpointSliceImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "discovery.k8s.io", + Version: "v1beta1", + Resource: "endpointslices", + }), + + namespace: namespace, + } +} + +type wrapDiscoveryV1beta1EndpointSliceImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typeddiscoveryv1beta1.EndpointSliceInterface = (*wrapDiscoveryV1beta1EndpointSliceImpl)(nil) + +func (w *wrapDiscoveryV1beta1EndpointSliceImpl) Create(ctx context.Context, in *discoveryv1beta1.EndpointSlice, opts metav1.CreateOptions) (*discoveryv1beta1.EndpointSlice, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "discovery.k8s.io", + Version: "v1beta1", + Kind: "EndpointSlice", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &discoveryv1beta1.EndpointSlice{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapDiscoveryV1beta1EndpointSliceImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapDiscoveryV1beta1EndpointSliceImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapDiscoveryV1beta1EndpointSliceImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*discoveryv1beta1.EndpointSlice, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &discoveryv1beta1.EndpointSlice{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapDiscoveryV1beta1EndpointSliceImpl) List(ctx context.Context, opts metav1.ListOptions) (*discoveryv1beta1.EndpointSliceList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &discoveryv1beta1.EndpointSliceList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapDiscoveryV1beta1EndpointSliceImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *discoveryv1beta1.EndpointSlice, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &discoveryv1beta1.EndpointSlice{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapDiscoveryV1beta1EndpointSliceImpl) Update(ctx context.Context, in *discoveryv1beta1.EndpointSlice, opts metav1.UpdateOptions) (*discoveryv1beta1.EndpointSlice, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "discovery.k8s.io", + Version: "v1beta1", + Kind: "EndpointSlice", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &discoveryv1beta1.EndpointSlice{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapDiscoveryV1beta1EndpointSliceImpl) UpdateStatus(ctx context.Context, in *discoveryv1beta1.EndpointSlice, opts metav1.UpdateOptions) (*discoveryv1beta1.EndpointSlice, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "discovery.k8s.io", + Version: "v1beta1", + Kind: "EndpointSlice", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &discoveryv1beta1.EndpointSlice{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapDiscoveryV1beta1EndpointSliceImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +// EventsV1 retrieves the EventsV1Client +func (w *wrapClient) EventsV1() typedeventsv1.EventsV1Interface { + return &wrapEventsV1{ + dyn: w.dyn, + } +} + +type wrapEventsV1 struct { + dyn dynamic.Interface +} + +func (w *wrapEventsV1) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapEventsV1) Events(namespace string) typedeventsv1.EventInterface { + return &wrapEventsV1EventImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "events.k8s.io", + Version: "v1", + Resource: "events", + }), + + namespace: namespace, + } +} + +type wrapEventsV1EventImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedeventsv1.EventInterface = (*wrapEventsV1EventImpl)(nil) + +func (w *wrapEventsV1EventImpl) Create(ctx context.Context, in *eventsv1.Event, opts metav1.CreateOptions) (*eventsv1.Event, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "events.k8s.io", + Version: "v1", + Kind: "Event", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &eventsv1.Event{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapEventsV1EventImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapEventsV1EventImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapEventsV1EventImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*eventsv1.Event, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &eventsv1.Event{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapEventsV1EventImpl) List(ctx context.Context, opts metav1.ListOptions) (*eventsv1.EventList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &eventsv1.EventList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapEventsV1EventImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *eventsv1.Event, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &eventsv1.Event{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapEventsV1EventImpl) Update(ctx context.Context, in *eventsv1.Event, opts metav1.UpdateOptions) (*eventsv1.Event, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "events.k8s.io", + Version: "v1", + Kind: "Event", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &eventsv1.Event{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapEventsV1EventImpl) UpdateStatus(ctx context.Context, in *eventsv1.Event, opts metav1.UpdateOptions) (*eventsv1.Event, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "events.k8s.io", + Version: "v1", + Kind: "Event", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &eventsv1.Event{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapEventsV1EventImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +// EventsV1beta1 retrieves the EventsV1beta1Client +func (w *wrapClient) EventsV1beta1() typedeventsv1beta1.EventsV1beta1Interface { + return &wrapEventsV1beta1{ + dyn: w.dyn, + } +} + +type wrapEventsV1beta1 struct { + dyn dynamic.Interface +} + +func (w *wrapEventsV1beta1) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapEventsV1beta1) Events(namespace string) typedeventsv1beta1.EventInterface { + return &wrapEventsV1beta1EventImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "events.k8s.io", + Version: "v1beta1", + Resource: "events", + }), + + namespace: namespace, + } +} + +type wrapEventsV1beta1EventImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedeventsv1beta1.EventInterface = (*wrapEventsV1beta1EventImpl)(nil) + +func (w *wrapEventsV1beta1EventImpl) Create(ctx context.Context, in *eventsv1beta1.Event, opts metav1.CreateOptions) (*eventsv1beta1.Event, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "events.k8s.io", + Version: "v1beta1", + Kind: "Event", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &eventsv1beta1.Event{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapEventsV1beta1EventImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapEventsV1beta1EventImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapEventsV1beta1EventImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*eventsv1beta1.Event, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &eventsv1beta1.Event{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapEventsV1beta1EventImpl) List(ctx context.Context, opts metav1.ListOptions) (*eventsv1beta1.EventList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &eventsv1beta1.EventList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapEventsV1beta1EventImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *eventsv1beta1.Event, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &eventsv1beta1.Event{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapEventsV1beta1EventImpl) Update(ctx context.Context, in *eventsv1beta1.Event, opts metav1.UpdateOptions) (*eventsv1beta1.Event, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "events.k8s.io", + Version: "v1beta1", + Kind: "Event", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &eventsv1beta1.Event{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapEventsV1beta1EventImpl) UpdateStatus(ctx context.Context, in *eventsv1beta1.Event, opts metav1.UpdateOptions) (*eventsv1beta1.Event, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "events.k8s.io", + Version: "v1beta1", + Kind: "Event", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &eventsv1beta1.Event{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapEventsV1beta1EventImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +// ExtensionsV1beta1 retrieves the ExtensionsV1beta1Client +func (w *wrapClient) ExtensionsV1beta1() typedextensionsv1beta1.ExtensionsV1beta1Interface { + return &wrapExtensionsV1beta1{ + dyn: w.dyn, + } +} + +type wrapExtensionsV1beta1 struct { + dyn dynamic.Interface +} + +func (w *wrapExtensionsV1beta1) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapExtensionsV1beta1) DaemonSets(namespace string) typedextensionsv1beta1.DaemonSetInterface { + return &wrapExtensionsV1beta1DaemonSetImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "extensions", + Version: "v1beta1", + Resource: "daemonsets", + }), + + namespace: namespace, + } +} + +type wrapExtensionsV1beta1DaemonSetImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedextensionsv1beta1.DaemonSetInterface = (*wrapExtensionsV1beta1DaemonSetImpl)(nil) + +func (w *wrapExtensionsV1beta1DaemonSetImpl) Create(ctx context.Context, in *extensionsv1beta1.DaemonSet, opts metav1.CreateOptions) (*extensionsv1beta1.DaemonSet, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "extensions", + Version: "v1beta1", + Kind: "DaemonSet", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &extensionsv1beta1.DaemonSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapExtensionsV1beta1DaemonSetImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapExtensionsV1beta1DaemonSetImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapExtensionsV1beta1DaemonSetImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*extensionsv1beta1.DaemonSet, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &extensionsv1beta1.DaemonSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapExtensionsV1beta1DaemonSetImpl) List(ctx context.Context, opts metav1.ListOptions) (*extensionsv1beta1.DaemonSetList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &extensionsv1beta1.DaemonSetList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapExtensionsV1beta1DaemonSetImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *extensionsv1beta1.DaemonSet, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &extensionsv1beta1.DaemonSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapExtensionsV1beta1DaemonSetImpl) Update(ctx context.Context, in *extensionsv1beta1.DaemonSet, opts metav1.UpdateOptions) (*extensionsv1beta1.DaemonSet, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "extensions", + Version: "v1beta1", + Kind: "DaemonSet", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &extensionsv1beta1.DaemonSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapExtensionsV1beta1DaemonSetImpl) UpdateStatus(ctx context.Context, in *extensionsv1beta1.DaemonSet, opts metav1.UpdateOptions) (*extensionsv1beta1.DaemonSet, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "extensions", + Version: "v1beta1", + Kind: "DaemonSet", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &extensionsv1beta1.DaemonSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapExtensionsV1beta1DaemonSetImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapExtensionsV1beta1) Deployments(namespace string) typedextensionsv1beta1.DeploymentInterface { + return &wrapExtensionsV1beta1DeploymentImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "extensions", + Version: "v1beta1", + Resource: "deployments", + }), + + namespace: namespace, + } +} + +type wrapExtensionsV1beta1DeploymentImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedextensionsv1beta1.DeploymentInterface = (*wrapExtensionsV1beta1DeploymentImpl)(nil) + +func (w *wrapExtensionsV1beta1DeploymentImpl) Create(ctx context.Context, in *extensionsv1beta1.Deployment, opts metav1.CreateOptions) (*extensionsv1beta1.Deployment, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "extensions", + Version: "v1beta1", + Kind: "Deployment", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &extensionsv1beta1.Deployment{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapExtensionsV1beta1DeploymentImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapExtensionsV1beta1DeploymentImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapExtensionsV1beta1DeploymentImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*extensionsv1beta1.Deployment, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &extensionsv1beta1.Deployment{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapExtensionsV1beta1DeploymentImpl) List(ctx context.Context, opts metav1.ListOptions) (*extensionsv1beta1.DeploymentList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &extensionsv1beta1.DeploymentList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapExtensionsV1beta1DeploymentImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *extensionsv1beta1.Deployment, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &extensionsv1beta1.Deployment{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapExtensionsV1beta1DeploymentImpl) Update(ctx context.Context, in *extensionsv1beta1.Deployment, opts metav1.UpdateOptions) (*extensionsv1beta1.Deployment, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "extensions", + Version: "v1beta1", + Kind: "Deployment", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &extensionsv1beta1.Deployment{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapExtensionsV1beta1DeploymentImpl) UpdateStatus(ctx context.Context, in *extensionsv1beta1.Deployment, opts metav1.UpdateOptions) (*extensionsv1beta1.Deployment, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "extensions", + Version: "v1beta1", + Kind: "Deployment", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &extensionsv1beta1.Deployment{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapExtensionsV1beta1DeploymentImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapExtensionsV1beta1DeploymentImpl) GetScale(ctx context.Context, name string, opts metav1.GetOptions) (*extensionsv1beta1.Scale, error) { + panic("NYI") +} + +func (w *wrapExtensionsV1beta1DeploymentImpl) UpdateScale(ctx context.Context, _ string, in *extensionsv1beta1.Scale, opts metav1.UpdateOptions) (*extensionsv1beta1.Scale, error) { + panic("NYI") +} + +func (w *wrapExtensionsV1beta1) Ingresses(namespace string) typedextensionsv1beta1.IngressInterface { + return &wrapExtensionsV1beta1IngressImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "extensions", + Version: "v1beta1", + Resource: "ingresses", + }), + + namespace: namespace, + } +} + +type wrapExtensionsV1beta1IngressImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedextensionsv1beta1.IngressInterface = (*wrapExtensionsV1beta1IngressImpl)(nil) + +func (w *wrapExtensionsV1beta1IngressImpl) Create(ctx context.Context, in *extensionsv1beta1.Ingress, opts metav1.CreateOptions) (*extensionsv1beta1.Ingress, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "extensions", + Version: "v1beta1", + Kind: "Ingress", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &extensionsv1beta1.Ingress{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapExtensionsV1beta1IngressImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapExtensionsV1beta1IngressImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapExtensionsV1beta1IngressImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*extensionsv1beta1.Ingress, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &extensionsv1beta1.Ingress{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapExtensionsV1beta1IngressImpl) List(ctx context.Context, opts metav1.ListOptions) (*extensionsv1beta1.IngressList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &extensionsv1beta1.IngressList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapExtensionsV1beta1IngressImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *extensionsv1beta1.Ingress, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &extensionsv1beta1.Ingress{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapExtensionsV1beta1IngressImpl) Update(ctx context.Context, in *extensionsv1beta1.Ingress, opts metav1.UpdateOptions) (*extensionsv1beta1.Ingress, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "extensions", + Version: "v1beta1", + Kind: "Ingress", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &extensionsv1beta1.Ingress{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapExtensionsV1beta1IngressImpl) UpdateStatus(ctx context.Context, in *extensionsv1beta1.Ingress, opts metav1.UpdateOptions) (*extensionsv1beta1.Ingress, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "extensions", + Version: "v1beta1", + Kind: "Ingress", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &extensionsv1beta1.Ingress{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapExtensionsV1beta1IngressImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapExtensionsV1beta1) NetworkPolicies(namespace string) typedextensionsv1beta1.NetworkPolicyInterface { + return &wrapExtensionsV1beta1NetworkPolicyImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "extensions", + Version: "v1beta1", + Resource: "networkpolicies", + }), + + namespace: namespace, + } +} + +type wrapExtensionsV1beta1NetworkPolicyImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedextensionsv1beta1.NetworkPolicyInterface = (*wrapExtensionsV1beta1NetworkPolicyImpl)(nil) + +func (w *wrapExtensionsV1beta1NetworkPolicyImpl) Create(ctx context.Context, in *extensionsv1beta1.NetworkPolicy, opts metav1.CreateOptions) (*extensionsv1beta1.NetworkPolicy, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "extensions", + Version: "v1beta1", + Kind: "NetworkPolicy", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &extensionsv1beta1.NetworkPolicy{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapExtensionsV1beta1NetworkPolicyImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapExtensionsV1beta1NetworkPolicyImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapExtensionsV1beta1NetworkPolicyImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*extensionsv1beta1.NetworkPolicy, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &extensionsv1beta1.NetworkPolicy{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapExtensionsV1beta1NetworkPolicyImpl) List(ctx context.Context, opts metav1.ListOptions) (*extensionsv1beta1.NetworkPolicyList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &extensionsv1beta1.NetworkPolicyList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapExtensionsV1beta1NetworkPolicyImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *extensionsv1beta1.NetworkPolicy, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &extensionsv1beta1.NetworkPolicy{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapExtensionsV1beta1NetworkPolicyImpl) Update(ctx context.Context, in *extensionsv1beta1.NetworkPolicy, opts metav1.UpdateOptions) (*extensionsv1beta1.NetworkPolicy, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "extensions", + Version: "v1beta1", + Kind: "NetworkPolicy", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &extensionsv1beta1.NetworkPolicy{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapExtensionsV1beta1NetworkPolicyImpl) UpdateStatus(ctx context.Context, in *extensionsv1beta1.NetworkPolicy, opts metav1.UpdateOptions) (*extensionsv1beta1.NetworkPolicy, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "extensions", + Version: "v1beta1", + Kind: "NetworkPolicy", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &extensionsv1beta1.NetworkPolicy{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapExtensionsV1beta1NetworkPolicyImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapExtensionsV1beta1) PodSecurityPolicies() typedextensionsv1beta1.PodSecurityPolicyInterface { + return &wrapExtensionsV1beta1PodSecurityPolicyImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "extensions", + Version: "v1beta1", + Resource: "podsecuritypolicies", + }), + } +} + +type wrapExtensionsV1beta1PodSecurityPolicyImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedextensionsv1beta1.PodSecurityPolicyInterface = (*wrapExtensionsV1beta1PodSecurityPolicyImpl)(nil) + +func (w *wrapExtensionsV1beta1PodSecurityPolicyImpl) Create(ctx context.Context, in *extensionsv1beta1.PodSecurityPolicy, opts metav1.CreateOptions) (*extensionsv1beta1.PodSecurityPolicy, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "extensions", + Version: "v1beta1", + Kind: "PodSecurityPolicy", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &extensionsv1beta1.PodSecurityPolicy{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapExtensionsV1beta1PodSecurityPolicyImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Delete(ctx, name, opts) +} + +func (w *wrapExtensionsV1beta1PodSecurityPolicyImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapExtensionsV1beta1PodSecurityPolicyImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*extensionsv1beta1.PodSecurityPolicy, error) { + uo, err := w.dyn.Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &extensionsv1beta1.PodSecurityPolicy{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapExtensionsV1beta1PodSecurityPolicyImpl) List(ctx context.Context, opts metav1.ListOptions) (*extensionsv1beta1.PodSecurityPolicyList, error) { + uo, err := w.dyn.List(ctx, opts) + if err != nil { + return nil, err + } + out := &extensionsv1beta1.PodSecurityPolicyList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapExtensionsV1beta1PodSecurityPolicyImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *extensionsv1beta1.PodSecurityPolicy, err error) { + uo, err := w.dyn.Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &extensionsv1beta1.PodSecurityPolicy{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapExtensionsV1beta1PodSecurityPolicyImpl) Update(ctx context.Context, in *extensionsv1beta1.PodSecurityPolicy, opts metav1.UpdateOptions) (*extensionsv1beta1.PodSecurityPolicy, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "extensions", + Version: "v1beta1", + Kind: "PodSecurityPolicy", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &extensionsv1beta1.PodSecurityPolicy{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapExtensionsV1beta1PodSecurityPolicyImpl) UpdateStatus(ctx context.Context, in *extensionsv1beta1.PodSecurityPolicy, opts metav1.UpdateOptions) (*extensionsv1beta1.PodSecurityPolicy, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "extensions", + Version: "v1beta1", + Kind: "PodSecurityPolicy", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &extensionsv1beta1.PodSecurityPolicy{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapExtensionsV1beta1PodSecurityPolicyImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapExtensionsV1beta1) ReplicaSets(namespace string) typedextensionsv1beta1.ReplicaSetInterface { + return &wrapExtensionsV1beta1ReplicaSetImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "extensions", + Version: "v1beta1", + Resource: "replicasets", + }), + + namespace: namespace, + } +} + +type wrapExtensionsV1beta1ReplicaSetImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedextensionsv1beta1.ReplicaSetInterface = (*wrapExtensionsV1beta1ReplicaSetImpl)(nil) + +func (w *wrapExtensionsV1beta1ReplicaSetImpl) Create(ctx context.Context, in *extensionsv1beta1.ReplicaSet, opts metav1.CreateOptions) (*extensionsv1beta1.ReplicaSet, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "extensions", + Version: "v1beta1", + Kind: "ReplicaSet", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &extensionsv1beta1.ReplicaSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapExtensionsV1beta1ReplicaSetImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapExtensionsV1beta1ReplicaSetImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapExtensionsV1beta1ReplicaSetImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*extensionsv1beta1.ReplicaSet, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &extensionsv1beta1.ReplicaSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapExtensionsV1beta1ReplicaSetImpl) List(ctx context.Context, opts metav1.ListOptions) (*extensionsv1beta1.ReplicaSetList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &extensionsv1beta1.ReplicaSetList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapExtensionsV1beta1ReplicaSetImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *extensionsv1beta1.ReplicaSet, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &extensionsv1beta1.ReplicaSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapExtensionsV1beta1ReplicaSetImpl) Update(ctx context.Context, in *extensionsv1beta1.ReplicaSet, opts metav1.UpdateOptions) (*extensionsv1beta1.ReplicaSet, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "extensions", + Version: "v1beta1", + Kind: "ReplicaSet", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &extensionsv1beta1.ReplicaSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapExtensionsV1beta1ReplicaSetImpl) UpdateStatus(ctx context.Context, in *extensionsv1beta1.ReplicaSet, opts metav1.UpdateOptions) (*extensionsv1beta1.ReplicaSet, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "extensions", + Version: "v1beta1", + Kind: "ReplicaSet", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &extensionsv1beta1.ReplicaSet{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapExtensionsV1beta1ReplicaSetImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapExtensionsV1beta1ReplicaSetImpl) GetScale(ctx context.Context, name string, opts metav1.GetOptions) (*extensionsv1beta1.Scale, error) { + panic("NYI") +} + +func (w *wrapExtensionsV1beta1ReplicaSetImpl) UpdateScale(ctx context.Context, _ string, in *extensionsv1beta1.Scale, opts metav1.UpdateOptions) (*extensionsv1beta1.Scale, error) { + panic("NYI") +} + +// FlowcontrolV1alpha1 retrieves the FlowcontrolV1alpha1Client +func (w *wrapClient) FlowcontrolV1alpha1() typedflowcontrolv1alpha1.FlowcontrolV1alpha1Interface { + return &wrapFlowcontrolV1alpha1{ + dyn: w.dyn, + } +} + +type wrapFlowcontrolV1alpha1 struct { + dyn dynamic.Interface +} + +func (w *wrapFlowcontrolV1alpha1) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapFlowcontrolV1alpha1) FlowSchemas() typedflowcontrolv1alpha1.FlowSchemaInterface { + return &wrapFlowcontrolV1alpha1FlowSchemaImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "flowcontrol.apiserver.k8s.io", + Version: "v1alpha1", + Resource: "flowschemas", + }), + } +} + +type wrapFlowcontrolV1alpha1FlowSchemaImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedflowcontrolv1alpha1.FlowSchemaInterface = (*wrapFlowcontrolV1alpha1FlowSchemaImpl)(nil) + +func (w *wrapFlowcontrolV1alpha1FlowSchemaImpl) Create(ctx context.Context, in *flowcontrolv1alpha1.FlowSchema, opts metav1.CreateOptions) (*flowcontrolv1alpha1.FlowSchema, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "flowcontrol.apiserver.k8s.io", + Version: "v1alpha1", + Kind: "FlowSchema", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &flowcontrolv1alpha1.FlowSchema{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapFlowcontrolV1alpha1FlowSchemaImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Delete(ctx, name, opts) +} + +func (w *wrapFlowcontrolV1alpha1FlowSchemaImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapFlowcontrolV1alpha1FlowSchemaImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*flowcontrolv1alpha1.FlowSchema, error) { + uo, err := w.dyn.Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &flowcontrolv1alpha1.FlowSchema{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapFlowcontrolV1alpha1FlowSchemaImpl) List(ctx context.Context, opts metav1.ListOptions) (*flowcontrolv1alpha1.FlowSchemaList, error) { + uo, err := w.dyn.List(ctx, opts) + if err != nil { + return nil, err + } + out := &flowcontrolv1alpha1.FlowSchemaList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapFlowcontrolV1alpha1FlowSchemaImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *flowcontrolv1alpha1.FlowSchema, err error) { + uo, err := w.dyn.Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &flowcontrolv1alpha1.FlowSchema{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapFlowcontrolV1alpha1FlowSchemaImpl) Update(ctx context.Context, in *flowcontrolv1alpha1.FlowSchema, opts metav1.UpdateOptions) (*flowcontrolv1alpha1.FlowSchema, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "flowcontrol.apiserver.k8s.io", + Version: "v1alpha1", + Kind: "FlowSchema", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &flowcontrolv1alpha1.FlowSchema{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapFlowcontrolV1alpha1FlowSchemaImpl) UpdateStatus(ctx context.Context, in *flowcontrolv1alpha1.FlowSchema, opts metav1.UpdateOptions) (*flowcontrolv1alpha1.FlowSchema, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "flowcontrol.apiserver.k8s.io", + Version: "v1alpha1", + Kind: "FlowSchema", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &flowcontrolv1alpha1.FlowSchema{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapFlowcontrolV1alpha1FlowSchemaImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapFlowcontrolV1alpha1) PriorityLevelConfigurations() typedflowcontrolv1alpha1.PriorityLevelConfigurationInterface { + return &wrapFlowcontrolV1alpha1PriorityLevelConfigurationImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "flowcontrol.apiserver.k8s.io", + Version: "v1alpha1", + Resource: "prioritylevelconfigurations", + }), + } +} + +type wrapFlowcontrolV1alpha1PriorityLevelConfigurationImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedflowcontrolv1alpha1.PriorityLevelConfigurationInterface = (*wrapFlowcontrolV1alpha1PriorityLevelConfigurationImpl)(nil) + +func (w *wrapFlowcontrolV1alpha1PriorityLevelConfigurationImpl) Create(ctx context.Context, in *flowcontrolv1alpha1.PriorityLevelConfiguration, opts metav1.CreateOptions) (*flowcontrolv1alpha1.PriorityLevelConfiguration, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "flowcontrol.apiserver.k8s.io", + Version: "v1alpha1", + Kind: "PriorityLevelConfiguration", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &flowcontrolv1alpha1.PriorityLevelConfiguration{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapFlowcontrolV1alpha1PriorityLevelConfigurationImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Delete(ctx, name, opts) +} + +func (w *wrapFlowcontrolV1alpha1PriorityLevelConfigurationImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapFlowcontrolV1alpha1PriorityLevelConfigurationImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*flowcontrolv1alpha1.PriorityLevelConfiguration, error) { + uo, err := w.dyn.Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &flowcontrolv1alpha1.PriorityLevelConfiguration{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapFlowcontrolV1alpha1PriorityLevelConfigurationImpl) List(ctx context.Context, opts metav1.ListOptions) (*flowcontrolv1alpha1.PriorityLevelConfigurationList, error) { + uo, err := w.dyn.List(ctx, opts) + if err != nil { + return nil, err + } + out := &flowcontrolv1alpha1.PriorityLevelConfigurationList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapFlowcontrolV1alpha1PriorityLevelConfigurationImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *flowcontrolv1alpha1.PriorityLevelConfiguration, err error) { + uo, err := w.dyn.Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &flowcontrolv1alpha1.PriorityLevelConfiguration{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapFlowcontrolV1alpha1PriorityLevelConfigurationImpl) Update(ctx context.Context, in *flowcontrolv1alpha1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (*flowcontrolv1alpha1.PriorityLevelConfiguration, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "flowcontrol.apiserver.k8s.io", + Version: "v1alpha1", + Kind: "PriorityLevelConfiguration", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &flowcontrolv1alpha1.PriorityLevelConfiguration{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapFlowcontrolV1alpha1PriorityLevelConfigurationImpl) UpdateStatus(ctx context.Context, in *flowcontrolv1alpha1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (*flowcontrolv1alpha1.PriorityLevelConfiguration, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "flowcontrol.apiserver.k8s.io", + Version: "v1alpha1", + Kind: "PriorityLevelConfiguration", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &flowcontrolv1alpha1.PriorityLevelConfiguration{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapFlowcontrolV1alpha1PriorityLevelConfigurationImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +// FlowcontrolV1beta1 retrieves the FlowcontrolV1beta1Client +func (w *wrapClient) FlowcontrolV1beta1() typedflowcontrolv1beta1.FlowcontrolV1beta1Interface { + return &wrapFlowcontrolV1beta1{ + dyn: w.dyn, + } +} + +type wrapFlowcontrolV1beta1 struct { + dyn dynamic.Interface +} + +func (w *wrapFlowcontrolV1beta1) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapFlowcontrolV1beta1) FlowSchemas() typedflowcontrolv1beta1.FlowSchemaInterface { + return &wrapFlowcontrolV1beta1FlowSchemaImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "flowcontrol.apiserver.k8s.io", + Version: "v1beta1", + Resource: "flowschemas", + }), + } +} + +type wrapFlowcontrolV1beta1FlowSchemaImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedflowcontrolv1beta1.FlowSchemaInterface = (*wrapFlowcontrolV1beta1FlowSchemaImpl)(nil) + +func (w *wrapFlowcontrolV1beta1FlowSchemaImpl) Create(ctx context.Context, in *flowcontrolv1beta1.FlowSchema, opts metav1.CreateOptions) (*flowcontrolv1beta1.FlowSchema, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "flowcontrol.apiserver.k8s.io", + Version: "v1beta1", + Kind: "FlowSchema", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &flowcontrolv1beta1.FlowSchema{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapFlowcontrolV1beta1FlowSchemaImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Delete(ctx, name, opts) +} + +func (w *wrapFlowcontrolV1beta1FlowSchemaImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapFlowcontrolV1beta1FlowSchemaImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*flowcontrolv1beta1.FlowSchema, error) { + uo, err := w.dyn.Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &flowcontrolv1beta1.FlowSchema{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapFlowcontrolV1beta1FlowSchemaImpl) List(ctx context.Context, opts metav1.ListOptions) (*flowcontrolv1beta1.FlowSchemaList, error) { + uo, err := w.dyn.List(ctx, opts) + if err != nil { + return nil, err + } + out := &flowcontrolv1beta1.FlowSchemaList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapFlowcontrolV1beta1FlowSchemaImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *flowcontrolv1beta1.FlowSchema, err error) { + uo, err := w.dyn.Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &flowcontrolv1beta1.FlowSchema{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapFlowcontrolV1beta1FlowSchemaImpl) Update(ctx context.Context, in *flowcontrolv1beta1.FlowSchema, opts metav1.UpdateOptions) (*flowcontrolv1beta1.FlowSchema, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "flowcontrol.apiserver.k8s.io", + Version: "v1beta1", + Kind: "FlowSchema", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &flowcontrolv1beta1.FlowSchema{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapFlowcontrolV1beta1FlowSchemaImpl) UpdateStatus(ctx context.Context, in *flowcontrolv1beta1.FlowSchema, opts metav1.UpdateOptions) (*flowcontrolv1beta1.FlowSchema, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "flowcontrol.apiserver.k8s.io", + Version: "v1beta1", + Kind: "FlowSchema", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &flowcontrolv1beta1.FlowSchema{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapFlowcontrolV1beta1FlowSchemaImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapFlowcontrolV1beta1) PriorityLevelConfigurations() typedflowcontrolv1beta1.PriorityLevelConfigurationInterface { + return &wrapFlowcontrolV1beta1PriorityLevelConfigurationImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "flowcontrol.apiserver.k8s.io", + Version: "v1beta1", + Resource: "prioritylevelconfigurations", + }), + } +} + +type wrapFlowcontrolV1beta1PriorityLevelConfigurationImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedflowcontrolv1beta1.PriorityLevelConfigurationInterface = (*wrapFlowcontrolV1beta1PriorityLevelConfigurationImpl)(nil) + +func (w *wrapFlowcontrolV1beta1PriorityLevelConfigurationImpl) Create(ctx context.Context, in *flowcontrolv1beta1.PriorityLevelConfiguration, opts metav1.CreateOptions) (*flowcontrolv1beta1.PriorityLevelConfiguration, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "flowcontrol.apiserver.k8s.io", + Version: "v1beta1", + Kind: "PriorityLevelConfiguration", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &flowcontrolv1beta1.PriorityLevelConfiguration{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapFlowcontrolV1beta1PriorityLevelConfigurationImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Delete(ctx, name, opts) +} + +func (w *wrapFlowcontrolV1beta1PriorityLevelConfigurationImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapFlowcontrolV1beta1PriorityLevelConfigurationImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*flowcontrolv1beta1.PriorityLevelConfiguration, error) { + uo, err := w.dyn.Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &flowcontrolv1beta1.PriorityLevelConfiguration{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapFlowcontrolV1beta1PriorityLevelConfigurationImpl) List(ctx context.Context, opts metav1.ListOptions) (*flowcontrolv1beta1.PriorityLevelConfigurationList, error) { + uo, err := w.dyn.List(ctx, opts) + if err != nil { + return nil, err + } + out := &flowcontrolv1beta1.PriorityLevelConfigurationList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapFlowcontrolV1beta1PriorityLevelConfigurationImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *flowcontrolv1beta1.PriorityLevelConfiguration, err error) { + uo, err := w.dyn.Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &flowcontrolv1beta1.PriorityLevelConfiguration{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapFlowcontrolV1beta1PriorityLevelConfigurationImpl) Update(ctx context.Context, in *flowcontrolv1beta1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (*flowcontrolv1beta1.PriorityLevelConfiguration, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "flowcontrol.apiserver.k8s.io", + Version: "v1beta1", + Kind: "PriorityLevelConfiguration", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &flowcontrolv1beta1.PriorityLevelConfiguration{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapFlowcontrolV1beta1PriorityLevelConfigurationImpl) UpdateStatus(ctx context.Context, in *flowcontrolv1beta1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (*flowcontrolv1beta1.PriorityLevelConfiguration, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "flowcontrol.apiserver.k8s.io", + Version: "v1beta1", + Kind: "PriorityLevelConfiguration", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &flowcontrolv1beta1.PriorityLevelConfiguration{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapFlowcontrolV1beta1PriorityLevelConfigurationImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +// NetworkingV1 retrieves the NetworkingV1Client +func (w *wrapClient) NetworkingV1() typednetworkingv1.NetworkingV1Interface { + return &wrapNetworkingV1{ + dyn: w.dyn, + } +} + +type wrapNetworkingV1 struct { + dyn dynamic.Interface +} + +func (w *wrapNetworkingV1) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapNetworkingV1) Ingresses(namespace string) typednetworkingv1.IngressInterface { + return &wrapNetworkingV1IngressImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "networking.k8s.io", + Version: "v1", + Resource: "ingresses", + }), + + namespace: namespace, + } +} + +type wrapNetworkingV1IngressImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typednetworkingv1.IngressInterface = (*wrapNetworkingV1IngressImpl)(nil) + +func (w *wrapNetworkingV1IngressImpl) Create(ctx context.Context, in *networkingv1.Ingress, opts metav1.CreateOptions) (*networkingv1.Ingress, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "networking.k8s.io", + Version: "v1", + Kind: "Ingress", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &networkingv1.Ingress{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNetworkingV1IngressImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapNetworkingV1IngressImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapNetworkingV1IngressImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*networkingv1.Ingress, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &networkingv1.Ingress{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNetworkingV1IngressImpl) List(ctx context.Context, opts metav1.ListOptions) (*networkingv1.IngressList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &networkingv1.IngressList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNetworkingV1IngressImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *networkingv1.Ingress, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &networkingv1.Ingress{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNetworkingV1IngressImpl) Update(ctx context.Context, in *networkingv1.Ingress, opts metav1.UpdateOptions) (*networkingv1.Ingress, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "networking.k8s.io", + Version: "v1", + Kind: "Ingress", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &networkingv1.Ingress{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNetworkingV1IngressImpl) UpdateStatus(ctx context.Context, in *networkingv1.Ingress, opts metav1.UpdateOptions) (*networkingv1.Ingress, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "networking.k8s.io", + Version: "v1", + Kind: "Ingress", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &networkingv1.Ingress{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNetworkingV1IngressImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapNetworkingV1) IngressClasses() typednetworkingv1.IngressClassInterface { + return &wrapNetworkingV1IngressClassImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "networking.k8s.io", + Version: "v1", + Resource: "ingressclasses", + }), + } +} + +type wrapNetworkingV1IngressClassImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typednetworkingv1.IngressClassInterface = (*wrapNetworkingV1IngressClassImpl)(nil) + +func (w *wrapNetworkingV1IngressClassImpl) Create(ctx context.Context, in *networkingv1.IngressClass, opts metav1.CreateOptions) (*networkingv1.IngressClass, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "networking.k8s.io", + Version: "v1", + Kind: "IngressClass", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &networkingv1.IngressClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNetworkingV1IngressClassImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Delete(ctx, name, opts) +} + +func (w *wrapNetworkingV1IngressClassImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapNetworkingV1IngressClassImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*networkingv1.IngressClass, error) { + uo, err := w.dyn.Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &networkingv1.IngressClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNetworkingV1IngressClassImpl) List(ctx context.Context, opts metav1.ListOptions) (*networkingv1.IngressClassList, error) { + uo, err := w.dyn.List(ctx, opts) + if err != nil { + return nil, err + } + out := &networkingv1.IngressClassList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNetworkingV1IngressClassImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *networkingv1.IngressClass, err error) { + uo, err := w.dyn.Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &networkingv1.IngressClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNetworkingV1IngressClassImpl) Update(ctx context.Context, in *networkingv1.IngressClass, opts metav1.UpdateOptions) (*networkingv1.IngressClass, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "networking.k8s.io", + Version: "v1", + Kind: "IngressClass", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &networkingv1.IngressClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNetworkingV1IngressClassImpl) UpdateStatus(ctx context.Context, in *networkingv1.IngressClass, opts metav1.UpdateOptions) (*networkingv1.IngressClass, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "networking.k8s.io", + Version: "v1", + Kind: "IngressClass", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &networkingv1.IngressClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNetworkingV1IngressClassImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapNetworkingV1) NetworkPolicies(namespace string) typednetworkingv1.NetworkPolicyInterface { + return &wrapNetworkingV1NetworkPolicyImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "networking.k8s.io", + Version: "v1", + Resource: "networkpolicies", + }), + + namespace: namespace, + } +} + +type wrapNetworkingV1NetworkPolicyImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typednetworkingv1.NetworkPolicyInterface = (*wrapNetworkingV1NetworkPolicyImpl)(nil) + +func (w *wrapNetworkingV1NetworkPolicyImpl) Create(ctx context.Context, in *networkingv1.NetworkPolicy, opts metav1.CreateOptions) (*networkingv1.NetworkPolicy, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "networking.k8s.io", + Version: "v1", + Kind: "NetworkPolicy", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &networkingv1.NetworkPolicy{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNetworkingV1NetworkPolicyImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapNetworkingV1NetworkPolicyImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapNetworkingV1NetworkPolicyImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*networkingv1.NetworkPolicy, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &networkingv1.NetworkPolicy{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNetworkingV1NetworkPolicyImpl) List(ctx context.Context, opts metav1.ListOptions) (*networkingv1.NetworkPolicyList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &networkingv1.NetworkPolicyList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNetworkingV1NetworkPolicyImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *networkingv1.NetworkPolicy, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &networkingv1.NetworkPolicy{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNetworkingV1NetworkPolicyImpl) Update(ctx context.Context, in *networkingv1.NetworkPolicy, opts metav1.UpdateOptions) (*networkingv1.NetworkPolicy, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "networking.k8s.io", + Version: "v1", + Kind: "NetworkPolicy", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &networkingv1.NetworkPolicy{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNetworkingV1NetworkPolicyImpl) UpdateStatus(ctx context.Context, in *networkingv1.NetworkPolicy, opts metav1.UpdateOptions) (*networkingv1.NetworkPolicy, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "networking.k8s.io", + Version: "v1", + Kind: "NetworkPolicy", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &networkingv1.NetworkPolicy{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNetworkingV1NetworkPolicyImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +// NetworkingV1beta1 retrieves the NetworkingV1beta1Client +func (w *wrapClient) NetworkingV1beta1() typednetworkingv1beta1.NetworkingV1beta1Interface { + return &wrapNetworkingV1beta1{ + dyn: w.dyn, + } +} + +type wrapNetworkingV1beta1 struct { + dyn dynamic.Interface +} + +func (w *wrapNetworkingV1beta1) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapNetworkingV1beta1) Ingresses(namespace string) typednetworkingv1beta1.IngressInterface { + return &wrapNetworkingV1beta1IngressImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "networking.k8s.io", + Version: "v1beta1", + Resource: "ingresses", + }), + + namespace: namespace, + } +} + +type wrapNetworkingV1beta1IngressImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typednetworkingv1beta1.IngressInterface = (*wrapNetworkingV1beta1IngressImpl)(nil) + +func (w *wrapNetworkingV1beta1IngressImpl) Create(ctx context.Context, in *networkingv1beta1.Ingress, opts metav1.CreateOptions) (*networkingv1beta1.Ingress, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "networking.k8s.io", + Version: "v1beta1", + Kind: "Ingress", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &networkingv1beta1.Ingress{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNetworkingV1beta1IngressImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapNetworkingV1beta1IngressImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapNetworkingV1beta1IngressImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*networkingv1beta1.Ingress, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &networkingv1beta1.Ingress{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNetworkingV1beta1IngressImpl) List(ctx context.Context, opts metav1.ListOptions) (*networkingv1beta1.IngressList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &networkingv1beta1.IngressList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNetworkingV1beta1IngressImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *networkingv1beta1.Ingress, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &networkingv1beta1.Ingress{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNetworkingV1beta1IngressImpl) Update(ctx context.Context, in *networkingv1beta1.Ingress, opts metav1.UpdateOptions) (*networkingv1beta1.Ingress, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "networking.k8s.io", + Version: "v1beta1", + Kind: "Ingress", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &networkingv1beta1.Ingress{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNetworkingV1beta1IngressImpl) UpdateStatus(ctx context.Context, in *networkingv1beta1.Ingress, opts metav1.UpdateOptions) (*networkingv1beta1.Ingress, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "networking.k8s.io", + Version: "v1beta1", + Kind: "Ingress", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &networkingv1beta1.Ingress{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNetworkingV1beta1IngressImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapNetworkingV1beta1) IngressClasses() typednetworkingv1beta1.IngressClassInterface { + return &wrapNetworkingV1beta1IngressClassImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "networking.k8s.io", + Version: "v1beta1", + Resource: "ingressclasses", + }), + } +} + +type wrapNetworkingV1beta1IngressClassImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typednetworkingv1beta1.IngressClassInterface = (*wrapNetworkingV1beta1IngressClassImpl)(nil) + +func (w *wrapNetworkingV1beta1IngressClassImpl) Create(ctx context.Context, in *networkingv1beta1.IngressClass, opts metav1.CreateOptions) (*networkingv1beta1.IngressClass, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "networking.k8s.io", + Version: "v1beta1", + Kind: "IngressClass", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &networkingv1beta1.IngressClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNetworkingV1beta1IngressClassImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Delete(ctx, name, opts) +} + +func (w *wrapNetworkingV1beta1IngressClassImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapNetworkingV1beta1IngressClassImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*networkingv1beta1.IngressClass, error) { + uo, err := w.dyn.Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &networkingv1beta1.IngressClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNetworkingV1beta1IngressClassImpl) List(ctx context.Context, opts metav1.ListOptions) (*networkingv1beta1.IngressClassList, error) { + uo, err := w.dyn.List(ctx, opts) + if err != nil { + return nil, err + } + out := &networkingv1beta1.IngressClassList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNetworkingV1beta1IngressClassImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *networkingv1beta1.IngressClass, err error) { + uo, err := w.dyn.Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &networkingv1beta1.IngressClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNetworkingV1beta1IngressClassImpl) Update(ctx context.Context, in *networkingv1beta1.IngressClass, opts metav1.UpdateOptions) (*networkingv1beta1.IngressClass, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "networking.k8s.io", + Version: "v1beta1", + Kind: "IngressClass", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &networkingv1beta1.IngressClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNetworkingV1beta1IngressClassImpl) UpdateStatus(ctx context.Context, in *networkingv1beta1.IngressClass, opts metav1.UpdateOptions) (*networkingv1beta1.IngressClass, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "networking.k8s.io", + Version: "v1beta1", + Kind: "IngressClass", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &networkingv1beta1.IngressClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNetworkingV1beta1IngressClassImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +// NodeV1 retrieves the NodeV1Client +func (w *wrapClient) NodeV1() typednodev1.NodeV1Interface { + return &wrapNodeV1{ + dyn: w.dyn, + } +} + +type wrapNodeV1 struct { + dyn dynamic.Interface +} + +func (w *wrapNodeV1) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapNodeV1) RuntimeClasses() typednodev1.RuntimeClassInterface { + return &wrapNodeV1RuntimeClassImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "node.k8s.io", + Version: "v1", + Resource: "runtimeclasses", + }), + } +} + +type wrapNodeV1RuntimeClassImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typednodev1.RuntimeClassInterface = (*wrapNodeV1RuntimeClassImpl)(nil) + +func (w *wrapNodeV1RuntimeClassImpl) Create(ctx context.Context, in *nodev1.RuntimeClass, opts metav1.CreateOptions) (*nodev1.RuntimeClass, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "node.k8s.io", + Version: "v1", + Kind: "RuntimeClass", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &nodev1.RuntimeClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNodeV1RuntimeClassImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Delete(ctx, name, opts) +} + +func (w *wrapNodeV1RuntimeClassImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapNodeV1RuntimeClassImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*nodev1.RuntimeClass, error) { + uo, err := w.dyn.Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &nodev1.RuntimeClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNodeV1RuntimeClassImpl) List(ctx context.Context, opts metav1.ListOptions) (*nodev1.RuntimeClassList, error) { + uo, err := w.dyn.List(ctx, opts) + if err != nil { + return nil, err + } + out := &nodev1.RuntimeClassList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNodeV1RuntimeClassImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *nodev1.RuntimeClass, err error) { + uo, err := w.dyn.Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &nodev1.RuntimeClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNodeV1RuntimeClassImpl) Update(ctx context.Context, in *nodev1.RuntimeClass, opts metav1.UpdateOptions) (*nodev1.RuntimeClass, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "node.k8s.io", + Version: "v1", + Kind: "RuntimeClass", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &nodev1.RuntimeClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNodeV1RuntimeClassImpl) UpdateStatus(ctx context.Context, in *nodev1.RuntimeClass, opts metav1.UpdateOptions) (*nodev1.RuntimeClass, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "node.k8s.io", + Version: "v1", + Kind: "RuntimeClass", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &nodev1.RuntimeClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNodeV1RuntimeClassImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +// NodeV1alpha1 retrieves the NodeV1alpha1Client +func (w *wrapClient) NodeV1alpha1() typednodev1alpha1.NodeV1alpha1Interface { + return &wrapNodeV1alpha1{ + dyn: w.dyn, + } +} + +type wrapNodeV1alpha1 struct { + dyn dynamic.Interface +} + +func (w *wrapNodeV1alpha1) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapNodeV1alpha1) RuntimeClasses() typednodev1alpha1.RuntimeClassInterface { + return &wrapNodeV1alpha1RuntimeClassImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "node.k8s.io", + Version: "v1alpha1", + Resource: "runtimeclasses", + }), + } +} + +type wrapNodeV1alpha1RuntimeClassImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typednodev1alpha1.RuntimeClassInterface = (*wrapNodeV1alpha1RuntimeClassImpl)(nil) + +func (w *wrapNodeV1alpha1RuntimeClassImpl) Create(ctx context.Context, in *nodev1alpha1.RuntimeClass, opts metav1.CreateOptions) (*nodev1alpha1.RuntimeClass, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "node.k8s.io", + Version: "v1alpha1", + Kind: "RuntimeClass", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &nodev1alpha1.RuntimeClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNodeV1alpha1RuntimeClassImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Delete(ctx, name, opts) +} + +func (w *wrapNodeV1alpha1RuntimeClassImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapNodeV1alpha1RuntimeClassImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*nodev1alpha1.RuntimeClass, error) { + uo, err := w.dyn.Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &nodev1alpha1.RuntimeClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNodeV1alpha1RuntimeClassImpl) List(ctx context.Context, opts metav1.ListOptions) (*nodev1alpha1.RuntimeClassList, error) { + uo, err := w.dyn.List(ctx, opts) + if err != nil { + return nil, err + } + out := &nodev1alpha1.RuntimeClassList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNodeV1alpha1RuntimeClassImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *nodev1alpha1.RuntimeClass, err error) { + uo, err := w.dyn.Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &nodev1alpha1.RuntimeClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNodeV1alpha1RuntimeClassImpl) Update(ctx context.Context, in *nodev1alpha1.RuntimeClass, opts metav1.UpdateOptions) (*nodev1alpha1.RuntimeClass, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "node.k8s.io", + Version: "v1alpha1", + Kind: "RuntimeClass", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &nodev1alpha1.RuntimeClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNodeV1alpha1RuntimeClassImpl) UpdateStatus(ctx context.Context, in *nodev1alpha1.RuntimeClass, opts metav1.UpdateOptions) (*nodev1alpha1.RuntimeClass, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "node.k8s.io", + Version: "v1alpha1", + Kind: "RuntimeClass", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &nodev1alpha1.RuntimeClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNodeV1alpha1RuntimeClassImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +// NodeV1beta1 retrieves the NodeV1beta1Client +func (w *wrapClient) NodeV1beta1() typednodev1beta1.NodeV1beta1Interface { + return &wrapNodeV1beta1{ + dyn: w.dyn, + } +} + +type wrapNodeV1beta1 struct { + dyn dynamic.Interface +} + +func (w *wrapNodeV1beta1) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapNodeV1beta1) RuntimeClasses() typednodev1beta1.RuntimeClassInterface { + return &wrapNodeV1beta1RuntimeClassImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "node.k8s.io", + Version: "v1beta1", + Resource: "runtimeclasses", + }), + } +} + +type wrapNodeV1beta1RuntimeClassImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typednodev1beta1.RuntimeClassInterface = (*wrapNodeV1beta1RuntimeClassImpl)(nil) + +func (w *wrapNodeV1beta1RuntimeClassImpl) Create(ctx context.Context, in *nodev1beta1.RuntimeClass, opts metav1.CreateOptions) (*nodev1beta1.RuntimeClass, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "node.k8s.io", + Version: "v1beta1", + Kind: "RuntimeClass", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &nodev1beta1.RuntimeClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNodeV1beta1RuntimeClassImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Delete(ctx, name, opts) +} + +func (w *wrapNodeV1beta1RuntimeClassImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapNodeV1beta1RuntimeClassImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*nodev1beta1.RuntimeClass, error) { + uo, err := w.dyn.Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &nodev1beta1.RuntimeClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNodeV1beta1RuntimeClassImpl) List(ctx context.Context, opts metav1.ListOptions) (*nodev1beta1.RuntimeClassList, error) { + uo, err := w.dyn.List(ctx, opts) + if err != nil { + return nil, err + } + out := &nodev1beta1.RuntimeClassList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNodeV1beta1RuntimeClassImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *nodev1beta1.RuntimeClass, err error) { + uo, err := w.dyn.Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &nodev1beta1.RuntimeClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNodeV1beta1RuntimeClassImpl) Update(ctx context.Context, in *nodev1beta1.RuntimeClass, opts metav1.UpdateOptions) (*nodev1beta1.RuntimeClass, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "node.k8s.io", + Version: "v1beta1", + Kind: "RuntimeClass", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &nodev1beta1.RuntimeClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNodeV1beta1RuntimeClassImpl) UpdateStatus(ctx context.Context, in *nodev1beta1.RuntimeClass, opts metav1.UpdateOptions) (*nodev1beta1.RuntimeClass, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "node.k8s.io", + Version: "v1beta1", + Kind: "RuntimeClass", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &nodev1beta1.RuntimeClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapNodeV1beta1RuntimeClassImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +// PolicyV1beta1 retrieves the PolicyV1beta1Client +func (w *wrapClient) PolicyV1beta1() typedpolicyv1beta1.PolicyV1beta1Interface { + return &wrapPolicyV1beta1{ + dyn: w.dyn, + } +} + +type wrapPolicyV1beta1 struct { + dyn dynamic.Interface +} + +func (w *wrapPolicyV1beta1) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapPolicyV1beta1) Evictions(namespace string) typedpolicyv1beta1.EvictionInterface { + return &wrapPolicyV1beta1EvictionImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "policy", + Version: "v1beta1", + Resource: "evictions", + }), + + namespace: namespace, + } +} + +type wrapPolicyV1beta1EvictionImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedpolicyv1beta1.EvictionInterface = (*wrapPolicyV1beta1EvictionImpl)(nil) + +func (w *wrapPolicyV1beta1) PodDisruptionBudgets(namespace string) typedpolicyv1beta1.PodDisruptionBudgetInterface { + return &wrapPolicyV1beta1PodDisruptionBudgetImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "policy", + Version: "v1beta1", + Resource: "poddisruptionbudgets", + }), + + namespace: namespace, + } +} + +type wrapPolicyV1beta1PodDisruptionBudgetImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedpolicyv1beta1.PodDisruptionBudgetInterface = (*wrapPolicyV1beta1PodDisruptionBudgetImpl)(nil) + +func (w *wrapPolicyV1beta1PodDisruptionBudgetImpl) Create(ctx context.Context, in *policyv1beta1.PodDisruptionBudget, opts metav1.CreateOptions) (*policyv1beta1.PodDisruptionBudget, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "policy", + Version: "v1beta1", + Kind: "PodDisruptionBudget", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &policyv1beta1.PodDisruptionBudget{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapPolicyV1beta1PodDisruptionBudgetImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapPolicyV1beta1PodDisruptionBudgetImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapPolicyV1beta1PodDisruptionBudgetImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*policyv1beta1.PodDisruptionBudget, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &policyv1beta1.PodDisruptionBudget{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapPolicyV1beta1PodDisruptionBudgetImpl) List(ctx context.Context, opts metav1.ListOptions) (*policyv1beta1.PodDisruptionBudgetList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &policyv1beta1.PodDisruptionBudgetList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapPolicyV1beta1PodDisruptionBudgetImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *policyv1beta1.PodDisruptionBudget, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &policyv1beta1.PodDisruptionBudget{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapPolicyV1beta1PodDisruptionBudgetImpl) Update(ctx context.Context, in *policyv1beta1.PodDisruptionBudget, opts metav1.UpdateOptions) (*policyv1beta1.PodDisruptionBudget, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "policy", + Version: "v1beta1", + Kind: "PodDisruptionBudget", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &policyv1beta1.PodDisruptionBudget{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapPolicyV1beta1PodDisruptionBudgetImpl) UpdateStatus(ctx context.Context, in *policyv1beta1.PodDisruptionBudget, opts metav1.UpdateOptions) (*policyv1beta1.PodDisruptionBudget, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "policy", + Version: "v1beta1", + Kind: "PodDisruptionBudget", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &policyv1beta1.PodDisruptionBudget{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapPolicyV1beta1PodDisruptionBudgetImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapPolicyV1beta1) PodSecurityPolicies() typedpolicyv1beta1.PodSecurityPolicyInterface { + return &wrapPolicyV1beta1PodSecurityPolicyImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "policy", + Version: "v1beta1", + Resource: "podsecuritypolicies", + }), + } +} + +type wrapPolicyV1beta1PodSecurityPolicyImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedpolicyv1beta1.PodSecurityPolicyInterface = (*wrapPolicyV1beta1PodSecurityPolicyImpl)(nil) + +func (w *wrapPolicyV1beta1PodSecurityPolicyImpl) Create(ctx context.Context, in *policyv1beta1.PodSecurityPolicy, opts metav1.CreateOptions) (*policyv1beta1.PodSecurityPolicy, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "policy", + Version: "v1beta1", + Kind: "PodSecurityPolicy", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &policyv1beta1.PodSecurityPolicy{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapPolicyV1beta1PodSecurityPolicyImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Delete(ctx, name, opts) +} + +func (w *wrapPolicyV1beta1PodSecurityPolicyImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapPolicyV1beta1PodSecurityPolicyImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*policyv1beta1.PodSecurityPolicy, error) { + uo, err := w.dyn.Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &policyv1beta1.PodSecurityPolicy{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapPolicyV1beta1PodSecurityPolicyImpl) List(ctx context.Context, opts metav1.ListOptions) (*policyv1beta1.PodSecurityPolicyList, error) { + uo, err := w.dyn.List(ctx, opts) + if err != nil { + return nil, err + } + out := &policyv1beta1.PodSecurityPolicyList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapPolicyV1beta1PodSecurityPolicyImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *policyv1beta1.PodSecurityPolicy, err error) { + uo, err := w.dyn.Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &policyv1beta1.PodSecurityPolicy{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapPolicyV1beta1PodSecurityPolicyImpl) Update(ctx context.Context, in *policyv1beta1.PodSecurityPolicy, opts metav1.UpdateOptions) (*policyv1beta1.PodSecurityPolicy, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "policy", + Version: "v1beta1", + Kind: "PodSecurityPolicy", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &policyv1beta1.PodSecurityPolicy{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapPolicyV1beta1PodSecurityPolicyImpl) UpdateStatus(ctx context.Context, in *policyv1beta1.PodSecurityPolicy, opts metav1.UpdateOptions) (*policyv1beta1.PodSecurityPolicy, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "policy", + Version: "v1beta1", + Kind: "PodSecurityPolicy", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &policyv1beta1.PodSecurityPolicy{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapPolicyV1beta1PodSecurityPolicyImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +// RbacV1 retrieves the RbacV1Client +func (w *wrapClient) RbacV1() typedrbacv1.RbacV1Interface { + return &wrapRbacV1{ + dyn: w.dyn, + } +} + +type wrapRbacV1 struct { + dyn dynamic.Interface +} + +func (w *wrapRbacV1) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapRbacV1) ClusterRoles() typedrbacv1.ClusterRoleInterface { + return &wrapRbacV1ClusterRoleImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "rbac.authorization.k8s.io", + Version: "v1", + Resource: "clusterroles", + }), + } +} + +type wrapRbacV1ClusterRoleImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedrbacv1.ClusterRoleInterface = (*wrapRbacV1ClusterRoleImpl)(nil) + +func (w *wrapRbacV1ClusterRoleImpl) Create(ctx context.Context, in *rbacv1.ClusterRole, opts metav1.CreateOptions) (*rbacv1.ClusterRole, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "rbac.authorization.k8s.io", + Version: "v1", + Kind: "ClusterRole", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &rbacv1.ClusterRole{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1ClusterRoleImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Delete(ctx, name, opts) +} + +func (w *wrapRbacV1ClusterRoleImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapRbacV1ClusterRoleImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*rbacv1.ClusterRole, error) { + uo, err := w.dyn.Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &rbacv1.ClusterRole{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1ClusterRoleImpl) List(ctx context.Context, opts metav1.ListOptions) (*rbacv1.ClusterRoleList, error) { + uo, err := w.dyn.List(ctx, opts) + if err != nil { + return nil, err + } + out := &rbacv1.ClusterRoleList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1ClusterRoleImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *rbacv1.ClusterRole, err error) { + uo, err := w.dyn.Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &rbacv1.ClusterRole{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1ClusterRoleImpl) Update(ctx context.Context, in *rbacv1.ClusterRole, opts metav1.UpdateOptions) (*rbacv1.ClusterRole, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "rbac.authorization.k8s.io", + Version: "v1", + Kind: "ClusterRole", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &rbacv1.ClusterRole{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1ClusterRoleImpl) UpdateStatus(ctx context.Context, in *rbacv1.ClusterRole, opts metav1.UpdateOptions) (*rbacv1.ClusterRole, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "rbac.authorization.k8s.io", + Version: "v1", + Kind: "ClusterRole", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &rbacv1.ClusterRole{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1ClusterRoleImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapRbacV1) ClusterRoleBindings() typedrbacv1.ClusterRoleBindingInterface { + return &wrapRbacV1ClusterRoleBindingImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "rbac.authorization.k8s.io", + Version: "v1", + Resource: "clusterrolebindings", + }), + } +} + +type wrapRbacV1ClusterRoleBindingImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedrbacv1.ClusterRoleBindingInterface = (*wrapRbacV1ClusterRoleBindingImpl)(nil) + +func (w *wrapRbacV1ClusterRoleBindingImpl) Create(ctx context.Context, in *rbacv1.ClusterRoleBinding, opts metav1.CreateOptions) (*rbacv1.ClusterRoleBinding, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "rbac.authorization.k8s.io", + Version: "v1", + Kind: "ClusterRoleBinding", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &rbacv1.ClusterRoleBinding{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1ClusterRoleBindingImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Delete(ctx, name, opts) +} + +func (w *wrapRbacV1ClusterRoleBindingImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapRbacV1ClusterRoleBindingImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*rbacv1.ClusterRoleBinding, error) { + uo, err := w.dyn.Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &rbacv1.ClusterRoleBinding{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1ClusterRoleBindingImpl) List(ctx context.Context, opts metav1.ListOptions) (*rbacv1.ClusterRoleBindingList, error) { + uo, err := w.dyn.List(ctx, opts) + if err != nil { + return nil, err + } + out := &rbacv1.ClusterRoleBindingList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1ClusterRoleBindingImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *rbacv1.ClusterRoleBinding, err error) { + uo, err := w.dyn.Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &rbacv1.ClusterRoleBinding{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1ClusterRoleBindingImpl) Update(ctx context.Context, in *rbacv1.ClusterRoleBinding, opts metav1.UpdateOptions) (*rbacv1.ClusterRoleBinding, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "rbac.authorization.k8s.io", + Version: "v1", + Kind: "ClusterRoleBinding", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &rbacv1.ClusterRoleBinding{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1ClusterRoleBindingImpl) UpdateStatus(ctx context.Context, in *rbacv1.ClusterRoleBinding, opts metav1.UpdateOptions) (*rbacv1.ClusterRoleBinding, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "rbac.authorization.k8s.io", + Version: "v1", + Kind: "ClusterRoleBinding", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &rbacv1.ClusterRoleBinding{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1ClusterRoleBindingImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapRbacV1) Roles(namespace string) typedrbacv1.RoleInterface { + return &wrapRbacV1RoleImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "rbac.authorization.k8s.io", + Version: "v1", + Resource: "roles", + }), + + namespace: namespace, + } +} + +type wrapRbacV1RoleImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedrbacv1.RoleInterface = (*wrapRbacV1RoleImpl)(nil) + +func (w *wrapRbacV1RoleImpl) Create(ctx context.Context, in *rbacv1.Role, opts metav1.CreateOptions) (*rbacv1.Role, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "rbac.authorization.k8s.io", + Version: "v1", + Kind: "Role", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &rbacv1.Role{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1RoleImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapRbacV1RoleImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapRbacV1RoleImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*rbacv1.Role, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &rbacv1.Role{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1RoleImpl) List(ctx context.Context, opts metav1.ListOptions) (*rbacv1.RoleList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &rbacv1.RoleList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1RoleImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *rbacv1.Role, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &rbacv1.Role{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1RoleImpl) Update(ctx context.Context, in *rbacv1.Role, opts metav1.UpdateOptions) (*rbacv1.Role, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "rbac.authorization.k8s.io", + Version: "v1", + Kind: "Role", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &rbacv1.Role{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1RoleImpl) UpdateStatus(ctx context.Context, in *rbacv1.Role, opts metav1.UpdateOptions) (*rbacv1.Role, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "rbac.authorization.k8s.io", + Version: "v1", + Kind: "Role", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &rbacv1.Role{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1RoleImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapRbacV1) RoleBindings(namespace string) typedrbacv1.RoleBindingInterface { + return &wrapRbacV1RoleBindingImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "rbac.authorization.k8s.io", + Version: "v1", + Resource: "rolebindings", + }), + + namespace: namespace, + } +} + +type wrapRbacV1RoleBindingImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedrbacv1.RoleBindingInterface = (*wrapRbacV1RoleBindingImpl)(nil) + +func (w *wrapRbacV1RoleBindingImpl) Create(ctx context.Context, in *rbacv1.RoleBinding, opts metav1.CreateOptions) (*rbacv1.RoleBinding, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "rbac.authorization.k8s.io", + Version: "v1", + Kind: "RoleBinding", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &rbacv1.RoleBinding{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1RoleBindingImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapRbacV1RoleBindingImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapRbacV1RoleBindingImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*rbacv1.RoleBinding, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &rbacv1.RoleBinding{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1RoleBindingImpl) List(ctx context.Context, opts metav1.ListOptions) (*rbacv1.RoleBindingList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &rbacv1.RoleBindingList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1RoleBindingImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *rbacv1.RoleBinding, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &rbacv1.RoleBinding{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1RoleBindingImpl) Update(ctx context.Context, in *rbacv1.RoleBinding, opts metav1.UpdateOptions) (*rbacv1.RoleBinding, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "rbac.authorization.k8s.io", + Version: "v1", + Kind: "RoleBinding", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &rbacv1.RoleBinding{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1RoleBindingImpl) UpdateStatus(ctx context.Context, in *rbacv1.RoleBinding, opts metav1.UpdateOptions) (*rbacv1.RoleBinding, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "rbac.authorization.k8s.io", + Version: "v1", + Kind: "RoleBinding", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &rbacv1.RoleBinding{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1RoleBindingImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +// RbacV1alpha1 retrieves the RbacV1alpha1Client +func (w *wrapClient) RbacV1alpha1() typedrbacv1alpha1.RbacV1alpha1Interface { + return &wrapRbacV1alpha1{ + dyn: w.dyn, + } +} + +type wrapRbacV1alpha1 struct { + dyn dynamic.Interface +} + +func (w *wrapRbacV1alpha1) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapRbacV1alpha1) ClusterRoles() typedrbacv1alpha1.ClusterRoleInterface { + return &wrapRbacV1alpha1ClusterRoleImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "rbac.authorization.k8s.io", + Version: "v1alpha1", + Resource: "clusterroles", + }), + } +} + +type wrapRbacV1alpha1ClusterRoleImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedrbacv1alpha1.ClusterRoleInterface = (*wrapRbacV1alpha1ClusterRoleImpl)(nil) + +func (w *wrapRbacV1alpha1ClusterRoleImpl) Create(ctx context.Context, in *rbacv1alpha1.ClusterRole, opts metav1.CreateOptions) (*rbacv1alpha1.ClusterRole, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "rbac.authorization.k8s.io", + Version: "v1alpha1", + Kind: "ClusterRole", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &rbacv1alpha1.ClusterRole{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1alpha1ClusterRoleImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Delete(ctx, name, opts) +} + +func (w *wrapRbacV1alpha1ClusterRoleImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapRbacV1alpha1ClusterRoleImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*rbacv1alpha1.ClusterRole, error) { + uo, err := w.dyn.Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &rbacv1alpha1.ClusterRole{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1alpha1ClusterRoleImpl) List(ctx context.Context, opts metav1.ListOptions) (*rbacv1alpha1.ClusterRoleList, error) { + uo, err := w.dyn.List(ctx, opts) + if err != nil { + return nil, err + } + out := &rbacv1alpha1.ClusterRoleList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1alpha1ClusterRoleImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *rbacv1alpha1.ClusterRole, err error) { + uo, err := w.dyn.Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &rbacv1alpha1.ClusterRole{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1alpha1ClusterRoleImpl) Update(ctx context.Context, in *rbacv1alpha1.ClusterRole, opts metav1.UpdateOptions) (*rbacv1alpha1.ClusterRole, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "rbac.authorization.k8s.io", + Version: "v1alpha1", + Kind: "ClusterRole", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &rbacv1alpha1.ClusterRole{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1alpha1ClusterRoleImpl) UpdateStatus(ctx context.Context, in *rbacv1alpha1.ClusterRole, opts metav1.UpdateOptions) (*rbacv1alpha1.ClusterRole, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "rbac.authorization.k8s.io", + Version: "v1alpha1", + Kind: "ClusterRole", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &rbacv1alpha1.ClusterRole{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1alpha1ClusterRoleImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapRbacV1alpha1) ClusterRoleBindings() typedrbacv1alpha1.ClusterRoleBindingInterface { + return &wrapRbacV1alpha1ClusterRoleBindingImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "rbac.authorization.k8s.io", + Version: "v1alpha1", + Resource: "clusterrolebindings", + }), + } +} + +type wrapRbacV1alpha1ClusterRoleBindingImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedrbacv1alpha1.ClusterRoleBindingInterface = (*wrapRbacV1alpha1ClusterRoleBindingImpl)(nil) + +func (w *wrapRbacV1alpha1ClusterRoleBindingImpl) Create(ctx context.Context, in *rbacv1alpha1.ClusterRoleBinding, opts metav1.CreateOptions) (*rbacv1alpha1.ClusterRoleBinding, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "rbac.authorization.k8s.io", + Version: "v1alpha1", + Kind: "ClusterRoleBinding", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &rbacv1alpha1.ClusterRoleBinding{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1alpha1ClusterRoleBindingImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Delete(ctx, name, opts) +} + +func (w *wrapRbacV1alpha1ClusterRoleBindingImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapRbacV1alpha1ClusterRoleBindingImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*rbacv1alpha1.ClusterRoleBinding, error) { + uo, err := w.dyn.Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &rbacv1alpha1.ClusterRoleBinding{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1alpha1ClusterRoleBindingImpl) List(ctx context.Context, opts metav1.ListOptions) (*rbacv1alpha1.ClusterRoleBindingList, error) { + uo, err := w.dyn.List(ctx, opts) + if err != nil { + return nil, err + } + out := &rbacv1alpha1.ClusterRoleBindingList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1alpha1ClusterRoleBindingImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *rbacv1alpha1.ClusterRoleBinding, err error) { + uo, err := w.dyn.Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &rbacv1alpha1.ClusterRoleBinding{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1alpha1ClusterRoleBindingImpl) Update(ctx context.Context, in *rbacv1alpha1.ClusterRoleBinding, opts metav1.UpdateOptions) (*rbacv1alpha1.ClusterRoleBinding, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "rbac.authorization.k8s.io", + Version: "v1alpha1", + Kind: "ClusterRoleBinding", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &rbacv1alpha1.ClusterRoleBinding{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1alpha1ClusterRoleBindingImpl) UpdateStatus(ctx context.Context, in *rbacv1alpha1.ClusterRoleBinding, opts metav1.UpdateOptions) (*rbacv1alpha1.ClusterRoleBinding, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "rbac.authorization.k8s.io", + Version: "v1alpha1", + Kind: "ClusterRoleBinding", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &rbacv1alpha1.ClusterRoleBinding{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1alpha1ClusterRoleBindingImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapRbacV1alpha1) Roles(namespace string) typedrbacv1alpha1.RoleInterface { + return &wrapRbacV1alpha1RoleImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "rbac.authorization.k8s.io", + Version: "v1alpha1", + Resource: "roles", + }), + + namespace: namespace, + } +} + +type wrapRbacV1alpha1RoleImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedrbacv1alpha1.RoleInterface = (*wrapRbacV1alpha1RoleImpl)(nil) + +func (w *wrapRbacV1alpha1RoleImpl) Create(ctx context.Context, in *rbacv1alpha1.Role, opts metav1.CreateOptions) (*rbacv1alpha1.Role, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "rbac.authorization.k8s.io", + Version: "v1alpha1", + Kind: "Role", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &rbacv1alpha1.Role{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1alpha1RoleImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapRbacV1alpha1RoleImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapRbacV1alpha1RoleImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*rbacv1alpha1.Role, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &rbacv1alpha1.Role{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1alpha1RoleImpl) List(ctx context.Context, opts metav1.ListOptions) (*rbacv1alpha1.RoleList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &rbacv1alpha1.RoleList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1alpha1RoleImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *rbacv1alpha1.Role, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &rbacv1alpha1.Role{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1alpha1RoleImpl) Update(ctx context.Context, in *rbacv1alpha1.Role, opts metav1.UpdateOptions) (*rbacv1alpha1.Role, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "rbac.authorization.k8s.io", + Version: "v1alpha1", + Kind: "Role", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &rbacv1alpha1.Role{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1alpha1RoleImpl) UpdateStatus(ctx context.Context, in *rbacv1alpha1.Role, opts metav1.UpdateOptions) (*rbacv1alpha1.Role, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "rbac.authorization.k8s.io", + Version: "v1alpha1", + Kind: "Role", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &rbacv1alpha1.Role{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1alpha1RoleImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapRbacV1alpha1) RoleBindings(namespace string) typedrbacv1alpha1.RoleBindingInterface { + return &wrapRbacV1alpha1RoleBindingImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "rbac.authorization.k8s.io", + Version: "v1alpha1", + Resource: "rolebindings", + }), + + namespace: namespace, + } +} + +type wrapRbacV1alpha1RoleBindingImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedrbacv1alpha1.RoleBindingInterface = (*wrapRbacV1alpha1RoleBindingImpl)(nil) + +func (w *wrapRbacV1alpha1RoleBindingImpl) Create(ctx context.Context, in *rbacv1alpha1.RoleBinding, opts metav1.CreateOptions) (*rbacv1alpha1.RoleBinding, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "rbac.authorization.k8s.io", + Version: "v1alpha1", + Kind: "RoleBinding", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &rbacv1alpha1.RoleBinding{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1alpha1RoleBindingImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapRbacV1alpha1RoleBindingImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapRbacV1alpha1RoleBindingImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*rbacv1alpha1.RoleBinding, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &rbacv1alpha1.RoleBinding{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1alpha1RoleBindingImpl) List(ctx context.Context, opts metav1.ListOptions) (*rbacv1alpha1.RoleBindingList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &rbacv1alpha1.RoleBindingList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1alpha1RoleBindingImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *rbacv1alpha1.RoleBinding, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &rbacv1alpha1.RoleBinding{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1alpha1RoleBindingImpl) Update(ctx context.Context, in *rbacv1alpha1.RoleBinding, opts metav1.UpdateOptions) (*rbacv1alpha1.RoleBinding, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "rbac.authorization.k8s.io", + Version: "v1alpha1", + Kind: "RoleBinding", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &rbacv1alpha1.RoleBinding{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1alpha1RoleBindingImpl) UpdateStatus(ctx context.Context, in *rbacv1alpha1.RoleBinding, opts metav1.UpdateOptions) (*rbacv1alpha1.RoleBinding, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "rbac.authorization.k8s.io", + Version: "v1alpha1", + Kind: "RoleBinding", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &rbacv1alpha1.RoleBinding{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1alpha1RoleBindingImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +// RbacV1beta1 retrieves the RbacV1beta1Client +func (w *wrapClient) RbacV1beta1() typedrbacv1beta1.RbacV1beta1Interface { + return &wrapRbacV1beta1{ + dyn: w.dyn, + } +} + +type wrapRbacV1beta1 struct { + dyn dynamic.Interface +} + +func (w *wrapRbacV1beta1) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapRbacV1beta1) ClusterRoles() typedrbacv1beta1.ClusterRoleInterface { + return &wrapRbacV1beta1ClusterRoleImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "rbac.authorization.k8s.io", + Version: "v1beta1", + Resource: "clusterroles", + }), + } +} + +type wrapRbacV1beta1ClusterRoleImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedrbacv1beta1.ClusterRoleInterface = (*wrapRbacV1beta1ClusterRoleImpl)(nil) + +func (w *wrapRbacV1beta1ClusterRoleImpl) Create(ctx context.Context, in *rbacv1beta1.ClusterRole, opts metav1.CreateOptions) (*rbacv1beta1.ClusterRole, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "rbac.authorization.k8s.io", + Version: "v1beta1", + Kind: "ClusterRole", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &rbacv1beta1.ClusterRole{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1beta1ClusterRoleImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Delete(ctx, name, opts) +} + +func (w *wrapRbacV1beta1ClusterRoleImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapRbacV1beta1ClusterRoleImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*rbacv1beta1.ClusterRole, error) { + uo, err := w.dyn.Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &rbacv1beta1.ClusterRole{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1beta1ClusterRoleImpl) List(ctx context.Context, opts metav1.ListOptions) (*rbacv1beta1.ClusterRoleList, error) { + uo, err := w.dyn.List(ctx, opts) + if err != nil { + return nil, err + } + out := &rbacv1beta1.ClusterRoleList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1beta1ClusterRoleImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *rbacv1beta1.ClusterRole, err error) { + uo, err := w.dyn.Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &rbacv1beta1.ClusterRole{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1beta1ClusterRoleImpl) Update(ctx context.Context, in *rbacv1beta1.ClusterRole, opts metav1.UpdateOptions) (*rbacv1beta1.ClusterRole, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "rbac.authorization.k8s.io", + Version: "v1beta1", + Kind: "ClusterRole", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &rbacv1beta1.ClusterRole{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1beta1ClusterRoleImpl) UpdateStatus(ctx context.Context, in *rbacv1beta1.ClusterRole, opts metav1.UpdateOptions) (*rbacv1beta1.ClusterRole, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "rbac.authorization.k8s.io", + Version: "v1beta1", + Kind: "ClusterRole", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &rbacv1beta1.ClusterRole{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1beta1ClusterRoleImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapRbacV1beta1) ClusterRoleBindings() typedrbacv1beta1.ClusterRoleBindingInterface { + return &wrapRbacV1beta1ClusterRoleBindingImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "rbac.authorization.k8s.io", + Version: "v1beta1", + Resource: "clusterrolebindings", + }), + } +} + +type wrapRbacV1beta1ClusterRoleBindingImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedrbacv1beta1.ClusterRoleBindingInterface = (*wrapRbacV1beta1ClusterRoleBindingImpl)(nil) + +func (w *wrapRbacV1beta1ClusterRoleBindingImpl) Create(ctx context.Context, in *rbacv1beta1.ClusterRoleBinding, opts metav1.CreateOptions) (*rbacv1beta1.ClusterRoleBinding, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "rbac.authorization.k8s.io", + Version: "v1beta1", + Kind: "ClusterRoleBinding", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &rbacv1beta1.ClusterRoleBinding{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1beta1ClusterRoleBindingImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Delete(ctx, name, opts) +} + +func (w *wrapRbacV1beta1ClusterRoleBindingImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapRbacV1beta1ClusterRoleBindingImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*rbacv1beta1.ClusterRoleBinding, error) { + uo, err := w.dyn.Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &rbacv1beta1.ClusterRoleBinding{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1beta1ClusterRoleBindingImpl) List(ctx context.Context, opts metav1.ListOptions) (*rbacv1beta1.ClusterRoleBindingList, error) { + uo, err := w.dyn.List(ctx, opts) + if err != nil { + return nil, err + } + out := &rbacv1beta1.ClusterRoleBindingList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1beta1ClusterRoleBindingImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *rbacv1beta1.ClusterRoleBinding, err error) { + uo, err := w.dyn.Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &rbacv1beta1.ClusterRoleBinding{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1beta1ClusterRoleBindingImpl) Update(ctx context.Context, in *rbacv1beta1.ClusterRoleBinding, opts metav1.UpdateOptions) (*rbacv1beta1.ClusterRoleBinding, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "rbac.authorization.k8s.io", + Version: "v1beta1", + Kind: "ClusterRoleBinding", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &rbacv1beta1.ClusterRoleBinding{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1beta1ClusterRoleBindingImpl) UpdateStatus(ctx context.Context, in *rbacv1beta1.ClusterRoleBinding, opts metav1.UpdateOptions) (*rbacv1beta1.ClusterRoleBinding, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "rbac.authorization.k8s.io", + Version: "v1beta1", + Kind: "ClusterRoleBinding", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &rbacv1beta1.ClusterRoleBinding{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1beta1ClusterRoleBindingImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapRbacV1beta1) Roles(namespace string) typedrbacv1beta1.RoleInterface { + return &wrapRbacV1beta1RoleImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "rbac.authorization.k8s.io", + Version: "v1beta1", + Resource: "roles", + }), + + namespace: namespace, + } +} + +type wrapRbacV1beta1RoleImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedrbacv1beta1.RoleInterface = (*wrapRbacV1beta1RoleImpl)(nil) + +func (w *wrapRbacV1beta1RoleImpl) Create(ctx context.Context, in *rbacv1beta1.Role, opts metav1.CreateOptions) (*rbacv1beta1.Role, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "rbac.authorization.k8s.io", + Version: "v1beta1", + Kind: "Role", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &rbacv1beta1.Role{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1beta1RoleImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapRbacV1beta1RoleImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapRbacV1beta1RoleImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*rbacv1beta1.Role, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &rbacv1beta1.Role{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1beta1RoleImpl) List(ctx context.Context, opts metav1.ListOptions) (*rbacv1beta1.RoleList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &rbacv1beta1.RoleList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1beta1RoleImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *rbacv1beta1.Role, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &rbacv1beta1.Role{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1beta1RoleImpl) Update(ctx context.Context, in *rbacv1beta1.Role, opts metav1.UpdateOptions) (*rbacv1beta1.Role, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "rbac.authorization.k8s.io", + Version: "v1beta1", + Kind: "Role", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &rbacv1beta1.Role{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1beta1RoleImpl) UpdateStatus(ctx context.Context, in *rbacv1beta1.Role, opts metav1.UpdateOptions) (*rbacv1beta1.Role, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "rbac.authorization.k8s.io", + Version: "v1beta1", + Kind: "Role", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &rbacv1beta1.Role{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1beta1RoleImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapRbacV1beta1) RoleBindings(namespace string) typedrbacv1beta1.RoleBindingInterface { + return &wrapRbacV1beta1RoleBindingImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "rbac.authorization.k8s.io", + Version: "v1beta1", + Resource: "rolebindings", + }), + + namespace: namespace, + } +} + +type wrapRbacV1beta1RoleBindingImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedrbacv1beta1.RoleBindingInterface = (*wrapRbacV1beta1RoleBindingImpl)(nil) + +func (w *wrapRbacV1beta1RoleBindingImpl) Create(ctx context.Context, in *rbacv1beta1.RoleBinding, opts metav1.CreateOptions) (*rbacv1beta1.RoleBinding, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "rbac.authorization.k8s.io", + Version: "v1beta1", + Kind: "RoleBinding", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &rbacv1beta1.RoleBinding{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1beta1RoleBindingImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapRbacV1beta1RoleBindingImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapRbacV1beta1RoleBindingImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*rbacv1beta1.RoleBinding, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &rbacv1beta1.RoleBinding{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1beta1RoleBindingImpl) List(ctx context.Context, opts metav1.ListOptions) (*rbacv1beta1.RoleBindingList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &rbacv1beta1.RoleBindingList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1beta1RoleBindingImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *rbacv1beta1.RoleBinding, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &rbacv1beta1.RoleBinding{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1beta1RoleBindingImpl) Update(ctx context.Context, in *rbacv1beta1.RoleBinding, opts metav1.UpdateOptions) (*rbacv1beta1.RoleBinding, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "rbac.authorization.k8s.io", + Version: "v1beta1", + Kind: "RoleBinding", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &rbacv1beta1.RoleBinding{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1beta1RoleBindingImpl) UpdateStatus(ctx context.Context, in *rbacv1beta1.RoleBinding, opts metav1.UpdateOptions) (*rbacv1beta1.RoleBinding, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "rbac.authorization.k8s.io", + Version: "v1beta1", + Kind: "RoleBinding", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &rbacv1beta1.RoleBinding{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapRbacV1beta1RoleBindingImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +// SchedulingV1 retrieves the SchedulingV1Client +func (w *wrapClient) SchedulingV1() typedschedulingv1.SchedulingV1Interface { + return &wrapSchedulingV1{ + dyn: w.dyn, + } +} + +type wrapSchedulingV1 struct { + dyn dynamic.Interface +} + +func (w *wrapSchedulingV1) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapSchedulingV1) PriorityClasses() typedschedulingv1.PriorityClassInterface { + return &wrapSchedulingV1PriorityClassImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "scheduling.k8s.io", + Version: "v1", + Resource: "priorityclasses", + }), + } +} + +type wrapSchedulingV1PriorityClassImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedschedulingv1.PriorityClassInterface = (*wrapSchedulingV1PriorityClassImpl)(nil) + +func (w *wrapSchedulingV1PriorityClassImpl) Create(ctx context.Context, in *schedulingv1.PriorityClass, opts metav1.CreateOptions) (*schedulingv1.PriorityClass, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "scheduling.k8s.io", + Version: "v1", + Kind: "PriorityClass", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &schedulingv1.PriorityClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapSchedulingV1PriorityClassImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Delete(ctx, name, opts) +} + +func (w *wrapSchedulingV1PriorityClassImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapSchedulingV1PriorityClassImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*schedulingv1.PriorityClass, error) { + uo, err := w.dyn.Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &schedulingv1.PriorityClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapSchedulingV1PriorityClassImpl) List(ctx context.Context, opts metav1.ListOptions) (*schedulingv1.PriorityClassList, error) { + uo, err := w.dyn.List(ctx, opts) + if err != nil { + return nil, err + } + out := &schedulingv1.PriorityClassList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapSchedulingV1PriorityClassImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *schedulingv1.PriorityClass, err error) { + uo, err := w.dyn.Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &schedulingv1.PriorityClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapSchedulingV1PriorityClassImpl) Update(ctx context.Context, in *schedulingv1.PriorityClass, opts metav1.UpdateOptions) (*schedulingv1.PriorityClass, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "scheduling.k8s.io", + Version: "v1", + Kind: "PriorityClass", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &schedulingv1.PriorityClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapSchedulingV1PriorityClassImpl) UpdateStatus(ctx context.Context, in *schedulingv1.PriorityClass, opts metav1.UpdateOptions) (*schedulingv1.PriorityClass, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "scheduling.k8s.io", + Version: "v1", + Kind: "PriorityClass", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &schedulingv1.PriorityClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapSchedulingV1PriorityClassImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +// SchedulingV1alpha1 retrieves the SchedulingV1alpha1Client +func (w *wrapClient) SchedulingV1alpha1() typedschedulingv1alpha1.SchedulingV1alpha1Interface { + return &wrapSchedulingV1alpha1{ + dyn: w.dyn, + } +} + +type wrapSchedulingV1alpha1 struct { + dyn dynamic.Interface +} + +func (w *wrapSchedulingV1alpha1) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapSchedulingV1alpha1) PriorityClasses() typedschedulingv1alpha1.PriorityClassInterface { + return &wrapSchedulingV1alpha1PriorityClassImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "scheduling.k8s.io", + Version: "v1alpha1", + Resource: "priorityclasses", + }), + } +} + +type wrapSchedulingV1alpha1PriorityClassImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedschedulingv1alpha1.PriorityClassInterface = (*wrapSchedulingV1alpha1PriorityClassImpl)(nil) + +func (w *wrapSchedulingV1alpha1PriorityClassImpl) Create(ctx context.Context, in *schedulingv1alpha1.PriorityClass, opts metav1.CreateOptions) (*schedulingv1alpha1.PriorityClass, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "scheduling.k8s.io", + Version: "v1alpha1", + Kind: "PriorityClass", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &schedulingv1alpha1.PriorityClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapSchedulingV1alpha1PriorityClassImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Delete(ctx, name, opts) +} + +func (w *wrapSchedulingV1alpha1PriorityClassImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapSchedulingV1alpha1PriorityClassImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*schedulingv1alpha1.PriorityClass, error) { + uo, err := w.dyn.Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &schedulingv1alpha1.PriorityClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapSchedulingV1alpha1PriorityClassImpl) List(ctx context.Context, opts metav1.ListOptions) (*schedulingv1alpha1.PriorityClassList, error) { + uo, err := w.dyn.List(ctx, opts) + if err != nil { + return nil, err + } + out := &schedulingv1alpha1.PriorityClassList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapSchedulingV1alpha1PriorityClassImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *schedulingv1alpha1.PriorityClass, err error) { + uo, err := w.dyn.Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &schedulingv1alpha1.PriorityClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapSchedulingV1alpha1PriorityClassImpl) Update(ctx context.Context, in *schedulingv1alpha1.PriorityClass, opts metav1.UpdateOptions) (*schedulingv1alpha1.PriorityClass, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "scheduling.k8s.io", + Version: "v1alpha1", + Kind: "PriorityClass", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &schedulingv1alpha1.PriorityClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapSchedulingV1alpha1PriorityClassImpl) UpdateStatus(ctx context.Context, in *schedulingv1alpha1.PriorityClass, opts metav1.UpdateOptions) (*schedulingv1alpha1.PriorityClass, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "scheduling.k8s.io", + Version: "v1alpha1", + Kind: "PriorityClass", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &schedulingv1alpha1.PriorityClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapSchedulingV1alpha1PriorityClassImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +// SchedulingV1beta1 retrieves the SchedulingV1beta1Client +func (w *wrapClient) SchedulingV1beta1() typedschedulingv1beta1.SchedulingV1beta1Interface { + return &wrapSchedulingV1beta1{ + dyn: w.dyn, + } +} + +type wrapSchedulingV1beta1 struct { + dyn dynamic.Interface +} + +func (w *wrapSchedulingV1beta1) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapSchedulingV1beta1) PriorityClasses() typedschedulingv1beta1.PriorityClassInterface { + return &wrapSchedulingV1beta1PriorityClassImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "scheduling.k8s.io", + Version: "v1beta1", + Resource: "priorityclasses", + }), + } +} + +type wrapSchedulingV1beta1PriorityClassImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedschedulingv1beta1.PriorityClassInterface = (*wrapSchedulingV1beta1PriorityClassImpl)(nil) + +func (w *wrapSchedulingV1beta1PriorityClassImpl) Create(ctx context.Context, in *schedulingv1beta1.PriorityClass, opts metav1.CreateOptions) (*schedulingv1beta1.PriorityClass, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "scheduling.k8s.io", + Version: "v1beta1", + Kind: "PriorityClass", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &schedulingv1beta1.PriorityClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapSchedulingV1beta1PriorityClassImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Delete(ctx, name, opts) +} + +func (w *wrapSchedulingV1beta1PriorityClassImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapSchedulingV1beta1PriorityClassImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*schedulingv1beta1.PriorityClass, error) { + uo, err := w.dyn.Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &schedulingv1beta1.PriorityClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapSchedulingV1beta1PriorityClassImpl) List(ctx context.Context, opts metav1.ListOptions) (*schedulingv1beta1.PriorityClassList, error) { + uo, err := w.dyn.List(ctx, opts) + if err != nil { + return nil, err + } + out := &schedulingv1beta1.PriorityClassList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapSchedulingV1beta1PriorityClassImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *schedulingv1beta1.PriorityClass, err error) { + uo, err := w.dyn.Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &schedulingv1beta1.PriorityClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapSchedulingV1beta1PriorityClassImpl) Update(ctx context.Context, in *schedulingv1beta1.PriorityClass, opts metav1.UpdateOptions) (*schedulingv1beta1.PriorityClass, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "scheduling.k8s.io", + Version: "v1beta1", + Kind: "PriorityClass", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &schedulingv1beta1.PriorityClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapSchedulingV1beta1PriorityClassImpl) UpdateStatus(ctx context.Context, in *schedulingv1beta1.PriorityClass, opts metav1.UpdateOptions) (*schedulingv1beta1.PriorityClass, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "scheduling.k8s.io", + Version: "v1beta1", + Kind: "PriorityClass", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &schedulingv1beta1.PriorityClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapSchedulingV1beta1PriorityClassImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +// StorageV1 retrieves the StorageV1Client +func (w *wrapClient) StorageV1() typedstoragev1.StorageV1Interface { + return &wrapStorageV1{ + dyn: w.dyn, + } +} + +type wrapStorageV1 struct { + dyn dynamic.Interface +} + +func (w *wrapStorageV1) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapStorageV1) CSIDrivers() typedstoragev1.CSIDriverInterface { + return &wrapStorageV1CSIDriverImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "storage.k8s.io", + Version: "v1", + Resource: "csidrivers", + }), + } +} + +type wrapStorageV1CSIDriverImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedstoragev1.CSIDriverInterface = (*wrapStorageV1CSIDriverImpl)(nil) + +func (w *wrapStorageV1CSIDriverImpl) Create(ctx context.Context, in *storagev1.CSIDriver, opts metav1.CreateOptions) (*storagev1.CSIDriver, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "storage.k8s.io", + Version: "v1", + Kind: "CSIDriver", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &storagev1.CSIDriver{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1CSIDriverImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Delete(ctx, name, opts) +} + +func (w *wrapStorageV1CSIDriverImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapStorageV1CSIDriverImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*storagev1.CSIDriver, error) { + uo, err := w.dyn.Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &storagev1.CSIDriver{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1CSIDriverImpl) List(ctx context.Context, opts metav1.ListOptions) (*storagev1.CSIDriverList, error) { + uo, err := w.dyn.List(ctx, opts) + if err != nil { + return nil, err + } + out := &storagev1.CSIDriverList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1CSIDriverImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *storagev1.CSIDriver, err error) { + uo, err := w.dyn.Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &storagev1.CSIDriver{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1CSIDriverImpl) Update(ctx context.Context, in *storagev1.CSIDriver, opts metav1.UpdateOptions) (*storagev1.CSIDriver, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "storage.k8s.io", + Version: "v1", + Kind: "CSIDriver", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &storagev1.CSIDriver{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1CSIDriverImpl) UpdateStatus(ctx context.Context, in *storagev1.CSIDriver, opts metav1.UpdateOptions) (*storagev1.CSIDriver, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "storage.k8s.io", + Version: "v1", + Kind: "CSIDriver", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &storagev1.CSIDriver{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1CSIDriverImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapStorageV1) CSINodes() typedstoragev1.CSINodeInterface { + return &wrapStorageV1CSINodeImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "storage.k8s.io", + Version: "v1", + Resource: "csinodes", + }), + } +} + +type wrapStorageV1CSINodeImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedstoragev1.CSINodeInterface = (*wrapStorageV1CSINodeImpl)(nil) + +func (w *wrapStorageV1CSINodeImpl) Create(ctx context.Context, in *storagev1.CSINode, opts metav1.CreateOptions) (*storagev1.CSINode, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "storage.k8s.io", + Version: "v1", + Kind: "CSINode", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &storagev1.CSINode{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1CSINodeImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Delete(ctx, name, opts) +} + +func (w *wrapStorageV1CSINodeImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapStorageV1CSINodeImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*storagev1.CSINode, error) { + uo, err := w.dyn.Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &storagev1.CSINode{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1CSINodeImpl) List(ctx context.Context, opts metav1.ListOptions) (*storagev1.CSINodeList, error) { + uo, err := w.dyn.List(ctx, opts) + if err != nil { + return nil, err + } + out := &storagev1.CSINodeList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1CSINodeImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *storagev1.CSINode, err error) { + uo, err := w.dyn.Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &storagev1.CSINode{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1CSINodeImpl) Update(ctx context.Context, in *storagev1.CSINode, opts metav1.UpdateOptions) (*storagev1.CSINode, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "storage.k8s.io", + Version: "v1", + Kind: "CSINode", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &storagev1.CSINode{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1CSINodeImpl) UpdateStatus(ctx context.Context, in *storagev1.CSINode, opts metav1.UpdateOptions) (*storagev1.CSINode, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "storage.k8s.io", + Version: "v1", + Kind: "CSINode", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &storagev1.CSINode{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1CSINodeImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapStorageV1) StorageClasses() typedstoragev1.StorageClassInterface { + return &wrapStorageV1StorageClassImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "storage.k8s.io", + Version: "v1", + Resource: "storageclasses", + }), + } +} + +type wrapStorageV1StorageClassImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedstoragev1.StorageClassInterface = (*wrapStorageV1StorageClassImpl)(nil) + +func (w *wrapStorageV1StorageClassImpl) Create(ctx context.Context, in *storagev1.StorageClass, opts metav1.CreateOptions) (*storagev1.StorageClass, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "storage.k8s.io", + Version: "v1", + Kind: "StorageClass", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &storagev1.StorageClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1StorageClassImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Delete(ctx, name, opts) +} + +func (w *wrapStorageV1StorageClassImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapStorageV1StorageClassImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*storagev1.StorageClass, error) { + uo, err := w.dyn.Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &storagev1.StorageClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1StorageClassImpl) List(ctx context.Context, opts metav1.ListOptions) (*storagev1.StorageClassList, error) { + uo, err := w.dyn.List(ctx, opts) + if err != nil { + return nil, err + } + out := &storagev1.StorageClassList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1StorageClassImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *storagev1.StorageClass, err error) { + uo, err := w.dyn.Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &storagev1.StorageClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1StorageClassImpl) Update(ctx context.Context, in *storagev1.StorageClass, opts metav1.UpdateOptions) (*storagev1.StorageClass, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "storage.k8s.io", + Version: "v1", + Kind: "StorageClass", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &storagev1.StorageClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1StorageClassImpl) UpdateStatus(ctx context.Context, in *storagev1.StorageClass, opts metav1.UpdateOptions) (*storagev1.StorageClass, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "storage.k8s.io", + Version: "v1", + Kind: "StorageClass", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &storagev1.StorageClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1StorageClassImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapStorageV1) VolumeAttachments() typedstoragev1.VolumeAttachmentInterface { + return &wrapStorageV1VolumeAttachmentImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "storage.k8s.io", + Version: "v1", + Resource: "volumeattachments", + }), + } +} + +type wrapStorageV1VolumeAttachmentImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedstoragev1.VolumeAttachmentInterface = (*wrapStorageV1VolumeAttachmentImpl)(nil) + +func (w *wrapStorageV1VolumeAttachmentImpl) Create(ctx context.Context, in *storagev1.VolumeAttachment, opts metav1.CreateOptions) (*storagev1.VolumeAttachment, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "storage.k8s.io", + Version: "v1", + Kind: "VolumeAttachment", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &storagev1.VolumeAttachment{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1VolumeAttachmentImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Delete(ctx, name, opts) +} + +func (w *wrapStorageV1VolumeAttachmentImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapStorageV1VolumeAttachmentImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*storagev1.VolumeAttachment, error) { + uo, err := w.dyn.Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &storagev1.VolumeAttachment{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1VolumeAttachmentImpl) List(ctx context.Context, opts metav1.ListOptions) (*storagev1.VolumeAttachmentList, error) { + uo, err := w.dyn.List(ctx, opts) + if err != nil { + return nil, err + } + out := &storagev1.VolumeAttachmentList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1VolumeAttachmentImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *storagev1.VolumeAttachment, err error) { + uo, err := w.dyn.Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &storagev1.VolumeAttachment{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1VolumeAttachmentImpl) Update(ctx context.Context, in *storagev1.VolumeAttachment, opts metav1.UpdateOptions) (*storagev1.VolumeAttachment, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "storage.k8s.io", + Version: "v1", + Kind: "VolumeAttachment", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &storagev1.VolumeAttachment{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1VolumeAttachmentImpl) UpdateStatus(ctx context.Context, in *storagev1.VolumeAttachment, opts metav1.UpdateOptions) (*storagev1.VolumeAttachment, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "storage.k8s.io", + Version: "v1", + Kind: "VolumeAttachment", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &storagev1.VolumeAttachment{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1VolumeAttachmentImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +// StorageV1alpha1 retrieves the StorageV1alpha1Client +func (w *wrapClient) StorageV1alpha1() typedstoragev1alpha1.StorageV1alpha1Interface { + return &wrapStorageV1alpha1{ + dyn: w.dyn, + } +} + +type wrapStorageV1alpha1 struct { + dyn dynamic.Interface +} + +func (w *wrapStorageV1alpha1) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapStorageV1alpha1) CSIStorageCapacities(namespace string) typedstoragev1alpha1.CSIStorageCapacityInterface { + return &wrapStorageV1alpha1CSIStorageCapacityImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "storage.k8s.io", + Version: "v1alpha1", + Resource: "csistoragecapacities", + }), + + namespace: namespace, + } +} + +type wrapStorageV1alpha1CSIStorageCapacityImpl struct { + dyn dynamic.NamespaceableResourceInterface + + namespace string +} + +var _ typedstoragev1alpha1.CSIStorageCapacityInterface = (*wrapStorageV1alpha1CSIStorageCapacityImpl)(nil) + +func (w *wrapStorageV1alpha1CSIStorageCapacityImpl) Create(ctx context.Context, in *storagev1alpha1.CSIStorageCapacity, opts metav1.CreateOptions) (*storagev1alpha1.CSIStorageCapacity, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "storage.k8s.io", + Version: "v1alpha1", + Kind: "CSIStorageCapacity", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &storagev1alpha1.CSIStorageCapacity{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1alpha1CSIStorageCapacityImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) +} + +func (w *wrapStorageV1alpha1CSIStorageCapacityImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapStorageV1alpha1CSIStorageCapacityImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*storagev1alpha1.CSIStorageCapacity, error) { + uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &storagev1alpha1.CSIStorageCapacity{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1alpha1CSIStorageCapacityImpl) List(ctx context.Context, opts metav1.ListOptions) (*storagev1alpha1.CSIStorageCapacityList, error) { + uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) + if err != nil { + return nil, err + } + out := &storagev1alpha1.CSIStorageCapacityList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1alpha1CSIStorageCapacityImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *storagev1alpha1.CSIStorageCapacity, err error) { + uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &storagev1alpha1.CSIStorageCapacity{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1alpha1CSIStorageCapacityImpl) Update(ctx context.Context, in *storagev1alpha1.CSIStorageCapacity, opts metav1.UpdateOptions) (*storagev1alpha1.CSIStorageCapacity, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "storage.k8s.io", + Version: "v1alpha1", + Kind: "CSIStorageCapacity", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &storagev1alpha1.CSIStorageCapacity{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1alpha1CSIStorageCapacityImpl) UpdateStatus(ctx context.Context, in *storagev1alpha1.CSIStorageCapacity, opts metav1.UpdateOptions) (*storagev1alpha1.CSIStorageCapacity, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "storage.k8s.io", + Version: "v1alpha1", + Kind: "CSIStorageCapacity", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &storagev1alpha1.CSIStorageCapacity{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1alpha1CSIStorageCapacityImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapStorageV1alpha1) VolumeAttachments() typedstoragev1alpha1.VolumeAttachmentInterface { + return &wrapStorageV1alpha1VolumeAttachmentImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "storage.k8s.io", + Version: "v1alpha1", + Resource: "volumeattachments", + }), + } +} + +type wrapStorageV1alpha1VolumeAttachmentImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedstoragev1alpha1.VolumeAttachmentInterface = (*wrapStorageV1alpha1VolumeAttachmentImpl)(nil) + +func (w *wrapStorageV1alpha1VolumeAttachmentImpl) Create(ctx context.Context, in *storagev1alpha1.VolumeAttachment, opts metav1.CreateOptions) (*storagev1alpha1.VolumeAttachment, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "storage.k8s.io", + Version: "v1alpha1", + Kind: "VolumeAttachment", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &storagev1alpha1.VolumeAttachment{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1alpha1VolumeAttachmentImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Delete(ctx, name, opts) +} + +func (w *wrapStorageV1alpha1VolumeAttachmentImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapStorageV1alpha1VolumeAttachmentImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*storagev1alpha1.VolumeAttachment, error) { + uo, err := w.dyn.Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &storagev1alpha1.VolumeAttachment{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1alpha1VolumeAttachmentImpl) List(ctx context.Context, opts metav1.ListOptions) (*storagev1alpha1.VolumeAttachmentList, error) { + uo, err := w.dyn.List(ctx, opts) + if err != nil { + return nil, err + } + out := &storagev1alpha1.VolumeAttachmentList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1alpha1VolumeAttachmentImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *storagev1alpha1.VolumeAttachment, err error) { + uo, err := w.dyn.Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &storagev1alpha1.VolumeAttachment{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1alpha1VolumeAttachmentImpl) Update(ctx context.Context, in *storagev1alpha1.VolumeAttachment, opts metav1.UpdateOptions) (*storagev1alpha1.VolumeAttachment, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "storage.k8s.io", + Version: "v1alpha1", + Kind: "VolumeAttachment", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &storagev1alpha1.VolumeAttachment{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1alpha1VolumeAttachmentImpl) UpdateStatus(ctx context.Context, in *storagev1alpha1.VolumeAttachment, opts metav1.UpdateOptions) (*storagev1alpha1.VolumeAttachment, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "storage.k8s.io", + Version: "v1alpha1", + Kind: "VolumeAttachment", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &storagev1alpha1.VolumeAttachment{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1alpha1VolumeAttachmentImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +// StorageV1beta1 retrieves the StorageV1beta1Client +func (w *wrapClient) StorageV1beta1() typedstoragev1beta1.StorageV1beta1Interface { + return &wrapStorageV1beta1{ + dyn: w.dyn, + } +} + +type wrapStorageV1beta1 struct { + dyn dynamic.Interface +} + +func (w *wrapStorageV1beta1) RESTClient() rest.Interface { + panic("RESTClient called on dynamic client!") +} + +func (w *wrapStorageV1beta1) CSIDrivers() typedstoragev1beta1.CSIDriverInterface { + return &wrapStorageV1beta1CSIDriverImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "storage.k8s.io", + Version: "v1beta1", + Resource: "csidrivers", + }), + } +} + +type wrapStorageV1beta1CSIDriverImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedstoragev1beta1.CSIDriverInterface = (*wrapStorageV1beta1CSIDriverImpl)(nil) + +func (w *wrapStorageV1beta1CSIDriverImpl) Create(ctx context.Context, in *storagev1beta1.CSIDriver, opts metav1.CreateOptions) (*storagev1beta1.CSIDriver, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "storage.k8s.io", + Version: "v1beta1", + Kind: "CSIDriver", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &storagev1beta1.CSIDriver{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1beta1CSIDriverImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Delete(ctx, name, opts) +} + +func (w *wrapStorageV1beta1CSIDriverImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapStorageV1beta1CSIDriverImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*storagev1beta1.CSIDriver, error) { + uo, err := w.dyn.Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &storagev1beta1.CSIDriver{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1beta1CSIDriverImpl) List(ctx context.Context, opts metav1.ListOptions) (*storagev1beta1.CSIDriverList, error) { + uo, err := w.dyn.List(ctx, opts) + if err != nil { + return nil, err + } + out := &storagev1beta1.CSIDriverList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1beta1CSIDriverImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *storagev1beta1.CSIDriver, err error) { + uo, err := w.dyn.Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &storagev1beta1.CSIDriver{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1beta1CSIDriverImpl) Update(ctx context.Context, in *storagev1beta1.CSIDriver, opts metav1.UpdateOptions) (*storagev1beta1.CSIDriver, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "storage.k8s.io", + Version: "v1beta1", + Kind: "CSIDriver", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &storagev1beta1.CSIDriver{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1beta1CSIDriverImpl) UpdateStatus(ctx context.Context, in *storagev1beta1.CSIDriver, opts metav1.UpdateOptions) (*storagev1beta1.CSIDriver, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "storage.k8s.io", + Version: "v1beta1", + Kind: "CSIDriver", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &storagev1beta1.CSIDriver{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1beta1CSIDriverImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapStorageV1beta1) CSINodes() typedstoragev1beta1.CSINodeInterface { + return &wrapStorageV1beta1CSINodeImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "storage.k8s.io", + Version: "v1beta1", + Resource: "csinodes", + }), + } +} + +type wrapStorageV1beta1CSINodeImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedstoragev1beta1.CSINodeInterface = (*wrapStorageV1beta1CSINodeImpl)(nil) + +func (w *wrapStorageV1beta1CSINodeImpl) Create(ctx context.Context, in *storagev1beta1.CSINode, opts metav1.CreateOptions) (*storagev1beta1.CSINode, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "storage.k8s.io", + Version: "v1beta1", + Kind: "CSINode", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &storagev1beta1.CSINode{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1beta1CSINodeImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Delete(ctx, name, opts) +} + +func (w *wrapStorageV1beta1CSINodeImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapStorageV1beta1CSINodeImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*storagev1beta1.CSINode, error) { + uo, err := w.dyn.Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &storagev1beta1.CSINode{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1beta1CSINodeImpl) List(ctx context.Context, opts metav1.ListOptions) (*storagev1beta1.CSINodeList, error) { + uo, err := w.dyn.List(ctx, opts) + if err != nil { + return nil, err + } + out := &storagev1beta1.CSINodeList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1beta1CSINodeImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *storagev1beta1.CSINode, err error) { + uo, err := w.dyn.Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &storagev1beta1.CSINode{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1beta1CSINodeImpl) Update(ctx context.Context, in *storagev1beta1.CSINode, opts metav1.UpdateOptions) (*storagev1beta1.CSINode, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "storage.k8s.io", + Version: "v1beta1", + Kind: "CSINode", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &storagev1beta1.CSINode{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1beta1CSINodeImpl) UpdateStatus(ctx context.Context, in *storagev1beta1.CSINode, opts metav1.UpdateOptions) (*storagev1beta1.CSINode, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "storage.k8s.io", + Version: "v1beta1", + Kind: "CSINode", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &storagev1beta1.CSINode{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1beta1CSINodeImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapStorageV1beta1) StorageClasses() typedstoragev1beta1.StorageClassInterface { + return &wrapStorageV1beta1StorageClassImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "storage.k8s.io", + Version: "v1beta1", + Resource: "storageclasses", + }), + } +} + +type wrapStorageV1beta1StorageClassImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedstoragev1beta1.StorageClassInterface = (*wrapStorageV1beta1StorageClassImpl)(nil) + +func (w *wrapStorageV1beta1StorageClassImpl) Create(ctx context.Context, in *storagev1beta1.StorageClass, opts metav1.CreateOptions) (*storagev1beta1.StorageClass, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "storage.k8s.io", + Version: "v1beta1", + Kind: "StorageClass", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &storagev1beta1.StorageClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1beta1StorageClassImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Delete(ctx, name, opts) +} + +func (w *wrapStorageV1beta1StorageClassImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapStorageV1beta1StorageClassImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*storagev1beta1.StorageClass, error) { + uo, err := w.dyn.Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &storagev1beta1.StorageClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1beta1StorageClassImpl) List(ctx context.Context, opts metav1.ListOptions) (*storagev1beta1.StorageClassList, error) { + uo, err := w.dyn.List(ctx, opts) + if err != nil { + return nil, err + } + out := &storagev1beta1.StorageClassList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1beta1StorageClassImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *storagev1beta1.StorageClass, err error) { + uo, err := w.dyn.Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &storagev1beta1.StorageClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1beta1StorageClassImpl) Update(ctx context.Context, in *storagev1beta1.StorageClass, opts metav1.UpdateOptions) (*storagev1beta1.StorageClass, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "storage.k8s.io", + Version: "v1beta1", + Kind: "StorageClass", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &storagev1beta1.StorageClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1beta1StorageClassImpl) UpdateStatus(ctx context.Context, in *storagev1beta1.StorageClass, opts metav1.UpdateOptions) (*storagev1beta1.StorageClass, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "storage.k8s.io", + Version: "v1beta1", + Kind: "StorageClass", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &storagev1beta1.StorageClass{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1beta1StorageClassImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} + +func (w *wrapStorageV1beta1) VolumeAttachments() typedstoragev1beta1.VolumeAttachmentInterface { + return &wrapStorageV1beta1VolumeAttachmentImpl{ + dyn: w.dyn.Resource(schema.GroupVersionResource{ + Group: "storage.k8s.io", + Version: "v1beta1", + Resource: "volumeattachments", + }), + } +} + +type wrapStorageV1beta1VolumeAttachmentImpl struct { + dyn dynamic.NamespaceableResourceInterface +} + +var _ typedstoragev1beta1.VolumeAttachmentInterface = (*wrapStorageV1beta1VolumeAttachmentImpl)(nil) + +func (w *wrapStorageV1beta1VolumeAttachmentImpl) Create(ctx context.Context, in *storagev1beta1.VolumeAttachment, opts metav1.CreateOptions) (*storagev1beta1.VolumeAttachment, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "storage.k8s.io", + Version: "v1beta1", + Kind: "VolumeAttachment", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &storagev1beta1.VolumeAttachment{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1beta1VolumeAttachmentImpl) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return w.dyn.Delete(ctx, name, opts) +} + +func (w *wrapStorageV1beta1VolumeAttachmentImpl) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return w.dyn.DeleteCollection(ctx, opts, listOpts) +} + +func (w *wrapStorageV1beta1VolumeAttachmentImpl) Get(ctx context.Context, name string, opts metav1.GetOptions) (*storagev1beta1.VolumeAttachment, error) { + uo, err := w.dyn.Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &storagev1beta1.VolumeAttachment{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1beta1VolumeAttachmentImpl) List(ctx context.Context, opts metav1.ListOptions) (*storagev1beta1.VolumeAttachmentList, error) { + uo, err := w.dyn.List(ctx, opts) + if err != nil { + return nil, err + } + out := &storagev1beta1.VolumeAttachmentList{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1beta1VolumeAttachmentImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *storagev1beta1.VolumeAttachment, err error) { + uo, err := w.dyn.Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &storagev1beta1.VolumeAttachment{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1beta1VolumeAttachmentImpl) Update(ctx context.Context, in *storagev1beta1.VolumeAttachment, opts metav1.UpdateOptions) (*storagev1beta1.VolumeAttachment, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "storage.k8s.io", + Version: "v1beta1", + Kind: "VolumeAttachment", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &storagev1beta1.VolumeAttachment{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1beta1VolumeAttachmentImpl) UpdateStatus(ctx context.Context, in *storagev1beta1.VolumeAttachment, opts metav1.UpdateOptions) (*storagev1beta1.VolumeAttachment, error) { + in.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "storage.k8s.io", + Version: "v1beta1", + Kind: "VolumeAttachment", + }) + uo := &unstructured.Unstructured{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn.UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &storagev1beta1.VolumeAttachment{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} + +func (w *wrapStorageV1beta1VolumeAttachmentImpl) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, errors.New("NYI: Watch") +} diff --git a/vendor/knative.dev/pkg/client/injection/kube/client/client_expansion.go b/vendor/knative.dev/pkg/client/injection/kube/client/client_expansion.go new file mode 100644 index 00000000..feb358db --- /dev/null +++ b/vendor/knative.dev/pkg/client/injection/kube/client/client_expansion.go @@ -0,0 +1,103 @@ +/* +Copyright 2021 The Knative 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. +*/ + +package client + +import ( + context "context" + + certificatesv1beta1 "k8s.io/api/certificates/v1beta1" + corev1 "k8s.io/api/core/v1" + eventsv1beta1 "k8s.io/api/events/v1beta1" + extensionsv1beta1 "k8s.io/api/extensions/v1beta1" + policyv1beta1 "k8s.io/api/policy/v1beta1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/fields" + "k8s.io/apimachinery/pkg/runtime" + restclient "k8s.io/client-go/rest" +) + +func (*wrapCoreV1NamespaceImpl) Finalize(context.Context, *corev1.Namespace, metav1.UpdateOptions) (*corev1.Namespace, error) { + panic("NYI") +} + +func (*wrapCoreV1ServiceImpl) ProxyGet(string, string, string, string, map[string]string) restclient.ResponseWrapper { + panic("NYI") +} + +func (*wrapEventsV1beta1EventImpl) CreateWithEventNamespace(*eventsv1beta1.Event) (*eventsv1beta1.Event, error) { + panic("NYI") +} + +func (*wrapEventsV1beta1EventImpl) UpdateWithEventNamespace(*eventsv1beta1.Event) (*eventsv1beta1.Event, error) { + panic("NYI") +} + +func (*wrapEventsV1beta1EventImpl) PatchWithEventNamespace(*eventsv1beta1.Event, []byte) (*eventsv1beta1.Event, error) { + panic("NYI") +} + +func (*wrapCoreV1EventImpl) CreateWithEventNamespace(*corev1.Event) (*corev1.Event, error) { + panic("NYI") +} + +func (*wrapCoreV1EventImpl) UpdateWithEventNamespace(*corev1.Event) (*corev1.Event, error) { + panic("NYI") +} + +func (*wrapCoreV1EventImpl) PatchWithEventNamespace(*corev1.Event, []byte) (*corev1.Event, error) { + panic("NYI") +} + +func (*wrapCoreV1EventImpl) Search(*runtime.Scheme, runtime.Object) (*corev1.EventList, error) { + panic("NYI") +} + +func (*wrapCoreV1EventImpl) GetFieldSelector(*string, *string, *string, *string) fields.Selector { + panic("NYI") +} + +func (*wrapCoreV1NodeImpl) PatchStatus(context.Context, string, []byte) (*corev1.Node, error) { + panic("NYI") +} + +func (*wrapCoreV1PodImpl) Bind(context.Context, *corev1.Binding, metav1.CreateOptions) error { + panic("NYI") +} + +func (*wrapCoreV1PodImpl) Evict(context.Context, *policyv1beta1.Eviction) error { + panic("NYI") +} + +func (*wrapCoreV1PodImpl) GetLogs(string, *corev1.PodLogOptions) *restclient.Request { + panic("NYI") +} + +func (*wrapCoreV1PodImpl) ProxyGet(string, string, string, string, map[string]string) restclient.ResponseWrapper { + panic("NYI") +} + +func (*wrapExtensionsV1beta1DeploymentImpl) Rollback(context.Context, *extensionsv1beta1.DeploymentRollback, metav1.CreateOptions) error { + panic("NYI") +} + +func (*wrapPolicyV1beta1EvictionImpl) Evict(context.Context, *policyv1beta1.Eviction) error { + panic("NYI") +} + +func (*wrapCertificatesV1beta1CertificateSigningRequestImpl) UpdateApproval(context.Context, *certificatesv1beta1.CertificateSigningRequest, metav1.UpdateOptions) (*certificatesv1beta1.CertificateSigningRequest, error) { + panic("NYI") +} diff --git a/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/client.go b/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/client.go index d7cb717e..8346454b 100644 --- a/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/client.go +++ b/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/client.go @@ -17,8 +17,15 @@ limitations under the License. package generators import ( + "fmt" "io" + "path/filepath" + "sort" + "strings" + "k8s.io/apimachinery/pkg/util/sets" + "k8s.io/code-generator/cmd/client-gen/generators/util" + clientgentypes "k8s.io/code-generator/cmd/client-gen/types" "k8s.io/gengo/generator" "k8s.io/gengo/namer" "k8s.io/gengo/types" @@ -29,6 +36,11 @@ import ( // type. type clientGenerator struct { generator.DefaultGen + + groupVersions map[string]clientgentypes.GroupVersions + groupGoNames map[string]string + groupVersionTypes map[string]map[clientgentypes.Version][]*types.Type + outputPackage string imports namer.ImportTracker clientSetPackage string @@ -46,14 +58,37 @@ func (g *clientGenerator) Filter(c *generator.Context, t *types.Type) bool { return false } +var publicPluralNamer = &ExceptionNamer{ + Exceptions: map[string]string{ + // these exceptions are used to deconflict the generated code + // you can put your fully qualified package like + // to generate a name that doesn't conflict with your group. + // "k8s.io/apis/events/v1beta1.Event": "EventResource" + }, + KeyFunc: func(t *types.Type) string { + return t.Name.Package + "." + t.Name.Name + }, + Delegate: namer.NewPublicPluralNamer(map[string]string{ + "Endpoints": "Endpoints", + }), +} + func (g *clientGenerator) Namers(c *generator.Context) namer.NameSystems { return namer.NameSystems{ - "raw": namer.NewRawNamer(g.outputPackage, g.imports), + "raw": namer.NewRawNamer(g.outputPackage, g.imports), + "publicPlural": publicPluralNamer, } } func (g *clientGenerator) Imports(c *generator.Context) (imports []string) { imports = append(imports, g.imports.ImportLines()...) + for gpn, group := range g.groupVersions { + for _, version := range group.Versions { + typedClientPath := filepath.Join(g.clientSetPackage, "typed", strings.ToLower(group.PackageName), strings.ToLower(version.NonEmpty())) + imports = append(imports, fmt.Sprintf("%s \"%s\"", strings.ToLower("typed"+g.groupGoNames[gpn]+version.NonEmpty()), typedClientPath)) + } + } + imports = sets.NewString(imports...).List() return } @@ -63,9 +98,10 @@ func (g *clientGenerator) GenerateType(c *generator.Context, t *types.Type, w io klog.V(5).Info("processing type ", t) m := map[string]interface{}{ - "clientSetNewForConfigOrDie": c.Universe.Function(types.Name{Package: g.clientSetPackage, Name: "NewForConfigOrDie"}), - "clientSetInterface": c.Universe.Type(types.Name{Package: g.clientSetPackage, Name: "Interface"}), - "injectionRegisterClient": c.Universe.Function(types.Name{Package: "knative.dev/pkg/injection", Name: "Default.RegisterClient"}), + "clientSetNewForConfigOrDie": c.Universe.Function(types.Name{Package: g.clientSetPackage, Name: "NewForConfigOrDie"}), + "clientSetInterface": c.Universe.Type(types.Name{Package: g.clientSetPackage, Name: "Interface"}), + "injectionRegisterClient": c.Universe.Function(types.Name{Package: "knative.dev/pkg/injection", Name: "Default.RegisterClient"}), + "injectionRegisterDynamicClient": c.Universe.Function(types.Name{Package: "knative.dev/pkg/injection", Name: "Dynamic.RegisterDynamicClient"}), "injectionRegisterClientFetcher": c.Universe.Function(types.Name{ Package: "knative.dev/pkg/injection", Name: "Default.RegisterClientFetcher", @@ -79,28 +115,231 @@ func (g *clientGenerator) GenerateType(c *generator.Context, t *types.Type, w io Package: "context", Name: "Context", }), + "dynamicInterface": c.Universe.Type(types.Name{ + Package: "k8s.io/client-go/dynamic", + Name: "Interface", + }), + "dynamicclientGet": c.Universe.Function(types.Name{ + Package: "knative.dev/pkg/injection/clients/dynamicclient", + Name: "Get", + }), + "discoveryInterface": c.Universe.Type(types.Name{ + Package: "k8s.io/client-go/discovery", + Name: "DiscoveryInterface", + }), + "runtimeObject": c.Universe.Type(types.Name{ + Package: "k8s.io/apimachinery/pkg/runtime", + Name: "Object", + }), + "jsonMarshal": c.Universe.Function(types.Name{ + Package: "encoding/json", + Name: "Marshal", + }), + "jsonUnmarshal": c.Universe.Function(types.Name{ + Package: "encoding/json", + Name: "Unmarshal", + }), + "fmtErrorf": c.Universe.Function(types.Name{ + Package: "fmt", + Name: "Errorf", + }), } sw.Do(injectionClient, m) + gpns := make(sets.String, len(g.groupGoNames)) + for gpn := range g.groupGoNames { + gpns.Insert(gpn) + } + + for _, gpn := range gpns.List() { + ggn := g.groupGoNames[gpn] + gv := g.groupVersions[gpn] + verTypes := g.groupVersionTypes[gpn] + for _, version := range gv.Versions { + vts := verTypes[version.Version] + if len(vts) == 0 { + // Skip things with zero types. + continue + } + sw.Do(clientsetInterfaceImplTemplate, map[string]interface{}{ + "dynamicInterface": c.Universe.Type(types.Name{ + Package: "k8s.io/client-go/dynamic", + Name: "Interface", + }), + "restInterface": c.Universe.Type(types.Name{ + Package: "k8s.io/client-go/rest", + Name: "Interface", + }), + "GroupGoName": ggn, + "Version": namer.IC(version.String()), + "PackageAlias": strings.ToLower("typed" + g.groupGoNames[gpn] + version.NonEmpty()), + }) + sort.Slice(vts, func(i, j int) bool { + lhs, rhs := vts[i], vts[j] + return lhs.String() < rhs.String() + }) + for _, t := range vts { + tags, err := util.ParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) + if err != nil { + return err + } + + // Don't use the literal group "core", these should be left blank. + group := gv.Group + if group == "core" { + group = "" + } + + sw.Do(typeImplTemplate, map[string]interface{}{ + "dynamicNamespaceableResourceInterface": c.Universe.Type(types.Name{ + Package: "k8s.io/client-go/dynamic", + Name: "NamespaceableResourceInterface", + }), + "schemaGroupVersionResource": c.Universe.Type(types.Name{ + Package: "k8s.io/apimachinery/pkg/runtime/schema", + Name: "GroupVersionResource", + }), + "contextContext": c.Universe.Type(types.Name{ + Package: "context", + Name: "Context", + }), + "GroupGoName": ggn, + "Version": namer.IC(version.String()), + "PackageAlias": strings.ToLower("typed" + g.groupGoNames[gpn] + version.NonEmpty()), + "Type": t, + "Namespaced": !tags.NonNamespaced, + "Group": group, + "VersionLower": version, + "Resource": strings.ToLower(publicPluralNamer.Name(t)), + }) + opts := map[string]interface{}{ + "contextContext": c.Universe.Type(types.Name{ + Package: "context", + Name: "Context", + }), + "unstructuredUnstructured": c.Universe.Type(types.Name{ + Package: "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured", + Name: "Unstructured", + }), + "metav1CreateOptions": c.Universe.Type(types.Name{ + Package: "k8s.io/apimachinery/pkg/apis/meta/v1", + Name: "CreateOptions", + }), + "metav1UpdateOptions": c.Universe.Type(types.Name{ + Package: "k8s.io/apimachinery/pkg/apis/meta/v1", + Name: "UpdateOptions", + }), + "metav1GetOptions": c.Universe.Type(types.Name{ + Package: "k8s.io/apimachinery/pkg/apis/meta/v1", + Name: "GetOptions", + }), + "metav1ListOptions": c.Universe.Type(types.Name{ + Package: "k8s.io/apimachinery/pkg/apis/meta/v1", + Name: "ListOptions", + }), + "metav1DeleteOptions": c.Universe.Type(types.Name{ + Package: "k8s.io/apimachinery/pkg/apis/meta/v1", + Name: "DeleteOptions", + }), + "metav1PatchOptions": c.Universe.Type(types.Name{ + Package: "k8s.io/apimachinery/pkg/apis/meta/v1", + Name: "PatchOptions", + }), + "typesPatchType": c.Universe.Type(types.Name{ + Package: "k8s.io/apimachinery/pkg/types", + Name: "PatchType", + }), + "watchInterface": c.Universe.Type(types.Name{ + Package: "k8s.io/apimachinery/pkg/watch", + Name: "Interface", + }), + "errorsNew": c.Universe.Function(types.Name{ + Package: "errors", + Name: "New", + }), + "GroupGoName": ggn, + "Version": namer.IC(version.String()), + "Type": t, + "InputType": t, + "ResultType": t, + "Namespaced": !tags.NonNamespaced, + "Subresource": "", + "schemaGroupVersionKind": c.Universe.Type(types.Name{ + Package: "k8s.io/apimachinery/pkg/runtime/schema", + Name: "GroupVersionKind", + }), + "Group": group, + "VersionLower": version, + "Kind": t.Name.Name, + } + for _, v := range verbs.List() { + tmpl := verbMap[v] + if tags.NoVerbs || !tags.HasVerb(v) { + continue + } + sw.Do(tmpl, opts) + } + for _, e := range tags.Extensions { + for _, v := range extensionVerbs.List() { + tmpl := extensionVerbMap[v] + if !e.HasVerb(v) { + continue + } + inputType := *t + resultType := *t + if len(e.InputTypeOverride) > 0 { + if name, pkg := e.Input(); len(pkg) > 0 { + // _, inputGVString = util.ParsePathGroupVersion(pkg) + newType := c.Universe.Type(types.Name{Package: pkg, Name: name}) + inputType = *newType + } else { + inputType.Name.Name = e.InputTypeOverride + } + } + if len(e.ResultTypeOverride) > 0 { + if name, pkg := e.Result(); len(pkg) > 0 { + newType := c.Universe.Type(types.Name{Package: pkg, Name: name}) + resultType = *newType + } else { + resultType.Name.Name = e.ResultTypeOverride + } + } + opts["InputType"] = &inputType + opts["ResultType"] = &resultType + if e.IsSubresource() { + opts["Subresource"] = e.SubResourcePath + } + sw.Do(strings.Replace(tmpl, " "+strings.Title(e.VerbType), " "+e.VerbName, -1), opts) + } + } + } + } + } + return sw.Error() } var injectionClient = ` func init() { - {{.injectionRegisterClient|raw}}(withClient) + {{.injectionRegisterClient|raw}}(withClientFromConfig) {{.injectionRegisterClientFetcher|raw}}(func(ctx context.Context) interface{} { return Get(ctx) }) + {{.injectionRegisterDynamicClient|raw}}(withClientFromDynamic) } // Key is used as the key for associating information with a context.Context. type Key struct{} -func withClient(ctx {{.contextContext|raw}}, cfg *{{.restConfig|raw}}) context.Context { +func withClientFromConfig(ctx {{.contextContext|raw}}, cfg *{{.restConfig|raw}}) context.Context { return context.WithValue(ctx, Key{}, {{.clientSetNewForConfigOrDie|raw}}(cfg)) } +func withClientFromDynamic(ctx {{.contextContext|raw}}) context.Context { + return context.WithValue(ctx, Key{}, &wrapClient{dyn: {{.dynamicclientGet|raw}}(ctx)}) +} + // Get extracts the {{.clientSetInterface|raw}} client from the context. func Get(ctx {{.contextContext|raw}}) {{.clientSetInterface|raw}} { untyped := ctx.Value(Key{}) @@ -115,4 +354,258 @@ func Get(ctx {{.contextContext|raw}}) {{.clientSetInterface|raw}} { } return untyped.({{.clientSetInterface|raw}}) } + +type wrapClient struct { + dyn {{.dynamicInterface|raw}} +} + +var _ {{.clientSetInterface|raw}} = (*wrapClient)(nil) + +func (w *wrapClient) Discovery() {{.discoveryInterface|raw}} { + panic("Discovery called on dynamic client!") +} + + +func convert(from interface{}, to {{ .runtimeObject|raw }}) error { + bs, err := {{ .jsonMarshal|raw }}(from) + if err != nil { + return {{ .fmtErrorf|raw }}("Marshal() = %w", err) + } + if err := {{ .jsonUnmarshal|raw }}(bs, to); err != nil { + return {{ .fmtErrorf|raw }}("Unmarshal() = %w", err) + } + return nil +} + ` + +var clientsetInterfaceImplTemplate = ` +// {{.GroupGoName}}{{.Version}} retrieves the {{.GroupGoName}}{{.Version}}Client +func (w *wrapClient) {{.GroupGoName}}{{.Version}}() {{.PackageAlias}}.{{.GroupGoName}}{{.Version}}Interface { + return &wrap{{.GroupGoName}}{{.Version}}{ + dyn: w.dyn, + } +} + +type wrap{{.GroupGoName}}{{.Version}} struct { + dyn {{.dynamicInterface|raw}} +} + +func (w *wrap{{.GroupGoName}}{{.Version}}) RESTClient() {{.restInterface|raw}} { + panic("RESTClient called on dynamic client!") +} + +` + +var typeImplTemplate = ` +func (w *wrap{{ .GroupGoName }}{{ .Version }}) {{ .Type|publicPlural }}({{if .Namespaced}}namespace string{{end}}) {{ .PackageAlias }}.{{ .Type.Name.Name }}Interface { + return &wrap{{.GroupGoName}}{{.Version}}{{ .Type.Name.Name }}Impl{ + dyn: w.dyn.Resource({{ .schemaGroupVersionResource|raw }}{ + Group: "{{ .Group }}", + Version: "{{ .VersionLower }}", + Resource: "{{ .Resource }}", + }), +{{if .Namespaced}} + namespace: namespace, +{{end}} + } +} + +type wrap{{.GroupGoName}}{{.Version}}{{ .Type.Name.Name }}Impl struct { + dyn {{.dynamicNamespaceableResourceInterface|raw}} +{{if .Namespaced}} + namespace string +{{end}}} + +var _ {{ .PackageAlias }}.{{ .Type.Name.Name }}Interface = (*wrap{{.GroupGoName}}{{.Version}}{{ .Type.Name.Name }}Impl)(nil) + +` + +var verbs = sets.NewString( /* Populated from verbMap during init */ ) +var verbMap = map[string]string{ + "create": ` +func (w *wrap{{.GroupGoName}}{{.Version}}{{ .Type.Name.Name }}Impl) Create(ctx {{ .contextContext|raw }}, {{ if .Subresource }}_ string, {{ end }}in *{{ .InputType|raw }}, opts {{ .metav1CreateOptions|raw }}) (*{{ .ResultType|raw }}, error) { + in.SetGroupVersionKind({{ .schemaGroupVersionKind|raw }}{ + Group: "{{ .Group }}", + Version: "{{ .VersionLower }}", + Kind: "{{ .Kind }}", + }) + uo := &{{ .unstructuredUnstructured|raw }}{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn{{if .Namespaced}}{{if .Namespaced}}.Namespace(w.namespace){{end}}{{end}}.Create(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &{{ .ResultType|raw }}{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} +`, + + "update": ` +func (w *wrap{{.GroupGoName}}{{.Version}}{{ .Type.Name.Name }}Impl) Update(ctx {{ .contextContext|raw }}, {{ if .Subresource }}_ string, {{ end }}in *{{ .InputType|raw }}, opts {{ .metav1UpdateOptions|raw }}) (*{{ .ResultType|raw }}, error) { + in.SetGroupVersionKind({{ .schemaGroupVersionKind|raw }}{ + Group: "{{ .Group }}", + Version: "{{ .VersionLower }}", + Kind: "{{ .Kind }}", + }) + uo := &{{ .unstructuredUnstructured|raw }}{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn{{if .Namespaced}}.Namespace(w.namespace){{end}}.Update(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &{{ .ResultType|raw }}{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} +`, + + "updateStatus": ` +func (w *wrap{{.GroupGoName}}{{.Version}}{{ .Type.Name.Name }}Impl) UpdateStatus(ctx {{ .contextContext|raw }}, in *{{ .InputType|raw }}, opts {{ .metav1UpdateOptions|raw }}) (*{{ .ResultType|raw }}, error) { + in.SetGroupVersionKind({{ .schemaGroupVersionKind|raw }}{ + Group: "{{ .Group }}", + Version: "{{ .VersionLower }}", + Kind: "{{ .Kind }}", + }) + uo := &{{ .unstructuredUnstructured|raw }}{} + if err := convert(in, uo); err != nil { + return nil, err + } + uo, err := w.dyn{{if .Namespaced}}.Namespace(w.namespace){{end}}.UpdateStatus(ctx, uo, opts) + if err != nil { + return nil, err + } + out := &{{ .ResultType|raw }}{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} +`, + + "delete": ` +func (w *wrap{{.GroupGoName}}{{.Version}}{{ .Type.Name.Name }}Impl) Delete(ctx {{ .contextContext|raw }}, name string, opts {{ .metav1DeleteOptions|raw }}) error { + return w.dyn{{if .Namespaced}}.Namespace(w.namespace){{end}}.Delete(ctx, name, opts) +} +`, + + "deleteCollection": ` +func (w *wrap{{.GroupGoName}}{{.Version}}{{ .Type.Name.Name }}Impl) DeleteCollection(ctx {{ .contextContext|raw }}, opts {{ .metav1DeleteOptions|raw }}, listOpts {{ .metav1ListOptions|raw }}) error { + return w.dyn{{if .Namespaced}}.Namespace(w.namespace){{end}}.DeleteCollection(ctx, opts, listOpts) +} +`, + + "get": ` +func (w *wrap{{.GroupGoName}}{{.Version}}{{ .Type.Name.Name }}Impl) Get(ctx {{ .contextContext|raw }}, name string, opts {{ .metav1GetOptions|raw }}) (*{{ .ResultType|raw }}, error) { + uo, err := w.dyn{{if .Namespaced}}.Namespace(w.namespace){{end}}.Get(ctx, name, opts) + if err != nil { + return nil, err + } + out := &{{ .ResultType|raw }}{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} +`, + + "list": ` +func (w *wrap{{.GroupGoName}}{{.Version}}{{ .Type.Name.Name }}Impl) List(ctx {{ .contextContext|raw }}, opts {{ .metav1ListOptions|raw }}) (*{{ .ResultType|raw }}List, error) { + uo, err := w.dyn{{if .Namespaced}}.Namespace(w.namespace){{end}}.List(ctx, opts) + if err != nil { + return nil, err + } + out := &{{ .ResultType|raw }}List{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} +`, + + "watch": ` +func (w *wrap{{.GroupGoName}}{{.Version}}{{ .Type.Name.Name }}Impl) Watch(ctx {{ .contextContext|raw }}, opts {{ .metav1ListOptions|raw }}) ({{ .watchInterface|raw }}, error) { + return nil, {{ .errorsNew|raw }}("NYI: Watch") +} +`, + "patch": ` +func (w *wrap{{.GroupGoName}}{{.Version}}{{ .Type.Name.Name }}Impl) Patch(ctx {{ .contextContext|raw }}, name string, pt {{ .typesPatchType|raw }}, data []byte, opts {{ .metav1PatchOptions|raw }}, subresources ...string) (result *{{ .ResultType|raw }}, err error) { + uo, err := w.dyn{{if .Namespaced}}.Namespace(w.namespace){{end}}.Patch(ctx, name, pt, data, opts) + if err != nil { + return nil, err + } + out := &{{ .ResultType|raw }}{} + if err := convert(uo, out); err != nil { + return nil, err + } + return out, nil +} +`, +} + +var extensionVerbs = sets.NewString( /* Populated from extensionVerbMap during init */ ) +var extensionVerbMap = map[string]string{ + "create": ` +func (w *wrap{{.GroupGoName}}{{.Version}}{{ .Type.Name.Name }}Impl) Create(ctx {{ .contextContext|raw }}, {{ if .Subresource }}_ string, {{ end }}in *{{ .InputType|raw }}, opts {{ .metav1CreateOptions|raw }}) (*{{ .ResultType|raw }}, error) { + panic("NYI") +} +`, + "update": ` +func (w *wrap{{.GroupGoName}}{{.Version}}{{ .Type.Name.Name }}Impl) Update(ctx {{ .contextContext|raw }}, {{ if .Subresource }}_ string, {{ end }}in *{{ .InputType|raw }}, opts {{ .metav1UpdateOptions|raw }}) (*{{ .ResultType|raw }}, error) { + panic("NYI") +} +`, + "updateStatus": ` +func (w *wrap{{.GroupGoName}}{{.Version}}{{ .Type.Name.Name }}Impl) UpdateStatus(ctx {{ .contextContext|raw }}, in *{{ .InputType|raw }}, opts {{ .metav1UpdateOptions|raw }}) (*{{ .ResultType|raw }}, error) { + panic("NYI") +} +`, + "delete": ` +func (w *wrap{{.GroupGoName}}{{.Version}}{{ .Type.Name.Name }}Impl) Delete(ctx {{ .contextContext|raw }}, name string, opts {{ .metav1DeleteOptions|raw }}) error { + panic("NYI") +} +`, + "deleteCollection": ` +func (w *wrap{{.GroupGoName}}{{.Version}}{{ .Type.Name.Name }}Impl) DeleteCollection(ctx {{ .contextContext|raw }}, opts {{ .metav1DeleteOptions|raw }}, listOpts {{ .metav1ListOptions|raw }}) error { + panic("NYI") +} +`, + "get": ` +func (w *wrap{{.GroupGoName}}{{.Version}}{{ .Type.Name.Name }}Impl) Get(ctx {{ .contextContext|raw }}, name string, opts {{ .metav1GetOptions|raw }}) (*{{ .ResultType|raw }}, error) { + panic("NYI") +} +`, + "list": ` +func (w *wrap{{.GroupGoName}}{{.Version}}{{ .Type.Name.Name }}Impl) List(ctx {{ .contextContext|raw }}, opts {{ .metav1ListOptions|raw }}) (*{{ .ResultType|raw }}List, error) { + panic("NYI") +} +`, + "watch": ` +func (w *wrap{{.GroupGoName}}{{.Version}}{{ .Type.Name.Name }}Impl) Watch(ctx {{ .contextContext|raw }}, opts {{ .metav1ListOptions|raw }}) ({{ .watchInterface|raw }}, error) { + panic("NYI") +} +`, + "patch": ` +func (w *wrap{{.GroupGoName}}{{.Version}}{{ .Type.Name.Name }}Impl) Patch(ctx {{ .contextContext|raw }}, name string, pt {{ .typesPatchType|raw }}, data []byte, opts {{ .metav1PatchOptions|raw }}, subresources ...string) (result *{{ .ResultType|raw }}, err error) { + panic("NYI") +} +`, +} + +func init() { + for v := range verbMap { + verbs.Insert(v) + } + for ev := range extensionVerbMap { + extensionVerbs.Insert(ev) + } +} diff --git a/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/filtered_informer.go b/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/filtered_informer.go index c82a2e59..3100052a 100644 --- a/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/filtered_informer.go +++ b/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/filtered_informer.go @@ -19,6 +19,7 @@ package generators import ( "io" + "k8s.io/code-generator/cmd/client-gen/generators/util" clientgentypes "k8s.io/code-generator/cmd/client-gen/types" "k8s.io/gengo/generator" "k8s.io/gengo/namer" @@ -37,6 +38,9 @@ type filteredInjectionGenerator struct { imports namer.ImportTracker typedInformerPackage string groupInformerFactoryPackage string + injectionClientSetPackage string + clientSetPackage string + listerPkg string } var _ generator.Generator = (*filteredInjectionGenerator)(nil) @@ -78,11 +82,23 @@ func (g *filteredInjectionGenerator) GenerateType(c *generator.Context, t *types klog.V(5).Info("processing type ", t) + tags, err := util.ParseClientGenTags(append(g.typeToGenerate.SecondClosestCommentLines, g.typeToGenerate.CommentLines...)) + if err != nil { + return err + } + m := map[string]interface{}{ + "clientGet": c.Universe.Type(types.Name{Package: g.injectionClientSetPackage, Name: "Get"}), + "clientSetInterface": c.Universe.Type(types.Name{Package: g.clientSetPackage, Name: "Interface"}), + "resourceLister": c.Universe.Type(types.Name{Name: g.typeToGenerate.Name.Name + "Lister", Package: g.listerPkg}), + "resourceNamespaceLister": c.Universe.Type(types.Name{Name: g.typeToGenerate.Name.Name + "NamespaceLister", Package: g.listerPkg}), + "groupGoName": namer.IC(g.groupGoName), + "versionGoName": namer.IC(g.groupVersion.Version.String()), "group": namer.IC(g.groupGoName), "type": t, "version": namer.IC(g.groupVersion.Version.String()), "injectionRegisterFilteredInformers": c.Universe.Type(types.Name{Package: "knative.dev/pkg/injection", Name: "Default.RegisterFilteredInformers"}), + "injectionRegisterDynamicInformer": c.Universe.Type(types.Name{Package: "knative.dev/pkg/injection", Name: "Dynamic.RegisterDynamicInformer"}), "controllerInformer": c.Universe.Type(types.Name{Package: "knative.dev/pkg/controller", Name: "Informer"}), "informersTypedInformer": c.Universe.Type(types.Name{Package: g.typedInformerPackage, Name: t.Name.Name + "Informer"}), "factoryLabelKey": c.Universe.Type(types.Name{Package: g.groupInformerFactoryPackage, Name: "LabelKey"}), @@ -95,6 +111,43 @@ func (g *filteredInjectionGenerator) GenerateType(c *generator.Context, t *types Package: "context", Name: "Context", }), + "contextWithValue": c.Universe.Function(types.Name{ + Package: "context", + Name: "WithValue", + }), + "schemaGVR": c.Universe.Type(types.Name{ + Package: "k8s.io/apimachinery/pkg/runtime/schema", + Name: "GroupVersionResource", + }), + "labelsSelector": c.Universe.Type(types.Name{ + Package: "k8s.io/apimachinery/pkg/labels", + Name: "Selector", + }), + "labelsParseToRequirements": c.Universe.Type(types.Name{ + Package: "k8s.io/apimachinery/pkg/labels", + Name: "ParseToRequirements", + }), + "contextTODO": c.Universe.Function(types.Name{ + Package: "context", + Name: "TODO", + }), + "metav1GetOptions": c.Universe.Type(types.Name{ + Package: "k8s.io/apimachinery/pkg/apis/meta/v1", + Name: "GetOptions", + }), + "metav1ListOptions": c.Universe.Type(types.Name{ + Package: "k8s.io/apimachinery/pkg/apis/meta/v1", + Name: "ListOptions", + }), + "cacheSharedIndexInformer": c.Universe.Type(types.Name{ + Package: "k8s.io/client-go/tools/cache", + Name: "SharedIndexInformer", + }), + "cacheNewSharedIndexInformer": c.Universe.Function(types.Name{ + Package: "k8s.io/client-go/tools/cache", + Name: "NewSharedIndexInformer", + }), + "Namespaced": !tags.NonNamespaced, } sw.Do(filteredInjectionInformer, m) @@ -105,6 +158,7 @@ func (g *filteredInjectionGenerator) GenerateType(c *generator.Context, t *types var filteredInjectionInformer = ` func init() { {{.injectionRegisterFilteredInformers|raw}}(withInformer) + {{.injectionRegisterDynamicInformer|raw}}(withDynamicInformer) } // Key is used for associating the Informer inside the context.Context. @@ -123,12 +177,26 @@ func withInformer(ctx {{.contextContext|raw}}) ({{.contextContext|raw}}, []{{.co for _, selector := range labelSelectors { f := {{.factoryGet|raw}}(ctx, selector) inf := f.{{.group}}().{{.version}}().{{.type|publicPlural}}() - ctx = context.WithValue(ctx, Key{Selector: selector}, inf) + ctx = {{ .contextWithValue|raw }}(ctx, Key{Selector: selector}, inf) infs = append(infs, inf.Informer()) } return ctx, infs } +func withDynamicInformer(ctx {{.contextContext|raw}}) {{.contextContext|raw}} { + untyped := ctx.Value({{.factoryLabelKey|raw}}{}) + if untyped == nil { + {{.loggingFromContext|raw}}(ctx).Panic( + "Unable to fetch labelkey from context.") + } + labelSelectors := untyped.([]string) + for _, selector := range labelSelectors { + inf := &wrapper{client: {{ .clientGet|raw }}(ctx), selector: selector} + ctx = {{ .contextWithValue|raw }}(ctx, Key{Selector: selector}, inf) + } + return ctx +} + // Get extracts the typed informer from the context. func Get(ctx {{.contextContext|raw}}, selector string) {{.informersTypedInformer|raw}} { untyped := ctx.Value(Key{Selector: selector}) @@ -138,4 +206,55 @@ func Get(ctx {{.contextContext|raw}}, selector string) {{.informersTypedInformer } return untyped.({{.informersTypedInformer|raw}}) } + +type wrapper struct { + client {{.clientSetInterface|raw}} +{{ if .Namespaced }} + namespace string +{{ end }} + selector string +} + +var _ {{.informersTypedInformer|raw}} = (*wrapper)(nil) +var _ {{.resourceLister|raw}} = (*wrapper)(nil) + +func (w *wrapper) Informer() {{ .cacheSharedIndexInformer|raw }} { + return {{ .cacheNewSharedIndexInformer|raw }}(nil, &{{ .type|raw }}{}, 0, nil) +} + +func (w *wrapper) Lister() {{ .resourceLister|raw }} { + return w +} + +{{if .Namespaced}} +func (w *wrapper) {{ .type|publicPlural }}(namespace string) {{ .resourceNamespaceLister|raw }} { + return &wrapper{client: w.client, namespace: namespace, selector: w.selector} +} +{{end}} + +func (w *wrapper) List(selector {{ .labelsSelector|raw }}) (ret []*{{ .type|raw }}, err error) { + reqs, err := {{ .labelsParseToRequirements|raw }}(w.selector) + if err != nil { + return nil, err + } + selector = selector.Add(reqs...) + lo, err := w.client.{{.groupGoName}}{{.versionGoName}}().{{.type|publicPlural}}({{if .Namespaced}}w.namespace{{end}}).List({{ .contextTODO|raw }}(), {{ .metav1ListOptions|raw }}{ + LabelSelector: selector.String(), + // TODO(mattmoor): Incorporate resourceVersion bounds based on staleness criteria. + }) + if err != nil { + return nil, err + } + for idx := range lo.Items { + ret = append(ret, &lo.Items[idx]) + } + return ret, nil +} + +func (w *wrapper) Get(name string) (*{{ .type|raw }}, error) { + // TODO(mattmoor): Check that the fetched object matches the selector. + return w.client.{{.groupGoName}}{{.versionGoName}}().{{.type|publicPlural}}({{if .Namespaced}}w.namespace{{end}}).Get({{ .contextTODO|raw }}(), name, {{ .metav1GetOptions|raw }}{ + // TODO(mattmoor): Incorporate resourceVersion bounds based on staleness criteria. + }) +} ` diff --git a/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/informer.go b/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/informer.go index e696873f..bbbffb4c 100644 --- a/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/informer.go +++ b/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/informer.go @@ -19,6 +19,7 @@ package generators import ( "io" + "k8s.io/code-generator/cmd/client-gen/generators/util" clientgentypes "k8s.io/code-generator/cmd/client-gen/types" "k8s.io/gengo/generator" "k8s.io/gengo/namer" @@ -37,6 +38,9 @@ type injectionGenerator struct { imports namer.ImportTracker typedInformerPackage string groupInformerFactoryPackage string + injectionClientSetPackage string + clientSetPackage string + listerPkg string } var _ generator.Generator = (*injectionGenerator)(nil) @@ -78,14 +82,26 @@ func (g *injectionGenerator) GenerateType(c *generator.Context, t *types.Type, w klog.V(5).Info("processing type ", t) + tags, err := util.ParseClientGenTags(append(g.typeToGenerate.SecondClosestCommentLines, g.typeToGenerate.CommentLines...)) + if err != nil { + return err + } + m := map[string]interface{}{ - "group": namer.IC(g.groupGoName), - "type": t, - "version": namer.IC(g.groupVersion.Version.String()), - "injectionRegisterInformer": c.Universe.Type(types.Name{Package: "knative.dev/pkg/injection", Name: "Default.RegisterInformer"}), - "controllerInformer": c.Universe.Type(types.Name{Package: "knative.dev/pkg/controller", Name: "Informer"}), - "informersTypedInformer": c.Universe.Type(types.Name{Package: g.typedInformerPackage, Name: t.Name.Name + "Informer"}), - "factoryGet": c.Universe.Type(types.Name{Package: g.groupInformerFactoryPackage, Name: "Get"}), + "clientGet": c.Universe.Type(types.Name{Package: g.injectionClientSetPackage, Name: "Get"}), + "clientSetInterface": c.Universe.Type(types.Name{Package: g.clientSetPackage, Name: "Interface"}), + "resourceLister": c.Universe.Type(types.Name{Name: g.typeToGenerate.Name.Name + "Lister", Package: g.listerPkg}), + "resourceNamespaceLister": c.Universe.Type(types.Name{Name: g.typeToGenerate.Name.Name + "NamespaceLister", Package: g.listerPkg}), + "groupGoName": namer.IC(g.groupGoName), + "versionGoName": namer.IC(g.groupVersion.Version.String()), + "group": g.groupVersion.Group.String(), + "version": g.groupVersion.Version.String(), + "type": t, + "injectionRegisterInformer": c.Universe.Type(types.Name{Package: "knative.dev/pkg/injection", Name: "Default.RegisterInformer"}), + "injectionRegisterDynamicInformer": c.Universe.Type(types.Name{Package: "knative.dev/pkg/injection", Name: "Dynamic.RegisterDynamicInformer"}), + "controllerInformer": c.Universe.Type(types.Name{Package: "knative.dev/pkg/controller", Name: "Informer"}), + "informersTypedInformer": c.Universe.Type(types.Name{Package: g.typedInformerPackage, Name: t.Name.Name + "Informer"}), + "factoryGet": c.Universe.Type(types.Name{Package: g.groupInformerFactoryPackage, Name: "Get"}), "loggingFromContext": c.Universe.Function(types.Name{ Package: "knative.dev/pkg/logging", Name: "FromContext", @@ -94,6 +110,39 @@ func (g *injectionGenerator) GenerateType(c *generator.Context, t *types.Type, w Package: "context", Name: "Context", }), + "contextWithValue": c.Universe.Function(types.Name{ + Package: "context", + Name: "WithValue", + }), + "schemaGVR": c.Universe.Type(types.Name{ + Package: "k8s.io/apimachinery/pkg/runtime/schema", + Name: "GroupVersionResource", + }), + "labelsSelector": c.Universe.Type(types.Name{ + Package: "k8s.io/apimachinery/pkg/labels", + Name: "Selector", + }), + "contextTODO": c.Universe.Function(types.Name{ + Package: "context", + Name: "TODO", + }), + "metav1GetOptions": c.Universe.Type(types.Name{ + Package: "k8s.io/apimachinery/pkg/apis/meta/v1", + Name: "GetOptions", + }), + "metav1ListOptions": c.Universe.Type(types.Name{ + Package: "k8s.io/apimachinery/pkg/apis/meta/v1", + Name: "ListOptions", + }), + "cacheSharedIndexInformer": c.Universe.Type(types.Name{ + Package: "k8s.io/client-go/tools/cache", + Name: "SharedIndexInformer", + }), + "cacheNewSharedIndexInformer": c.Universe.Function(types.Name{ + Package: "k8s.io/client-go/tools/cache", + Name: "NewSharedIndexInformer", + }), + "Namespaced": !tags.NonNamespaced, } sw.Do(injectionInformer, m) @@ -104,6 +153,7 @@ func (g *injectionGenerator) GenerateType(c *generator.Context, t *types.Type, w var injectionInformer = ` func init() { {{.injectionRegisterInformer|raw}}(withInformer) + {{.injectionRegisterDynamicInformer|raw}}(withDynamicInformer) } // Key is used for associating the Informer inside the context.Context. @@ -111,8 +161,13 @@ type Key struct{} func withInformer(ctx {{.contextContext|raw}}) ({{.contextContext|raw}}, {{.controllerInformer|raw}}) { f := {{.factoryGet|raw}}(ctx) - inf := f.{{.group}}().{{.version}}().{{.type|publicPlural}}() - return context.WithValue(ctx, Key{}, inf), inf.Informer() + inf := f.{{.groupGoName}}().{{.versionGoName}}().{{.type|publicPlural}}() + return {{ .contextWithValue|raw }}(ctx, Key{}, inf), inf.Informer() +} + +func withDynamicInformer(ctx {{.contextContext|raw}}) {{.contextContext|raw}} { + inf := &wrapper{client: {{ .clientGet|raw }}(ctx)} + return {{ .contextWithValue|raw }}(ctx, Key{}, inf) } // Get extracts the typed informer from the context. @@ -124,4 +179,49 @@ func Get(ctx {{.contextContext|raw}}) {{.informersTypedInformer|raw}} { } return untyped.({{.informersTypedInformer|raw}}) } + +type wrapper struct { + client {{.clientSetInterface|raw}} +{{ if .Namespaced }} + namespace string +{{ end }} +} + +var _ {{.informersTypedInformer|raw}} = (*wrapper)(nil) +var _ {{.resourceLister|raw}} = (*wrapper)(nil) + +func (w *wrapper) Informer() {{ .cacheSharedIndexInformer|raw }} { + return {{ .cacheNewSharedIndexInformer|raw }}(nil, &{{ .type|raw }}{}, 0, nil) +} + +func (w *wrapper) Lister() {{ .resourceLister|raw }} { + return w +} + +{{if .Namespaced}} +func (w *wrapper) {{ .type|publicPlural }}(namespace string) {{ .resourceNamespaceLister|raw }} { + return &wrapper{client: w.client, namespace: namespace} +} +{{end}} + +func (w *wrapper) List(selector {{ .labelsSelector|raw }}) (ret []*{{ .type|raw }}, err error) { + lo, err := w.client.{{.groupGoName}}{{.versionGoName}}().{{.type|publicPlural}}({{if .Namespaced}}w.namespace{{end}}).List({{ .contextTODO|raw }}(), {{ .metav1ListOptions|raw }}{ + LabelSelector: selector.String(), + // TODO(mattmoor): Incorporate resourceVersion bounds based on staleness criteria. + }) + if err != nil { + return nil, err + } + for idx := range lo.Items { + ret = append(ret, &lo.Items[idx]) + } + return ret, nil +} + +func (w *wrapper) Get(name string) (*{{ .type|raw }}, error) { + return w.client.{{.groupGoName}}{{.versionGoName}}().{{.type|publicPlural}}({{if .Namespaced}}w.namespace{{end}}).Get({{ .contextTODO|raw }}(), name, {{ .metav1GetOptions|raw }}{ + // TODO(mattmoor): Incorporate resourceVersion bounds based on staleness criteria. + }) +} + ` diff --git a/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/packages.go b/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/packages.go index e71e92dc..1900802f 100644 --- a/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/packages.go +++ b/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/packages.go @@ -50,6 +50,7 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat groupVersions := make(map[string]clientgentypes.GroupVersions) groupGoNames := make(map[string]string) + groupVersionTypes := make(map[string]map[clientgentypes.Version][]*types.Type) for _, inputDir := range arguments.InputDirs { p := context.Universe.Package(vendorless(inputDir)) @@ -78,15 +79,10 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat groupGoNames[groupPackageName] = namer.IC(override[0]) } - // Generate the client and fake. - packageList = append(packageList, versionClientsPackages(versionPackagePath, boilerplate, customArgs)...) - - // Generate the informer factory and fake. - packageList = append(packageList, versionFactoryPackages(versionPackagePath, boilerplate, customArgs)...) - var typesWithInformers []*types.Type var duckTypes []*types.Type var reconcilerTypes []*types.Type + var clientTypes []*types.Type for _, t := range p.Types { tags := MustParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) if tags.NeedsInformerInjection() { @@ -98,6 +94,9 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat if tags.NeedsReconciler(t, customArgs) { reconcilerTypes = append(reconcilerTypes, t) } + if tags.GenerateClient { + clientTypes = append(clientTypes, t) + } } groupVersionsEntry, ok := targetGroupVersions[groupPackageName] @@ -109,6 +108,12 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat } groupVersionsEntry.Versions = append(groupVersionsEntry.Versions, clientgentypes.PackageVersion{Version: gv.Version, Package: gvPackage}) targetGroupVersions[groupPackageName] = groupVersionsEntry + verTypes, ok := groupVersionTypes[groupPackageName] + if !ok { + verTypes = make(map[clientgentypes.Version][]*types.Type) + } + verTypes[gv.Version] = clientTypes + groupVersionTypes[groupPackageName] = verTypes if len(typesWithInformers) != 0 { orderer := namer.Orderer{Namer: namer.NewPrivateNamer(0)} @@ -135,6 +140,12 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat } } + // Generate the client and fake. + packageList = append(packageList, versionClientsPackages(versionPackagePath, boilerplate, customArgs, groupVersions, groupGoNames, groupVersionTypes)...) + + // Generate the informer factory and fake. + packageList = append(packageList, versionFactoryPackages(versionPackagePath, boilerplate, customArgs)...) + return packageList } @@ -233,7 +244,7 @@ func typedInformerPackage(groupPkgName string, gv clientgentypes.GroupVersion, e return filepath.Join(externalVersionsInformersPackage, groupPkgName, gv.Version.String()) } -func versionClientsPackages(basePackage string, boilerplate []byte, customArgs *informergenargs.CustomArgs) []generator.Package { +func versionClientsPackages(basePackage string, boilerplate []byte, customArgs *informergenargs.CustomArgs, groupVersions map[string]clientgentypes.GroupVersions, groupGoNames map[string]string, groupVersionTypes map[string]map[clientgentypes.Version][]*types.Type) []generator.Package { packagePath := filepath.Join(basePackage, "client") return []generator.Package{ @@ -248,6 +259,11 @@ func versionClientsPackages(basePackage string, boilerplate []byte, customArgs * DefaultGen: generator.DefaultGen{ OptionalName: "client", }, + + groupVersions: groupVersions, + groupGoNames: groupGoNames, + groupVersionTypes: groupVersionTypes, + outputPackage: packagePath, imports: generator.NewImportTracker(), clientSetPackage: customArgs.VersionedClientSetPackage, @@ -392,6 +408,7 @@ func versionInformerPackages(basePackage string, groupPkgName string, gv clientg filteredFactoryPackagePath := filepath.Join(basePackage, "informers", "factory", "filtered") packagePath := filepath.Join(basePackage, "informers", groupPkgName, strings.ToLower(gv.Version.NonEmpty())) + listerPackagePath := filepath.Join(customArgs.ListersPackage, groupPkgName, strings.ToLower(gv.Version.NonEmpty())) vers := make([]generator.Package, 0, 2*len(typesToGenerate)) @@ -419,6 +436,9 @@ func versionInformerPackages(basePackage string, groupPkgName string, gv clientg imports: generator.NewImportTracker(), typedInformerPackage: typedInformerPackage, groupInformerFactoryPackage: factoryPackagePath, + clientSetPackage: customArgs.VersionedClientSetPackage, + injectionClientSetPackage: filepath.Join(basePackage, "client"), + listerPkg: listerPackagePath, }) return generators }, @@ -472,6 +492,9 @@ func versionInformerPackages(basePackage string, groupPkgName string, gv clientg imports: generator.NewImportTracker(), typedInformerPackage: typedInformerPackage, groupInformerFactoryPackage: filteredFactoryPackagePath, + clientSetPackage: customArgs.VersionedClientSetPackage, + injectionClientSetPackage: filepath.Join(basePackage, "client"), + listerPkg: listerPackagePath, }) return generators }, diff --git a/vendor/knative.dev/pkg/controller/controller.go b/vendor/knative.dev/pkg/controller/controller.go index 7ac98b2e..d3cec2dd 100644 --- a/vendor/knative.dev/pkg/controller/controller.go +++ b/vendor/knative.dev/pkg/controller/controller.go @@ -487,7 +487,8 @@ func (c *Impl) RunContext(ctx context.Context, threadiness int) error { } // Run runs the controller. -// DEPRECATED: Use RunContext instead. +// +// Deprecated: Use RunContext instead. func (c *Impl) Run(threadiness int, stopCh <-chan struct{}) error { // Create a context that is cancelled when the stopCh is called. ctx, cancel := context.WithCancel(context.Background()) diff --git a/vendor/knative.dev/pkg/hack/update-codegen.sh b/vendor/knative.dev/pkg/hack/update-codegen.sh index a8051e6d..3b374fa5 100644 --- a/vendor/knative.dev/pkg/hack/update-codegen.sh +++ b/vendor/knative.dev/pkg/hack/update-codegen.sh @@ -38,13 +38,18 @@ ${REPO_ROOT_DIR}/hack/generate-knative.sh "injection" \ "duck:v1alpha1,v1beta1,v1" \ --go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt +# Based on: https://github.com/kubernetes/kubernetes/blob/8ddabd0da5cc54761f3216c08e99fa1a9f7ee2c5/hack/lib/init.sh#L116 +# The '-path' is a hack to workaround the lack of portable `-depth 2`. +K8S_TYPES=$(find ./vendor/k8s.io/api -type d -path '*/*/*/*/*/*' | cut -d'/' -f 5-6 | sort | sed 's@/@:@g' | + grep -v "admission:" | grep -v "imagepolicy:" | grep -v "abac:" | grep -v "componentconfig:") + OUTPUT_PKG="knative.dev/pkg/client/injection/kube" \ VERSIONED_CLIENTSET_PKG="k8s.io/client-go/kubernetes" \ EXTERNAL_INFORMER_PKG="k8s.io/client-go/informers" \ ${REPO_ROOT_DIR}/hack/generate-knative.sh "injection" \ k8s.io/client-go \ k8s.io/api \ - "admissionregistration:v1beta1,v1 apps:v1 autoscaling:v1,v2beta1 batch:v1,v1beta1 core:v1 rbac:v1 coordination:v1" \ + "${K8S_TYPES}" \ --go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt \ --force-genreconciler-kinds "Namespace,Deployment,Secret" diff --git a/vendor/knative.dev/pkg/injection/clients.go b/vendor/knative.dev/pkg/injection/clients.go index b71ef1d9..92e99121 100644 --- a/vendor/knative.dev/pkg/injection/clients.go +++ b/vendor/knative.dev/pkg/injection/clients.go @@ -62,3 +62,22 @@ func (i *impl) FetchAllClients(ctx context.Context) []interface{} { } return clients } + +// DynamicClientInjector holds the type of a callback that attaches a particular +// client type to a context. +type DynamicClientInjector func(context.Context) context.Context + +func (i *impl) RegisterDynamicClient(ci DynamicClientInjector) { + i.m.Lock() + defer i.m.Unlock() + + i.dynamicClients = append(i.dynamicClients, ci) +} + +func (i *impl) GetDynamicClients() []DynamicClientInjector { + i.m.RLock() + defer i.m.RUnlock() + + // Copy the slice before returning. + return append(i.dynamicClients[:0:0], i.dynamicClients...) +} diff --git a/vendor/knative.dev/pkg/injection/clients/dynamicclient/dynamicclient.go b/vendor/knative.dev/pkg/injection/clients/dynamicclient/dynamicclient.go new file mode 100644 index 00000000..2eece5c5 --- /dev/null +++ b/vendor/knative.dev/pkg/injection/clients/dynamicclient/dynamicclient.go @@ -0,0 +1,49 @@ +/* +Copyright 2019 The Knative 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. +*/ + +package dynamicclient + +import ( + "context" + + "k8s.io/client-go/dynamic" + "k8s.io/client-go/rest" + + "knative.dev/pkg/injection" + "knative.dev/pkg/logging" +) + +func init() { + injection.Default.RegisterClient(withClient) +} + +// Key is used as the key for associating information +// with a context.Context. +type Key struct{} + +func withClient(ctx context.Context, cfg *rest.Config) context.Context { + return context.WithValue(ctx, Key{}, dynamic.NewForConfigOrDie(cfg)) +} + +// Get extracts the Dynamic client from the context. +func Get(ctx context.Context) dynamic.Interface { + untyped := ctx.Value(Key{}) + if untyped == nil { + logging.FromContext(ctx).Panic( + "Unable to fetch k8s.io/client-go/dynamic.Interface from context.") + } + return untyped.(dynamic.Interface) +} diff --git a/vendor/knative.dev/pkg/injection/informers.go b/vendor/knative.dev/pkg/injection/informers.go index 9356f8d7..ce5d481e 100644 --- a/vendor/knative.dev/pkg/injection/informers.go +++ b/vendor/knative.dev/pkg/injection/informers.go @@ -28,6 +28,10 @@ import ( // informer type to a context. type InformerInjector func(context.Context) (context.Context, controller.Informer) +// DynamicInformerInjector holds the type of a callback that attaches a particular +// informer type (backed by a Dynamic) to a context. +type DynamicInformerInjector func(context.Context) context.Context + // FilteredInformersInjector holds the type of a callback that attaches a set of particular // filtered informers type to a context. type FilteredInformersInjector func(context.Context) (context.Context, []controller.Informer) @@ -39,6 +43,13 @@ func (i *impl) RegisterInformer(ii InformerInjector) { i.informers = append(i.informers, ii) } +func (i *impl) RegisterDynamicInformer(ii DynamicInformerInjector) { + i.m.Lock() + defer i.m.Unlock() + + i.dynamicInformers = append(i.dynamicInformers, ii) +} + func (i *impl) RegisterFilteredInformers(fii FilteredInformersInjector) { i.m.Lock() defer i.m.Unlock() @@ -54,6 +65,14 @@ func (i *impl) GetInformers() []InformerInjector { return append(i.informers[:0:0], i.informers...) } +func (i *impl) GetDynamicInformers() []DynamicInformerInjector { + i.m.RLock() + defer i.m.RUnlock() + + // Copy the slice before returning. + return append(i.dynamicInformers[:0:0], i.dynamicInformers...) +} + func (i *impl) GetFilteredInformers() []FilteredInformersInjector { i.m.RLock() defer i.m.RUnlock() @@ -62,6 +81,22 @@ func (i *impl) GetFilteredInformers() []FilteredInformersInjector { return append(i.filteredInformers[:0:0], i.filteredInformers...) } +func (i *impl) SetupDynamic(ctx context.Context) context.Context { + // Based on the reconcilers we have linked, build up a set of clients and inject + // them onto the context. + for _, ci := range i.GetDynamicClients() { + ctx = ci(ctx) + } + + // Based on the reconcilers we have linked, build up a set of informers + // and inject them onto the context. + for _, ii := range i.GetDynamicInformers() { + ctx = ii(ctx) + } + + return ctx +} + func (i *impl) SetupInformers(ctx context.Context, cfg *rest.Config) (context.Context, []controller.Informer) { // Based on the reconcilers we have linked, build up a set of clients and inject // them onto the context. diff --git a/vendor/knative.dev/pkg/injection/interface.go b/vendor/knative.dev/pkg/injection/interface.go index 112a6415..43372829 100644 --- a/vendor/knative.dev/pkg/injection/interface.go +++ b/vendor/knative.dev/pkg/injection/interface.go @@ -78,6 +78,29 @@ type Interface interface { SetupInformers(context.Context, *rest.Config) (context.Context, []controller.Informer) } +// DynamicInterface is the interface for interacting with dynamicclient-based injection +// implementations, such as Dynamic below. +type DynamicInterface interface { + // RegisterDynamicClient registers a new injector callback for associating + // a new dynamicclient-based client with a context. + RegisterDynamicClient(DynamicClientInjector) + + // GetDynamicClients fetches all of the registered dynamicclient-based client injectors. + GetDynamicClients() []DynamicClientInjector + + // RegisterDynamicInformer registers a new injector callback for associating + // a new dynamicclient-based informer with a context. + RegisterDynamicInformer(DynamicInformerInjector) + + // GetDynamicInformers fetches all of the registered dynamicclient-based informer injectors. + GetDynamicInformers() []DynamicInformerInjector + + // SetupDynamic runs all of the injectors against a context, starting with + // the clients and the given stream. A context infused with the various elements + // is returned. + SetupDynamic(context.Context) context.Context +} + type ControllerConstructor func(context.Context, configmap.Watcher) *controller.Impl var ( @@ -89,6 +112,10 @@ var ( // are being run for real. Default Interface = &impl{} + // Dynamic is the injection interface to use when bootstrapping a version + // of things based on the prototype dynamicclient-based reconciler framework. + Dynamic DynamicInterface = &impl{} + // Fake is the injection interface with which informers should register // to make themselves available to the controller process when it is being // unit tested. @@ -99,9 +126,11 @@ type impl struct { m sync.RWMutex clients []ClientInjector + dynamicClients []DynamicClientInjector clientFetchers []ClientFetcher factories []InformerFactoryInjector informers []InformerInjector + dynamicInformers []DynamicInformerInjector filteredInformers []FilteredInformersInjector ducks []DuckFactoryInjector } diff --git a/vendor/knative.dev/pkg/metrics/exporter.go b/vendor/knative.dev/pkg/metrics/exporter.go index 12b46b64..a4c83734 100644 --- a/vendor/knative.dev/pkg/metrics/exporter.go +++ b/vendor/knative.dev/pkg/metrics/exporter.go @@ -89,7 +89,8 @@ type ExporterOptions struct { // UpdateExporterFromConfigMap returns a helper func that can be used to update the exporter // when a config map is updated. -// DEPRECATED: Callers should migrate to ConfigMapWatcher. +// +// Deprecated: Callers should migrate to ConfigMapWatcher. func UpdateExporterFromConfigMap(ctx context.Context, component string, logger *zap.SugaredLogger) func(configMap *corev1.ConfigMap) { return ConfigMapWatcher(ctx, component, nil, logger) } diff --git a/vendor/knative.dev/pkg/network/error_handler.go b/vendor/knative.dev/pkg/network/error_handler.go index 8518c040..76376648 100644 --- a/vendor/knative.dev/pkg/network/error_handler.go +++ b/vendor/knative.dev/pkg/network/error_handler.go @@ -25,8 +25,8 @@ import ( // ErrorHandler sets up a handler suitable for use with the ErrorHandler field on // httputil's reverse proxy. -// TODO(mattmoor): Move the implementation into handlers/error.go once downstream consumers -// have adopted the alias. +// +// Deprecated: Use handler.Error instead. func ErrorHandler(logger *zap.SugaredLogger) func(http.ResponseWriter, *http.Request, error) { return func(w http.ResponseWriter, req *http.Request, err error) { ss := readSockStat(logger) diff --git a/vendor/knative.dev/pkg/tracker/interface.go b/vendor/knative.dev/pkg/tracker/interface.go index bfcda9cf..5e580b34 100644 --- a/vendor/knative.dev/pkg/tracker/interface.go +++ b/vendor/knative.dev/pkg/tracker/interface.go @@ -61,7 +61,8 @@ type Reference struct { type Interface interface { // Track tells us that "obj" is tracking changes to the // referenced object. - // DEPRECATED: use TrackReference + // + // Deprecated: use TrackReference. Track(ref corev1.ObjectReference, obj interface{}) error // Track tells us that "obj" is tracking changes to the diff --git a/vendor/modules.txt b/vendor/modules.txt index 61e19640..a269b17a 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -575,10 +575,10 @@ k8s.io/kube-openapi/pkg/util/sets k8s.io/utils/buffer k8s.io/utils/integer k8s.io/utils/trace -# knative.dev/hack v0.0.0-20210622141627-e28525d8d260 +# knative.dev/hack v0.0.0-20210806075220-815cd312d65c ## explicit knative.dev/hack -# knative.dev/pkg v0.0.0-20210803160015-21eb4c167cc5 +# knative.dev/pkg v0.0.0-20210818135208-7b5ecbc0e477 ## explicit knative.dev/pkg/apis knative.dev/pkg/apis/duck @@ -596,6 +596,7 @@ knative.dev/pkg/environment knative.dev/pkg/hack knative.dev/pkg/hash knative.dev/pkg/injection +knative.dev/pkg/injection/clients/dynamicclient knative.dev/pkg/kmeta knative.dev/pkg/kmp knative.dev/pkg/leaderelection