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