Matthias Andreas Benkard | 832a54e | 2019-01-29 09:27:38 +0100 | [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 | v1 "k8s.io/api/storage/v1" |
| 23 | meta_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 | // StorageClassesGetter has a method to return a StorageClassInterface. |
| 31 | // A group's client should implement this interface. |
| 32 | type StorageClassesGetter interface { |
| 33 | StorageClasses() StorageClassInterface |
| 34 | } |
| 35 | |
| 36 | // StorageClassInterface has methods to work with StorageClass resources. |
| 37 | type StorageClassInterface interface { |
| 38 | Create(*v1.StorageClass) (*v1.StorageClass, error) |
| 39 | Update(*v1.StorageClass) (*v1.StorageClass, error) |
| 40 | Delete(name string, options *meta_v1.DeleteOptions) error |
| 41 | DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error |
| 42 | Get(name string, options meta_v1.GetOptions) (*v1.StorageClass, error) |
| 43 | List(opts meta_v1.ListOptions) (*v1.StorageClassList, error) |
| 44 | Watch(opts meta_v1.ListOptions) (watch.Interface, error) |
| 45 | Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.StorageClass, err error) |
| 46 | StorageClassExpansion |
| 47 | } |
| 48 | |
| 49 | // storageClasses implements StorageClassInterface |
| 50 | type storageClasses struct { |
| 51 | client rest.Interface |
| 52 | } |
| 53 | |
| 54 | // newStorageClasses returns a StorageClasses |
| 55 | func newStorageClasses(c *StorageV1Client) *storageClasses { |
| 56 | return &storageClasses{ |
| 57 | client: c.RESTClient(), |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | // Get takes name of the storageClass, and returns the corresponding storageClass object, and an error if there is any. |
| 62 | func (c *storageClasses) Get(name string, options meta_v1.GetOptions) (result *v1.StorageClass, err error) { |
| 63 | result = &v1.StorageClass{} |
| 64 | err = c.client.Get(). |
| 65 | Resource("storageclasses"). |
| 66 | Name(name). |
| 67 | VersionedParams(&options, scheme.ParameterCodec). |
| 68 | Do(). |
| 69 | Into(result) |
| 70 | return |
| 71 | } |
| 72 | |
| 73 | // List takes label and field selectors, and returns the list of StorageClasses that match those selectors. |
| 74 | func (c *storageClasses) List(opts meta_v1.ListOptions) (result *v1.StorageClassList, err error) { |
| 75 | result = &v1.StorageClassList{} |
| 76 | err = c.client.Get(). |
| 77 | Resource("storageclasses"). |
| 78 | VersionedParams(&opts, scheme.ParameterCodec). |
| 79 | Do(). |
| 80 | Into(result) |
| 81 | return |
| 82 | } |
| 83 | |
| 84 | // Watch returns a watch.Interface that watches the requested storageClasses. |
| 85 | func (c *storageClasses) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { |
| 86 | opts.Watch = true |
| 87 | return c.client.Get(). |
| 88 | Resource("storageclasses"). |
| 89 | VersionedParams(&opts, scheme.ParameterCodec). |
| 90 | Watch() |
| 91 | } |
| 92 | |
| 93 | // Create takes the representation of a storageClass and creates it. Returns the server's representation of the storageClass, and an error, if there is any. |
| 94 | func (c *storageClasses) Create(storageClass *v1.StorageClass) (result *v1.StorageClass, err error) { |
| 95 | result = &v1.StorageClass{} |
| 96 | err = c.client.Post(). |
| 97 | Resource("storageclasses"). |
| 98 | Body(storageClass). |
| 99 | Do(). |
| 100 | Into(result) |
| 101 | return |
| 102 | } |
| 103 | |
| 104 | // Update takes the representation of a storageClass and updates it. Returns the server's representation of the storageClass, and an error, if there is any. |
| 105 | func (c *storageClasses) Update(storageClass *v1.StorageClass) (result *v1.StorageClass, err error) { |
| 106 | result = &v1.StorageClass{} |
| 107 | err = c.client.Put(). |
| 108 | Resource("storageclasses"). |
| 109 | Name(storageClass.Name). |
| 110 | Body(storageClass). |
| 111 | Do(). |
| 112 | Into(result) |
| 113 | return |
| 114 | } |
| 115 | |
| 116 | // Delete takes name of the storageClass and deletes it. Returns an error if one occurs. |
| 117 | func (c *storageClasses) Delete(name string, options *meta_v1.DeleteOptions) error { |
| 118 | return c.client.Delete(). |
| 119 | Resource("storageclasses"). |
| 120 | Name(name). |
| 121 | Body(options). |
| 122 | Do(). |
| 123 | Error() |
| 124 | } |
| 125 | |
| 126 | // DeleteCollection deletes a collection of objects. |
| 127 | func (c *storageClasses) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error { |
| 128 | return c.client.Delete(). |
| 129 | Resource("storageclasses"). |
| 130 | VersionedParams(&listOptions, scheme.ParameterCodec). |
| 131 | Body(options). |
| 132 | Do(). |
| 133 | Error() |
| 134 | } |
| 135 | |
| 136 | // Patch applies the patch and returns the patched storageClass. |
| 137 | func (c *storageClasses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.StorageClass, err error) { |
| 138 | result = &v1.StorageClass{} |
| 139 | err = c.client.Patch(pt). |
| 140 | Resource("storageclasses"). |
| 141 | SubResource(subresources...). |
| 142 | Name(name). |
| 143 | Body(data). |
| 144 | Do(). |
| 145 | Into(result) |
| 146 | return |
| 147 | } |