Scott Baker | e7144bc | 2019-10-01 14:16:47 -0700 | [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 | "time" |
| 23 | |
| 24 | v1alpha1 "k8s.io/api/auditregistration/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" |
| 30 | ) |
| 31 | |
| 32 | // AuditSinksGetter has a method to return a AuditSinkInterface. |
| 33 | // A group's client should implement this interface. |
| 34 | type AuditSinksGetter interface { |
| 35 | AuditSinks() AuditSinkInterface |
| 36 | } |
| 37 | |
| 38 | // AuditSinkInterface has methods to work with AuditSink resources. |
| 39 | type AuditSinkInterface interface { |
| 40 | Create(*v1alpha1.AuditSink) (*v1alpha1.AuditSink, error) |
| 41 | Update(*v1alpha1.AuditSink) (*v1alpha1.AuditSink, 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) (*v1alpha1.AuditSink, error) |
| 45 | List(opts v1.ListOptions) (*v1alpha1.AuditSinkList, error) |
| 46 | Watch(opts v1.ListOptions) (watch.Interface, error) |
| 47 | Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.AuditSink, err error) |
| 48 | AuditSinkExpansion |
| 49 | } |
| 50 | |
| 51 | // auditSinks implements AuditSinkInterface |
| 52 | type auditSinks struct { |
| 53 | client rest.Interface |
| 54 | } |
| 55 | |
| 56 | // newAuditSinks returns a AuditSinks |
| 57 | func newAuditSinks(c *AuditregistrationV1alpha1Client) *auditSinks { |
| 58 | return &auditSinks{ |
| 59 | client: c.RESTClient(), |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | // Get takes name of the auditSink, and returns the corresponding auditSink object, and an error if there is any. |
| 64 | func (c *auditSinks) Get(name string, options v1.GetOptions) (result *v1alpha1.AuditSink, err error) { |
| 65 | result = &v1alpha1.AuditSink{} |
| 66 | err = c.client.Get(). |
| 67 | Resource("auditsinks"). |
| 68 | Name(name). |
| 69 | VersionedParams(&options, scheme.ParameterCodec). |
| 70 | Do(). |
| 71 | Into(result) |
| 72 | return |
| 73 | } |
| 74 | |
| 75 | // List takes label and field selectors, and returns the list of AuditSinks that match those selectors. |
| 76 | func (c *auditSinks) List(opts v1.ListOptions) (result *v1alpha1.AuditSinkList, err error) { |
| 77 | var timeout time.Duration |
| 78 | if opts.TimeoutSeconds != nil { |
| 79 | timeout = time.Duration(*opts.TimeoutSeconds) * time.Second |
| 80 | } |
| 81 | result = &v1alpha1.AuditSinkList{} |
| 82 | err = c.client.Get(). |
| 83 | Resource("auditsinks"). |
| 84 | VersionedParams(&opts, scheme.ParameterCodec). |
| 85 | Timeout(timeout). |
| 86 | Do(). |
| 87 | Into(result) |
| 88 | return |
| 89 | } |
| 90 | |
| 91 | // Watch returns a watch.Interface that watches the requested auditSinks. |
| 92 | func (c *auditSinks) 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 |
| 96 | } |
| 97 | opts.Watch = true |
| 98 | return c.client.Get(). |
| 99 | Resource("auditsinks"). |
| 100 | VersionedParams(&opts, scheme.ParameterCodec). |
| 101 | Timeout(timeout). |
| 102 | Watch() |
| 103 | } |
| 104 | |
| 105 | // Create takes the representation of a auditSink and creates it. Returns the server's representation of the auditSink, and an error, if there is any. |
| 106 | func (c *auditSinks) Create(auditSink *v1alpha1.AuditSink) (result *v1alpha1.AuditSink, err error) { |
| 107 | result = &v1alpha1.AuditSink{} |
| 108 | err = c.client.Post(). |
| 109 | Resource("auditsinks"). |
| 110 | Body(auditSink). |
| 111 | Do(). |
| 112 | Into(result) |
| 113 | return |
| 114 | } |
| 115 | |
| 116 | // Update takes the representation of a auditSink and updates it. Returns the server's representation of the auditSink, and an error, if there is any. |
| 117 | func (c *auditSinks) Update(auditSink *v1alpha1.AuditSink) (result *v1alpha1.AuditSink, err error) { |
| 118 | result = &v1alpha1.AuditSink{} |
| 119 | err = c.client.Put(). |
| 120 | Resource("auditsinks"). |
| 121 | Name(auditSink.Name). |
| 122 | Body(auditSink). |
| 123 | Do(). |
| 124 | Into(result) |
| 125 | return |
| 126 | } |
| 127 | |
| 128 | // Delete takes name of the auditSink and deletes it. Returns an error if one occurs. |
| 129 | func (c *auditSinks) Delete(name string, options *v1.DeleteOptions) error { |
| 130 | return c.client.Delete(). |
| 131 | Resource("auditsinks"). |
| 132 | Name(name). |
| 133 | Body(options). |
| 134 | Do(). |
| 135 | Error() |
| 136 | } |
| 137 | |
| 138 | // DeleteCollection deletes a collection of objects. |
| 139 | func (c *auditSinks) 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 |
| 143 | } |
| 144 | return c.client.Delete(). |
| 145 | Resource("auditsinks"). |
| 146 | VersionedParams(&listOptions, scheme.ParameterCodec). |
| 147 | Timeout(timeout). |
| 148 | Body(options). |
| 149 | Do(). |
| 150 | Error() |
| 151 | } |
| 152 | |
| 153 | // Patch applies the patch and returns the patched auditSink. |
| 154 | func (c *auditSinks) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.AuditSink, err error) { |
| 155 | result = &v1alpha1.AuditSink{} |
| 156 | err = c.client.Patch(pt). |
| 157 | Resource("auditsinks"). |
| 158 | SubResource(subresources...). |
| 159 | Name(name). |
| 160 | Body(data). |
| 161 | Do(). |
| 162 | Into(result) |
| 163 | return |
| 164 | } |