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