Remove BPA from Makefile
[icn.git] / cmd / bpa-operator / vendor / github.com / coreos / prometheus-operator / pkg / client / versioned / typed / monitoring / v1 / monitoring_client.go
1 // Copyright 2018 The prometheus-operator Authors
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //     http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 // Code generated by client-gen. DO NOT EDIT.
16
17 package v1
18
19 import (
20         v1 "github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1"
21         "github.com/coreos/prometheus-operator/pkg/client/versioned/scheme"
22         serializer "k8s.io/apimachinery/pkg/runtime/serializer"
23         rest "k8s.io/client-go/rest"
24 )
25
26 type MonitoringV1Interface interface {
27         RESTClient() rest.Interface
28         AlertmanagersGetter
29         PrometheusesGetter
30         PrometheusRulesGetter
31         ServiceMonitorsGetter
32 }
33
34 // MonitoringV1Client is used to interact with features provided by the monitoring.coreos.com group.
35 type MonitoringV1Client struct {
36         restClient rest.Interface
37 }
38
39 func (c *MonitoringV1Client) Alertmanagers(namespace string) AlertmanagerInterface {
40         return newAlertmanagers(c, namespace)
41 }
42
43 func (c *MonitoringV1Client) Prometheuses(namespace string) PrometheusInterface {
44         return newPrometheuses(c, namespace)
45 }
46
47 func (c *MonitoringV1Client) PrometheusRules(namespace string) PrometheusRuleInterface {
48         return newPrometheusRules(c, namespace)
49 }
50
51 func (c *MonitoringV1Client) ServiceMonitors(namespace string) ServiceMonitorInterface {
52         return newServiceMonitors(c, namespace)
53 }
54
55 // NewForConfig creates a new MonitoringV1Client for the given config.
56 func NewForConfig(c *rest.Config) (*MonitoringV1Client, error) {
57         config := *c
58         if err := setConfigDefaults(&config); err != nil {
59                 return nil, err
60         }
61         client, err := rest.RESTClientFor(&config)
62         if err != nil {
63                 return nil, err
64         }
65         return &MonitoringV1Client{client}, nil
66 }
67
68 // NewForConfigOrDie creates a new MonitoringV1Client for the given config and
69 // panics if there is an error in the config.
70 func NewForConfigOrDie(c *rest.Config) *MonitoringV1Client {
71         client, err := NewForConfig(c)
72         if err != nil {
73                 panic(err)
74         }
75         return client
76 }
77
78 // New creates a new MonitoringV1Client for the given RESTClient.
79 func New(c rest.Interface) *MonitoringV1Client {
80         return &MonitoringV1Client{c}
81 }
82
83 func setConfigDefaults(config *rest.Config) error {
84         gv := v1.SchemeGroupVersion
85         config.GroupVersion = &gv
86         config.APIPath = "/apis"
87         config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs}
88
89         if config.UserAgent == "" {
90                 config.UserAgent = rest.DefaultKubernetesUserAgent()
91         }
92
93         return nil
94 }
95
96 // RESTClient returns a RESTClient that is used to communicate
97 // with API server by this client implementation.
98 func (c *MonitoringV1Client) RESTClient() rest.Interface {
99         if c == nil {
100                 return nil
101         }
102         return c.restClient
103 }