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