Debian Codegraph @

kubernetes/typed/certificates/v1beta1/certificates_client.go

raw symbols SCIP
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 v1beta1
20
21 import (
22 http "net/http"
23
24 certificatesv1beta1 "k8s.io/api/certificates/v1beta1"
25 scheme "k8s.io/client-go/kubernetes/scheme"
26 rest "k8s.io/client-go/rest"
27 )
28
29 type CertificatesV1beta1Interface interface {
30 RESTClient() rest.Interface
31 CertificateSigningRequestsGetter
32 ClusterTrustBundlesGetter
33 }
34
35 // CertificatesV1beta1Client is used to interact with features provided by the certificates.k8s.io group.
36 type CertificatesV1beta1Client struct {
37 restClient rest.Interface
38 }
39
40 func (c *CertificatesV1beta1Client) CertificateSigningRequests() CertificateSigningRequestInterface {
41 return newCertificateSigningRequests(c)
42 }
43
44 func (c *CertificatesV1beta1Client) ClusterTrustBundles() ClusterTrustBundleInterface {
45 return newClusterTrustBundles(c)
46 }
47
48 // NewForConfig creates a new CertificatesV1beta1Client for the given config.
49 // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient),
50 // where httpClient was generated with rest.HTTPClientFor(c).
51 func NewForConfig(c *rest.Config) (*CertificatesV1beta1Client, error) {
52 config := *c
53 setConfigDefaults(&config)
54 httpClient, err := rest.HTTPClientFor(&config)
55 if err != nil {
56 return nil, err
57 }
58 return NewForConfigAndClient(&config, httpClient)
59 }
60
61 // NewForConfigAndClient creates a new CertificatesV1beta1Client for the given config and http client.
62 // Note the http client provided takes precedence over the configured transport values.
63 func NewForConfigAndClient(c *rest.Config, h *http.Client) (*CertificatesV1beta1Client, error) {
64 config := *c
65 setConfigDefaults(&config)
66 client, err := rest.RESTClientForConfigAndClient(&config, h)
67 if err != nil {
68 return nil, err
69 }
70 return &CertificatesV1beta1Client{client}, nil
71 }
72
73 // NewForConfigOrDie creates a new CertificatesV1beta1Client for the given config and
74 // panics if there is an error in the config.
75 func NewForConfigOrDie(c *rest.Config) *CertificatesV1beta1Client {
76 client, err := NewForConfig(c)
77 if err != nil {
78 panic(err)
79 }
80 return client
81 }
82
83 // New creates a new CertificatesV1beta1Client for the given RESTClient.
84 func New(c rest.Interface) *CertificatesV1beta1Client {
85 return &CertificatesV1beta1Client{c}
86 }
87
88 func setConfigDefaults(config *rest.Config) {
89 gv := certificatesv1beta1.SchemeGroupVersion
90 config.GroupVersion = &gv
91 config.APIPath = "/apis"
92 config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion()
93
94 if config.UserAgent == "" {
95 config.UserAgent = rest.DefaultKubernetesUserAgent()
96 }
97 }
98
99 // RESTClient returns a RESTClient that is used to communicate
100 // with API server by this client implementation.
101 func (c *CertificatesV1beta1Client) RESTClient() rest.Interface {
102 if c == nil {
103 return nil
104 }
105 return c.restClient
106 }