sslobodr | d046be8 | 2019-01-16 10:02:22 -0500 | [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/extensions/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 | // DeploymentsGetter has a method to return a DeploymentInterface. |
| 33 | // A group's client should implement this interface. |
| 34 | type DeploymentsGetter interface { |
| 35 | Deployments(namespace string) DeploymentInterface |
| 36 | } |
| 37 | |
| 38 | // DeploymentInterface has methods to work with Deployment resources. |
| 39 | type DeploymentInterface interface { |
| 40 | Create(*v1beta1.Deployment) (*v1beta1.Deployment, error) |
| 41 | Update(*v1beta1.Deployment) (*v1beta1.Deployment, error) |
| 42 | UpdateStatus(*v1beta1.Deployment) (*v1beta1.Deployment, 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.Deployment, error) |
| 46 | List(opts v1.ListOptions) (*v1beta1.DeploymentList, error) |
| 47 | Watch(opts v1.ListOptions) (watch.Interface, error) |
| 48 | Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Deployment, err error) |
| 49 | GetScale(deploymentName string, options v1.GetOptions) (*v1beta1.Scale, error) |
| 50 | UpdateScale(deploymentName string, scale *v1beta1.Scale) (*v1beta1.Scale, error) |
| 51 | |
| 52 | DeploymentExpansion |
| 53 | } |
| 54 | |
| 55 | // deployments implements DeploymentInterface |
| 56 | type deployments struct { |
| 57 | client rest.Interface |
| 58 | ns string |
| 59 | } |
| 60 | |
| 61 | // newDeployments returns a Deployments |
| 62 | func newDeployments(c *ExtensionsV1beta1Client, namespace string) *deployments { |
| 63 | return &deployments{ |
| 64 | client: c.RESTClient(), |
| 65 | ns: namespace, |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | // Get takes name of the deployment, and returns the corresponding deployment object, and an error if there is any. |
| 70 | func (c *deployments) Get(name string, options v1.GetOptions) (result *v1beta1.Deployment, err error) { |
| 71 | result = &v1beta1.Deployment{} |
| 72 | err = c.client.Get(). |
| 73 | Namespace(c.ns). |
| 74 | Resource("deployments"). |
| 75 | Name(name). |
| 76 | VersionedParams(&options, scheme.ParameterCodec). |
| 77 | Do(). |
| 78 | Into(result) |
| 79 | return |
| 80 | } |
| 81 | |
| 82 | // List takes label and field selectors, and returns the list of Deployments that match those selectors. |
| 83 | func (c *deployments) List(opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) { |
| 84 | var timeout time.Duration |
| 85 | if opts.TimeoutSeconds != nil { |
| 86 | timeout = time.Duration(*opts.TimeoutSeconds) * time.Second |
| 87 | } |
| 88 | result = &v1beta1.DeploymentList{} |
| 89 | err = c.client.Get(). |
| 90 | Namespace(c.ns). |
| 91 | Resource("deployments"). |
| 92 | VersionedParams(&opts, scheme.ParameterCodec). |
| 93 | Timeout(timeout). |
| 94 | Do(). |
| 95 | Into(result) |
| 96 | return |
| 97 | } |
| 98 | |
| 99 | // Watch returns a watch.Interface that watches the requested deployments. |
| 100 | func (c *deployments) Watch(opts v1.ListOptions) (watch.Interface, error) { |
| 101 | var timeout time.Duration |
| 102 | if opts.TimeoutSeconds != nil { |
| 103 | timeout = time.Duration(*opts.TimeoutSeconds) * time.Second |
| 104 | } |
| 105 | opts.Watch = true |
| 106 | return c.client.Get(). |
| 107 | Namespace(c.ns). |
| 108 | Resource("deployments"). |
| 109 | VersionedParams(&opts, scheme.ParameterCodec). |
| 110 | Timeout(timeout). |
| 111 | Watch() |
| 112 | } |
| 113 | |
| 114 | // Create takes the representation of a deployment and creates it. Returns the server's representation of the deployment, and an error, if there is any. |
| 115 | func (c *deployments) Create(deployment *v1beta1.Deployment) (result *v1beta1.Deployment, err error) { |
| 116 | result = &v1beta1.Deployment{} |
| 117 | err = c.client.Post(). |
| 118 | Namespace(c.ns). |
| 119 | Resource("deployments"). |
| 120 | Body(deployment). |
| 121 | Do(). |
| 122 | Into(result) |
| 123 | return |
| 124 | } |
| 125 | |
| 126 | // Update takes the representation of a deployment and updates it. Returns the server's representation of the deployment, and an error, if there is any. |
| 127 | func (c *deployments) Update(deployment *v1beta1.Deployment) (result *v1beta1.Deployment, err error) { |
| 128 | result = &v1beta1.Deployment{} |
| 129 | err = c.client.Put(). |
| 130 | Namespace(c.ns). |
| 131 | Resource("deployments"). |
| 132 | Name(deployment.Name). |
| 133 | Body(deployment). |
| 134 | Do(). |
| 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 | |
| 142 | func (c *deployments) UpdateStatus(deployment *v1beta1.Deployment) (result *v1beta1.Deployment, err error) { |
| 143 | result = &v1beta1.Deployment{} |
| 144 | err = c.client.Put(). |
| 145 | Namespace(c.ns). |
| 146 | Resource("deployments"). |
| 147 | Name(deployment.Name). |
| 148 | SubResource("status"). |
| 149 | Body(deployment). |
| 150 | Do(). |
| 151 | Into(result) |
| 152 | return |
| 153 | } |
| 154 | |
| 155 | // Delete takes name of the deployment and deletes it. Returns an error if one occurs. |
| 156 | func (c *deployments) Delete(name string, options *v1.DeleteOptions) error { |
| 157 | return c.client.Delete(). |
| 158 | Namespace(c.ns). |
| 159 | Resource("deployments"). |
| 160 | Name(name). |
| 161 | Body(options). |
| 162 | Do(). |
| 163 | Error() |
| 164 | } |
| 165 | |
| 166 | // DeleteCollection deletes a collection of objects. |
| 167 | func (c *deployments) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { |
| 168 | var timeout time.Duration |
| 169 | if listOptions.TimeoutSeconds != nil { |
| 170 | timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second |
| 171 | } |
| 172 | return c.client.Delete(). |
| 173 | Namespace(c.ns). |
| 174 | Resource("deployments"). |
| 175 | VersionedParams(&listOptions, scheme.ParameterCodec). |
| 176 | Timeout(timeout). |
| 177 | Body(options). |
| 178 | Do(). |
| 179 | Error() |
| 180 | } |
| 181 | |
| 182 | // Patch applies the patch and returns the patched deployment. |
| 183 | func (c *deployments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Deployment, err error) { |
| 184 | result = &v1beta1.Deployment{} |
| 185 | err = c.client.Patch(pt). |
| 186 | Namespace(c.ns). |
| 187 | Resource("deployments"). |
| 188 | SubResource(subresources...). |
| 189 | Name(name). |
| 190 | Body(data). |
| 191 | Do(). |
| 192 | Into(result) |
| 193 | return |
| 194 | } |
| 195 | |
| 196 | // GetScale takes name of the deployment, and returns the corresponding v1beta1.Scale object, and an error if there is any. |
| 197 | func (c *deployments) GetScale(deploymentName string, options v1.GetOptions) (result *v1beta1.Scale, err error) { |
| 198 | result = &v1beta1.Scale{} |
| 199 | err = c.client.Get(). |
| 200 | Namespace(c.ns). |
| 201 | Resource("deployments"). |
| 202 | Name(deploymentName). |
| 203 | SubResource("scale"). |
| 204 | VersionedParams(&options, scheme.ParameterCodec). |
| 205 | Do(). |
| 206 | Into(result) |
| 207 | return |
| 208 | } |
| 209 | |
| 210 | // UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. |
| 211 | func (c *deployments) UpdateScale(deploymentName string, scale *v1beta1.Scale) (result *v1beta1.Scale, err error) { |
| 212 | result = &v1beta1.Scale{} |
| 213 | err = c.client.Put(). |
| 214 | Namespace(c.ns). |
| 215 | Resource("deployments"). |
| 216 | Name(deploymentName). |
| 217 | SubResource("scale"). |
| 218 | Body(scale). |
| 219 | Do(). |
| 220 | Into(result) |
| 221 | return |
| 222 | } |