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