2 Copyright The Kubernetes Authors.
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
8 http://www.apache.org/licenses/LICENSE-2.0
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.
17 // Code generated by client-gen. DO NOT EDIT.
22 v1 "k8s.io/api/batch/v1"
23 serializer "k8s.io/apimachinery/pkg/runtime/serializer"
24 "k8s.io/client-go/kubernetes/scheme"
25 rest "k8s.io/client-go/rest"
28 type BatchV1Interface interface {
29 RESTClient() rest.Interface
33 // BatchV1Client is used to interact with features provided by the batch group.
34 type BatchV1Client struct {
35 restClient rest.Interface
38 func (c *BatchV1Client) Jobs(namespace string) JobInterface {
39 return newJobs(c, namespace)
42 // NewForConfig creates a new BatchV1Client for the given config.
43 func NewForConfig(c *rest.Config) (*BatchV1Client, error) {
45 if err := setConfigDefaults(&config); err != nil {
48 client, err := rest.RESTClientFor(&config)
52 return &BatchV1Client{client}, nil
55 // NewForConfigOrDie creates a new BatchV1Client for the given config and
56 // panics if there is an error in the config.
57 func NewForConfigOrDie(c *rest.Config) *BatchV1Client {
58 client, err := NewForConfig(c)
65 // New creates a new BatchV1Client for the given RESTClient.
66 func New(c rest.Interface) *BatchV1Client {
67 return &BatchV1Client{c}
70 func setConfigDefaults(config *rest.Config) error {
71 gv := v1.SchemeGroupVersion
72 config.GroupVersion = &gv
73 config.APIPath = "/apis"
74 config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs}
76 if config.UserAgent == "" {
77 config.UserAgent = rest.DefaultKubernetesUserAgent()
83 // RESTClient returns a RESTClient that is used to communicate
84 // with API server by this client implementation.
85 func (c *BatchV1Client) RESTClient() rest.Interface {