Debian Codegraph @

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