Matteo Scandolo | a428586 | 2020-12-01 18:10:10 -0800 | [diff] [blame^] | 1 | /* |
| 2 | Copyright The Kubernetes Authors. |
| 3 | |
| 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 |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 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. |
| 15 | */ |
| 16 | |
| 17 | // Code generated by client-gen. DO NOT EDIT. |
| 18 | |
| 19 | package v1alpha1 |
| 20 | |
| 21 | import ( |
| 22 | "context" |
| 23 | "time" |
| 24 | |
| 25 | v1alpha1 "k8s.io/api/storage/v1alpha1" |
| 26 | v1 "k8s.io/apimachinery/pkg/apis/meta/v1" |
| 27 | types "k8s.io/apimachinery/pkg/types" |
| 28 | watch "k8s.io/apimachinery/pkg/watch" |
| 29 | scheme "k8s.io/client-go/kubernetes/scheme" |
| 30 | rest "k8s.io/client-go/rest" |
| 31 | ) |
| 32 | |
| 33 | // VolumeAttachmentsGetter has a method to return a VolumeAttachmentInterface. |
| 34 | // A group's client should implement this interface. |
| 35 | type VolumeAttachmentsGetter interface { |
| 36 | VolumeAttachments() VolumeAttachmentInterface |
| 37 | } |
| 38 | |
| 39 | // VolumeAttachmentInterface has methods to work with VolumeAttachment resources. |
| 40 | type VolumeAttachmentInterface interface { |
| 41 | Create(ctx context.Context, volumeAttachment *v1alpha1.VolumeAttachment, opts v1.CreateOptions) (*v1alpha1.VolumeAttachment, error) |
| 42 | Update(ctx context.Context, volumeAttachment *v1alpha1.VolumeAttachment, opts v1.UpdateOptions) (*v1alpha1.VolumeAttachment, error) |
| 43 | UpdateStatus(ctx context.Context, volumeAttachment *v1alpha1.VolumeAttachment, opts v1.UpdateOptions) (*v1alpha1.VolumeAttachment, error) |
| 44 | Delete(ctx context.Context, name string, opts v1.DeleteOptions) error |
| 45 | DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error |
| 46 | Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.VolumeAttachment, error) |
| 47 | List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.VolumeAttachmentList, error) |
| 48 | Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) |
| 49 | Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VolumeAttachment, err error) |
| 50 | VolumeAttachmentExpansion |
| 51 | } |
| 52 | |
| 53 | // volumeAttachments implements VolumeAttachmentInterface |
| 54 | type volumeAttachments struct { |
| 55 | client rest.Interface |
| 56 | } |
| 57 | |
| 58 | // newVolumeAttachments returns a VolumeAttachments |
| 59 | func newVolumeAttachments(c *StorageV1alpha1Client) *volumeAttachments { |
| 60 | return &volumeAttachments{ |
| 61 | client: c.RESTClient(), |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | // Get takes name of the volumeAttachment, and returns the corresponding volumeAttachment object, and an error if there is any. |
| 66 | func (c *volumeAttachments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumeAttachment, err error) { |
| 67 | result = &v1alpha1.VolumeAttachment{} |
| 68 | err = c.client.Get(). |
| 69 | Resource("volumeattachments"). |
| 70 | Name(name). |
| 71 | VersionedParams(&options, scheme.ParameterCodec). |
| 72 | Do(ctx). |
| 73 | Into(result) |
| 74 | return |
| 75 | } |
| 76 | |
| 77 | // List takes label and field selectors, and returns the list of VolumeAttachments that match those selectors. |
| 78 | func (c *volumeAttachments) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VolumeAttachmentList, err error) { |
| 79 | var timeout time.Duration |
| 80 | if opts.TimeoutSeconds != nil { |
| 81 | timeout = time.Duration(*opts.TimeoutSeconds) * time.Second |
| 82 | } |
| 83 | result = &v1alpha1.VolumeAttachmentList{} |
| 84 | err = c.client.Get(). |
| 85 | Resource("volumeattachments"). |
| 86 | VersionedParams(&opts, scheme.ParameterCodec). |
| 87 | Timeout(timeout). |
| 88 | Do(ctx). |
| 89 | Into(result) |
| 90 | return |
| 91 | } |
| 92 | |
| 93 | // Watch returns a watch.Interface that watches the requested volumeAttachments. |
| 94 | func (c *volumeAttachments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { |
| 95 | var timeout time.Duration |
| 96 | if opts.TimeoutSeconds != nil { |
| 97 | timeout = time.Duration(*opts.TimeoutSeconds) * time.Second |
| 98 | } |
| 99 | opts.Watch = true |
| 100 | return c.client.Get(). |
| 101 | Resource("volumeattachments"). |
| 102 | VersionedParams(&opts, scheme.ParameterCodec). |
| 103 | Timeout(timeout). |
| 104 | Watch(ctx) |
| 105 | } |
| 106 | |
| 107 | // 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. |
| 108 | func (c *volumeAttachments) Create(ctx context.Context, volumeAttachment *v1alpha1.VolumeAttachment, opts v1.CreateOptions) (result *v1alpha1.VolumeAttachment, err error) { |
| 109 | result = &v1alpha1.VolumeAttachment{} |
| 110 | err = c.client.Post(). |
| 111 | Resource("volumeattachments"). |
| 112 | VersionedParams(&opts, scheme.ParameterCodec). |
| 113 | Body(volumeAttachment). |
| 114 | Do(ctx). |
| 115 | Into(result) |
| 116 | return |
| 117 | } |
| 118 | |
| 119 | // 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. |
| 120 | func (c *volumeAttachments) Update(ctx context.Context, volumeAttachment *v1alpha1.VolumeAttachment, opts v1.UpdateOptions) (result *v1alpha1.VolumeAttachment, err error) { |
| 121 | result = &v1alpha1.VolumeAttachment{} |
| 122 | err = c.client.Put(). |
| 123 | Resource("volumeattachments"). |
| 124 | Name(volumeAttachment.Name). |
| 125 | VersionedParams(&opts, scheme.ParameterCodec). |
| 126 | Body(volumeAttachment). |
| 127 | Do(ctx). |
| 128 | Into(result) |
| 129 | return |
| 130 | } |
| 131 | |
| 132 | // UpdateStatus was generated because the type contains a Status member. |
| 133 | // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). |
| 134 | func (c *volumeAttachments) UpdateStatus(ctx context.Context, volumeAttachment *v1alpha1.VolumeAttachment, opts v1.UpdateOptions) (result *v1alpha1.VolumeAttachment, err error) { |
| 135 | result = &v1alpha1.VolumeAttachment{} |
| 136 | err = c.client.Put(). |
| 137 | Resource("volumeattachments"). |
| 138 | Name(volumeAttachment.Name). |
| 139 | SubResource("status"). |
| 140 | VersionedParams(&opts, scheme.ParameterCodec). |
| 141 | Body(volumeAttachment). |
| 142 | Do(ctx). |
| 143 | Into(result) |
| 144 | return |
| 145 | } |
| 146 | |
| 147 | // Delete takes name of the volumeAttachment and deletes it. Returns an error if one occurs. |
| 148 | func (c *volumeAttachments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { |
| 149 | return c.client.Delete(). |
| 150 | Resource("volumeattachments"). |
| 151 | Name(name). |
| 152 | Body(&opts). |
| 153 | Do(ctx). |
| 154 | Error() |
| 155 | } |
| 156 | |
| 157 | // DeleteCollection deletes a collection of objects. |
| 158 | func (c *volumeAttachments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { |
| 159 | var timeout time.Duration |
| 160 | if listOpts.TimeoutSeconds != nil { |
| 161 | timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second |
| 162 | } |
| 163 | return c.client.Delete(). |
| 164 | Resource("volumeattachments"). |
| 165 | VersionedParams(&listOpts, scheme.ParameterCodec). |
| 166 | Timeout(timeout). |
| 167 | Body(&opts). |
| 168 | Do(ctx). |
| 169 | Error() |
| 170 | } |
| 171 | |
| 172 | // Patch applies the patch and returns the patched volumeAttachment. |
| 173 | func (c *volumeAttachments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VolumeAttachment, err error) { |
| 174 | result = &v1alpha1.VolumeAttachment{} |
| 175 | err = c.client.Patch(pt). |
| 176 | Resource("volumeattachments"). |
| 177 | Name(name). |
| 178 | SubResource(subresources...). |
| 179 | VersionedParams(&opts, scheme.ParameterCodec). |
| 180 | Body(data). |
| 181 | Do(ctx). |
| 182 | Into(result) |
| 183 | return |
| 184 | } |