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 v1alpha1 "k8s.io/api/storage/v1alpha1"
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"
32 // VolumeAttachmentsGetter has a method to return a VolumeAttachmentInterface.
33 // A group's client should implement this interface.
34 type VolumeAttachmentsGetter interface {
35 VolumeAttachments() VolumeAttachmentInterface
38 // VolumeAttachmentInterface has methods to work with VolumeAttachment resources.
39 type VolumeAttachmentInterface interface {
40 Create(*v1alpha1.VolumeAttachment) (*v1alpha1.VolumeAttachment, error)
41 Update(*v1alpha1.VolumeAttachment) (*v1alpha1.VolumeAttachment, error)
42 UpdateStatus(*v1alpha1.VolumeAttachment) (*v1alpha1.VolumeAttachment, 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) (*v1alpha1.VolumeAttachment, error)
46 List(opts v1.ListOptions) (*v1alpha1.VolumeAttachmentList, error)
47 Watch(opts v1.ListOptions) (watch.Interface, error)
48 Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.VolumeAttachment, err error)
49 VolumeAttachmentExpansion
52 // volumeAttachments implements VolumeAttachmentInterface
53 type volumeAttachments struct {
57 // newVolumeAttachments returns a VolumeAttachments
58 func newVolumeAttachments(c *StorageV1alpha1Client) *volumeAttachments {
59 return &volumeAttachments{
60 client: c.RESTClient(),
64 // Get takes name of the volumeAttachment, and returns the corresponding volumeAttachment object, and an error if there is any.
65 func (c *volumeAttachments) Get(name string, options v1.GetOptions) (result *v1alpha1.VolumeAttachment, err error) {
66 result = &v1alpha1.VolumeAttachment{}
68 Resource("volumeattachments").
70 VersionedParams(&options, scheme.ParameterCodec).
76 // List takes label and field selectors, and returns the list of VolumeAttachments that match those selectors.
77 func (c *volumeAttachments) List(opts v1.ListOptions) (result *v1alpha1.VolumeAttachmentList, err error) {
78 var timeout time.Duration
79 if opts.TimeoutSeconds != nil {
80 timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
82 result = &v1alpha1.VolumeAttachmentList{}
84 Resource("volumeattachments").
85 VersionedParams(&opts, scheme.ParameterCodec).
92 // Watch returns a watch.Interface that watches the requested volumeAttachments.
93 func (c *volumeAttachments) Watch(opts v1.ListOptions) (watch.Interface, error) {
94 var timeout time.Duration
95 if opts.TimeoutSeconds != nil {
96 timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
99 return c.client.Get().
100 Resource("volumeattachments").
101 VersionedParams(&opts, scheme.ParameterCodec).
106 // 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.
107 func (c *volumeAttachments) Create(volumeAttachment *v1alpha1.VolumeAttachment) (result *v1alpha1.VolumeAttachment, err error) {
108 result = &v1alpha1.VolumeAttachment{}
109 err = c.client.Post().
110 Resource("volumeattachments").
111 Body(volumeAttachment).
117 // 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.
118 func (c *volumeAttachments) Update(volumeAttachment *v1alpha1.VolumeAttachment) (result *v1alpha1.VolumeAttachment, err error) {
119 result = &v1alpha1.VolumeAttachment{}
120 err = c.client.Put().
121 Resource("volumeattachments").
122 Name(volumeAttachment.Name).
123 Body(volumeAttachment).
129 // UpdateStatus was generated because the type contains a Status member.
130 // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
132 func (c *volumeAttachments) UpdateStatus(volumeAttachment *v1alpha1.VolumeAttachment) (result *v1alpha1.VolumeAttachment, err error) {
133 result = &v1alpha1.VolumeAttachment{}
134 err = c.client.Put().
135 Resource("volumeattachments").
136 Name(volumeAttachment.Name).
137 SubResource("status").
138 Body(volumeAttachment).
144 // Delete takes name of the volumeAttachment and deletes it. Returns an error if one occurs.
145 func (c *volumeAttachments) Delete(name string, options *v1.DeleteOptions) error {
146 return c.client.Delete().
147 Resource("volumeattachments").
154 // DeleteCollection deletes a collection of objects.
155 func (c *volumeAttachments) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
156 var timeout time.Duration
157 if listOptions.TimeoutSeconds != nil {
158 timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
160 return c.client.Delete().
161 Resource("volumeattachments").
162 VersionedParams(&listOptions, scheme.ParameterCodec).
169 // Patch applies the patch and returns the patched volumeAttachment.
170 func (c *volumeAttachments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.VolumeAttachment, err error) {
171 result = &v1alpha1.VolumeAttachment{}
172 err = c.client.Patch(pt).
173 Resource("volumeattachments").
174 SubResource(subresources...).