Remove BPA from Makefile
[icn.git] / cmd / bpa-operator / vendor / k8s.io / client-go / kubernetes / typed / policy / v1beta1 / policy_client.go
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 v1beta1
20
21 import (
22         v1beta1 "k8s.io/api/policy/v1beta1"
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 PolicyV1beta1Interface interface {
29         RESTClient() rest.Interface
30         EvictionsGetter
31         PodDisruptionBudgetsGetter
32         PodSecurityPoliciesGetter
33 }
34
35 // PolicyV1beta1Client is used to interact with features provided by the policy group.
36 type PolicyV1beta1Client struct {
37         restClient rest.Interface
38 }
39
40 func (c *PolicyV1beta1Client) Evictions(namespace string) EvictionInterface {
41         return newEvictions(c, namespace)
42 }
43
44 func (c *PolicyV1beta1Client) PodDisruptionBudgets(namespace string) PodDisruptionBudgetInterface {
45         return newPodDisruptionBudgets(c, namespace)
46 }
47
48 func (c *PolicyV1beta1Client) PodSecurityPolicies() PodSecurityPolicyInterface {
49         return newPodSecurityPolicies(c)
50 }
51
52 // NewForConfig creates a new PolicyV1beta1Client for the given config.
53 func NewForConfig(c *rest.Config) (*PolicyV1beta1Client, error) {
54         config := *c
55         if err := setConfigDefaults(&config); err != nil {
56                 return nil, err
57         }
58         client, err := rest.RESTClientFor(&config)
59         if err != nil {
60                 return nil, err
61         }
62         return &PolicyV1beta1Client{client}, nil
63 }
64
65 // NewForConfigOrDie creates a new PolicyV1beta1Client for the given config and
66 // panics if there is an error in the config.
67 func NewForConfigOrDie(c *rest.Config) *PolicyV1beta1Client {
68         client, err := NewForConfig(c)
69         if err != nil {
70                 panic(err)
71         }
72         return client
73 }
74
75 // New creates a new PolicyV1beta1Client for the given RESTClient.
76 func New(c rest.Interface) *PolicyV1beta1Client {
77         return &PolicyV1beta1Client{c}
78 }
79
80 func setConfigDefaults(config *rest.Config) error {
81         gv := v1beta1.SchemeGroupVersion
82         config.GroupVersion = &gv
83         config.APIPath = "/apis"
84         config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs}
85
86         if config.UserAgent == "" {
87                 config.UserAgent = rest.DefaultKubernetesUserAgent()
88         }
89
90         return nil
91 }
92
93 // RESTClient returns a RESTClient that is used to communicate
94 // with API server by this client implementation.
95 func (c *PolicyV1beta1Client) RESTClient() rest.Interface {
96         if c == nil {
97                 return nil
98         }
99         return c.restClient
100 }