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