845a8989685ac3ae8ac35881f05d296bef6a7967
[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         "context"\r
9         "time"\r
10 \r
11         v1alpha1 "github.com/open-ness/EMCO/src/monitor/pkg/apis/k8splugin/v1alpha1"\r
12         scheme "github.com/open-ness/EMCO/src/monitor/pkg/generated/clientset/versioned/scheme"\r
13 \r
14         v1 "k8s.io/apimachinery/pkg/apis/meta/v1"\r
15         types "k8s.io/apimachinery/pkg/types"\r
16         watch "k8s.io/apimachinery/pkg/watch"\r
17         rest "k8s.io/client-go/rest"\r
18 )\r
19 \r
20 // ResourceBundleStatesGetter has a method to return a ResourceBundleStateInterface.\r
21 // A group's client should implement this interface.\r
22 type ResourceBundleStatesGetter interface {\r
23         ResourceBundleStates(namespace string) ResourceBundleStateInterface\r
24 }\r
25 \r
26 // ResourceBundleStateInterface has methods to work with ResourceBundleState resources.\r
27 type ResourceBundleStateInterface interface {\r
28         Create(*v1alpha1.ResourceBundleState) (*v1alpha1.ResourceBundleState, error)\r
29         Update(*v1alpha1.ResourceBundleState) (*v1alpha1.ResourceBundleState, error)\r
30         UpdateStatus(*v1alpha1.ResourceBundleState) (*v1alpha1.ResourceBundleState, error)\r
31         Delete(name string, options *v1.DeleteOptions) error\r
32         DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error\r
33         Get(name string, options v1.GetOptions) (*v1alpha1.ResourceBundleState, error)\r
34         List(opts v1.ListOptions) (*v1alpha1.ResourceBundleStateList, error)\r
35         Watch(opts v1.ListOptions) (watch.Interface, error)\r
36         Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ResourceBundleState, err error)\r
37         ResourceBundleStateExpansion\r
38 }\r
39 \r
40 // resourceBundleStates implements ResourceBundleStateInterface\r
41 type resourceBundleStates struct {\r
42         client rest.Interface\r
43         ns     string\r
44 }\r
45 \r
46 // newResourceBundleStates returns a ResourceBundleStates\r
47 func newResourceBundleStates(c *K8spluginV1alpha1Client, namespace string) *resourceBundleStates {\r
48         return &resourceBundleStates{\r
49                 client: c.RESTClient(),\r
50                 ns:     namespace,\r
51         }\r
52 }\r
53 \r
54 // Get takes name of the resourceBundleState, and returns the corresponding resourceBundleState object, and an error if there is any.\r
55 func (c *resourceBundleStates) Get(name string, options v1.GetOptions) (result *v1alpha1.ResourceBundleState, err error) {\r
56         result = &v1alpha1.ResourceBundleState{}\r
57         err = c.client.Get().\r
58                 Namespace(c.ns).\r
59                 Resource("resourcebundlestates").\r
60                 Name(name).\r
61                 VersionedParams(&options, scheme.ParameterCodec).\r
62                 Do(context.TODO()).\r
63                 Into(result)\r
64         return\r
65 }\r
66 \r
67 // List takes label and field selectors, and returns the list of ResourceBundleStates that match those selectors.\r
68 func (c *resourceBundleStates) List(opts v1.ListOptions) (result *v1alpha1.ResourceBundleStateList, err error) {\r
69         var timeout time.Duration\r
70         if opts.TimeoutSeconds != nil {\r
71                 timeout = time.Duration(*opts.TimeoutSeconds) * time.Second\r
72         }\r
73         result = &v1alpha1.ResourceBundleStateList{}\r
74         err = c.client.Get().\r
75                 Namespace(c.ns).\r
76                 Resource("resourcebundlestates").\r
77                 VersionedParams(&opts, scheme.ParameterCodec).\r
78                 Timeout(timeout).\r
79                 Do(context.TODO()).\r
80                 Into(result)\r
81         return\r
82 }\r
83 \r
84 // Watch returns a watch.Interface that watches the requested resourceBundleStates.\r
85 func (c *resourceBundleStates) Watch(opts v1.ListOptions) (watch.Interface, error) {\r
86         var timeout time.Duration\r
87         if opts.TimeoutSeconds != nil {\r
88                 timeout = time.Duration(*opts.TimeoutSeconds) * time.Second\r
89         }\r
90         opts.Watch = true\r
91         return c.client.Get().\r
92                 Namespace(c.ns).\r
93                 Resource("resourcebundlestates").\r
94                 VersionedParams(&opts, scheme.ParameterCodec).\r
95                 Timeout(timeout).\r
96                 Watch(context.TODO())\r
97 }\r
98 \r
99 // Create takes the representation of a resourceBundleState and creates it.  Returns the server's representation of the resourceBundleState, and an error, if there is any.\r
100 func (c *resourceBundleStates) Create(resourceBundleState *v1alpha1.ResourceBundleState) (result *v1alpha1.ResourceBundleState, err error) {\r
101         result = &v1alpha1.ResourceBundleState{}\r
102         err = c.client.Post().\r
103                 Namespace(c.ns).\r
104                 Resource("resourcebundlestates").\r
105                 Body(resourceBundleState).\r
106                 Do(context.TODO()).\r
107                 Into(result)\r
108         return\r
109 }\r
110 \r
111 // Update takes the representation of a resourceBundleState and updates it. Returns the server's representation of the resourceBundleState, and an error, if there is any.\r
112 func (c *resourceBundleStates) Update(resourceBundleState *v1alpha1.ResourceBundleState) (result *v1alpha1.ResourceBundleState, err error) {\r
113         result = &v1alpha1.ResourceBundleState{}\r
114         err = c.client.Put().\r
115                 Namespace(c.ns).\r
116                 Resource("resourcebundlestates").\r
117                 Name(resourceBundleState.Name).\r
118                 Body(resourceBundleState).\r
119                 Do(context.TODO()).\r
120                 Into(result)\r
121         return\r
122 }\r
123 \r
124 // UpdateStatus was generated because the type contains a Status member.\r
125 // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().\r
126 \r
127 func (c *resourceBundleStates) UpdateStatus(resourceBundleState *v1alpha1.ResourceBundleState) (result *v1alpha1.ResourceBundleState, err error) {\r
128         result = &v1alpha1.ResourceBundleState{}\r
129         err = c.client.Put().\r
130                 Namespace(c.ns).\r
131                 Resource("resourcebundlestates").\r
132                 Name(resourceBundleState.Name).\r
133                 SubResource("status").\r
134                 Body(resourceBundleState).\r
135                 Do(context.TODO()).\r
136                 Into(result)\r
137         return\r
138 }\r
139 \r
140 // Delete takes name of the resourceBundleState and deletes it. Returns an error if one occurs.\r
141 func (c *resourceBundleStates) Delete(name string, options *v1.DeleteOptions) error {\r
142         return c.client.Delete().\r
143                 Namespace(c.ns).\r
144                 Resource("resourcebundlestates").\r
145                 Name(name).\r
146                 Body(options).\r
147                 Do(context.TODO()).\r
148                 Error()\r
149 }\r
150 \r
151 // DeleteCollection deletes a collection of objects.\r
152 func (c *resourceBundleStates) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {\r
153         var timeout time.Duration\r
154         if listOptions.TimeoutSeconds != nil {\r
155                 timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second\r
156         }\r
157         return c.client.Delete().\r
158                 Namespace(c.ns).\r
159                 Resource("resourcebundlestates").\r
160                 VersionedParams(&listOptions, scheme.ParameterCodec).\r
161                 Timeout(timeout).\r
162                 Body(options).\r
163                 Do(context.TODO()).\r
164                 Error()\r
165 }\r
166 \r
167 // Patch applies the patch and returns the patched resourceBundleState.\r
168 func (c *resourceBundleStates) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ResourceBundleState, err error) {\r
169         result = &v1alpha1.ResourceBundleState{}\r
170         err = c.client.Patch(pt).\r
171                 Namespace(c.ns).\r
172                 Resource("resourcebundlestates").\r
173                 SubResource(subresources...).\r
174                 Name(name).\r
175                 Body(data).\r
176                 Do(context.TODO()).\r
177                 Into(result)\r
178         return\r
179 }\r