1 // SPDX-License-Identifier: Apache-2.0
2 // Copyright (c) 2020 Intel Corporation
3 // Code generated by client-gen. DO NOT EDIT.
11 v1alpha1 "github.com/open-ness/EMCO/src/monitor/pkg/apis/k8splugin/v1alpha1"
12 scheme "github.com/open-ness/EMCO/src/monitor/pkg/generated/clientset/versioned/scheme"
14 v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
15 types "k8s.io/apimachinery/pkg/types"
16 watch "k8s.io/apimachinery/pkg/watch"
17 rest "k8s.io/client-go/rest"
20 // ResourceBundleStatesGetter has a method to return a ResourceBundleStateInterface.
21 // A group's client should implement this interface.
22 type ResourceBundleStatesGetter interface {
23 ResourceBundleStates(namespace string) ResourceBundleStateInterface
26 // ResourceBundleStateInterface has methods to work with ResourceBundleState resources.
27 type ResourceBundleStateInterface interface {
28 Create(*v1alpha1.ResourceBundleState) (*v1alpha1.ResourceBundleState, error)
29 Update(*v1alpha1.ResourceBundleState) (*v1alpha1.ResourceBundleState, error)
30 UpdateStatus(*v1alpha1.ResourceBundleState) (*v1alpha1.ResourceBundleState, error)
31 Delete(name string, options *v1.DeleteOptions) error
32 DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
33 Get(name string, options v1.GetOptions) (*v1alpha1.ResourceBundleState, error)
34 List(opts v1.ListOptions) (*v1alpha1.ResourceBundleStateList, error)
35 Watch(opts v1.ListOptions) (watch.Interface, error)
36 Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ResourceBundleState, err error)
37 ResourceBundleStateExpansion
40 // resourceBundleStates implements ResourceBundleStateInterface
41 type resourceBundleStates struct {
46 // newResourceBundleStates returns a ResourceBundleStates
47 func newResourceBundleStates(c *K8spluginV1alpha1Client, namespace string) *resourceBundleStates {
48 return &resourceBundleStates{
49 client: c.RESTClient(),
54 // Get takes name of the resourceBundleState, and returns the corresponding resourceBundleState object, and an error if there is any.
55 func (c *resourceBundleStates) Get(name string, options v1.GetOptions) (result *v1alpha1.ResourceBundleState, err error) {
56 result = &v1alpha1.ResourceBundleState{}
59 Resource("resourcebundlestates").
61 VersionedParams(&options, scheme.ParameterCodec).
67 // List takes label and field selectors, and returns the list of ResourceBundleStates that match those selectors.
68 func (c *resourceBundleStates) List(opts v1.ListOptions) (result *v1alpha1.ResourceBundleStateList, err error) {
69 var timeout time.Duration
70 if opts.TimeoutSeconds != nil {
71 timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
73 result = &v1alpha1.ResourceBundleStateList{}
76 Resource("resourcebundlestates").
77 VersionedParams(&opts, scheme.ParameterCodec).
84 // Watch returns a watch.Interface that watches the requested resourceBundleStates.
85 func (c *resourceBundleStates) Watch(opts v1.ListOptions) (watch.Interface, error) {
86 var timeout time.Duration
87 if opts.TimeoutSeconds != nil {
88 timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
91 return c.client.Get().
93 Resource("resourcebundlestates").
94 VersionedParams(&opts, scheme.ParameterCodec).
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.
100 func (c *resourceBundleStates) Create(resourceBundleState *v1alpha1.ResourceBundleState) (result *v1alpha1.ResourceBundleState, err error) {
101 result = &v1alpha1.ResourceBundleState{}
102 err = c.client.Post().
104 Resource("resourcebundlestates").
105 Body(resourceBundleState).
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.
112 func (c *resourceBundleStates) Update(resourceBundleState *v1alpha1.ResourceBundleState) (result *v1alpha1.ResourceBundleState, err error) {
113 result = &v1alpha1.ResourceBundleState{}
114 err = c.client.Put().
116 Resource("resourcebundlestates").
117 Name(resourceBundleState.Name).
118 Body(resourceBundleState).
124 // UpdateStatus was generated because the type contains a Status member.
125 // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
127 func (c *resourceBundleStates) UpdateStatus(resourceBundleState *v1alpha1.ResourceBundleState) (result *v1alpha1.ResourceBundleState, err error) {
128 result = &v1alpha1.ResourceBundleState{}
129 err = c.client.Put().
131 Resource("resourcebundlestates").
132 Name(resourceBundleState.Name).
133 SubResource("status").
134 Body(resourceBundleState).
140 // Delete takes name of the resourceBundleState and deletes it. Returns an error if one occurs.
141 func (c *resourceBundleStates) Delete(name string, options *v1.DeleteOptions) error {
142 return c.client.Delete().
144 Resource("resourcebundlestates").
151 // DeleteCollection deletes a collection of objects.
152 func (c *resourceBundleStates) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
153 var timeout time.Duration
154 if listOptions.TimeoutSeconds != nil {
155 timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
157 return c.client.Delete().
159 Resource("resourcebundlestates").
160 VersionedParams(&listOptions, scheme.ParameterCodec).
167 // Patch applies the patch and returns the patched resourceBundleState.
168 func (c *resourceBundleStates) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ResourceBundleState, err error) {
169 result = &v1alpha1.ResourceBundleState{}
170 err = c.client.Patch(pt).
172 Resource("resourcebundlestates").
173 SubResource(subresources...).