12
12
""" # noqa: E501
13
13
14
14
15
- import re # noqa: F401
16
15
import io
17
16
import warnings
18
17
19
- from pydantic import validate_arguments , ValidationError
18
+ from pydantic import validate_call , Field , StrictFloat , StrictStr , StrictInt
19
+ from typing import Dict , List , Optional , Tuple , Union , Any
20
+
21
+ try :
22
+ from typing import Annotated
23
+ except ImportError :
24
+ from typing_extensions import Annotated
20
25
21
26
22
27
from labs_alert_manager_client .api_client import ApiClient
23
28
from labs_alert_manager_client .api_response import ApiResponse
24
- from labs_alert_manager_client .exceptions import ( # noqa: F401
25
- ApiTypeError ,
26
- ApiValueError
27
- )
29
+ from labs_alert_manager_client .rest import RESTResponseType
28
30
29
31
30
32
class HealthCheckApi :
@@ -39,126 +41,237 @@ def __init__(self, api_client=None) -> None:
39
41
api_client = ApiClient .get_default ()
40
42
self .api_client = api_client
41
43
42
- @validate_arguments
43
- def get_health_check (self , ** kwargs ) -> None : # noqa: E501
44
- """get_health_check # noqa: E501
45
44
46
- This method makes a synchronous HTTP request by default. To make an
47
- asynchronous HTTP request, please pass async_req=True
45
+ @validate_call
46
+ def get_health_check (
47
+ self ,
48
+ _request_timeout : Union [
49
+ None ,
50
+ Annotated [StrictFloat , Field (gt = 0 )],
51
+ Tuple [
52
+ Annotated [StrictFloat , Field (gt = 0 )],
53
+ Annotated [StrictFloat , Field (gt = 0 )]
54
+ ]
55
+ ] = None ,
56
+ _request_auth : Optional [Dict [StrictStr , Any ]] = None ,
57
+ _content_type : Optional [StrictStr ] = None ,
58
+ _headers : Optional [Dict [StrictStr , Any ]] = None ,
59
+ _host_index : Annotated [StrictInt , Field (ge = 0 , le = 0 )] = 0 ,
60
+ ) -> None :
61
+ """get_health_check
48
62
49
- >>> thread = api.get_health_check(async_req=True)
50
- >>> result = thread.get()
51
63
52
- :param async_req: Whether to execute the request asynchronously.
53
- :type async_req: bool, optional
54
- :param _request_timeout: timeout setting for this request.
55
- If one number provided, it will be total request
56
- timeout. It can also be a pair (tuple) of
57
- (connection, read) timeouts.
64
+ :param _request_timeout: timeout setting for this request. If one
65
+ number provided, it will be total request
66
+ timeout. It can also be a pair (tuple) of
67
+ (connection, read) timeouts.
68
+ :type _request_timeout: int, tuple(int, int), optional
69
+ :param _request_auth: set to override the auth_settings for an a single
70
+ request; this effectively ignores the
71
+ authentication in the spec for a single request.
72
+ :type _request_auth: dict, optional
73
+ :param _content_type: force content-type for the request.
74
+ :type _content_type: str, Optional
75
+ :param _headers: set to override the headers for a single
76
+ request; this effectively ignores the headers
77
+ in the spec for a single request.
78
+ :type _headers: dict, optional
79
+ :param _host_index: set to override the host_index for a single
80
+ request; this effectively ignores the host_index
81
+ in the spec for a single request.
82
+ :type _host_index: int, optional
58
83
:return: Returns the result object.
59
- If the method is called asynchronously,
60
- returns the request thread.
61
- :rtype: None
62
- """
63
- kwargs ['_return_http_data_only' ] = True
64
- if '_preload_content' in kwargs :
65
- message = "Error! Please call the get_health_check_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
66
- raise ValueError (message )
67
- return self .get_health_check_with_http_info (** kwargs ) # noqa: E501
68
-
69
- @validate_arguments
70
- def get_health_check_with_http_info (self , ** kwargs ) -> ApiResponse : # noqa: E501
71
- """get_health_check # noqa: E501
72
-
73
- This method makes a synchronous HTTP request by default. To make an
74
- asynchronous HTTP request, please pass async_req=True
75
-
76
- >>> thread = api.get_health_check_with_http_info(async_req=True)
77
- >>> result = thread.get()
78
-
79
- :param async_req: Whether to execute the request asynchronously.
80
- :type async_req: bool, optional
81
- :param _preload_content: if False, the ApiResponse.data will
82
- be set to none and raw_data will store the
83
- HTTP response body without reading/decoding.
84
- Default is True.
85
- :type _preload_content: bool, optional
86
- :param _return_http_data_only: response data instead of ApiResponse
87
- object with status code, headers, etc
88
- :type _return_http_data_only: bool, optional
84
+ """ # noqa: E501
85
+
86
+ _param = self ._get_health_check_serialize (
87
+ _request_auth = _request_auth ,
88
+ _content_type = _content_type ,
89
+ _headers = _headers ,
90
+ _host_index = _host_index
91
+ )
92
+
93
+ _response_types_map : Dict [str , Optional [str ]] = {
94
+
95
+ }
96
+ response_data = self .api_client .call_api (
97
+ * _param ,
98
+ _request_timeout = _request_timeout
99
+ )
100
+ response_data .read ()
101
+ return self .api_client .response_deserialize (
102
+ response_data = response_data ,
103
+ response_types_map = _response_types_map ,
104
+ ).data
105
+
106
+
107
+ @validate_call
108
+ def get_health_check_with_http_info (
109
+ self ,
110
+ _request_timeout : Union [
111
+ None ,
112
+ Annotated [StrictFloat , Field (gt = 0 )],
113
+ Tuple [
114
+ Annotated [StrictFloat , Field (gt = 0 )],
115
+ Annotated [StrictFloat , Field (gt = 0 )]
116
+ ]
117
+ ] = None ,
118
+ _request_auth : Optional [Dict [StrictStr , Any ]] = None ,
119
+ _content_type : Optional [StrictStr ] = None ,
120
+ _headers : Optional [Dict [StrictStr , Any ]] = None ,
121
+ _host_index : Annotated [StrictInt , Field (ge = 0 , le = 0 )] = 0 ,
122
+ ) -> ApiResponse [None ]:
123
+ """get_health_check
124
+
125
+
89
126
:param _request_timeout: timeout setting for this request. If one
90
127
number provided, it will be total request
91
128
timeout. It can also be a pair (tuple) of
92
129
(connection, read) timeouts.
130
+ :type _request_timeout: int, tuple(int, int), optional
93
131
:param _request_auth: set to override the auth_settings for an a single
94
- request; this effectively ignores the authentication
95
- in the spec for a single request.
132
+ request; this effectively ignores the
133
+ authentication in the spec for a single request.
96
134
:type _request_auth: dict, optional
97
- :type _content_type: string, optional: force content-type for the request
135
+ :param _content_type: force content-type for the request.
136
+ :type _content_type: str, Optional
137
+ :param _headers: set to override the headers for a single
138
+ request; this effectively ignores the headers
139
+ in the spec for a single request.
140
+ :type _headers: dict, optional
141
+ :param _host_index: set to override the host_index for a single
142
+ request; this effectively ignores the host_index
143
+ in the spec for a single request.
144
+ :type _host_index: int, optional
98
145
:return: Returns the result object.
99
- If the method is called asynchronously,
100
- returns the request thread.
101
- :rtype: None
102
- """
146
+ """ # noqa: E501
103
147
104
- _params = locals ()
148
+ _param = self ._get_health_check_serialize (
149
+ _request_auth = _request_auth ,
150
+ _content_type = _content_type ,
151
+ _headers = _headers ,
152
+ _host_index = _host_index
153
+ )
105
154
106
- _all_params = [
107
- ]
108
- _all_params .extend (
109
- [
110
- 'async_req' ,
111
- '_return_http_data_only' ,
112
- '_preload_content' ,
113
- '_request_timeout' ,
114
- '_request_auth' ,
115
- '_content_type' ,
116
- '_headers'
155
+ _response_types_map : Dict [str , Optional [str ]] = {
156
+
157
+ }
158
+ response_data = self .api_client .call_api (
159
+ * _param ,
160
+ _request_timeout = _request_timeout
161
+ )
162
+ response_data .read ()
163
+ return self .api_client .response_deserialize (
164
+ response_data = response_data ,
165
+ response_types_map = _response_types_map ,
166
+ )
167
+
168
+
169
+ @validate_call
170
+ def get_health_check_without_preload_content (
171
+ self ,
172
+ _request_timeout : Union [
173
+ None ,
174
+ Annotated [StrictFloat , Field (gt = 0 )],
175
+ Tuple [
176
+ Annotated [StrictFloat , Field (gt = 0 )],
177
+ Annotated [StrictFloat , Field (gt = 0 )]
117
178
]
179
+ ] = None ,
180
+ _request_auth : Optional [Dict [StrictStr , Any ]] = None ,
181
+ _content_type : Optional [StrictStr ] = None ,
182
+ _headers : Optional [Dict [StrictStr , Any ]] = None ,
183
+ _host_index : Annotated [StrictInt , Field (ge = 0 , le = 0 )] = 0 ,
184
+ ) -> RESTResponseType :
185
+ """get_health_check
186
+
187
+
188
+ :param _request_timeout: timeout setting for this request. If one
189
+ number provided, it will be total request
190
+ timeout. It can also be a pair (tuple) of
191
+ (connection, read) timeouts.
192
+ :type _request_timeout: int, tuple(int, int), optional
193
+ :param _request_auth: set to override the auth_settings for an a single
194
+ request; this effectively ignores the
195
+ authentication in the spec for a single request.
196
+ :type _request_auth: dict, optional
197
+ :param _content_type: force content-type for the request.
198
+ :type _content_type: str, Optional
199
+ :param _headers: set to override the headers for a single
200
+ request; this effectively ignores the headers
201
+ in the spec for a single request.
202
+ :type _headers: dict, optional
203
+ :param _host_index: set to override the host_index for a single
204
+ request; this effectively ignores the host_index
205
+ in the spec for a single request.
206
+ :type _host_index: int, optional
207
+ :return: Returns the result object.
208
+ """ # noqa: E501
209
+
210
+ _param = self ._get_health_check_serialize (
211
+ _request_auth = _request_auth ,
212
+ _content_type = _content_type ,
213
+ _headers = _headers ,
214
+ _host_index = _host_index
215
+ )
216
+
217
+ _response_types_map : Dict [str , Optional [str ]] = {
218
+
219
+ }
220
+ response_data = self .api_client .call_api (
221
+ * _param ,
222
+ _request_timeout = _request_timeout
118
223
)
224
+ return response_data .response
119
225
120
- # validate the arguments
121
- for _key , _val in _params ['kwargs' ].items ():
122
- if _key not in _all_params :
123
- raise ApiTypeError (
124
- "Got an unexpected keyword argument '%s'"
125
- " to method get_health_check" % _key
126
- )
127
- _params [_key ] = _val
128
- del _params ['kwargs' ]
129
226
130
- _collection_formats = {}
227
+ def _get_health_check_serialize (
228
+ self ,
229
+ _request_auth ,
230
+ _content_type ,
231
+ _headers ,
232
+ _host_index ,
233
+ ) -> Tuple :
131
234
132
- # process the path parameters
133
- _path_params = {}
235
+ _host = None
236
+
237
+ _collection_formats : Dict [str , str ] = {
238
+
239
+ }
134
240
241
+ _path_params : Dict [str , str ] = {}
242
+ _query_params : List [Tuple [str , str ]] = []
243
+ _header_params : Dict [str , Optional [str ]] = _headers or {}
244
+ _form_params : List [Tuple [str , str ]] = []
245
+ _files : Dict [str , str ] = {}
246
+ _body_params : Optional [bytes ] = None
247
+
248
+ # process the path parameters
135
249
# process the query parameters
136
- _query_params = []
137
250
# process the header parameters
138
- _header_params = dict (_params .get ('_headers' , {}))
139
251
# process the form parameters
140
- _form_params = []
141
- _files = {}
142
252
# process the body parameter
143
- _body_params = None
144
- # authentication setting
145
- _auth_settings = ['auth_token' ] # noqa: E501
146
253
147
- _response_types_map = {}
148
254
149
- return self .api_client .call_api (
150
- '/health_check' , 'GET' ,
151
- _path_params ,
152
- _query_params ,
153
- _header_params ,
255
+
256
+
257
+ # authentication setting
258
+ _auth_settings : List [str ] = [
259
+ 'auth_token'
260
+ ]
261
+
262
+ return self .api_client .param_serialize (
263
+ method = 'GET' ,
264
+ resource_path = '/health_check' ,
265
+ path_params = _path_params ,
266
+ query_params = _query_params ,
267
+ header_params = _header_params ,
154
268
body = _body_params ,
155
269
post_params = _form_params ,
156
270
files = _files ,
157
- response_types_map = _response_types_map ,
158
271
auth_settings = _auth_settings ,
159
- async_req = _params .get ('async_req' ),
160
- _return_http_data_only = _params .get ('_return_http_data_only' ), # noqa: E501
161
- _preload_content = _params .get ('_preload_content' , True ),
162
- _request_timeout = _params .get ('_request_timeout' ),
163
272
collection_formats = _collection_formats ,
164
- _request_auth = _params .get ('_request_auth' ))
273
+ _host = _host ,
274
+ _request_auth = _request_auth
275
+ )
276
+
277
+
0 commit comments