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