halkyon.io/api@v1.0.0-rc.6/capability/clientset/versioned/clientset.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 versioned
    20  
    21  import (
    22  	halkyonv1beta1 "halkyon.io/api/capability/clientset/versioned/typed/capability/v1beta1"
    23  	discovery "k8s.io/client-go/discovery"
    24  	rest "k8s.io/client-go/rest"
    25  	flowcontrol "k8s.io/client-go/util/flowcontrol"
    26  )
    27  
    28  type Interface interface {
    29  	Discovery() discovery.DiscoveryInterface
    30  	HalkyonV1beta1() halkyonv1beta1.HalkyonV1beta1Interface
    31  	// Deprecated: please explicitly pick a version if possible.
    32  	Halkyon() halkyonv1beta1.HalkyonV1beta1Interface
    33  }
    34  
    35  // Clientset contains the clients for groups. Each group has exactly one
    36  // version included in a Clientset.
    37  type Clientset struct {
    38  	*discovery.DiscoveryClient
    39  	halkyonV1beta1 *halkyonv1beta1.HalkyonV1beta1Client
    40  }
    41  
    42  // HalkyonV1beta1 retrieves the HalkyonV1beta1Client
    43  func (c *Clientset) HalkyonV1beta1() halkyonv1beta1.HalkyonV1beta1Interface {
    44  	return c.halkyonV1beta1
    45  }
    46  
    47  // Deprecated: Halkyon retrieves the default version of HalkyonClient.
    48  // Please explicitly pick a version.
    49  func (c *Clientset) Halkyon() halkyonv1beta1.HalkyonV1beta1Interface {
    50  	return c.halkyonV1beta1
    51  }
    52  
    53  // Discovery retrieves the DiscoveryClient
    54  func (c *Clientset) Discovery() discovery.DiscoveryInterface {
    55  	if c == nil {
    56  		return nil
    57  	}
    58  	return c.DiscoveryClient
    59  }
    60  
    61  // NewForConfig creates a new Clientset for the given config.
    62  func NewForConfig(c *rest.Config) (*Clientset, error) {
    63  	configShallowCopy := *c
    64  	if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 {
    65  		configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst)
    66  	}
    67  	var cs Clientset
    68  	var err error
    69  	cs.halkyonV1beta1, err = halkyonv1beta1.NewForConfig(&configShallowCopy)
    70  	if err != nil {
    71  		return nil, err
    72  	}
    73  
    74  	cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy)
    75  	if err != nil {
    76  		return nil, err
    77  	}
    78  	return &cs, nil
    79  }
    80  
    81  // NewForConfigOrDie creates a new Clientset for the given config and
    82  // panics if there is an error in the config.
    83  func NewForConfigOrDie(c *rest.Config) *Clientset {
    84  	var cs Clientset
    85  	cs.halkyonV1beta1 = halkyonv1beta1.NewForConfigOrDie(c)
    86  
    87  	cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c)
    88  	return &cs
    89  }
    90  
    91  // New creates a new Clientset for the given RESTClient.
    92  func New(c rest.Interface) *Clientset {
    93  	var cs Clientset
    94  	cs.halkyonV1beta1 = halkyonv1beta1.New(c)
    95  
    96  	cs.DiscoveryClient = discovery.NewDiscoveryClient(c)
    97  	return &cs
    98  }