k8s.io/client-go@v0.22.2/kubernetes/typed/apps/v1beta2/apps_client.go (about)

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