github.com/interconnectedcloud/qdr-operator@v0.0.0-20210826174505-576d2b33dac7/pkg/client/clientset/versioned/clientset.go (about) 1 /* 2 Copyright 2019 The Interconnectedcloud 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 interconnectedcloudv1alpha1 "github.com/interconnectedcloud/qdr-operator/pkg/client/clientset/versioned/typed/interconnectedcloud/v1alpha1" 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 InterconnectedcloudV1alpha1() interconnectedcloudv1alpha1.InterconnectedcloudV1alpha1Interface 31 // Deprecated: please explicitly pick a version if possible. 32 Interconnectedcloud() interconnectedcloudv1alpha1.InterconnectedcloudV1alpha1Interface 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 interconnectedcloudV1alpha1 *interconnectedcloudv1alpha1.InterconnectedcloudV1alpha1Client 40 } 41 42 // InterconnectedcloudV1alpha1 retrieves the InterconnectedcloudV1alpha1Client 43 func (c *Clientset) InterconnectedcloudV1alpha1() interconnectedcloudv1alpha1.InterconnectedcloudV1alpha1Interface { 44 return c.interconnectedcloudV1alpha1 45 } 46 47 // Deprecated: Interconnectedcloud retrieves the default version of InterconnectedcloudClient. 48 // Please explicitly pick a version. 49 func (c *Clientset) Interconnectedcloud() interconnectedcloudv1alpha1.InterconnectedcloudV1alpha1Interface { 50 return c.interconnectedcloudV1alpha1 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.interconnectedcloudV1alpha1, err = interconnectedcloudv1alpha1.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.interconnectedcloudV1alpha1 = interconnectedcloudv1alpha1.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.interconnectedcloudV1alpha1 = interconnectedcloudv1alpha1.New(c) 95 96 cs.DiscoveryClient = discovery.NewDiscoveryClient(c) 97 return &cs 98 }