Zack Williams | e940c7a | 2019-08-21 14:25:39 -0700 | [diff] [blame] | 1 | /* |
| 2 | Copyright The Kubernetes Authors. |
| 3 | |
| 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 |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 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. |
| 15 | */ |
| 16 | |
| 17 | // Code generated by client-gen. DO NOT EDIT. |
| 18 | |
| 19 | package v1 |
| 20 | |
| 21 | import ( |
| 22 | v1 "k8s.io/api/apps/v1" |
Zack Williams | e940c7a | 2019-08-21 14:25:39 -0700 | [diff] [blame] | 23 | "k8s.io/client-go/kubernetes/scheme" |
| 24 | rest "k8s.io/client-go/rest" |
| 25 | ) |
| 26 | |
| 27 | type 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. |
| 37 | type AppsV1Client struct { |
| 38 | restClient rest.Interface |
| 39 | } |
| 40 | |
| 41 | func (c *AppsV1Client) ControllerRevisions(namespace string) ControllerRevisionInterface { |
| 42 | return newControllerRevisions(c, namespace) |
| 43 | } |
| 44 | |
| 45 | func (c *AppsV1Client) DaemonSets(namespace string) DaemonSetInterface { |
| 46 | return newDaemonSets(c, namespace) |
| 47 | } |
| 48 | |
| 49 | func (c *AppsV1Client) Deployments(namespace string) DeploymentInterface { |
| 50 | return newDeployments(c, namespace) |
| 51 | } |
| 52 | |
| 53 | func (c *AppsV1Client) ReplicaSets(namespace string) ReplicaSetInterface { |
| 54 | return newReplicaSets(c, namespace) |
| 55 | } |
| 56 | |
| 57 | func (c *AppsV1Client) StatefulSets(namespace string) StatefulSetInterface { |
| 58 | return newStatefulSets(c, namespace) |
| 59 | } |
| 60 | |
| 61 | // NewForConfig creates a new AppsV1Client for the given config. |
| 62 | func 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. |
| 76 | func 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. |
| 85 | func New(c rest.Interface) *AppsV1Client { |
| 86 | return &AppsV1Client{c} |
| 87 | } |
| 88 | |
| 89 | func setConfigDefaults(config *rest.Config) error { |
| 90 | gv := v1.SchemeGroupVersion |
| 91 | config.GroupVersion = &gv |
| 92 | config.APIPath = "/apis" |
David Bainbridge | 8697152 | 2019-09-26 22:09:39 +0000 | [diff] [blame] | 93 | config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() |
Zack Williams | e940c7a | 2019-08-21 14:25:39 -0700 | [diff] [blame] | 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. |
| 104 | func (c *AppsV1Client) RESTClient() rest.Interface { |
| 105 | if c == nil { |
| 106 | return nil |
| 107 | } |
| 108 | return c.restClient |
| 109 | } |