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