blob: 03fe25e487e47ea5de015674ebd0c6a2eee37aef [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 v2beta2
20
21import (
22 v2beta2 "k8s.io/api/autoscaling/v2beta2"
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 AutoscalingV2beta2Interface interface {
29 RESTClient() rest.Interface
30 HorizontalPodAutoscalersGetter
31}
32
33// AutoscalingV2beta2Client is used to interact with features provided by the autoscaling group.
34type AutoscalingV2beta2Client struct {
35 restClient rest.Interface
36}
37
38func (c *AutoscalingV2beta2Client) HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerInterface {
39 return newHorizontalPodAutoscalers(c, namespace)
40}
41
42// NewForConfig creates a new AutoscalingV2beta2Client for the given config.
43func NewForConfig(c *rest.Config) (*AutoscalingV2beta2Client, error) {
44 config := *c
45 if err := setConfigDefaults(&config); err != nil {
46 return nil, err
47 }
48 client, err := rest.RESTClientFor(&config)
49 if err != nil {
50 return nil, err
51 }
52 return &AutoscalingV2beta2Client{client}, nil
53}
54
55// NewForConfigOrDie creates a new AutoscalingV2beta2Client for the given config and
56// panics if there is an error in the config.
57func NewForConfigOrDie(c *rest.Config) *AutoscalingV2beta2Client {
58 client, err := NewForConfig(c)
59 if err != nil {
60 panic(err)
61 }
62 return client
63}
64
65// New creates a new AutoscalingV2beta2Client for the given RESTClient.
66func New(c rest.Interface) *AutoscalingV2beta2Client {
67 return &AutoscalingV2beta2Client{c}
68}
69
70func setConfigDefaults(config *rest.Config) error {
71 gv := v2beta2.SchemeGroupVersion
72 config.GroupVersion = &gv
73 config.APIPath = "/apis"
74 config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs}
75
76 if config.UserAgent == "" {
77 config.UserAgent = rest.DefaultKubernetesUserAgent()
78 }
79
80 return nil
81}
82
83// RESTClient returns a RESTClient that is used to communicate
84// with API server by this client implementation.
85func (c *AutoscalingV2beta2Client) RESTClient() rest.Interface {
86 if c == nil {
87 return nil
88 }
89 return c.restClient
90}