github.com/treeverse/lakefs@v1.24.1-0.20240520134607-95648127bfb0/clients/python/lakefs_sdk/api/config_api.py (about) 1 # coding: utf-8 2 3 """ 4 lakeFS API 5 6 lakeFS HTTP API 7 8 The version of the OpenAPI document: 1.0.0 9 Contact: services@treeverse.io 10 Generated by OpenAPI Generator (https://openapi-generator.tech) 11 12 Do not edit the class manually. 13 """ # noqa: E501 14 15 16 import re # noqa: F401 17 import io 18 import warnings 19 20 try: 21 from pydantic.v1 import validate_arguments, ValidationError 22 except ImportError: 23 from pydantic import validate_arguments, ValidationError 24 from typing_extensions import Annotated 25 26 from lakefs_sdk.models.config import Config 27 28 from lakefs_sdk.api_client import ApiClient 29 from lakefs_sdk.api_response import ApiResponse 30 from lakefs_sdk.exceptions import ( # noqa: F401 31 ApiTypeError, 32 ApiValueError 33 ) 34 35 36 class ConfigApi(object): 37 """NOTE: This class is auto generated by OpenAPI Generator 38 Ref: https://openapi-generator.tech 39 40 Do not edit the class manually. 41 """ 42 43 def __init__(self, api_client=None): 44 if api_client is None: 45 api_client = ApiClient.get_default() 46 self.api_client = api_client 47 48 @validate_arguments 49 def get_config(self, **kwargs) -> Config: # noqa: E501 50 """get_config # noqa: E501 51 52 retrieve lakeFS configuration # noqa: E501 53 This method makes a synchronous HTTP request by default. To make an 54 asynchronous HTTP request, please pass async_req=True 55 56 >>> thread = api.get_config(async_req=True) 57 >>> result = thread.get() 58 59 :param async_req: Whether to execute the request asynchronously. 60 :type async_req: bool, optional 61 :param _request_timeout: timeout setting for this request. If one 62 number provided, it will be total request 63 timeout. It can also be a pair (tuple) of 64 (connection, read) timeouts. 65 :return: Returns the result object. 66 If the method is called asynchronously, 67 returns the request thread. 68 :rtype: Config 69 """ 70 kwargs['_return_http_data_only'] = True 71 if '_preload_content' in kwargs: 72 raise ValueError("Error! Please call the get_config_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") 73 return self.get_config_with_http_info(**kwargs) # noqa: E501 74 75 @validate_arguments 76 def get_config_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 77 """get_config # noqa: E501 78 79 retrieve lakeFS configuration # noqa: E501 80 This method makes a synchronous HTTP request by default. To make an 81 asynchronous HTTP request, please pass async_req=True 82 83 >>> thread = api.get_config_with_http_info(async_req=True) 84 >>> result = thread.get() 85 86 :param async_req: Whether to execute the request asynchronously. 87 :type async_req: bool, optional 88 :param _preload_content: if False, the ApiResponse.data will 89 be set to none and raw_data will store the 90 HTTP response body without reading/decoding. 91 Default is True. 92 :type _preload_content: bool, optional 93 :param _return_http_data_only: response data instead of ApiResponse 94 object with status code, headers, etc 95 :type _return_http_data_only: bool, optional 96 :param _request_timeout: timeout setting for this request. If one 97 number provided, it will be total request 98 timeout. It can also be a pair (tuple) of 99 (connection, read) timeouts. 100 :param _request_auth: set to override the auth_settings for an a single 101 request; this effectively ignores the authentication 102 in the spec for a single request. 103 :type _request_auth: dict, optional 104 :type _content_type: string, optional: force content-type for the request 105 :return: Returns the result object. 106 If the method is called asynchronously, 107 returns the request thread. 108 :rtype: tuple(Config, status_code(int), headers(HTTPHeaderDict)) 109 """ 110 111 _params = locals() 112 113 _all_params = [ 114 ] 115 _all_params.extend( 116 [ 117 'async_req', 118 '_return_http_data_only', 119 '_preload_content', 120 '_request_timeout', 121 '_request_auth', 122 '_content_type', 123 '_headers' 124 ] 125 ) 126 127 # validate the arguments 128 for _key, _val in _params['kwargs'].items(): 129 if _key not in _all_params: 130 raise ApiTypeError( 131 "Got an unexpected keyword argument '%s'" 132 " to method get_config" % _key 133 ) 134 _params[_key] = _val 135 del _params['kwargs'] 136 137 _collection_formats = {} 138 139 # process the path parameters 140 _path_params = {} 141 142 # process the query parameters 143 _query_params = [] 144 # process the header parameters 145 _header_params = dict(_params.get('_headers', {})) 146 # process the form parameters 147 _form_params = [] 148 _files = {} 149 # process the body parameter 150 _body_params = None 151 # set the HTTP header `Accept` 152 _header_params['Accept'] = self.api_client.select_header_accept( 153 ['application/json']) # noqa: E501 154 155 # authentication setting 156 _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 157 158 _response_types_map = { 159 '200': "Config", 160 '401': "Error", 161 } 162 163 return self.api_client.call_api( 164 '/config', 'GET', 165 _path_params, 166 _query_params, 167 _header_params, 168 body=_body_params, 169 post_params=_form_params, 170 files=_files, 171 response_types_map=_response_types_map, 172 auth_settings=_auth_settings, 173 async_req=_params.get('async_req'), 174 _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 175 _preload_content=_params.get('_preload_content', True), 176 _request_timeout=_params.get('_request_timeout'), 177 collection_formats=_collection_formats, 178 _request_auth=_params.get('_request_auth'))