2 Copyright The Kubernetes Authors.
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
8 http://www.apache.org/licenses/LICENSE-2.0
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.
17 // Code generated by client-gen. DO NOT EDIT.
24 v1 "k8s.io/api/apps/v1"
25 metav1 "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"
32 // ControllerRevisionsGetter has a method to return a ControllerRevisionInterface.
33 // A group's client should implement this interface.
34 type ControllerRevisionsGetter interface {
35 ControllerRevisions(namespace string) ControllerRevisionInterface
38 // ControllerRevisionInterface has methods to work with ControllerRevision resources.
39 type ControllerRevisionInterface interface {
40 Create(*v1.ControllerRevision) (*v1.ControllerRevision, error)
41 Update(*v1.ControllerRevision) (*v1.ControllerRevision, error)
42 Delete(name string, options *metav1.DeleteOptions) error
43 DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
44 Get(name string, options metav1.GetOptions) (*v1.ControllerRevision, error)
45 List(opts metav1.ListOptions) (*v1.ControllerRevisionList, error)
46 Watch(opts metav1.ListOptions) (watch.Interface, error)
47 Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ControllerRevision, err error)
48 ControllerRevisionExpansion
51 // controllerRevisions implements ControllerRevisionInterface
52 type controllerRevisions struct {
57 // newControllerRevisions returns a ControllerRevisions
58 func newControllerRevisions(c *AppsV1Client, namespace string) *controllerRevisions {
59 return &controllerRevisions{
60 client: c.RESTClient(),
65 // Get takes name of the controllerRevision, and returns the corresponding controllerRevision object, and an error if there is any.
66 func (c *controllerRevisions) Get(name string, options metav1.GetOptions) (result *v1.ControllerRevision, err error) {
67 result = &v1.ControllerRevision{}
70 Resource("controllerrevisions").
72 VersionedParams(&options, scheme.ParameterCodec).
78 // List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors.
79 func (c *controllerRevisions) List(opts metav1.ListOptions) (result *v1.ControllerRevisionList, err error) {
80 var timeout time.Duration
81 if opts.TimeoutSeconds != nil {
82 timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
84 result = &v1.ControllerRevisionList{}
87 Resource("controllerrevisions").
88 VersionedParams(&opts, scheme.ParameterCodec).
95 // Watch returns a watch.Interface that watches the requested controllerRevisions.
96 func (c *controllerRevisions) Watch(opts metav1.ListOptions) (watch.Interface, error) {
97 var timeout time.Duration
98 if opts.TimeoutSeconds != nil {
99 timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
102 return c.client.Get().
104 Resource("controllerrevisions").
105 VersionedParams(&opts, scheme.ParameterCodec).
110 // 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.
111 func (c *controllerRevisions) Create(controllerRevision *v1.ControllerRevision) (result *v1.ControllerRevision, err error) {
112 result = &v1.ControllerRevision{}
113 err = c.client.Post().
115 Resource("controllerrevisions").
116 Body(controllerRevision).
122 // 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.
123 func (c *controllerRevisions) Update(controllerRevision *v1.ControllerRevision) (result *v1.ControllerRevision, err error) {
124 result = &v1.ControllerRevision{}
125 err = c.client.Put().
127 Resource("controllerrevisions").
128 Name(controllerRevision.Name).
129 Body(controllerRevision).
135 // Delete takes name of the controllerRevision and deletes it. Returns an error if one occurs.
136 func (c *controllerRevisions) Delete(name string, options *metav1.DeleteOptions) error {
137 return c.client.Delete().
139 Resource("controllerrevisions").
146 // DeleteCollection deletes a collection of objects.
147 func (c *controllerRevisions) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
148 var timeout time.Duration
149 if listOptions.TimeoutSeconds != nil {
150 timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
152 return c.client.Delete().
154 Resource("controllerrevisions").
155 VersionedParams(&listOptions, scheme.ParameterCodec).
162 // Patch applies the patch and returns the patched controllerRevision.
163 func (c *controllerRevisions) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ControllerRevision, err error) {
164 result = &v1.ControllerRevision{}
165 err = c.client.Patch(pt).
167 Resource("controllerrevisions").
168 SubResource(subresources...).