28d90c74c42f0b5c2d67999a9955c57739a11740
[icn/sdwan.git] /
1 // SPDX-License-Identifier: Apache-2.0
2 // Copyright (c) 2020 Intel Corporation
3 // Code generated by client-gen. DO NOT EDIT.
4
5 package v1alpha1
6
7 import (
8         v1alpha1 "github.com/open-ness/EMCO/src/monitor/pkg/apis/k8splugin/v1alpha1"
9         "github.com/open-ness/EMCO/src/monitor/pkg/generated/clientset/versioned/scheme"
10
11         //"k8s.io/apimachinery/pkg/runtime/serializer"
12         rest "k8s.io/client-go/rest"
13 )
14
15 type K8spluginV1alpha1Interface interface {
16         RESTClient() rest.Interface
17         ResourceBundleStatesGetter
18 }
19
20 // K8spluginV1alpha1Client is used to interact with features provided by the k8splugin.io group.
21 type K8spluginV1alpha1Client struct {
22         restClient rest.Interface
23 }
24
25 func (c *K8spluginV1alpha1Client) ResourceBundleStates(namespace string) ResourceBundleStateInterface {
26         return newResourceBundleStates(c, namespace)
27 }
28
29 // NewForConfig creates a new K8spluginV1alpha1Client for the given config.
30 func NewForConfig(c *rest.Config) (*K8spluginV1alpha1Client, error) {
31         config := *c
32         if err := setConfigDefaults(&config); err != nil {
33                 return nil, err
34         }
35         client, err := rest.RESTClientFor(&config)
36         if err != nil {
37                 return nil, err
38         }
39         return &K8spluginV1alpha1Client{client}, nil
40 }
41
42 // NewForConfigOrDie creates a new K8spluginV1alpha1Client for the given config and
43 // panics if there is an error in the config.
44 func NewForConfigOrDie(c *rest.Config) *K8spluginV1alpha1Client {
45         client, err := NewForConfig(c)
46         if err != nil {
47                 panic(err)
48         }
49         return client
50 }
51
52 // New creates a new K8spluginV1alpha1Client for the given RESTClient.
53 func New(c rest.Interface) *K8spluginV1alpha1Client {
54         return &K8spluginV1alpha1Client{c}
55 }
56
57 func setConfigDefaults(config *rest.Config) error {
58         gv := v1alpha1.SchemeGroupVersion
59         config.GroupVersion = &gv
60         config.APIPath = "/apis"
61         //config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs}
62         config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
63
64         if config.UserAgent == "" {
65                 config.UserAgent = rest.DefaultKubernetesUserAgent()
66         }
67
68         return nil
69 }
70
71 // RESTClient returns a RESTClient that is used to communicate
72 // with API server by this client implementation.
73 func (c *K8spluginV1alpha1Client) RESTClient() rest.Interface {
74         if c == nil {
75                 return nil
76         }
77         return c.restClient
78 }