1# coding: utf-8
2"""
3    Kubernetes
4
5    No description provided (generated by Swagger Codegen
6    https://github.com/swagger-api/swagger-codegen)
7
8    OpenAPI spec version: v1.14.4
9
10    Generated by: https://github.com/swagger-api/swagger-codegen.git
11"""
12
13from __future__ import absolute_import
14
15import sys
16import os
17import re
18
19# python 2 and python 3 compatibility library
20from six import iteritems
21
22from ..api_client import ApiClient
23
24
25class PolicyApi(object):
26  """
27    NOTE: This class is auto generated by the swagger code generator program.
28    Do not edit the class manually.
29    Ref: https://github.com/swagger-api/swagger-codegen
30    """
31
32  def __init__(self, api_client=None):
33    if api_client is None:
34      api_client = ApiClient()
35    self.api_client = api_client
36
37  def get_api_group(self, **kwargs):
38    """
39        get information of a group
40        This method makes a synchronous HTTP request by default. To make an
41        asynchronous HTTP request, please pass async_req=True
42        >>> thread = api.get_api_group(async_req=True)
43        >>> result = thread.get()
44
45        :param async_req bool
46        :return: V1APIGroup
47                 If the method is called asynchronously,
48                 returns the request thread.
49        """
50    kwargs['_return_http_data_only'] = True
51    if kwargs.get('async_req'):
52      return self.get_api_group_with_http_info(**kwargs)
53    else:
54      (data) = self.get_api_group_with_http_info(**kwargs)
55      return data
56
57  def get_api_group_with_http_info(self, **kwargs):
58    """
59        get information of a group
60        This method makes a synchronous HTTP request by default. To make an
61        asynchronous HTTP request, please pass async_req=True
62        >>> thread = api.get_api_group_with_http_info(async_req=True)
63        >>> result = thread.get()
64
65        :param async_req bool
66        :return: V1APIGroup
67                 If the method is called asynchronously,
68                 returns the request thread.
69        """
70
71    all_params = []
72    all_params.append('async_req')
73    all_params.append('_return_http_data_only')
74    all_params.append('_preload_content')
75    all_params.append('_request_timeout')
76
77    params = locals()
78    for key, val in iteritems(params['kwargs']):
79      if key not in all_params:
80        raise TypeError("Got an unexpected keyword argument '%s'"
81                        ' to method get_api_group' % key)
82      params[key] = val
83    del params['kwargs']
84
85    collection_formats = {}
86
87    path_params = {}
88
89    query_params = []
90
91    header_params = {}
92
93    form_params = []
94    local_var_files = {}
95
96    body_params = None
97    # HTTP header `Accept`
98    header_params['Accept'] = self.api_client.\
99        select_header_accept(['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'])
100
101    # HTTP header `Content-Type`
102    header_params['Content-Type'] = self.api_client.\
103        select_header_content_type(['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'])
104
105    # Authentication setting
106    auth_settings = ['BearerToken']
107
108    return self.api_client.call_api(
109        '/apis/policy/',
110        'GET',
111        path_params,
112        query_params,
113        header_params,
114        body=body_params,
115        post_params=form_params,
116        files=local_var_files,
117        response_type='V1APIGroup',
118        auth_settings=auth_settings,
119        async_req=params.get('async_req'),
120        _return_http_data_only=params.get('_return_http_data_only'),
121        _preload_content=params.get('_preload_content', True),
122        _request_timeout=params.get('_request_timeout'),
123        collection_formats=collection_formats)
124