blob: 88eac75b764db330c656bb56e3aa0e36154c1e1f [file] [log] [blame]
Zack Williamse940c7a2019-08-21 14:25:39 -07001/*
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/authorization/v1beta1"
Zack Williamse940c7a2019-08-21 14:25:39 -070023 "k8s.io/client-go/kubernetes/scheme"
24 rest "k8s.io/client-go/rest"
25)
26
27type AuthorizationV1beta1Interface interface {
28 RESTClient() rest.Interface
29 LocalSubjectAccessReviewsGetter
30 SelfSubjectAccessReviewsGetter
31 SelfSubjectRulesReviewsGetter
32 SubjectAccessReviewsGetter
33}
34
35// AuthorizationV1beta1Client is used to interact with features provided by the authorization.k8s.io group.
36type AuthorizationV1beta1Client struct {
37 restClient rest.Interface
38}
39
40func (c *AuthorizationV1beta1Client) LocalSubjectAccessReviews(namespace string) LocalSubjectAccessReviewInterface {
41 return newLocalSubjectAccessReviews(c, namespace)
42}
43
44func (c *AuthorizationV1beta1Client) SelfSubjectAccessReviews() SelfSubjectAccessReviewInterface {
45 return newSelfSubjectAccessReviews(c)
46}
47
48func (c *AuthorizationV1beta1Client) SelfSubjectRulesReviews() SelfSubjectRulesReviewInterface {
49 return newSelfSubjectRulesReviews(c)
50}
51
52func (c *AuthorizationV1beta1Client) SubjectAccessReviews() SubjectAccessReviewInterface {
53 return newSubjectAccessReviews(c)
54}
55
56// NewForConfig creates a new AuthorizationV1beta1Client for the given config.
57func NewForConfig(c *rest.Config) (*AuthorizationV1beta1Client, error) {
58 config := *c
59 if err := setConfigDefaults(&config); err != nil {
60 return nil, err
61 }
62 client, err := rest.RESTClientFor(&config)
63 if err != nil {
64 return nil, err
65 }
66 return &AuthorizationV1beta1Client{client}, nil
67}
68
69// NewForConfigOrDie creates a new AuthorizationV1beta1Client for the given config and
70// panics if there is an error in the config.
71func NewForConfigOrDie(c *rest.Config) *AuthorizationV1beta1Client {
72 client, err := NewForConfig(c)
73 if err != nil {
74 panic(err)
75 }
76 return client
77}
78
79// New creates a new AuthorizationV1beta1Client for the given RESTClient.
80func New(c rest.Interface) *AuthorizationV1beta1Client {
81 return &AuthorizationV1beta1Client{c}
82}
83
84func setConfigDefaults(config *rest.Config) error {
85 gv := v1beta1.SchemeGroupVersion
86 config.GroupVersion = &gv
87 config.APIPath = "/apis"
David Bainbridge86971522019-09-26 22:09:39 +000088 config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
Zack Williamse940c7a2019-08-21 14:25:39 -070089
90 if config.UserAgent == "" {
91 config.UserAgent = rest.DefaultKubernetesUserAgent()
92 }
93
94 return nil
95}
96
97// RESTClient returns a RESTClient that is used to communicate
98// with API server by this client implementation.
99func (c *AuthorizationV1beta1Client) RESTClient() rest.Interface {
100 if c == nil {
101 return nil
102 }
103 return c.restClient
104}