blob: 1290e7936b1996e7a070c0bb0f80ec3a4cb28dea [file] [log] [blame]
Matteo Scandoloa4285862020-12-01 18:10:10 -08001/*
2Copyright The Kubernetes Authors.
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16
17// Code generated by client-gen. DO NOT EDIT.
18
19package v1alpha1
20
21import (
22 "context"
23 "time"
24
25 v1alpha1 "k8s.io/api/flowcontrol/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// PriorityLevelConfigurationsGetter has a method to return a PriorityLevelConfigurationInterface.
34// A group's client should implement this interface.
35type PriorityLevelConfigurationsGetter interface {
36 PriorityLevelConfigurations() PriorityLevelConfigurationInterface
37}
38
39// PriorityLevelConfigurationInterface has methods to work with PriorityLevelConfiguration resources.
40type PriorityLevelConfigurationInterface interface {
41 Create(ctx context.Context, priorityLevelConfiguration *v1alpha1.PriorityLevelConfiguration, opts v1.CreateOptions) (*v1alpha1.PriorityLevelConfiguration, error)
42 Update(ctx context.Context, priorityLevelConfiguration *v1alpha1.PriorityLevelConfiguration, opts v1.UpdateOptions) (*v1alpha1.PriorityLevelConfiguration, error)
43 UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1alpha1.PriorityLevelConfiguration, opts v1.UpdateOptions) (*v1alpha1.PriorityLevelConfiguration, 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.PriorityLevelConfiguration, error)
47 List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.PriorityLevelConfigurationList, 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.PriorityLevelConfiguration, err error)
50 PriorityLevelConfigurationExpansion
51}
52
53// priorityLevelConfigurations implements PriorityLevelConfigurationInterface
54type priorityLevelConfigurations struct {
55 client rest.Interface
56}
57
58// newPriorityLevelConfigurations returns a PriorityLevelConfigurations
59func newPriorityLevelConfigurations(c *FlowcontrolV1alpha1Client) *priorityLevelConfigurations {
60 return &priorityLevelConfigurations{
61 client: c.RESTClient(),
62 }
63}
64
65// Get takes name of the priorityLevelConfiguration, and returns the corresponding priorityLevelConfiguration object, and an error if there is any.
66func (c *priorityLevelConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.PriorityLevelConfiguration, err error) {
67 result = &v1alpha1.PriorityLevelConfiguration{}
68 err = c.client.Get().
69 Resource("prioritylevelconfigurations").
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 PriorityLevelConfigurations that match those selectors.
78func (c *priorityLevelConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PriorityLevelConfigurationList, err error) {
79 var timeout time.Duration
80 if opts.TimeoutSeconds != nil {
81 timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
82 }
83 result = &v1alpha1.PriorityLevelConfigurationList{}
84 err = c.client.Get().
85 Resource("prioritylevelconfigurations").
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 priorityLevelConfigurations.
94func (c *priorityLevelConfigurations) 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("prioritylevelconfigurations").
102 VersionedParams(&opts, scheme.ParameterCodec).
103 Timeout(timeout).
104 Watch(ctx)
105}
106
107// Create takes the representation of a priorityLevelConfiguration and creates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any.
108func (c *priorityLevelConfigurations) Create(ctx context.Context, priorityLevelConfiguration *v1alpha1.PriorityLevelConfiguration, opts v1.CreateOptions) (result *v1alpha1.PriorityLevelConfiguration, err error) {
109 result = &v1alpha1.PriorityLevelConfiguration{}
110 err = c.client.Post().
111 Resource("prioritylevelconfigurations").
112 VersionedParams(&opts, scheme.ParameterCodec).
113 Body(priorityLevelConfiguration).
114 Do(ctx).
115 Into(result)
116 return
117}
118
119// Update takes the representation of a priorityLevelConfiguration and updates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any.
120func (c *priorityLevelConfigurations) Update(ctx context.Context, priorityLevelConfiguration *v1alpha1.PriorityLevelConfiguration, opts v1.UpdateOptions) (result *v1alpha1.PriorityLevelConfiguration, err error) {
121 result = &v1alpha1.PriorityLevelConfiguration{}
122 err = c.client.Put().
123 Resource("prioritylevelconfigurations").
124 Name(priorityLevelConfiguration.Name).
125 VersionedParams(&opts, scheme.ParameterCodec).
126 Body(priorityLevelConfiguration).
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().
134func (c *priorityLevelConfigurations) UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1alpha1.PriorityLevelConfiguration, opts v1.UpdateOptions) (result *v1alpha1.PriorityLevelConfiguration, err error) {
135 result = &v1alpha1.PriorityLevelConfiguration{}
136 err = c.client.Put().
137 Resource("prioritylevelconfigurations").
138 Name(priorityLevelConfiguration.Name).
139 SubResource("status").
140 VersionedParams(&opts, scheme.ParameterCodec).
141 Body(priorityLevelConfiguration).
142 Do(ctx).
143 Into(result)
144 return
145}
146
147// Delete takes name of the priorityLevelConfiguration and deletes it. Returns an error if one occurs.
148func (c *priorityLevelConfigurations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
149 return c.client.Delete().
150 Resource("prioritylevelconfigurations").
151 Name(name).
152 Body(&opts).
153 Do(ctx).
154 Error()
155}
156
157// DeleteCollection deletes a collection of objects.
158func (c *priorityLevelConfigurations) 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("prioritylevelconfigurations").
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 priorityLevelConfiguration.
173func (c *priorityLevelConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PriorityLevelConfiguration, err error) {
174 result = &v1alpha1.PriorityLevelConfiguration{}
175 err = c.client.Patch(pt).
176 Resource("prioritylevelconfigurations").
177 Name(name).
178 SubResource(subresources...).
179 VersionedParams(&opts, scheme.ParameterCodec).
180 Body(data).
181 Do(ctx).
182 Into(result)
183 return
184}