@@ -245,12 +245,12 @@ def __deserialize(self, data, klass):
245
245
246
246
if type (klass ) == str :
247
247
if klass .startswith ('list[' ):
248
- sub_kls = re .match ('list\[(.*)\]' , klass ).group (1 )
248
+ sub_kls = re .match (r 'list\[(.*)\]' , klass ).group (1 )
249
249
return [self .__deserialize (sub_data , sub_kls )
250
250
for sub_data in data ]
251
251
252
252
if klass .startswith ('dict(' ):
253
- sub_kls = re .match ('dict\(([^,]*), (.*)\)' , klass ).group (2 )
253
+ sub_kls = re .match (r 'dict\(([^,]*), (.*)\)' , klass ).group (2 )
254
254
return {k : self .__deserialize (v , sub_kls )
255
255
for k , v in six .iteritems (data )}
256
256
@@ -274,12 +274,12 @@ def __deserialize(self, data, klass):
274
274
def call_api (self , resource_path , method ,
275
275
path_params = None , query_params = None , header_params = None ,
276
276
body = None , post_params = None , files = None ,
277
- response_type = None , auth_settings = None , async = None ,
277
+ response_type = None , auth_settings = None , async_req = None ,
278
278
_return_http_data_only = None , collection_formats = None ,
279
279
_preload_content = True , _request_timeout = None ):
280
280
"""Makes the HTTP request (synchronous) and returns deserialized data.
281
281
282
- To make an async request, set the async parameter.
282
+ To make an async request, set the async_req parameter.
283
283
284
284
:param resource_path: Path to method endpoint.
285
285
:param method: Method to call.
@@ -294,7 +294,7 @@ def call_api(self, resource_path, method,
294
294
:param response: Response data type.
295
295
:param files dict: key -> filename, value -> filepath,
296
296
for `multipart/form-data`.
297
- :param async bool: execute request asynchronously
297
+ :param async_req bool: execute request asynchronously
298
298
:param _return_http_data_only: response data without head status code
299
299
and headers
300
300
:param collection_formats: dict of collection formats for path, query,
@@ -307,13 +307,13 @@ def call_api(self, resource_path, method,
307
307
timeout. It can also be a pair (tuple) of
308
308
(connection, read) timeouts.
309
309
:return:
310
- If async parameter is True,
310
+ If async_req parameter is True,
311
311
the request will be called asynchronously.
312
312
The method will return the request thread.
313
- If parameter async is False or missing,
313
+ If parameter async_req is False or missing,
314
314
then the method will return the response directly.
315
315
"""
316
- if not async :
316
+ if not async_req :
317
317
return self .__call_api (resource_path , method ,
318
318
path_params , query_params , header_params ,
319
319
body , post_params , files ,
@@ -591,6 +591,9 @@ def __deserialize_datatime(self, string):
591
591
)
592
592
)
593
593
594
+ def __hasattr (self , object , name ):
595
+ return name in object .__dict__
596
+
594
597
def __deserialize_model (self , data , klass ):
595
598
"""Deserializes list or dict to model.
596
599
@@ -599,7 +602,7 @@ def __deserialize_model(self, data, klass):
599
602
:return: model object.
600
603
"""
601
604
602
- if not klass .swagger_types and not hasattr (klass ,
605
+ if not klass .swagger_types and not self . __hasattr (klass ,
603
606
'get_real_child_model' ):
604
607
return data
605
608
@@ -620,7 +623,7 @@ def __deserialize_model(self, data, klass):
620
623
for key , value in data .items ():
621
624
if key not in klass .swagger_types :
622
625
instance [key ] = value
623
- if hasattr (instance , 'get_real_child_model' ):
626
+ if self . __hasattr (instance , 'get_real_child_model' ):
624
627
klass_name = instance .get_real_child_model (data )
625
628
if klass_name :
626
629
instance = self .__deserialize (data , klass_name )
0 commit comments