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 v1 |
| 20 | |
| 21 | import ( |
| 22 | "context" |
| 23 | "time" |
| 24 | |
| 25 | v1 "k8s.io/api/storage/v1" |
| 26 | metav1 "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 | // CSINodesGetter has a method to return a CSINodeInterface. |
| 34 | // A group's client should implement this interface. |
| 35 | type CSINodesGetter interface { |
| 36 | CSINodes() CSINodeInterface |
| 37 | } |
| 38 | |
| 39 | // CSINodeInterface has methods to work with CSINode resources. |
| 40 | type CSINodeInterface interface { |
| 41 | Create(ctx context.Context, cSINode *v1.CSINode, opts metav1.CreateOptions) (*v1.CSINode, error) |
| 42 | Update(ctx context.Context, cSINode *v1.CSINode, opts metav1.UpdateOptions) (*v1.CSINode, error) |
| 43 | Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error |
| 44 | DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error |
| 45 | Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.CSINode, error) |
| 46 | List(ctx context.Context, opts metav1.ListOptions) (*v1.CSINodeList, error) |
| 47 | Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) |
| 48 | Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CSINode, err error) |
| 49 | CSINodeExpansion |
| 50 | } |
| 51 | |
| 52 | // cSINodes implements CSINodeInterface |
| 53 | type cSINodes struct { |
| 54 | client rest.Interface |
| 55 | } |
| 56 | |
| 57 | // newCSINodes returns a CSINodes |
| 58 | func newCSINodes(c *StorageV1Client) *cSINodes { |
| 59 | return &cSINodes{ |
| 60 | client: c.RESTClient(), |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | // Get takes name of the cSINode, and returns the corresponding cSINode object, and an error if there is any. |
| 65 | func (c *cSINodes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CSINode, err error) { |
| 66 | result = &v1.CSINode{} |
| 67 | err = c.client.Get(). |
| 68 | Resource("csinodes"). |
| 69 | Name(name). |
| 70 | VersionedParams(&options, scheme.ParameterCodec). |
| 71 | Do(ctx). |
| 72 | Into(result) |
| 73 | return |
| 74 | } |
| 75 | |
| 76 | // List takes label and field selectors, and returns the list of CSINodes that match those selectors. |
| 77 | func (c *cSINodes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CSINodeList, err error) { |
| 78 | var timeout time.Duration |
| 79 | if opts.TimeoutSeconds != nil { |
| 80 | timeout = time.Duration(*opts.TimeoutSeconds) * time.Second |
| 81 | } |
| 82 | result = &v1.CSINodeList{} |
| 83 | err = c.client.Get(). |
| 84 | Resource("csinodes"). |
| 85 | VersionedParams(&opts, scheme.ParameterCodec). |
| 86 | Timeout(timeout). |
| 87 | Do(ctx). |
| 88 | Into(result) |
| 89 | return |
| 90 | } |
| 91 | |
| 92 | // Watch returns a watch.Interface that watches the requested cSINodes. |
| 93 | func (c *cSINodes) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { |
| 94 | var timeout time.Duration |
| 95 | if opts.TimeoutSeconds != nil { |
| 96 | timeout = time.Duration(*opts.TimeoutSeconds) * time.Second |
| 97 | } |
| 98 | opts.Watch = true |
| 99 | return c.client.Get(). |
| 100 | Resource("csinodes"). |
| 101 | VersionedParams(&opts, scheme.ParameterCodec). |
| 102 | Timeout(timeout). |
| 103 | Watch(ctx) |
| 104 | } |
| 105 | |
| 106 | // Create takes the representation of a cSINode and creates it. Returns the server's representation of the cSINode, and an error, if there is any. |
| 107 | func (c *cSINodes) Create(ctx context.Context, cSINode *v1.CSINode, opts metav1.CreateOptions) (result *v1.CSINode, err error) { |
| 108 | result = &v1.CSINode{} |
| 109 | err = c.client.Post(). |
| 110 | Resource("csinodes"). |
| 111 | VersionedParams(&opts, scheme.ParameterCodec). |
| 112 | Body(cSINode). |
| 113 | Do(ctx). |
| 114 | Into(result) |
| 115 | return |
| 116 | } |
| 117 | |
| 118 | // Update takes the representation of a cSINode and updates it. Returns the server's representation of the cSINode, and an error, if there is any. |
| 119 | func (c *cSINodes) Update(ctx context.Context, cSINode *v1.CSINode, opts metav1.UpdateOptions) (result *v1.CSINode, err error) { |
| 120 | result = &v1.CSINode{} |
| 121 | err = c.client.Put(). |
| 122 | Resource("csinodes"). |
| 123 | Name(cSINode.Name). |
| 124 | VersionedParams(&opts, scheme.ParameterCodec). |
| 125 | Body(cSINode). |
| 126 | Do(ctx). |
| 127 | Into(result) |
| 128 | return |
| 129 | } |
| 130 | |
| 131 | // Delete takes name of the cSINode and deletes it. Returns an error if one occurs. |
| 132 | func (c *cSINodes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { |
| 133 | return c.client.Delete(). |
| 134 | Resource("csinodes"). |
| 135 | Name(name). |
| 136 | Body(&opts). |
| 137 | Do(ctx). |
| 138 | Error() |
| 139 | } |
| 140 | |
| 141 | // DeleteCollection deletes a collection of objects. |
| 142 | func (c *cSINodes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { |
| 143 | var timeout time.Duration |
| 144 | if listOpts.TimeoutSeconds != nil { |
| 145 | timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second |
| 146 | } |
| 147 | return c.client.Delete(). |
| 148 | Resource("csinodes"). |
| 149 | VersionedParams(&listOpts, scheme.ParameterCodec). |
| 150 | Timeout(timeout). |
| 151 | Body(&opts). |
| 152 | Do(ctx). |
| 153 | Error() |
| 154 | } |
| 155 | |
| 156 | // Patch applies the patch and returns the patched cSINode. |
| 157 | func (c *cSINodes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CSINode, err error) { |
| 158 | result = &v1.CSINode{} |
| 159 | err = c.client.Patch(pt). |
| 160 | Resource("csinodes"). |
| 161 | Name(name). |
| 162 | SubResource(subresources...). |
| 163 | VersionedParams(&opts, scheme.ParameterCodec). |
| 164 | Body(data). |
| 165 | Do(ctx). |
| 166 | Into(result) |
| 167 | return |
| 168 | } |