blob: 1271cc623fef4f9a64ed17c955f235dfcc5120a2 [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 v1beta2
20
21import (
22 v1beta2 "k8s.io/api/apps/v1beta2"
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// ControllerRevisionsGetter has a method to return a ControllerRevisionInterface.
31// A group's client should implement this interface.
32type ControllerRevisionsGetter interface {
33 ControllerRevisions(namespace string) ControllerRevisionInterface
34}
35
36// ControllerRevisionInterface has methods to work with ControllerRevision resources.
37type ControllerRevisionInterface interface {
38 Create(*v1beta2.ControllerRevision) (*v1beta2.ControllerRevision, error)
39 Update(*v1beta2.ControllerRevision) (*v1beta2.ControllerRevision, error)
40 Delete(name string, options *v1.DeleteOptions) error
41 DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
42 Get(name string, options v1.GetOptions) (*v1beta2.ControllerRevision, error)
43 List(opts v1.ListOptions) (*v1beta2.ControllerRevisionList, error)
44 Watch(opts v1.ListOptions) (watch.Interface, error)
45 Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta2.ControllerRevision, err error)
46 ControllerRevisionExpansion
47}
48
49// controllerRevisions implements ControllerRevisionInterface
50type controllerRevisions struct {
51 client rest.Interface
52 ns string
53}
54
55// newControllerRevisions returns a ControllerRevisions
56func newControllerRevisions(c *AppsV1beta2Client, namespace string) *controllerRevisions {
57 return &controllerRevisions{
58 client: c.RESTClient(),
59 ns: namespace,
60 }
61}
62
63// Get takes name of the controllerRevision, and returns the corresponding controllerRevision object, and an error if there is any.
64func (c *controllerRevisions) Get(name string, options v1.GetOptions) (result *v1beta2.ControllerRevision, err error) {
65 result = &v1beta2.ControllerRevision{}
66 err = c.client.Get().
67 Namespace(c.ns).
68 Resource("controllerrevisions").
69 Name(name).
70 VersionedParams(&options, scheme.ParameterCodec).
71 Do().
72 Into(result)
73 return
74}
75
76// List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors.
77func (c *controllerRevisions) List(opts v1.ListOptions) (result *v1beta2.ControllerRevisionList, err error) {
78 result = &v1beta2.ControllerRevisionList{}
79 err = c.client.Get().
80 Namespace(c.ns).
81 Resource("controllerrevisions").
82 VersionedParams(&opts, scheme.ParameterCodec).
83 Do().
84 Into(result)
85 return
86}
87
88// Watch returns a watch.Interface that watches the requested controllerRevisions.
89func (c *controllerRevisions) Watch(opts v1.ListOptions) (watch.Interface, error) {
90 opts.Watch = true
91 return c.client.Get().
92 Namespace(c.ns).
93 Resource("controllerrevisions").
94 VersionedParams(&opts, scheme.ParameterCodec).
95 Watch()
96}
97
98// Create takes the representation of a controllerRevision and creates it. Returns the server's representation of the controllerRevision, and an error, if there is any.
99func (c *controllerRevisions) Create(controllerRevision *v1beta2.ControllerRevision) (result *v1beta2.ControllerRevision, err error) {
100 result = &v1beta2.ControllerRevision{}
101 err = c.client.Post().
102 Namespace(c.ns).
103 Resource("controllerrevisions").
104 Body(controllerRevision).
105 Do().
106 Into(result)
107 return
108}
109
110// Update takes the representation of a controllerRevision and updates it. Returns the server's representation of the controllerRevision, and an error, if there is any.
111func (c *controllerRevisions) Update(controllerRevision *v1beta2.ControllerRevision) (result *v1beta2.ControllerRevision, err error) {
112 result = &v1beta2.ControllerRevision{}
113 err = c.client.Put().
114 Namespace(c.ns).
115 Resource("controllerrevisions").
116 Name(controllerRevision.Name).
117 Body(controllerRevision).
118 Do().
119 Into(result)
120 return
121}
122
123// Delete takes name of the controllerRevision and deletes it. Returns an error if one occurs.
124func (c *controllerRevisions) Delete(name string, options *v1.DeleteOptions) error {
125 return c.client.Delete().
126 Namespace(c.ns).
127 Resource("controllerrevisions").
128 Name(name).
129 Body(options).
130 Do().
131 Error()
132}
133
134// DeleteCollection deletes a collection of objects.
135func (c *controllerRevisions) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
136 return c.client.Delete().
137 Namespace(c.ns).
138 Resource("controllerrevisions").
139 VersionedParams(&listOptions, scheme.ParameterCodec).
140 Body(options).
141 Do().
142 Error()
143}
144
145// Patch applies the patch and returns the patched controllerRevision.
146func (c *controllerRevisions) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta2.ControllerRevision, err error) {
147 result = &v1beta2.ControllerRevision{}
148 err = c.client.Patch(pt).
149 Namespace(c.ns).
150 Resource("controllerrevisions").
151 SubResource(subresources...).
152 Name(name).
153 Body(data).
154 Do().
155 Into(result)
156 return
157}