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