Matteo Scandolo | a428586 | 2020-12-01 18:10:10 -0800 | [diff] [blame] | 1 | /* |
| 2 | Copyright The Kubernetes Authors. |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | // Code generated by client-gen. DO NOT EDIT. |
| 18 | |
| 19 | package v1beta1 |
| 20 | |
| 21 | import ( |
| 22 | "context" |
| 23 | "time" |
| 24 | |
| 25 | v1beta1 "k8s.io/api/extensions/v1beta1" |
| 26 | v1 "k8s.io/apimachinery/pkg/apis/meta/v1" |
| 27 | types "k8s.io/apimachinery/pkg/types" |
| 28 | watch "k8s.io/apimachinery/pkg/watch" |
| 29 | scheme "k8s.io/client-go/kubernetes/scheme" |
| 30 | rest "k8s.io/client-go/rest" |
| 31 | ) |
| 32 | |
| 33 | // DaemonSetsGetter has a method to return a DaemonSetInterface. |
| 34 | // A group's client should implement this interface. |
| 35 | type DaemonSetsGetter interface { |
| 36 | DaemonSets(namespace string) DaemonSetInterface |
| 37 | } |
| 38 | |
| 39 | // DaemonSetInterface has methods to work with DaemonSet resources. |
| 40 | type DaemonSetInterface interface { |
| 41 | Create(ctx context.Context, daemonSet *v1beta1.DaemonSet, opts v1.CreateOptions) (*v1beta1.DaemonSet, error) |
| 42 | Update(ctx context.Context, daemonSet *v1beta1.DaemonSet, opts v1.UpdateOptions) (*v1beta1.DaemonSet, error) |
| 43 | UpdateStatus(ctx context.Context, daemonSet *v1beta1.DaemonSet, opts v1.UpdateOptions) (*v1beta1.DaemonSet, error) |
| 44 | Delete(ctx context.Context, name string, opts v1.DeleteOptions) error |
| 45 | DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error |
| 46 | Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.DaemonSet, error) |
| 47 | List(ctx context.Context, opts v1.ListOptions) (*v1beta1.DaemonSetList, error) |
| 48 | Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) |
| 49 | Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.DaemonSet, err error) |
| 50 | DaemonSetExpansion |
| 51 | } |
| 52 | |
| 53 | // daemonSets implements DaemonSetInterface |
| 54 | type daemonSets struct { |
| 55 | client rest.Interface |
| 56 | ns string |
| 57 | } |
| 58 | |
| 59 | // newDaemonSets returns a DaemonSets |
| 60 | func newDaemonSets(c *ExtensionsV1beta1Client, namespace string) *daemonSets { |
| 61 | return &daemonSets{ |
| 62 | client: c.RESTClient(), |
| 63 | ns: namespace, |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | // Get takes name of the daemonSet, and returns the corresponding daemonSet object, and an error if there is any. |
| 68 | func (c *daemonSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.DaemonSet, err error) { |
| 69 | result = &v1beta1.DaemonSet{} |
| 70 | err = c.client.Get(). |
| 71 | Namespace(c.ns). |
| 72 | Resource("daemonsets"). |
| 73 | Name(name). |
| 74 | VersionedParams(&options, scheme.ParameterCodec). |
| 75 | Do(ctx). |
| 76 | Into(result) |
| 77 | return |
| 78 | } |
| 79 | |
| 80 | // List takes label and field selectors, and returns the list of DaemonSets that match those selectors. |
| 81 | func (c *daemonSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DaemonSetList, err error) { |
| 82 | var timeout time.Duration |
| 83 | if opts.TimeoutSeconds != nil { |
| 84 | timeout = time.Duration(*opts.TimeoutSeconds) * time.Second |
| 85 | } |
| 86 | result = &v1beta1.DaemonSetList{} |
| 87 | err = c.client.Get(). |
| 88 | Namespace(c.ns). |
| 89 | Resource("daemonsets"). |
| 90 | VersionedParams(&opts, scheme.ParameterCodec). |
| 91 | Timeout(timeout). |
| 92 | Do(ctx). |
| 93 | Into(result) |
| 94 | return |
| 95 | } |
| 96 | |
| 97 | // Watch returns a watch.Interface that watches the requested daemonSets. |
| 98 | func (c *daemonSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { |
| 99 | var timeout time.Duration |
| 100 | if opts.TimeoutSeconds != nil { |
| 101 | timeout = time.Duration(*opts.TimeoutSeconds) * time.Second |
| 102 | } |
| 103 | opts.Watch = true |
| 104 | return c.client.Get(). |
| 105 | Namespace(c.ns). |
| 106 | Resource("daemonsets"). |
| 107 | VersionedParams(&opts, scheme.ParameterCodec). |
| 108 | Timeout(timeout). |
| 109 | Watch(ctx) |
| 110 | } |
| 111 | |
| 112 | // Create takes the representation of a daemonSet and creates it. Returns the server's representation of the daemonSet, and an error, if there is any. |
| 113 | func (c *daemonSets) Create(ctx context.Context, daemonSet *v1beta1.DaemonSet, opts v1.CreateOptions) (result *v1beta1.DaemonSet, err error) { |
| 114 | result = &v1beta1.DaemonSet{} |
| 115 | err = c.client.Post(). |
| 116 | Namespace(c.ns). |
| 117 | Resource("daemonsets"). |
| 118 | VersionedParams(&opts, scheme.ParameterCodec). |
| 119 | Body(daemonSet). |
| 120 | Do(ctx). |
| 121 | Into(result) |
| 122 | return |
| 123 | } |
| 124 | |
| 125 | // Update takes the representation of a daemonSet and updates it. Returns the server's representation of the daemonSet, and an error, if there is any. |
| 126 | func (c *daemonSets) Update(ctx context.Context, daemonSet *v1beta1.DaemonSet, opts v1.UpdateOptions) (result *v1beta1.DaemonSet, err error) { |
| 127 | result = &v1beta1.DaemonSet{} |
| 128 | err = c.client.Put(). |
| 129 | Namespace(c.ns). |
| 130 | Resource("daemonsets"). |
| 131 | Name(daemonSet.Name). |
| 132 | VersionedParams(&opts, scheme.ParameterCodec). |
| 133 | Body(daemonSet). |
| 134 | Do(ctx). |
| 135 | Into(result) |
| 136 | return |
| 137 | } |
| 138 | |
| 139 | // UpdateStatus was generated because the type contains a Status member. |
| 140 | // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). |
| 141 | func (c *daemonSets) UpdateStatus(ctx context.Context, daemonSet *v1beta1.DaemonSet, opts v1.UpdateOptions) (result *v1beta1.DaemonSet, err error) { |
| 142 | result = &v1beta1.DaemonSet{} |
| 143 | err = c.client.Put(). |
| 144 | Namespace(c.ns). |
| 145 | Resource("daemonsets"). |
| 146 | Name(daemonSet.Name). |
| 147 | SubResource("status"). |
| 148 | VersionedParams(&opts, scheme.ParameterCodec). |
| 149 | Body(daemonSet). |
| 150 | Do(ctx). |
| 151 | Into(result) |
| 152 | return |
| 153 | } |
| 154 | |
| 155 | // Delete takes name of the daemonSet and deletes it. Returns an error if one occurs. |
| 156 | func (c *daemonSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { |
| 157 | return c.client.Delete(). |
| 158 | Namespace(c.ns). |
| 159 | Resource("daemonsets"). |
| 160 | Name(name). |
| 161 | Body(&opts). |
| 162 | Do(ctx). |
| 163 | Error() |
| 164 | } |
| 165 | |
| 166 | // DeleteCollection deletes a collection of objects. |
| 167 | func (c *daemonSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { |
| 168 | var timeout time.Duration |
| 169 | if listOpts.TimeoutSeconds != nil { |
| 170 | timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second |
| 171 | } |
| 172 | return c.client.Delete(). |
| 173 | Namespace(c.ns). |
| 174 | Resource("daemonsets"). |
| 175 | VersionedParams(&listOpts, scheme.ParameterCodec). |
| 176 | Timeout(timeout). |
| 177 | Body(&opts). |
| 178 | Do(ctx). |
| 179 | Error() |
| 180 | } |
| 181 | |
| 182 | // Patch applies the patch and returns the patched daemonSet. |
| 183 | func (c *daemonSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.DaemonSet, err error) { |
| 184 | result = &v1beta1.DaemonSet{} |
| 185 | err = c.client.Patch(pt). |
| 186 | Namespace(c.ns). |
| 187 | Resource("daemonsets"). |
| 188 | Name(name). |
| 189 | SubResource(subresources...). |
| 190 | VersionedParams(&opts, scheme.ParameterCodec). |
| 191 | Body(data). |
| 192 | Do(ctx). |
| 193 | Into(result) |
| 194 | return |
| 195 | } |