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