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 v1beta1 "k8s.io/api/storage/v1beta1"
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 // StorageClassesGetter has a method to return a StorageClassInterface.
33 // A group's client should implement this interface.
34 type StorageClassesGetter interface {
35 StorageClasses() StorageClassInterface
38 // StorageClassInterface has methods to work with StorageClass resources.
39 type StorageClassInterface interface {
40 Create(*v1beta1.StorageClass) (*v1beta1.StorageClass, error)
41 Update(*v1beta1.StorageClass) (*v1beta1.StorageClass, error)
42 Delete(name string, options *v1.DeleteOptions) error
43 DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
44 Get(name string, options v1.GetOptions) (*v1beta1.StorageClass, error)
45 List(opts v1.ListOptions) (*v1beta1.StorageClassList, error)
46 Watch(opts v1.ListOptions) (watch.Interface, error)
47 Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.StorageClass, err error)
51 // storageClasses implements StorageClassInterface
52 type storageClasses struct {
56 // newStorageClasses returns a StorageClasses
57 func newStorageClasses(c *StorageV1beta1Client) *storageClasses {
58 return &storageClasses{
59 client: c.RESTClient(),
63 // Get takes name of the storageClass, and returns the corresponding storageClass object, and an error if there is any.
64 func (c *storageClasses) Get(name string, options v1.GetOptions) (result *v1beta1.StorageClass, err error) {
65 result = &v1beta1.StorageClass{}
67 Resource("storageclasses").
69 VersionedParams(&options, scheme.ParameterCodec).
75 // List takes label and field selectors, and returns the list of StorageClasses that match those selectors.
76 func (c *storageClasses) List(opts v1.ListOptions) (result *v1beta1.StorageClassList, err error) {
77 var timeout time.Duration
78 if opts.TimeoutSeconds != nil {
79 timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
81 result = &v1beta1.StorageClassList{}
83 Resource("storageclasses").
84 VersionedParams(&opts, scheme.ParameterCodec).
91 // Watch returns a watch.Interface that watches the requested storageClasses.
92 func (c *storageClasses) Watch(opts v1.ListOptions) (watch.Interface, error) {
93 var timeout time.Duration
94 if opts.TimeoutSeconds != nil {
95 timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
98 return c.client.Get().
99 Resource("storageclasses").
100 VersionedParams(&opts, scheme.ParameterCodec).
105 // 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.
106 func (c *storageClasses) Create(storageClass *v1beta1.StorageClass) (result *v1beta1.StorageClass, err error) {
107 result = &v1beta1.StorageClass{}
108 err = c.client.Post().
109 Resource("storageclasses").
116 // 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.
117 func (c *storageClasses) Update(storageClass *v1beta1.StorageClass) (result *v1beta1.StorageClass, err error) {
118 result = &v1beta1.StorageClass{}
119 err = c.client.Put().
120 Resource("storageclasses").
121 Name(storageClass.Name).
128 // Delete takes name of the storageClass and deletes it. Returns an error if one occurs.
129 func (c *storageClasses) Delete(name string, options *v1.DeleteOptions) error {
130 return c.client.Delete().
131 Resource("storageclasses").
138 // DeleteCollection deletes a collection of objects.
139 func (c *storageClasses) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
140 var timeout time.Duration
141 if listOptions.TimeoutSeconds != nil {
142 timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
144 return c.client.Delete().
145 Resource("storageclasses").
146 VersionedParams(&listOptions, scheme.ParameterCodec).
153 // Patch applies the patch and returns the patched storageClass.
154 func (c *storageClasses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.StorageClass, err error) {
155 result = &v1beta1.StorageClass{}
156 err = c.client.Patch(pt).
157 Resource("storageclasses").
158 SubResource(subresources...).