blob: e5dd64d98332a611541d33e17b9170eb8ff51129 [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/apps/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 AppsV1beta1Interface interface {
28 RESTClient() rest.Interface
29 ControllerRevisionsGetter
30 DeploymentsGetter
31 StatefulSetsGetter
32}
33
34// AppsV1beta1Client is used to interact with features provided by the apps group.
35type AppsV1beta1Client struct {
36 restClient rest.Interface
37}
38
39func (c *AppsV1beta1Client) ControllerRevisions(namespace string) ControllerRevisionInterface {
40 return newControllerRevisions(c, namespace)
41}
42
43func (c *AppsV1beta1Client) Deployments(namespace string) DeploymentInterface {
44 return newDeployments(c, namespace)
45}
46
47func (c *AppsV1beta1Client) StatefulSets(namespace string) StatefulSetInterface {
48 return newStatefulSets(c, namespace)
49}
50
51// NewForConfig creates a new AppsV1beta1Client for the given config.
52func NewForConfig(c *rest.Config) (*AppsV1beta1Client, error) {
53 config := *c
54 if err := setConfigDefaults(&config); err != nil {
55 return nil, err
56 }
57 client, err := rest.RESTClientFor(&config)
58 if err != nil {
59 return nil, err
60 }
61 return &AppsV1beta1Client{client}, nil
62}
63
64// NewForConfigOrDie creates a new AppsV1beta1Client for the given config and
65// panics if there is an error in the config.
66func NewForConfigOrDie(c *rest.Config) *AppsV1beta1Client {
67 client, err := NewForConfig(c)
68 if err != nil {
69 panic(err)
70 }
71 return client
72}
73
74// New creates a new AppsV1beta1Client for the given RESTClient.
75func New(c rest.Interface) *AppsV1beta1Client {
76 return &AppsV1beta1Client{c}
77}
78
79func setConfigDefaults(config *rest.Config) error {
80 gv := v1beta1.SchemeGroupVersion
81 config.GroupVersion = &gv
82 config.APIPath = "/apis"
David Bainbridge86971522019-09-26 22:09:39 +000083 config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
Zack Williamse940c7a2019-08-21 14:25:39 -070084
85 if config.UserAgent == "" {
86 config.UserAgent = rest.DefaultKubernetesUserAgent()
87 }
88
89 return nil
90}
91
92// RESTClient returns a RESTClient that is used to communicate
93// with API server by this client implementation.
94func (c *AppsV1beta1Client) RESTClient() rest.Interface {
95 if c == nil {
96 return nil
97 }
98 return c.restClient
99}