blob: 2d93ff02ee64bcf3b98a083e471f5b45fefd58fc [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/admissionregistration/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 AdmissionregistrationV1beta1Interface interface {
28 RESTClient() rest.Interface
29 MutatingWebhookConfigurationsGetter
30 ValidatingWebhookConfigurationsGetter
31}
32
33// AdmissionregistrationV1beta1Client is used to interact with features provided by the admissionregistration.k8s.io group.
34type AdmissionregistrationV1beta1Client struct {
35 restClient rest.Interface
36}
37
38func (c *AdmissionregistrationV1beta1Client) MutatingWebhookConfigurations() MutatingWebhookConfigurationInterface {
39 return newMutatingWebhookConfigurations(c)
40}
41
42func (c *AdmissionregistrationV1beta1Client) ValidatingWebhookConfigurations() ValidatingWebhookConfigurationInterface {
43 return newValidatingWebhookConfigurations(c)
44}
45
46// NewForConfig creates a new AdmissionregistrationV1beta1Client for the given config.
47func NewForConfig(c *rest.Config) (*AdmissionregistrationV1beta1Client, error) {
48 config := *c
49 if err := setConfigDefaults(&config); err != nil {
50 return nil, err
51 }
52 client, err := rest.RESTClientFor(&config)
53 if err != nil {
54 return nil, err
55 }
56 return &AdmissionregistrationV1beta1Client{client}, nil
57}
58
59// NewForConfigOrDie creates a new AdmissionregistrationV1beta1Client for the given config and
60// panics if there is an error in the config.
61func NewForConfigOrDie(c *rest.Config) *AdmissionregistrationV1beta1Client {
62 client, err := NewForConfig(c)
63 if err != nil {
64 panic(err)
65 }
66 return client
67}
68
69// New creates a new AdmissionregistrationV1beta1Client for the given RESTClient.
70func New(c rest.Interface) *AdmissionregistrationV1beta1Client {
71 return &AdmissionregistrationV1beta1Client{c}
72}
73
74func setConfigDefaults(config *rest.Config) error {
75 gv := v1beta1.SchemeGroupVersion
76 config.GroupVersion = &gv
77 config.APIPath = "/apis"
David Bainbridge86971522019-09-26 22:09:39 +000078 config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
Zack Williamse940c7a2019-08-21 14:25:39 -070079
80 if config.UserAgent == "" {
81 config.UserAgent = rest.DefaultKubernetesUserAgent()
82 }
83
84 return nil
85}
86
87// RESTClient returns a RESTClient that is used to communicate
88// with API server by this client implementation.
89func (c *AdmissionregistrationV1beta1Client) RESTClient() rest.Interface {
90 if c == nil {
91 return nil
92 }
93 return c.restClient
94}