sslobodr | d046be8 | 2019-01-16 10:02:22 -0500 | [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 | v1alpha1 "k8s.io/api/rbac/v1alpha1" |
| 23 | serializer "k8s.io/apimachinery/pkg/runtime/serializer" |
| 24 | "k8s.io/client-go/kubernetes/scheme" |
| 25 | rest "k8s.io/client-go/rest" |
| 26 | ) |
| 27 | |
| 28 | type RbacV1alpha1Interface interface { |
| 29 | RESTClient() rest.Interface |
| 30 | ClusterRolesGetter |
| 31 | ClusterRoleBindingsGetter |
| 32 | RolesGetter |
| 33 | RoleBindingsGetter |
| 34 | } |
| 35 | |
| 36 | // RbacV1alpha1Client is used to interact with features provided by the rbac.authorization.k8s.io group. |
| 37 | type RbacV1alpha1Client struct { |
| 38 | restClient rest.Interface |
| 39 | } |
| 40 | |
| 41 | func (c *RbacV1alpha1Client) ClusterRoles() ClusterRoleInterface { |
| 42 | return newClusterRoles(c) |
| 43 | } |
| 44 | |
| 45 | func (c *RbacV1alpha1Client) ClusterRoleBindings() ClusterRoleBindingInterface { |
| 46 | return newClusterRoleBindings(c) |
| 47 | } |
| 48 | |
| 49 | func (c *RbacV1alpha1Client) Roles(namespace string) RoleInterface { |
| 50 | return newRoles(c, namespace) |
| 51 | } |
| 52 | |
| 53 | func (c *RbacV1alpha1Client) RoleBindings(namespace string) RoleBindingInterface { |
| 54 | return newRoleBindings(c, namespace) |
| 55 | } |
| 56 | |
| 57 | // NewForConfig creates a new RbacV1alpha1Client for the given config. |
| 58 | func NewForConfig(c *rest.Config) (*RbacV1alpha1Client, error) { |
| 59 | config := *c |
| 60 | if err := setConfigDefaults(&config); err != nil { |
| 61 | return nil, err |
| 62 | } |
| 63 | client, err := rest.RESTClientFor(&config) |
| 64 | if err != nil { |
| 65 | return nil, err |
| 66 | } |
| 67 | return &RbacV1alpha1Client{client}, nil |
| 68 | } |
| 69 | |
| 70 | // NewForConfigOrDie creates a new RbacV1alpha1Client for the given config and |
| 71 | // panics if there is an error in the config. |
| 72 | func NewForConfigOrDie(c *rest.Config) *RbacV1alpha1Client { |
| 73 | client, err := NewForConfig(c) |
| 74 | if err != nil { |
| 75 | panic(err) |
| 76 | } |
| 77 | return client |
| 78 | } |
| 79 | |
| 80 | // New creates a new RbacV1alpha1Client for the given RESTClient. |
| 81 | func New(c rest.Interface) *RbacV1alpha1Client { |
| 82 | return &RbacV1alpha1Client{c} |
| 83 | } |
| 84 | |
| 85 | func setConfigDefaults(config *rest.Config) error { |
| 86 | gv := v1alpha1.SchemeGroupVersion |
| 87 | config.GroupVersion = &gv |
| 88 | config.APIPath = "/apis" |
| 89 | config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs} |
| 90 | |
| 91 | if config.UserAgent == "" { |
| 92 | config.UserAgent = rest.DefaultKubernetesUserAgent() |
| 93 | } |
| 94 | |
| 95 | return nil |
| 96 | } |
| 97 | |
| 98 | // RESTClient returns a RESTClient that is used to communicate |
| 99 | // with API server by this client implementation. |
| 100 | func (c *RbacV1alpha1Client) RESTClient() rest.Interface { |
| 101 | if c == nil { |
| 102 | return nil |
| 103 | } |
| 104 | return c.restClient |
| 105 | } |