1/*
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 v1
20
21import (
22	v1 "k8s.io/api/apps/v1"
23	"k8s.io/client-go/deprecated/scheme"
24	rest "k8s.io/client-go/rest"
25)
26
27type AppsV1Interface interface {
28	RESTClient() rest.Interface
29	ControllerRevisionsGetter
30	DaemonSetsGetter
31	DeploymentsGetter
32	ReplicaSetsGetter
33	StatefulSetsGetter
34}
35
36// AppsV1Client is used to interact with features provided by the apps group.
37type AppsV1Client struct {
38	restClient rest.Interface
39}
40
41func (c *AppsV1Client) ControllerRevisions(namespace string) ControllerRevisionInterface {
42	return newControllerRevisions(c, namespace)
43}
44
45func (c *AppsV1Client) DaemonSets(namespace string) DaemonSetInterface {
46	return newDaemonSets(c, namespace)
47}
48
49func (c *AppsV1Client) Deployments(namespace string) DeploymentInterface {
50	return newDeployments(c, namespace)
51}
52
53func (c *AppsV1Client) ReplicaSets(namespace string) ReplicaSetInterface {
54	return newReplicaSets(c, namespace)
55}
56
57func (c *AppsV1Client) StatefulSets(namespace string) StatefulSetInterface {
58	return newStatefulSets(c, namespace)
59}
60
61// NewForConfig creates a new AppsV1Client for the given config.
62func NewForConfig(c *rest.Config) (*AppsV1Client, 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 &AppsV1Client{client}, nil
72}
73
74// NewForConfigOrDie creates a new AppsV1Client for the given config and
75// panics if there is an error in the config.
76func NewForConfigOrDie(c *rest.Config) *AppsV1Client {
77	client, err := NewForConfig(c)
78	if err != nil {
79		panic(err)
80	}
81	return client
82}
83
84// New creates a new AppsV1Client for the given RESTClient.
85func New(c rest.Interface) *AppsV1Client {
86	return &AppsV1Client{c}
87}
88
89func setConfigDefaults(config *rest.Config) error {
90	gv := v1.SchemeGroupVersion
91	config.GroupVersion = &gv
92	config.APIPath = "/apis"
93	config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
94
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 *AppsV1Client) RESTClient() rest.Interface {
105	if c == nil {
106		return nil
107	}
108	return c.restClient
109}
110