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.
22 v1 "k8s.io/api/authorization/v1"
23 serializer "k8s.io/apimachinery/pkg/runtime/serializer"
24 "k8s.io/client-go/kubernetes/scheme"
25 rest "k8s.io/client-go/rest"
28 type AuthorizationV1Interface interface {
29 RESTClient() rest.Interface
30 LocalSubjectAccessReviewsGetter
31 SelfSubjectAccessReviewsGetter
32 SelfSubjectRulesReviewsGetter
33 SubjectAccessReviewsGetter
36 // AuthorizationV1Client is used to interact with features provided by the authorization.k8s.io group.
37 type AuthorizationV1Client struct {
38 restClient rest.Interface
41 func (c *AuthorizationV1Client) LocalSubjectAccessReviews(namespace string) LocalSubjectAccessReviewInterface {
42 return newLocalSubjectAccessReviews(c, namespace)
45 func (c *AuthorizationV1Client) SelfSubjectAccessReviews() SelfSubjectAccessReviewInterface {
46 return newSelfSubjectAccessReviews(c)
49 func (c *AuthorizationV1Client) SelfSubjectRulesReviews() SelfSubjectRulesReviewInterface {
50 return newSelfSubjectRulesReviews(c)
53 func (c *AuthorizationV1Client) SubjectAccessReviews() SubjectAccessReviewInterface {
54 return newSubjectAccessReviews(c)
57 // NewForConfig creates a new AuthorizationV1Client for the given config.
58 func NewForConfig(c *rest.Config) (*AuthorizationV1Client, error) {
60 if err := setConfigDefaults(&config); err != nil {
63 client, err := rest.RESTClientFor(&config)
67 return &AuthorizationV1Client{client}, nil
70 // NewForConfigOrDie creates a new AuthorizationV1Client for the given config and
71 // panics if there is an error in the config.
72 func NewForConfigOrDie(c *rest.Config) *AuthorizationV1Client {
73 client, err := NewForConfig(c)
80 // New creates a new AuthorizationV1Client for the given RESTClient.
81 func New(c rest.Interface) *AuthorizationV1Client {
82 return &AuthorizationV1Client{c}
85 func setConfigDefaults(config *rest.Config) error {
86 gv := v1.SchemeGroupVersion
87 config.GroupVersion = &gv
88 config.APIPath = "/apis"
89 config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs}
91 if config.UserAgent == "" {
92 config.UserAgent = rest.DefaultKubernetesUserAgent()
98 // RESTClient returns a RESTClient that is used to communicate
99 // with API server by this client implementation.
100 func (c *AuthorizationV1Client) RESTClient() rest.Interface {