2 Copyright The Kubernetes Authors.
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
8 http://www.apache.org/licenses/LICENSE-2.0
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.
17 // Code generated by client-gen. DO NOT EDIT.
22 v1 "k8s.io/api/apps/v1"
23 serializer "k8s.io/apimachinery/pkg/runtime/serializer"
24 "k8s.io/client-go/kubernetes/scheme"
25 rest "k8s.io/client-go/rest"
28 type AppsV1Interface interface {
29 RESTClient() rest.Interface
30 ControllerRevisionsGetter
37 // AppsV1Client is used to interact with features provided by the apps group.
38 type AppsV1Client struct {
39 restClient rest.Interface
42 func (c *AppsV1Client) ControllerRevisions(namespace string) ControllerRevisionInterface {
43 return newControllerRevisions(c, namespace)
46 func (c *AppsV1Client) DaemonSets(namespace string) DaemonSetInterface {
47 return newDaemonSets(c, namespace)
50 func (c *AppsV1Client) Deployments(namespace string) DeploymentInterface {
51 return newDeployments(c, namespace)
54 func (c *AppsV1Client) ReplicaSets(namespace string) ReplicaSetInterface {
55 return newReplicaSets(c, namespace)
58 func (c *AppsV1Client) StatefulSets(namespace string) StatefulSetInterface {
59 return newStatefulSets(c, namespace)
62 // NewForConfig creates a new AppsV1Client for the given config.
63 func NewForConfig(c *rest.Config) (*AppsV1Client, error) {
65 if err := setConfigDefaults(&config); err != nil {
68 client, err := rest.RESTClientFor(&config)
72 return &AppsV1Client{client}, nil
75 // NewForConfigOrDie creates a new AppsV1Client for the given config and
76 // panics if there is an error in the config.
77 func NewForConfigOrDie(c *rest.Config) *AppsV1Client {
78 client, err := NewForConfig(c)
85 // New creates a new AppsV1Client for the given RESTClient.
86 func New(c rest.Interface) *AppsV1Client {
87 return &AppsV1Client{c}
90 func setConfigDefaults(config *rest.Config) error {
91 gv := v1.SchemeGroupVersion
92 config.GroupVersion = &gv
93 config.APIPath = "/apis"
94 config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs}
96 if config.UserAgent == "" {
97 config.UserAgent = rest.DefaultKubernetesUserAgent()
103 // RESTClient returns a RESTClient that is used to communicate
104 // with API server by this client implementation.
105 func (c *AppsV1Client) RESTClient() rest.Interface {