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
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
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
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
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
40 // resourceBundleStates implements ResourceBundleStateInterface
\r
41 type resourceBundleStates struct {
\r
42 client rest.Interface
\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
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
59 Resource("resourcebundlestates").
\r
61 VersionedParams(&options, scheme.ParameterCodec).
\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
73 result = &v1alpha1.ResourceBundleStateList{}
\r
74 err = c.client.Get().
\r
76 Resource("resourcebundlestates").
\r
77 VersionedParams(&opts, scheme.ParameterCodec).
\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
91 return c.client.Get().
\r
93 Resource("resourcebundlestates").
\r
94 VersionedParams(&opts, scheme.ParameterCodec).
\r
96 Watch(context.TODO())
\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
104 Resource("resourcebundlestates").
\r
105 Body(resourceBundleState).
\r
106 Do(context.TODO()).
\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
116 Resource("resourcebundlestates").
\r
117 Name(resourceBundleState.Name).
\r
118 Body(resourceBundleState).
\r
119 Do(context.TODO()).
\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
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
131 Resource("resourcebundlestates").
\r
132 Name(resourceBundleState.Name).
\r
133 SubResource("status").
\r
134 Body(resourceBundleState).
\r
135 Do(context.TODO()).
\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
144 Resource("resourcebundlestates").
\r
147 Do(context.TODO()).
\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
157 return c.client.Delete().
\r
159 Resource("resourcebundlestates").
\r
160 VersionedParams(&listOptions, scheme.ParameterCodec).
\r
163 Do(context.TODO()).
\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
172 Resource("resourcebundlestates").
\r
173 SubResource(subresources...).
\r
176 Do(context.TODO()).
\r