How to use request_headers method in wpt

Best JavaScript code snippet using wpt

thing_park_integration_controller_api.py

Source:thing_park_integration_controller_api.py Github

copy

Full Screen

1# coding: utf-82"""3 Thingsboard REST API4 For instructions how to authorize requests please visit <a href='http://thingsboard.io/docs/reference/rest-api/'>REST API documentation page</a>. # noqa: E5015 OpenAPI spec version: 2.06 Contact: info@thingsboard.io7 Generated by: https://github.com/swagger-api/swagger-codegen.git8"""9from __future__ import absolute_import10import re # noqa: F40111# python 2 and python 3 compatibility library12import six13from pyTB.api_client import ApiClient14class ThingParkIntegrationControllerApi(object):15 """NOTE: This class is auto generated by the swagger code generator program.16 Do not edit the class manually.17 Ref: https://github.com/swagger-api/swagger-codegen18 """19 def __init__(self, api_client=None):20 if api_client is None:21 api_client = ApiClient()22 self.api_client = api_client23 def process_request_tpe_using_delete(self, body, request_headers, all_request_params, routing_key, **kwargs): # noqa: E50124 """processRequestTPE # noqa: E50125 This method makes a synchronous HTTP request by default. To make an26 asynchronous HTTP request, please pass async_req=True27 >>> thread = api.process_request_tpe_using_delete(body, request_headers, all_request_params, routing_key, async_req=True)28 >>> result = thread.get()29 :param async_req bool30 :param str body: msg (required)31 :param Object request_headers: requestHeaders (required)32 :param Object all_request_params: allRequestParams (required)33 :param str routing_key: routingKey (required)34 :return: DeferredResultResponseEntity35 If the method is called asynchronously,36 returns the request thread.37 """38 kwargs['_return_http_data_only'] = True39 if kwargs.get('async_req'):40 return self.process_request_tpe_using_delete_with_http_info(body, request_headers, all_request_params, routing_key, **kwargs) # noqa: E50141 else:42 (data) = self.process_request_tpe_using_delete_with_http_info(body, request_headers, all_request_params, routing_key, **kwargs) # noqa: E50143 return data44 def process_request_tpe_using_delete_with_http_info(self, body, request_headers, all_request_params, routing_key, **kwargs): # noqa: E50145 """processRequestTPE # noqa: E50146 This method makes a synchronous HTTP request by default. To make an47 asynchronous HTTP request, please pass async_req=True48 >>> thread = api.process_request_tpe_using_delete_with_http_info(body, request_headers, all_request_params, routing_key, async_req=True)49 >>> result = thread.get()50 :param async_req bool51 :param str body: msg (required)52 :param Object request_headers: requestHeaders (required)53 :param Object all_request_params: allRequestParams (required)54 :param str routing_key: routingKey (required)55 :return: DeferredResultResponseEntity56 If the method is called asynchronously,57 returns the request thread.58 """59 all_params = ['body', 'request_headers', 'all_request_params', 'routing_key'] # noqa: E50160 all_params.append('async_req')61 all_params.append('_return_http_data_only')62 all_params.append('_preload_content')63 all_params.append('_request_timeout')64 params = locals()65 for key, val in six.iteritems(params['kwargs']):66 if key not in all_params:67 raise TypeError(68 "Got an unexpected keyword argument '%s'"69 " to method process_request_tpe_using_delete" % key70 )71 params[key] = val72 del params['kwargs']73 # verify the required parameter 'body' is set74 if ('body' not in params or75 params['body'] is None):76 raise ValueError("Missing the required parameter `body` when calling `process_request_tpe_using_delete`") # noqa: E50177 # verify the required parameter 'request_headers' is set78 if ('request_headers' not in params or79 params['request_headers'] is None):80 raise ValueError("Missing the required parameter `request_headers` when calling `process_request_tpe_using_delete`") # noqa: E50181 # verify the required parameter 'all_request_params' is set82 if ('all_request_params' not in params or83 params['all_request_params'] is None):84 raise ValueError("Missing the required parameter `all_request_params` when calling `process_request_tpe_using_delete`") # noqa: E50185 # verify the required parameter 'routing_key' is set86 if ('routing_key' not in params or87 params['routing_key'] is None):88 raise ValueError("Missing the required parameter `routing_key` when calling `process_request_tpe_using_delete`") # noqa: E50189 collection_formats = {}90 path_params = {}91 if 'routing_key' in params:92 path_params['routingKey'] = params['routing_key'] # noqa: E50193 query_params = []94 if 'all_request_params' in params:95 query_params.append(('allRequestParams', params['all_request_params'])) # noqa: E50196 header_params = {}97 if 'request_headers' in params:98 header_params['requestHeaders'] = params['request_headers'] # noqa: E50199 form_params = []100 local_var_files = {}101 body_params = None102 if 'body' in params:103 body_params = params['body']104 # HTTP header `Accept`105 header_params['Accept'] = self.api_client.select_header_accept(106 ['*/*']) # noqa: E501107 # HTTP header `Content-Type`108 header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501109 ['application/json']) # noqa: E501110 # Authentication setting111 auth_settings = ['X-Authorization'] # noqa: E501112 return self.api_client.call_api(113 '/api/v1/integrations/tpe/{routingKey}{?allRequestParams}', 'DELETE',114 path_params,115 query_params,116 header_params,117 body=body_params,118 post_params=form_params,119 files=local_var_files,120 response_type='DeferredResultResponseEntity', # noqa: E501121 auth_settings=auth_settings,122 async_req=params.get('async_req'),123 _return_http_data_only=params.get('_return_http_data_only'),124 _preload_content=params.get('_preload_content', True),125 _request_timeout=params.get('_request_timeout'),126 collection_formats=collection_formats)127 def process_request_tpe_using_get(self, body, request_headers, all_request_params, routing_key, **kwargs): # noqa: E501128 """processRequestTPE # noqa: E501129 This method makes a synchronous HTTP request by default. To make an130 asynchronous HTTP request, please pass async_req=True131 >>> thread = api.process_request_tpe_using_get(body, request_headers, all_request_params, routing_key, async_req=True)132 >>> result = thread.get()133 :param async_req bool134 :param str body: msg (required)135 :param Object request_headers: requestHeaders (required)136 :param Object all_request_params: allRequestParams (required)137 :param str routing_key: routingKey (required)138 :return: DeferredResultResponseEntity139 If the method is called asynchronously,140 returns the request thread.141 """142 kwargs['_return_http_data_only'] = True143 if kwargs.get('async_req'):144 return self.process_request_tpe_using_get_with_http_info(body, request_headers, all_request_params, routing_key, **kwargs) # noqa: E501145 else:146 (data) = self.process_request_tpe_using_get_with_http_info(body, request_headers, all_request_params, routing_key, **kwargs) # noqa: E501147 return data148 def process_request_tpe_using_get_with_http_info(self, body, request_headers, all_request_params, routing_key, **kwargs): # noqa: E501149 """processRequestTPE # noqa: E501150 This method makes a synchronous HTTP request by default. To make an151 asynchronous HTTP request, please pass async_req=True152 >>> thread = api.process_request_tpe_using_get_with_http_info(body, request_headers, all_request_params, routing_key, async_req=True)153 >>> result = thread.get()154 :param async_req bool155 :param str body: msg (required)156 :param Object request_headers: requestHeaders (required)157 :param Object all_request_params: allRequestParams (required)158 :param str routing_key: routingKey (required)159 :return: DeferredResultResponseEntity160 If the method is called asynchronously,161 returns the request thread.162 """163 all_params = ['body', 'request_headers', 'all_request_params', 'routing_key'] # noqa: E501164 all_params.append('async_req')165 all_params.append('_return_http_data_only')166 all_params.append('_preload_content')167 all_params.append('_request_timeout')168 params = locals()169 for key, val in six.iteritems(params['kwargs']):170 if key not in all_params:171 raise TypeError(172 "Got an unexpected keyword argument '%s'"173 " to method process_request_tpe_using_get" % key174 )175 params[key] = val176 del params['kwargs']177 # verify the required parameter 'body' is set178 if ('body' not in params or179 params['body'] is None):180 raise ValueError("Missing the required parameter `body` when calling `process_request_tpe_using_get`") # noqa: E501181 # verify the required parameter 'request_headers' is set182 if ('request_headers' not in params or183 params['request_headers'] is None):184 raise ValueError("Missing the required parameter `request_headers` when calling `process_request_tpe_using_get`") # noqa: E501185 # verify the required parameter 'all_request_params' is set186 if ('all_request_params' not in params or187 params['all_request_params'] is None):188 raise ValueError("Missing the required parameter `all_request_params` when calling `process_request_tpe_using_get`") # noqa: E501189 # verify the required parameter 'routing_key' is set190 if ('routing_key' not in params or191 params['routing_key'] is None):192 raise ValueError("Missing the required parameter `routing_key` when calling `process_request_tpe_using_get`") # noqa: E501193 collection_formats = {}194 path_params = {}195 if 'routing_key' in params:196 path_params['routingKey'] = params['routing_key'] # noqa: E501197 query_params = []198 if 'all_request_params' in params:199 query_params.append(('allRequestParams', params['all_request_params'])) # noqa: E501200 header_params = {}201 if 'request_headers' in params:202 header_params['requestHeaders'] = params['request_headers'] # noqa: E501203 form_params = []204 local_var_files = {}205 body_params = None206 if 'body' in params:207 body_params = params['body']208 # HTTP header `Accept`209 header_params['Accept'] = self.api_client.select_header_accept(210 ['*/*']) # noqa: E501211 # HTTP header `Content-Type`212 header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501213 ['application/json']) # noqa: E501214 # Authentication setting215 auth_settings = ['X-Authorization'] # noqa: E501216 return self.api_client.call_api(217 '/api/v1/integrations/tpe/{routingKey}{?allRequestParams}', 'GET',218 path_params,219 query_params,220 header_params,221 body=body_params,222 post_params=form_params,223 files=local_var_files,224 response_type='DeferredResultResponseEntity', # noqa: E501225 auth_settings=auth_settings,226 async_req=params.get('async_req'),227 _return_http_data_only=params.get('_return_http_data_only'),228 _preload_content=params.get('_preload_content', True),229 _request_timeout=params.get('_request_timeout'),230 collection_formats=collection_formats)231 def process_request_tpe_using_head(self, body, request_headers, all_request_params, routing_key, **kwargs): # noqa: E501232 """processRequestTPE # noqa: E501233 This method makes a synchronous HTTP request by default. To make an234 asynchronous HTTP request, please pass async_req=True235 >>> thread = api.process_request_tpe_using_head(body, request_headers, all_request_params, routing_key, async_req=True)236 >>> result = thread.get()237 :param async_req bool238 :param str body: msg (required)239 :param Object request_headers: requestHeaders (required)240 :param Object all_request_params: allRequestParams (required)241 :param str routing_key: routingKey (required)242 :return: DeferredResultResponseEntity243 If the method is called asynchronously,244 returns the request thread.245 """246 kwargs['_return_http_data_only'] = True247 if kwargs.get('async_req'):248 return self.process_request_tpe_using_head_with_http_info(body, request_headers, all_request_params, routing_key, **kwargs) # noqa: E501249 else:250 (data) = self.process_request_tpe_using_head_with_http_info(body, request_headers, all_request_params, routing_key, **kwargs) # noqa: E501251 return data252 def process_request_tpe_using_head_with_http_info(self, body, request_headers, all_request_params, routing_key, **kwargs): # noqa: E501253 """processRequestTPE # noqa: E501254 This method makes a synchronous HTTP request by default. To make an255 asynchronous HTTP request, please pass async_req=True256 >>> thread = api.process_request_tpe_using_head_with_http_info(body, request_headers, all_request_params, routing_key, async_req=True)257 >>> result = thread.get()258 :param async_req bool259 :param str body: msg (required)260 :param Object request_headers: requestHeaders (required)261 :param Object all_request_params: allRequestParams (required)262 :param str routing_key: routingKey (required)263 :return: DeferredResultResponseEntity264 If the method is called asynchronously,265 returns the request thread.266 """267 all_params = ['body', 'request_headers', 'all_request_params', 'routing_key'] # noqa: E501268 all_params.append('async_req')269 all_params.append('_return_http_data_only')270 all_params.append('_preload_content')271 all_params.append('_request_timeout')272 params = locals()273 for key, val in six.iteritems(params['kwargs']):274 if key not in all_params:275 raise TypeError(276 "Got an unexpected keyword argument '%s'"277 " to method process_request_tpe_using_head" % key278 )279 params[key] = val280 del params['kwargs']281 # verify the required parameter 'body' is set282 if ('body' not in params or283 params['body'] is None):284 raise ValueError("Missing the required parameter `body` when calling `process_request_tpe_using_head`") # noqa: E501285 # verify the required parameter 'request_headers' is set286 if ('request_headers' not in params or287 params['request_headers'] is None):288 raise ValueError("Missing the required parameter `request_headers` when calling `process_request_tpe_using_head`") # noqa: E501289 # verify the required parameter 'all_request_params' is set290 if ('all_request_params' not in params or291 params['all_request_params'] is None):292 raise ValueError("Missing the required parameter `all_request_params` when calling `process_request_tpe_using_head`") # noqa: E501293 # verify the required parameter 'routing_key' is set294 if ('routing_key' not in params or295 params['routing_key'] is None):296 raise ValueError("Missing the required parameter `routing_key` when calling `process_request_tpe_using_head`") # noqa: E501297 collection_formats = {}298 path_params = {}299 if 'routing_key' in params:300 path_params['routingKey'] = params['routing_key'] # noqa: E501301 query_params = []302 if 'all_request_params' in params:303 query_params.append(('allRequestParams', params['all_request_params'])) # noqa: E501304 header_params = {}305 if 'request_headers' in params:306 header_params['requestHeaders'] = params['request_headers'] # noqa: E501307 form_params = []308 local_var_files = {}309 body_params = None310 if 'body' in params:311 body_params = params['body']312 # HTTP header `Accept`313 header_params['Accept'] = self.api_client.select_header_accept(314 ['*/*']) # noqa: E501315 # HTTP header `Content-Type`316 header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501317 ['application/json']) # noqa: E501318 # Authentication setting319 auth_settings = ['X-Authorization'] # noqa: E501320 return self.api_client.call_api(321 '/api/v1/integrations/tpe/{routingKey}{?allRequestParams}', 'HEAD',322 path_params,323 query_params,324 header_params,325 body=body_params,326 post_params=form_params,327 files=local_var_files,328 response_type='DeferredResultResponseEntity', # noqa: E501329 auth_settings=auth_settings,330 async_req=params.get('async_req'),331 _return_http_data_only=params.get('_return_http_data_only'),332 _preload_content=params.get('_preload_content', True),333 _request_timeout=params.get('_request_timeout'),334 collection_formats=collection_formats)335 def process_request_tpe_using_options(self, body, request_headers, all_request_params, routing_key, **kwargs): # noqa: E501336 """processRequestTPE # noqa: E501337 This method makes a synchronous HTTP request by default. To make an338 asynchronous HTTP request, please pass async_req=True339 >>> thread = api.process_request_tpe_using_options(body, request_headers, all_request_params, routing_key, async_req=True)340 >>> result = thread.get()341 :param async_req bool342 :param str body: msg (required)343 :param Object request_headers: requestHeaders (required)344 :param Object all_request_params: allRequestParams (required)345 :param str routing_key: routingKey (required)346 :return: DeferredResultResponseEntity347 If the method is called asynchronously,348 returns the request thread.349 """350 kwargs['_return_http_data_only'] = True351 if kwargs.get('async_req'):352 return self.process_request_tpe_using_options_with_http_info(body, request_headers, all_request_params, routing_key, **kwargs) # noqa: E501353 else:354 (data) = self.process_request_tpe_using_options_with_http_info(body, request_headers, all_request_params, routing_key, **kwargs) # noqa: E501355 return data356 def process_request_tpe_using_options_with_http_info(self, body, request_headers, all_request_params, routing_key, **kwargs): # noqa: E501357 """processRequestTPE # noqa: E501358 This method makes a synchronous HTTP request by default. To make an359 asynchronous HTTP request, please pass async_req=True360 >>> thread = api.process_request_tpe_using_options_with_http_info(body, request_headers, all_request_params, routing_key, async_req=True)361 >>> result = thread.get()362 :param async_req bool363 :param str body: msg (required)364 :param Object request_headers: requestHeaders (required)365 :param Object all_request_params: allRequestParams (required)366 :param str routing_key: routingKey (required)367 :return: DeferredResultResponseEntity368 If the method is called asynchronously,369 returns the request thread.370 """371 all_params = ['body', 'request_headers', 'all_request_params', 'routing_key'] # noqa: E501372 all_params.append('async_req')373 all_params.append('_return_http_data_only')374 all_params.append('_preload_content')375 all_params.append('_request_timeout')376 params = locals()377 for key, val in six.iteritems(params['kwargs']):378 if key not in all_params:379 raise TypeError(380 "Got an unexpected keyword argument '%s'"381 " to method process_request_tpe_using_options" % key382 )383 params[key] = val384 del params['kwargs']385 # verify the required parameter 'body' is set386 if ('body' not in params or387 params['body'] is None):388 raise ValueError("Missing the required parameter `body` when calling `process_request_tpe_using_options`") # noqa: E501389 # verify the required parameter 'request_headers' is set390 if ('request_headers' not in params or391 params['request_headers'] is None):392 raise ValueError("Missing the required parameter `request_headers` when calling `process_request_tpe_using_options`") # noqa: E501393 # verify the required parameter 'all_request_params' is set394 if ('all_request_params' not in params or395 params['all_request_params'] is None):396 raise ValueError("Missing the required parameter `all_request_params` when calling `process_request_tpe_using_options`") # noqa: E501397 # verify the required parameter 'routing_key' is set398 if ('routing_key' not in params or399 params['routing_key'] is None):400 raise ValueError("Missing the required parameter `routing_key` when calling `process_request_tpe_using_options`") # noqa: E501401 collection_formats = {}402 path_params = {}403 if 'routing_key' in params:404 path_params['routingKey'] = params['routing_key'] # noqa: E501405 query_params = []406 if 'all_request_params' in params:407 query_params.append(('allRequestParams', params['all_request_params'])) # noqa: E501408 header_params = {}409 if 'request_headers' in params:410 header_params['requestHeaders'] = params['request_headers'] # noqa: E501411 form_params = []412 local_var_files = {}413 body_params = None414 if 'body' in params:415 body_params = params['body']416 # HTTP header `Accept`417 header_params['Accept'] = self.api_client.select_header_accept(418 ['*/*']) # noqa: E501419 # HTTP header `Content-Type`420 header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501421 ['application/json']) # noqa: E501422 # Authentication setting423 auth_settings = ['X-Authorization'] # noqa: E501424 return self.api_client.call_api(425 '/api/v1/integrations/tpe/{routingKey}{?allRequestParams}', 'OPTIONS',426 path_params,427 query_params,428 header_params,429 body=body_params,430 post_params=form_params,431 files=local_var_files,432 response_type='DeferredResultResponseEntity', # noqa: E501433 auth_settings=auth_settings,434 async_req=params.get('async_req'),435 _return_http_data_only=params.get('_return_http_data_only'),436 _preload_content=params.get('_preload_content', True),437 _request_timeout=params.get('_request_timeout'),438 collection_formats=collection_formats)439 def process_request_tpe_using_patch(self, body, request_headers, all_request_params, routing_key, **kwargs): # noqa: E501440 """processRequestTPE # noqa: E501441 This method makes a synchronous HTTP request by default. To make an442 asynchronous HTTP request, please pass async_req=True443 >>> thread = api.process_request_tpe_using_patch(body, request_headers, all_request_params, routing_key, async_req=True)444 >>> result = thread.get()445 :param async_req bool446 :param str body: msg (required)447 :param Object request_headers: requestHeaders (required)448 :param Object all_request_params: allRequestParams (required)449 :param str routing_key: routingKey (required)450 :return: DeferredResultResponseEntity451 If the method is called asynchronously,452 returns the request thread.453 """454 kwargs['_return_http_data_only'] = True455 if kwargs.get('async_req'):456 return self.process_request_tpe_using_patch_with_http_info(body, request_headers, all_request_params, routing_key, **kwargs) # noqa: E501457 else:458 (data) = self.process_request_tpe_using_patch_with_http_info(body, request_headers, all_request_params, routing_key, **kwargs) # noqa: E501459 return data460 def process_request_tpe_using_patch_with_http_info(self, body, request_headers, all_request_params, routing_key, **kwargs): # noqa: E501461 """processRequestTPE # noqa: E501462 This method makes a synchronous HTTP request by default. To make an463 asynchronous HTTP request, please pass async_req=True464 >>> thread = api.process_request_tpe_using_patch_with_http_info(body, request_headers, all_request_params, routing_key, async_req=True)465 >>> result = thread.get()466 :param async_req bool467 :param str body: msg (required)468 :param Object request_headers: requestHeaders (required)469 :param Object all_request_params: allRequestParams (required)470 :param str routing_key: routingKey (required)471 :return: DeferredResultResponseEntity472 If the method is called asynchronously,473 returns the request thread.474 """475 all_params = ['body', 'request_headers', 'all_request_params', 'routing_key'] # noqa: E501476 all_params.append('async_req')477 all_params.append('_return_http_data_only')478 all_params.append('_preload_content')479 all_params.append('_request_timeout')480 params = locals()481 for key, val in six.iteritems(params['kwargs']):482 if key not in all_params:483 raise TypeError(484 "Got an unexpected keyword argument '%s'"485 " to method process_request_tpe_using_patch" % key486 )487 params[key] = val488 del params['kwargs']489 # verify the required parameter 'body' is set490 if ('body' not in params or491 params['body'] is None):492 raise ValueError("Missing the required parameter `body` when calling `process_request_tpe_using_patch`") # noqa: E501493 # verify the required parameter 'request_headers' is set494 if ('request_headers' not in params or495 params['request_headers'] is None):496 raise ValueError("Missing the required parameter `request_headers` when calling `process_request_tpe_using_patch`") # noqa: E501497 # verify the required parameter 'all_request_params' is set498 if ('all_request_params' not in params or499 params['all_request_params'] is None):500 raise ValueError("Missing the required parameter `all_request_params` when calling `process_request_tpe_using_patch`") # noqa: E501501 # verify the required parameter 'routing_key' is set502 if ('routing_key' not in params or503 params['routing_key'] is None):504 raise ValueError("Missing the required parameter `routing_key` when calling `process_request_tpe_using_patch`") # noqa: E501505 collection_formats = {}506 path_params = {}507 if 'routing_key' in params:508 path_params['routingKey'] = params['routing_key'] # noqa: E501509 query_params = []510 if 'all_request_params' in params:511 query_params.append(('allRequestParams', params['all_request_params'])) # noqa: E501512 header_params = {}513 if 'request_headers' in params:514 header_params['requestHeaders'] = params['request_headers'] # noqa: E501515 form_params = []516 local_var_files = {}517 body_params = None518 if 'body' in params:519 body_params = params['body']520 # HTTP header `Accept`521 header_params['Accept'] = self.api_client.select_header_accept(522 ['*/*']) # noqa: E501523 # HTTP header `Content-Type`524 header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501525 ['application/json']) # noqa: E501526 # Authentication setting527 auth_settings = ['X-Authorization'] # noqa: E501528 return self.api_client.call_api(529 '/api/v1/integrations/tpe/{routingKey}{?allRequestParams}', 'PATCH',530 path_params,531 query_params,532 header_params,533 body=body_params,534 post_params=form_params,535 files=local_var_files,536 response_type='DeferredResultResponseEntity', # noqa: E501537 auth_settings=auth_settings,538 async_req=params.get('async_req'),539 _return_http_data_only=params.get('_return_http_data_only'),540 _preload_content=params.get('_preload_content', True),541 _request_timeout=params.get('_request_timeout'),542 collection_formats=collection_formats)543 def process_request_tpe_using_post(self, body, request_headers, all_request_params, routing_key, **kwargs): # noqa: E501544 """processRequestTPE # noqa: E501545 This method makes a synchronous HTTP request by default. To make an546 asynchronous HTTP request, please pass async_req=True547 >>> thread = api.process_request_tpe_using_post(body, request_headers, all_request_params, routing_key, async_req=True)548 >>> result = thread.get()549 :param async_req bool550 :param str body: msg (required)551 :param Object request_headers: requestHeaders (required)552 :param Object all_request_params: allRequestParams (required)553 :param str routing_key: routingKey (required)554 :return: DeferredResultResponseEntity555 If the method is called asynchronously,556 returns the request thread.557 """558 kwargs['_return_http_data_only'] = True559 if kwargs.get('async_req'):560 return self.process_request_tpe_using_post_with_http_info(body, request_headers, all_request_params, routing_key, **kwargs) # noqa: E501561 else:562 (data) = self.process_request_tpe_using_post_with_http_info(body, request_headers, all_request_params, routing_key, **kwargs) # noqa: E501563 return data564 def process_request_tpe_using_post_with_http_info(self, body, request_headers, all_request_params, routing_key, **kwargs): # noqa: E501565 """processRequestTPE # noqa: E501566 This method makes a synchronous HTTP request by default. To make an567 asynchronous HTTP request, please pass async_req=True568 >>> thread = api.process_request_tpe_using_post_with_http_info(body, request_headers, all_request_params, routing_key, async_req=True)569 >>> result = thread.get()570 :param async_req bool571 :param str body: msg (required)572 :param Object request_headers: requestHeaders (required)573 :param Object all_request_params: allRequestParams (required)574 :param str routing_key: routingKey (required)575 :return: DeferredResultResponseEntity576 If the method is called asynchronously,577 returns the request thread.578 """579 all_params = ['body', 'request_headers', 'all_request_params', 'routing_key'] # noqa: E501580 all_params.append('async_req')581 all_params.append('_return_http_data_only')582 all_params.append('_preload_content')583 all_params.append('_request_timeout')584 params = locals()585 for key, val in six.iteritems(params['kwargs']):586 if key not in all_params:587 raise TypeError(588 "Got an unexpected keyword argument '%s'"589 " to method process_request_tpe_using_post" % key590 )591 params[key] = val592 del params['kwargs']593 # verify the required parameter 'body' is set594 if ('body' not in params or595 params['body'] is None):596 raise ValueError("Missing the required parameter `body` when calling `process_request_tpe_using_post`") # noqa: E501597 # verify the required parameter 'request_headers' is set598 if ('request_headers' not in params or599 params['request_headers'] is None):600 raise ValueError("Missing the required parameter `request_headers` when calling `process_request_tpe_using_post`") # noqa: E501601 # verify the required parameter 'all_request_params' is set602 if ('all_request_params' not in params or603 params['all_request_params'] is None):604 raise ValueError("Missing the required parameter `all_request_params` when calling `process_request_tpe_using_post`") # noqa: E501605 # verify the required parameter 'routing_key' is set606 if ('routing_key' not in params or607 params['routing_key'] is None):608 raise ValueError("Missing the required parameter `routing_key` when calling `process_request_tpe_using_post`") # noqa: E501609 collection_formats = {}610 path_params = {}611 if 'routing_key' in params:612 path_params['routingKey'] = params['routing_key'] # noqa: E501613 query_params = []614 if 'all_request_params' in params:615 query_params.append(('allRequestParams', params['all_request_params'])) # noqa: E501616 header_params = {}617 if 'request_headers' in params:618 header_params['requestHeaders'] = params['request_headers'] # noqa: E501619 form_params = []620 local_var_files = {}621 body_params = None622 if 'body' in params:623 body_params = params['body']624 # HTTP header `Accept`625 header_params['Accept'] = self.api_client.select_header_accept(626 ['*/*']) # noqa: E501627 # HTTP header `Content-Type`628 header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501629 ['application/json']) # noqa: E501630 # Authentication setting631 auth_settings = ['X-Authorization'] # noqa: E501632 return self.api_client.call_api(633 '/api/v1/integrations/tpe/{routingKey}{?allRequestParams}', 'POST',634 path_params,635 query_params,636 header_params,637 body=body_params,638 post_params=form_params,639 files=local_var_files,640 response_type='DeferredResultResponseEntity', # noqa: E501641 auth_settings=auth_settings,642 async_req=params.get('async_req'),643 _return_http_data_only=params.get('_return_http_data_only'),644 _preload_content=params.get('_preload_content', True),645 _request_timeout=params.get('_request_timeout'),646 collection_formats=collection_formats)647 def process_request_tpe_using_put(self, body, request_headers, all_request_params, routing_key, **kwargs): # noqa: E501648 """processRequestTPE # noqa: E501649 This method makes a synchronous HTTP request by default. To make an650 asynchronous HTTP request, please pass async_req=True651 >>> thread = api.process_request_tpe_using_put(body, request_headers, all_request_params, routing_key, async_req=True)652 >>> result = thread.get()653 :param async_req bool654 :param str body: msg (required)655 :param Object request_headers: requestHeaders (required)656 :param Object all_request_params: allRequestParams (required)657 :param str routing_key: routingKey (required)658 :return: DeferredResultResponseEntity659 If the method is called asynchronously,660 returns the request thread.661 """662 kwargs['_return_http_data_only'] = True663 if kwargs.get('async_req'):664 return self.process_request_tpe_using_put_with_http_info(body, request_headers, all_request_params, routing_key, **kwargs) # noqa: E501665 else:666 (data) = self.process_request_tpe_using_put_with_http_info(body, request_headers, all_request_params, routing_key, **kwargs) # noqa: E501667 return data668 def process_request_tpe_using_put_with_http_info(self, body, request_headers, all_request_params, routing_key, **kwargs): # noqa: E501669 """processRequestTPE # noqa: E501670 This method makes a synchronous HTTP request by default. To make an671 asynchronous HTTP request, please pass async_req=True672 >>> thread = api.process_request_tpe_using_put_with_http_info(body, request_headers, all_request_params, routing_key, async_req=True)673 >>> result = thread.get()674 :param async_req bool675 :param str body: msg (required)676 :param Object request_headers: requestHeaders (required)677 :param Object all_request_params: allRequestParams (required)678 :param str routing_key: routingKey (required)679 :return: DeferredResultResponseEntity680 If the method is called asynchronously,681 returns the request thread.682 """683 all_params = ['body', 'request_headers', 'all_request_params', 'routing_key'] # noqa: E501684 all_params.append('async_req')685 all_params.append('_return_http_data_only')686 all_params.append('_preload_content')687 all_params.append('_request_timeout')688 params = locals()689 for key, val in six.iteritems(params['kwargs']):690 if key not in all_params:691 raise TypeError(692 "Got an unexpected keyword argument '%s'"693 " to method process_request_tpe_using_put" % key694 )695 params[key] = val696 del params['kwargs']697 # verify the required parameter 'body' is set698 if ('body' not in params or699 params['body'] is None):700 raise ValueError("Missing the required parameter `body` when calling `process_request_tpe_using_put`") # noqa: E501701 # verify the required parameter 'request_headers' is set702 if ('request_headers' not in params or703 params['request_headers'] is None):704 raise ValueError("Missing the required parameter `request_headers` when calling `process_request_tpe_using_put`") # noqa: E501705 # verify the required parameter 'all_request_params' is set706 if ('all_request_params' not in params or707 params['all_request_params'] is None):708 raise ValueError("Missing the required parameter `all_request_params` when calling `process_request_tpe_using_put`") # noqa: E501709 # verify the required parameter 'routing_key' is set710 if ('routing_key' not in params or711 params['routing_key'] is None):712 raise ValueError("Missing the required parameter `routing_key` when calling `process_request_tpe_using_put`") # noqa: E501713 collection_formats = {}714 path_params = {}715 if 'routing_key' in params:716 path_params['routingKey'] = params['routing_key'] # noqa: E501717 query_params = []718 if 'all_request_params' in params:719 query_params.append(('allRequestParams', params['all_request_params'])) # noqa: E501720 header_params = {}721 if 'request_headers' in params:722 header_params['requestHeaders'] = params['request_headers'] # noqa: E501723 form_params = []724 local_var_files = {}725 body_params = None726 if 'body' in params:727 body_params = params['body']728 # HTTP header `Accept`729 header_params['Accept'] = self.api_client.select_header_accept(730 ['*/*']) # noqa: E501731 # HTTP header `Content-Type`732 header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501733 ['application/json']) # noqa: E501734 # Authentication setting735 auth_settings = ['X-Authorization'] # noqa: E501736 return self.api_client.call_api(737 '/api/v1/integrations/tpe/{routingKey}{?allRequestParams}', 'PUT',738 path_params,739 query_params,740 header_params,741 body=body_params,742 post_params=form_params,743 files=local_var_files,744 response_type='DeferredResultResponseEntity', # noqa: E501745 auth_settings=auth_settings,746 async_req=params.get('async_req'),747 _return_http_data_only=params.get('_return_http_data_only'),748 _preload_content=params.get('_preload_content', True),749 _request_timeout=params.get('_request_timeout'),750 collection_formats=collection_formats)751 def process_request_using_delete3(self, body, request_headers, all_request_params, routing_key, **kwargs): # noqa: E501752 """processRequest # noqa: E501753 This method makes a synchronous HTTP request by default. To make an754 asynchronous HTTP request, please pass async_req=True755 >>> thread = api.process_request_using_delete3(body, request_headers, all_request_params, routing_key, async_req=True)756 >>> result = thread.get()757 :param async_req bool758 :param str body: msg (required)759 :param Object request_headers: requestHeaders (required)760 :param Object all_request_params: allRequestParams (required)761 :param str routing_key: routingKey (required)762 :return: DeferredResultResponseEntity763 If the method is called asynchronously,764 returns the request thread.765 """766 kwargs['_return_http_data_only'] = True767 if kwargs.get('async_req'):768 return self.process_request_using_delete3_with_http_info(body, request_headers, all_request_params, routing_key, **kwargs) # noqa: E501769 else:770 (data) = self.process_request_using_delete3_with_http_info(body, request_headers, all_request_params, routing_key, **kwargs) # noqa: E501771 return data772 def process_request_using_delete3_with_http_info(self, body, request_headers, all_request_params, routing_key, **kwargs): # noqa: E501773 """processRequest # noqa: E501774 This method makes a synchronous HTTP request by default. To make an775 asynchronous HTTP request, please pass async_req=True776 >>> thread = api.process_request_using_delete3_with_http_info(body, request_headers, all_request_params, routing_key, async_req=True)777 >>> result = thread.get()778 :param async_req bool779 :param str body: msg (required)780 :param Object request_headers: requestHeaders (required)781 :param Object all_request_params: allRequestParams (required)782 :param str routing_key: routingKey (required)783 :return: DeferredResultResponseEntity784 If the method is called asynchronously,785 returns the request thread.786 """787 all_params = ['body', 'request_headers', 'all_request_params', 'routing_key'] # noqa: E501788 all_params.append('async_req')789 all_params.append('_return_http_data_only')790 all_params.append('_preload_content')791 all_params.append('_request_timeout')792 params = locals()793 for key, val in six.iteritems(params['kwargs']):794 if key not in all_params:795 raise TypeError(796 "Got an unexpected keyword argument '%s'"797 " to method process_request_using_delete3" % key798 )799 params[key] = val800 del params['kwargs']801 # verify the required parameter 'body' is set802 if ('body' not in params or803 params['body'] is None):804 raise ValueError("Missing the required parameter `body` when calling `process_request_using_delete3`") # noqa: E501805 # verify the required parameter 'request_headers' is set806 if ('request_headers' not in params or807 params['request_headers'] is None):808 raise ValueError("Missing the required parameter `request_headers` when calling `process_request_using_delete3`") # noqa: E501809 # verify the required parameter 'all_request_params' is set810 if ('all_request_params' not in params or811 params['all_request_params'] is None):812 raise ValueError("Missing the required parameter `all_request_params` when calling `process_request_using_delete3`") # noqa: E501813 # verify the required parameter 'routing_key' is set814 if ('routing_key' not in params or815 params['routing_key'] is None):816 raise ValueError("Missing the required parameter `routing_key` when calling `process_request_using_delete3`") # noqa: E501817 collection_formats = {}818 path_params = {}819 if 'routing_key' in params:820 path_params['routingKey'] = params['routing_key'] # noqa: E501821 query_params = []822 if 'all_request_params' in params:823 query_params.append(('allRequestParams', params['all_request_params'])) # noqa: E501824 header_params = {}825 if 'request_headers' in params:826 header_params['requestHeaders'] = params['request_headers'] # noqa: E501827 form_params = []828 local_var_files = {}829 body_params = None830 if 'body' in params:831 body_params = params['body']832 # HTTP header `Accept`833 header_params['Accept'] = self.api_client.select_header_accept(834 ['*/*']) # noqa: E501835 # HTTP header `Content-Type`836 header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501837 ['application/json']) # noqa: E501838 # Authentication setting839 auth_settings = ['X-Authorization'] # noqa: E501840 return self.api_client.call_api(841 '/api/v1/integrations/thingpark/{routingKey}{?allRequestParams}', 'DELETE',842 path_params,843 query_params,844 header_params,845 body=body_params,846 post_params=form_params,847 files=local_var_files,848 response_type='DeferredResultResponseEntity', # noqa: E501849 auth_settings=auth_settings,850 async_req=params.get('async_req'),851 _return_http_data_only=params.get('_return_http_data_only'),852 _preload_content=params.get('_preload_content', True),853 _request_timeout=params.get('_request_timeout'),854 collection_formats=collection_formats)855 def process_request_using_get3(self, body, request_headers, all_request_params, routing_key, **kwargs): # noqa: E501856 """processRequest # noqa: E501857 This method makes a synchronous HTTP request by default. To make an858 asynchronous HTTP request, please pass async_req=True859 >>> thread = api.process_request_using_get3(body, request_headers, all_request_params, routing_key, async_req=True)860 >>> result = thread.get()861 :param async_req bool862 :param str body: msg (required)863 :param Object request_headers: requestHeaders (required)864 :param Object all_request_params: allRequestParams (required)865 :param str routing_key: routingKey (required)866 :return: DeferredResultResponseEntity867 If the method is called asynchronously,868 returns the request thread.869 """870 kwargs['_return_http_data_only'] = True871 if kwargs.get('async_req'):872 return self.process_request_using_get3_with_http_info(body, request_headers, all_request_params, routing_key, **kwargs) # noqa: E501873 else:874 (data) = self.process_request_using_get3_with_http_info(body, request_headers, all_request_params, routing_key, **kwargs) # noqa: E501875 return data876 def process_request_using_get3_with_http_info(self, body, request_headers, all_request_params, routing_key, **kwargs): # noqa: E501877 """processRequest # noqa: E501878 This method makes a synchronous HTTP request by default. To make an879 asynchronous HTTP request, please pass async_req=True880 >>> thread = api.process_request_using_get3_with_http_info(body, request_headers, all_request_params, routing_key, async_req=True)881 >>> result = thread.get()882 :param async_req bool883 :param str body: msg (required)884 :param Object request_headers: requestHeaders (required)885 :param Object all_request_params: allRequestParams (required)886 :param str routing_key: routingKey (required)887 :return: DeferredResultResponseEntity888 If the method is called asynchronously,889 returns the request thread.890 """891 all_params = ['body', 'request_headers', 'all_request_params', 'routing_key'] # noqa: E501892 all_params.append('async_req')893 all_params.append('_return_http_data_only')894 all_params.append('_preload_content')895 all_params.append('_request_timeout')896 params = locals()897 for key, val in six.iteritems(params['kwargs']):898 if key not in all_params:899 raise TypeError(900 "Got an unexpected keyword argument '%s'"901 " to method process_request_using_get3" % key902 )903 params[key] = val904 del params['kwargs']905 # verify the required parameter 'body' is set906 if ('body' not in params or907 params['body'] is None):908 raise ValueError("Missing the required parameter `body` when calling `process_request_using_get3`") # noqa: E501909 # verify the required parameter 'request_headers' is set910 if ('request_headers' not in params or911 params['request_headers'] is None):912 raise ValueError("Missing the required parameter `request_headers` when calling `process_request_using_get3`") # noqa: E501913 # verify the required parameter 'all_request_params' is set914 if ('all_request_params' not in params or915 params['all_request_params'] is None):916 raise ValueError("Missing the required parameter `all_request_params` when calling `process_request_using_get3`") # noqa: E501917 # verify the required parameter 'routing_key' is set918 if ('routing_key' not in params or919 params['routing_key'] is None):920 raise ValueError("Missing the required parameter `routing_key` when calling `process_request_using_get3`") # noqa: E501921 collection_formats = {}922 path_params = {}923 if 'routing_key' in params:924 path_params['routingKey'] = params['routing_key'] # noqa: E501925 query_params = []926 if 'all_request_params' in params:927 query_params.append(('allRequestParams', params['all_request_params'])) # noqa: E501928 header_params = {}929 if 'request_headers' in params:930 header_params['requestHeaders'] = params['request_headers'] # noqa: E501931 form_params = []932 local_var_files = {}933 body_params = None934 if 'body' in params:935 body_params = params['body']936 # HTTP header `Accept`937 header_params['Accept'] = self.api_client.select_header_accept(938 ['*/*']) # noqa: E501939 # HTTP header `Content-Type`940 header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501941 ['application/json']) # noqa: E501942 # Authentication setting943 auth_settings = ['X-Authorization'] # noqa: E501944 return self.api_client.call_api(945 '/api/v1/integrations/thingpark/{routingKey}{?allRequestParams}', 'GET',946 path_params,947 query_params,948 header_params,949 body=body_params,950 post_params=form_params,951 files=local_var_files,952 response_type='DeferredResultResponseEntity', # noqa: E501953 auth_settings=auth_settings,954 async_req=params.get('async_req'),955 _return_http_data_only=params.get('_return_http_data_only'),956 _preload_content=params.get('_preload_content', True),957 _request_timeout=params.get('_request_timeout'),958 collection_formats=collection_formats)959 def process_request_using_head3(self, body, request_headers, all_request_params, routing_key, **kwargs): # noqa: E501960 """processRequest # noqa: E501961 This method makes a synchronous HTTP request by default. To make an962 asynchronous HTTP request, please pass async_req=True963 >>> thread = api.process_request_using_head3(body, request_headers, all_request_params, routing_key, async_req=True)964 >>> result = thread.get()965 :param async_req bool966 :param str body: msg (required)967 :param Object request_headers: requestHeaders (required)968 :param Object all_request_params: allRequestParams (required)969 :param str routing_key: routingKey (required)970 :return: DeferredResultResponseEntity971 If the method is called asynchronously,972 returns the request thread.973 """974 kwargs['_return_http_data_only'] = True975 if kwargs.get('async_req'):976 return self.process_request_using_head3_with_http_info(body, request_headers, all_request_params, routing_key, **kwargs) # noqa: E501977 else:978 (data) = self.process_request_using_head3_with_http_info(body, request_headers, all_request_params, routing_key, **kwargs) # noqa: E501979 return data980 def process_request_using_head3_with_http_info(self, body, request_headers, all_request_params, routing_key, **kwargs): # noqa: E501981 """processRequest # noqa: E501982 This method makes a synchronous HTTP request by default. To make an983 asynchronous HTTP request, please pass async_req=True984 >>> thread = api.process_request_using_head3_with_http_info(body, request_headers, all_request_params, routing_key, async_req=True)985 >>> result = thread.get()986 :param async_req bool987 :param str body: msg (required)988 :param Object request_headers: requestHeaders (required)989 :param Object all_request_params: allRequestParams (required)990 :param str routing_key: routingKey (required)991 :return: DeferredResultResponseEntity992 If the method is called asynchronously,993 returns the request thread.994 """995 all_params = ['body', 'request_headers', 'all_request_params', 'routing_key'] # noqa: E501996 all_params.append('async_req')997 all_params.append('_return_http_data_only')998 all_params.append('_preload_content')999 all_params.append('_request_timeout')1000 params = locals()1001 for key, val in six.iteritems(params['kwargs']):1002 if key not in all_params:1003 raise TypeError(1004 "Got an unexpected keyword argument '%s'"1005 " to method process_request_using_head3" % key1006 )1007 params[key] = val1008 del params['kwargs']1009 # verify the required parameter 'body' is set1010 if ('body' not in params or1011 params['body'] is None):1012 raise ValueError("Missing the required parameter `body` when calling `process_request_using_head3`") # noqa: E5011013 # verify the required parameter 'request_headers' is set1014 if ('request_headers' not in params or1015 params['request_headers'] is None):1016 raise ValueError("Missing the required parameter `request_headers` when calling `process_request_using_head3`") # noqa: E5011017 # verify the required parameter 'all_request_params' is set1018 if ('all_request_params' not in params or1019 params['all_request_params'] is None):1020 raise ValueError("Missing the required parameter `all_request_params` when calling `process_request_using_head3`") # noqa: E5011021 # verify the required parameter 'routing_key' is set1022 if ('routing_key' not in params or1023 params['routing_key'] is None):1024 raise ValueError("Missing the required parameter `routing_key` when calling `process_request_using_head3`") # noqa: E5011025 collection_formats = {}1026 path_params = {}1027 if 'routing_key' in params:1028 path_params['routingKey'] = params['routing_key'] # noqa: E5011029 query_params = []1030 if 'all_request_params' in params:1031 query_params.append(('allRequestParams', params['all_request_params'])) # noqa: E5011032 header_params = {}1033 if 'request_headers' in params:1034 header_params['requestHeaders'] = params['request_headers'] # noqa: E5011035 form_params = []1036 local_var_files = {}1037 body_params = None1038 if 'body' in params:1039 body_params = params['body']1040 # HTTP header `Accept`1041 header_params['Accept'] = self.api_client.select_header_accept(1042 ['*/*']) # noqa: E5011043 # HTTP header `Content-Type`1044 header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E5011045 ['application/json']) # noqa: E5011046 # Authentication setting1047 auth_settings = ['X-Authorization'] # noqa: E5011048 return self.api_client.call_api(1049 '/api/v1/integrations/thingpark/{routingKey}{?allRequestParams}', 'HEAD',1050 path_params,1051 query_params,1052 header_params,1053 body=body_params,1054 post_params=form_params,1055 files=local_var_files,1056 response_type='DeferredResultResponseEntity', # noqa: E5011057 auth_settings=auth_settings,1058 async_req=params.get('async_req'),1059 _return_http_data_only=params.get('_return_http_data_only'),1060 _preload_content=params.get('_preload_content', True),1061 _request_timeout=params.get('_request_timeout'),1062 collection_formats=collection_formats)1063 def process_request_using_options3(self, body, request_headers, all_request_params, routing_key, **kwargs): # noqa: E5011064 """processRequest # noqa: E5011065 This method makes a synchronous HTTP request by default. To make an1066 asynchronous HTTP request, please pass async_req=True1067 >>> thread = api.process_request_using_options3(body, request_headers, all_request_params, routing_key, async_req=True)1068 >>> result = thread.get()1069 :param async_req bool1070 :param str body: msg (required)1071 :param Object request_headers: requestHeaders (required)1072 :param Object all_request_params: allRequestParams (required)1073 :param str routing_key: routingKey (required)1074 :return: DeferredResultResponseEntity1075 If the method is called asynchronously,1076 returns the request thread.1077 """1078 kwargs['_return_http_data_only'] = True1079 if kwargs.get('async_req'):1080 return self.process_request_using_options3_with_http_info(body, request_headers, all_request_params, routing_key, **kwargs) # noqa: E5011081 else:1082 (data) = self.process_request_using_options3_with_http_info(body, request_headers, all_request_params, routing_key, **kwargs) # noqa: E5011083 return data1084 def process_request_using_options3_with_http_info(self, body, request_headers, all_request_params, routing_key, **kwargs): # noqa: E5011085 """processRequest # noqa: E5011086 This method makes a synchronous HTTP request by default. To make an1087 asynchronous HTTP request, please pass async_req=True1088 >>> thread = api.process_request_using_options3_with_http_info(body, request_headers, all_request_params, routing_key, async_req=True)1089 >>> result = thread.get()1090 :param async_req bool1091 :param str body: msg (required)1092 :param Object request_headers: requestHeaders (required)1093 :param Object all_request_params: allRequestParams (required)1094 :param str routing_key: routingKey (required)1095 :return: DeferredResultResponseEntity1096 If the method is called asynchronously,1097 returns the request thread.1098 """1099 all_params = ['body', 'request_headers', 'all_request_params', 'routing_key'] # noqa: E5011100 all_params.append('async_req')1101 all_params.append('_return_http_data_only')1102 all_params.append('_preload_content')1103 all_params.append('_request_timeout')1104 params = locals()1105 for key, val in six.iteritems(params['kwargs']):1106 if key not in all_params:1107 raise TypeError(1108 "Got an unexpected keyword argument '%s'"1109 " to method process_request_using_options3" % key1110 )1111 params[key] = val1112 del params['kwargs']1113 # verify the required parameter 'body' is set1114 if ('body' not in params or1115 params['body'] is None):1116 raise ValueError("Missing the required parameter `body` when calling `process_request_using_options3`") # noqa: E5011117 # verify the required parameter 'request_headers' is set1118 if ('request_headers' not in params or1119 params['request_headers'] is None):1120 raise ValueError("Missing the required parameter `request_headers` when calling `process_request_using_options3`") # noqa: E5011121 # verify the required parameter 'all_request_params' is set1122 if ('all_request_params' not in params or1123 params['all_request_params'] is None):1124 raise ValueError("Missing the required parameter `all_request_params` when calling `process_request_using_options3`") # noqa: E5011125 # verify the required parameter 'routing_key' is set1126 if ('routing_key' not in params or1127 params['routing_key'] is None):1128 raise ValueError("Missing the required parameter `routing_key` when calling `process_request_using_options3`") # noqa: E5011129 collection_formats = {}1130 path_params = {}1131 if 'routing_key' in params:1132 path_params['routingKey'] = params['routing_key'] # noqa: E5011133 query_params = []1134 if 'all_request_params' in params:1135 query_params.append(('allRequestParams', params['all_request_params'])) # noqa: E5011136 header_params = {}1137 if 'request_headers' in params:1138 header_params['requestHeaders'] = params['request_headers'] # noqa: E5011139 form_params = []1140 local_var_files = {}1141 body_params = None1142 if 'body' in params:1143 body_params = params['body']1144 # HTTP header `Accept`1145 header_params['Accept'] = self.api_client.select_header_accept(1146 ['*/*']) # noqa: E5011147 # HTTP header `Content-Type`1148 header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E5011149 ['application/json']) # noqa: E5011150 # Authentication setting1151 auth_settings = ['X-Authorization'] # noqa: E5011152 return self.api_client.call_api(1153 '/api/v1/integrations/thingpark/{routingKey}{?allRequestParams}', 'OPTIONS',1154 path_params,1155 query_params,1156 header_params,1157 body=body_params,1158 post_params=form_params,1159 files=local_var_files,1160 response_type='DeferredResultResponseEntity', # noqa: E5011161 auth_settings=auth_settings,1162 async_req=params.get('async_req'),1163 _return_http_data_only=params.get('_return_http_data_only'),1164 _preload_content=params.get('_preload_content', True),1165 _request_timeout=params.get('_request_timeout'),1166 collection_formats=collection_formats)1167 def process_request_using_patch3(self, body, request_headers, all_request_params, routing_key, **kwargs): # noqa: E5011168 """processRequest # noqa: E5011169 This method makes a synchronous HTTP request by default. To make an1170 asynchronous HTTP request, please pass async_req=True1171 >>> thread = api.process_request_using_patch3(body, request_headers, all_request_params, routing_key, async_req=True)1172 >>> result = thread.get()1173 :param async_req bool1174 :param str body: msg (required)1175 :param Object request_headers: requestHeaders (required)1176 :param Object all_request_params: allRequestParams (required)1177 :param str routing_key: routingKey (required)1178 :return: DeferredResultResponseEntity1179 If the method is called asynchronously,1180 returns the request thread.1181 """1182 kwargs['_return_http_data_only'] = True1183 if kwargs.get('async_req'):1184 return self.process_request_using_patch3_with_http_info(body, request_headers, all_request_params, routing_key, **kwargs) # noqa: E5011185 else:1186 (data) = self.process_request_using_patch3_with_http_info(body, request_headers, all_request_params, routing_key, **kwargs) # noqa: E5011187 return data1188 def process_request_using_patch3_with_http_info(self, body, request_headers, all_request_params, routing_key, **kwargs): # noqa: E5011189 """processRequest # noqa: E5011190 This method makes a synchronous HTTP request by default. To make an1191 asynchronous HTTP request, please pass async_req=True1192 >>> thread = api.process_request_using_patch3_with_http_info(body, request_headers, all_request_params, routing_key, async_req=True)1193 >>> result = thread.get()1194 :param async_req bool1195 :param str body: msg (required)1196 :param Object request_headers: requestHeaders (required)1197 :param Object all_request_params: allRequestParams (required)1198 :param str routing_key: routingKey (required)1199 :return: DeferredResultResponseEntity1200 If the method is called asynchronously,1201 returns the request thread.1202 """1203 all_params = ['body', 'request_headers', 'all_request_params', 'routing_key'] # noqa: E5011204 all_params.append('async_req')1205 all_params.append('_return_http_data_only')1206 all_params.append('_preload_content')1207 all_params.append('_request_timeout')1208 params = locals()1209 for key, val in six.iteritems(params['kwargs']):1210 if key not in all_params:1211 raise TypeError(1212 "Got an unexpected keyword argument '%s'"1213 " to method process_request_using_patch3" % key1214 )1215 params[key] = val1216 del params['kwargs']1217 # verify the required parameter 'body' is set1218 if ('body' not in params or1219 params['body'] is None):1220 raise ValueError("Missing the required parameter `body` when calling `process_request_using_patch3`") # noqa: E5011221 # verify the required parameter 'request_headers' is set1222 if ('request_headers' not in params or1223 params['request_headers'] is None):1224 raise ValueError("Missing the required parameter `request_headers` when calling `process_request_using_patch3`") # noqa: E5011225 # verify the required parameter 'all_request_params' is set1226 if ('all_request_params' not in params or1227 params['all_request_params'] is None):1228 raise ValueError("Missing the required parameter `all_request_params` when calling `process_request_using_patch3`") # noqa: E5011229 # verify the required parameter 'routing_key' is set1230 if ('routing_key' not in params or1231 params['routing_key'] is None):1232 raise ValueError("Missing the required parameter `routing_key` when calling `process_request_using_patch3`") # noqa: E5011233 collection_formats = {}1234 path_params = {}1235 if 'routing_key' in params:1236 path_params['routingKey'] = params['routing_key'] # noqa: E5011237 query_params = []1238 if 'all_request_params' in params:1239 query_params.append(('allRequestParams', params['all_request_params'])) # noqa: E5011240 header_params = {}1241 if 'request_headers' in params:1242 header_params['requestHeaders'] = params['request_headers'] # noqa: E5011243 form_params = []1244 local_var_files = {}1245 body_params = None1246 if 'body' in params:1247 body_params = params['body']1248 # HTTP header `Accept`1249 header_params['Accept'] = self.api_client.select_header_accept(1250 ['*/*']) # noqa: E5011251 # HTTP header `Content-Type`1252 header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E5011253 ['application/json']) # noqa: E5011254 # Authentication setting1255 auth_settings = ['X-Authorization'] # noqa: E5011256 return self.api_client.call_api(1257 '/api/v1/integrations/thingpark/{routingKey}{?allRequestParams}', 'PATCH',1258 path_params,1259 query_params,1260 header_params,1261 body=body_params,1262 post_params=form_params,1263 files=local_var_files,1264 response_type='DeferredResultResponseEntity', # noqa: E5011265 auth_settings=auth_settings,1266 async_req=params.get('async_req'),1267 _return_http_data_only=params.get('_return_http_data_only'),1268 _preload_content=params.get('_preload_content', True),1269 _request_timeout=params.get('_request_timeout'),1270 collection_formats=collection_formats)1271 def process_request_using_post5(self, body, request_headers, all_request_params, routing_key, **kwargs): # noqa: E5011272 """processRequest # noqa: E5011273 This method makes a synchronous HTTP request by default. To make an1274 asynchronous HTTP request, please pass async_req=True1275 >>> thread = api.process_request_using_post5(body, request_headers, all_request_params, routing_key, async_req=True)1276 >>> result = thread.get()1277 :param async_req bool1278 :param str body: msg (required)1279 :param Object request_headers: requestHeaders (required)1280 :param Object all_request_params: allRequestParams (required)1281 :param str routing_key: routingKey (required)1282 :return: DeferredResultResponseEntity1283 If the method is called asynchronously,1284 returns the request thread.1285 """1286 kwargs['_return_http_data_only'] = True1287 if kwargs.get('async_req'):1288 return self.process_request_using_post5_with_http_info(body, request_headers, all_request_params, routing_key, **kwargs) # noqa: E5011289 else:1290 (data) = self.process_request_using_post5_with_http_info(body, request_headers, all_request_params, routing_key, **kwargs) # noqa: E5011291 return data1292 def process_request_using_post5_with_http_info(self, body, request_headers, all_request_params, routing_key, **kwargs): # noqa: E5011293 """processRequest # noqa: E5011294 This method makes a synchronous HTTP request by default. To make an1295 asynchronous HTTP request, please pass async_req=True1296 >>> thread = api.process_request_using_post5_with_http_info(body, request_headers, all_request_params, routing_key, async_req=True)1297 >>> result = thread.get()1298 :param async_req bool1299 :param str body: msg (required)1300 :param Object request_headers: requestHeaders (required)1301 :param Object all_request_params: allRequestParams (required)1302 :param str routing_key: routingKey (required)1303 :return: DeferredResultResponseEntity1304 If the method is called asynchronously,1305 returns the request thread.1306 """1307 all_params = ['body', 'request_headers', 'all_request_params', 'routing_key'] # noqa: E5011308 all_params.append('async_req')1309 all_params.append('_return_http_data_only')1310 all_params.append('_preload_content')1311 all_params.append('_request_timeout')1312 params = locals()1313 for key, val in six.iteritems(params['kwargs']):1314 if key not in all_params:1315 raise TypeError(1316 "Got an unexpected keyword argument '%s'"1317 " to method process_request_using_post5" % key1318 )1319 params[key] = val1320 del params['kwargs']1321 # verify the required parameter 'body' is set1322 if ('body' not in params or1323 params['body'] is None):1324 raise ValueError("Missing the required parameter `body` when calling `process_request_using_post5`") # noqa: E5011325 # verify the required parameter 'request_headers' is set1326 if ('request_headers' not in params or1327 params['request_headers'] is None):1328 raise ValueError("Missing the required parameter `request_headers` when calling `process_request_using_post5`") # noqa: E5011329 # verify the required parameter 'all_request_params' is set1330 if ('all_request_params' not in params or1331 params['all_request_params'] is None):1332 raise ValueError("Missing the required parameter `all_request_params` when calling `process_request_using_post5`") # noqa: E5011333 # verify the required parameter 'routing_key' is set1334 if ('routing_key' not in params or1335 params['routing_key'] is None):1336 raise ValueError("Missing the required parameter `routing_key` when calling `process_request_using_post5`") # noqa: E5011337 collection_formats = {}1338 path_params = {}1339 if 'routing_key' in params:1340 path_params['routingKey'] = params['routing_key'] # noqa: E5011341 query_params = []1342 if 'all_request_params' in params:1343 query_params.append(('allRequestParams', params['all_request_params'])) # noqa: E5011344 header_params = {}1345 if 'request_headers' in params:1346 header_params['requestHeaders'] = params['request_headers'] # noqa: E5011347 form_params = []1348 local_var_files = {}1349 body_params = None1350 if 'body' in params:1351 body_params = params['body']1352 # HTTP header `Accept`1353 header_params['Accept'] = self.api_client.select_header_accept(1354 ['*/*']) # noqa: E5011355 # HTTP header `Content-Type`1356 header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E5011357 ['application/json']) # noqa: E5011358 # Authentication setting1359 auth_settings = ['X-Authorization'] # noqa: E5011360 return self.api_client.call_api(1361 '/api/v1/integrations/thingpark/{routingKey}{?allRequestParams}', 'POST',1362 path_params,1363 query_params,1364 header_params,1365 body=body_params,1366 post_params=form_params,1367 files=local_var_files,1368 response_type='DeferredResultResponseEntity', # noqa: E5011369 auth_settings=auth_settings,1370 async_req=params.get('async_req'),1371 _return_http_data_only=params.get('_return_http_data_only'),1372 _preload_content=params.get('_preload_content', True),1373 _request_timeout=params.get('_request_timeout'),1374 collection_formats=collection_formats)1375 def process_request_using_put3(self, body, request_headers, all_request_params, routing_key, **kwargs): # noqa: E5011376 """processRequest # noqa: E5011377 This method makes a synchronous HTTP request by default. To make an1378 asynchronous HTTP request, please pass async_req=True1379 >>> thread = api.process_request_using_put3(body, request_headers, all_request_params, routing_key, async_req=True)1380 >>> result = thread.get()1381 :param async_req bool1382 :param str body: msg (required)1383 :param Object request_headers: requestHeaders (required)1384 :param Object all_request_params: allRequestParams (required)1385 :param str routing_key: routingKey (required)1386 :return: DeferredResultResponseEntity1387 If the method is called asynchronously,1388 returns the request thread.1389 """1390 kwargs['_return_http_data_only'] = True1391 if kwargs.get('async_req'):1392 return self.process_request_using_put3_with_http_info(body, request_headers, all_request_params, routing_key, **kwargs) # noqa: E5011393 else:1394 (data) = self.process_request_using_put3_with_http_info(body, request_headers, all_request_params, routing_key, **kwargs) # noqa: E5011395 return data1396 def process_request_using_put3_with_http_info(self, body, request_headers, all_request_params, routing_key, **kwargs): # noqa: E5011397 """processRequest # noqa: E5011398 This method makes a synchronous HTTP request by default. To make an1399 asynchronous HTTP request, please pass async_req=True1400 >>> thread = api.process_request_using_put3_with_http_info(body, request_headers, all_request_params, routing_key, async_req=True)1401 >>> result = thread.get()1402 :param async_req bool1403 :param str body: msg (required)1404 :param Object request_headers: requestHeaders (required)1405 :param Object all_request_params: allRequestParams (required)1406 :param str routing_key: routingKey (required)1407 :return: DeferredResultResponseEntity1408 If the method is called asynchronously,1409 returns the request thread.1410 """1411 all_params = ['body', 'request_headers', 'all_request_params', 'routing_key'] # noqa: E5011412 all_params.append('async_req')1413 all_params.append('_return_http_data_only')1414 all_params.append('_preload_content')1415 all_params.append('_request_timeout')1416 params = locals()1417 for key, val in six.iteritems(params['kwargs']):1418 if key not in all_params:1419 raise TypeError(1420 "Got an unexpected keyword argument '%s'"1421 " to method process_request_using_put3" % key1422 )1423 params[key] = val1424 del params['kwargs']1425 # verify the required parameter 'body' is set1426 if ('body' not in params or1427 params['body'] is None):1428 raise ValueError("Missing the required parameter `body` when calling `process_request_using_put3`") # noqa: E5011429 # verify the required parameter 'request_headers' is set1430 if ('request_headers' not in params or1431 params['request_headers'] is None):1432 raise ValueError("Missing the required parameter `request_headers` when calling `process_request_using_put3`") # noqa: E5011433 # verify the required parameter 'all_request_params' is set1434 if ('all_request_params' not in params or1435 params['all_request_params'] is None):1436 raise ValueError("Missing the required parameter `all_request_params` when calling `process_request_using_put3`") # noqa: E5011437 # verify the required parameter 'routing_key' is set1438 if ('routing_key' not in params or1439 params['routing_key'] is None):1440 raise ValueError("Missing the required parameter `routing_key` when calling `process_request_using_put3`") # noqa: E5011441 collection_formats = {}1442 path_params = {}1443 if 'routing_key' in params:1444 path_params['routingKey'] = params['routing_key'] # noqa: E5011445 query_params = []1446 if 'all_request_params' in params:1447 query_params.append(('allRequestParams', params['all_request_params'])) # noqa: E5011448 header_params = {}1449 if 'request_headers' in params:1450 header_params['requestHeaders'] = params['request_headers'] # noqa: E5011451 form_params = []1452 local_var_files = {}1453 body_params = None1454 if 'body' in params:1455 body_params = params['body']1456 # HTTP header `Accept`1457 header_params['Accept'] = self.api_client.select_header_accept(1458 ['*/*']) # noqa: E5011459 # HTTP header `Content-Type`1460 header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E5011461 ['application/json']) # noqa: E5011462 # Authentication setting1463 auth_settings = ['X-Authorization'] # noqa: E5011464 return self.api_client.call_api(1465 '/api/v1/integrations/thingpark/{routingKey}{?allRequestParams}', 'PUT',1466 path_params,1467 query_params,1468 header_params,1469 body=body_params,1470 post_params=form_params,1471 files=local_var_files,1472 response_type='DeferredResultResponseEntity', # noqa: E5011473 auth_settings=auth_settings,1474 async_req=params.get('async_req'),1475 _return_http_data_only=params.get('_return_http_data_only'),1476 _preload_content=params.get('_preload_content', True),1477 _request_timeout=params.get('_request_timeout'),...

Full Screen

Full Screen

t_mobile_iot_cdp_integration_controller_api.py

Source:t_mobile_iot_cdp_integration_controller_api.py Github

copy

Full Screen

1# coding: utf-82"""3 Thingsboard REST API4 For instructions how to authorize requests please visit <a href='http://thingsboard.io/docs/reference/rest-api/'>REST API documentation page</a>. # noqa: E5015 OpenAPI spec version: 2.06 Contact: info@thingsboard.io7 Generated by: https://github.com/swagger-api/swagger-codegen.git8"""9from __future__ import absolute_import10import re # noqa: F40111# python 2 and python 3 compatibility library12import six13from pyTB.api_client import ApiClient14class TMobileIotCdpIntegrationControllerApi(object):15 """NOTE: This class is auto generated by the swagger code generator program.16 Do not edit the class manually.17 Ref: https://github.com/swagger-api/swagger-codegen18 """19 def __init__(self, api_client=None):20 if api_client is None:21 api_client = ApiClient()22 self.api_client = api_client23 def process_request_using_delete2(self, body, request_headers, routing_key, **kwargs): # noqa: E50124 """processRequest # noqa: E50125 This method makes a synchronous HTTP request by default. To make an26 asynchronous HTTP request, please pass async_req=True27 >>> thread = api.process_request_using_delete2(body, request_headers, routing_key, async_req=True)28 >>> result = thread.get()29 :param async_req bool30 :param str body: msg (required)31 :param Object request_headers: requestHeaders (required)32 :param str routing_key: routingKey (required)33 :return: DeferredResultResponseEntity34 If the method is called asynchronously,35 returns the request thread.36 """37 kwargs['_return_http_data_only'] = True38 if kwargs.get('async_req'):39 return self.process_request_using_delete2_with_http_info(body, request_headers, routing_key, **kwargs) # noqa: E50140 else:41 (data) = self.process_request_using_delete2_with_http_info(body, request_headers, routing_key, **kwargs) # noqa: E50142 return data43 def process_request_using_delete2_with_http_info(self, body, request_headers, routing_key, **kwargs): # noqa: E50144 """processRequest # noqa: E50145 This method makes a synchronous HTTP request by default. To make an46 asynchronous HTTP request, please pass async_req=True47 >>> thread = api.process_request_using_delete2_with_http_info(body, request_headers, routing_key, async_req=True)48 >>> result = thread.get()49 :param async_req bool50 :param str body: msg (required)51 :param Object request_headers: requestHeaders (required)52 :param str routing_key: routingKey (required)53 :return: DeferredResultResponseEntity54 If the method is called asynchronously,55 returns the request thread.56 """57 all_params = ['body', 'request_headers', 'routing_key'] # noqa: E50158 all_params.append('async_req')59 all_params.append('_return_http_data_only')60 all_params.append('_preload_content')61 all_params.append('_request_timeout')62 params = locals()63 for key, val in six.iteritems(params['kwargs']):64 if key not in all_params:65 raise TypeError(66 "Got an unexpected keyword argument '%s'"67 " to method process_request_using_delete2" % key68 )69 params[key] = val70 del params['kwargs']71 # verify the required parameter 'body' is set72 if ('body' not in params or73 params['body'] is None):74 raise ValueError("Missing the required parameter `body` when calling `process_request_using_delete2`") # noqa: E50175 # verify the required parameter 'request_headers' is set76 if ('request_headers' not in params or77 params['request_headers'] is None):78 raise ValueError("Missing the required parameter `request_headers` when calling `process_request_using_delete2`") # noqa: E50179 # verify the required parameter 'routing_key' is set80 if ('routing_key' not in params or81 params['routing_key'] is None):82 raise ValueError("Missing the required parameter `routing_key` when calling `process_request_using_delete2`") # noqa: E50183 collection_formats = {}84 path_params = {}85 if 'routing_key' in params:86 path_params['routingKey'] = params['routing_key'] # noqa: E50187 query_params = []88 header_params = {}89 if 'request_headers' in params:90 header_params['requestHeaders'] = params['request_headers'] # noqa: E50191 form_params = []92 local_var_files = {}93 body_params = None94 if 'body' in params:95 body_params = params['body']96 # HTTP header `Accept`97 header_params['Accept'] = self.api_client.select_header_accept(98 ['*/*']) # noqa: E50199 # HTTP header `Content-Type`100 header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501101 ['application/json']) # noqa: E501102 # Authentication setting103 auth_settings = ['X-Authorization'] # noqa: E501104 return self.api_client.call_api(105 '/api/v1/integrations/tmobile_iot_cdp/{routingKey}', 'DELETE',106 path_params,107 query_params,108 header_params,109 body=body_params,110 post_params=form_params,111 files=local_var_files,112 response_type='DeferredResultResponseEntity', # noqa: E501113 auth_settings=auth_settings,114 async_req=params.get('async_req'),115 _return_http_data_only=params.get('_return_http_data_only'),116 _preload_content=params.get('_preload_content', True),117 _request_timeout=params.get('_request_timeout'),118 collection_formats=collection_formats)119 def process_request_using_get2(self, body, request_headers, routing_key, **kwargs): # noqa: E501120 """processRequest # noqa: E501121 This method makes a synchronous HTTP request by default. To make an122 asynchronous HTTP request, please pass async_req=True123 >>> thread = api.process_request_using_get2(body, request_headers, routing_key, async_req=True)124 >>> result = thread.get()125 :param async_req bool126 :param str body: msg (required)127 :param Object request_headers: requestHeaders (required)128 :param str routing_key: routingKey (required)129 :return: DeferredResultResponseEntity130 If the method is called asynchronously,131 returns the request thread.132 """133 kwargs['_return_http_data_only'] = True134 if kwargs.get('async_req'):135 return self.process_request_using_get2_with_http_info(body, request_headers, routing_key, **kwargs) # noqa: E501136 else:137 (data) = self.process_request_using_get2_with_http_info(body, request_headers, routing_key, **kwargs) # noqa: E501138 return data139 def process_request_using_get2_with_http_info(self, body, request_headers, routing_key, **kwargs): # noqa: E501140 """processRequest # noqa: E501141 This method makes a synchronous HTTP request by default. To make an142 asynchronous HTTP request, please pass async_req=True143 >>> thread = api.process_request_using_get2_with_http_info(body, request_headers, routing_key, async_req=True)144 >>> result = thread.get()145 :param async_req bool146 :param str body: msg (required)147 :param Object request_headers: requestHeaders (required)148 :param str routing_key: routingKey (required)149 :return: DeferredResultResponseEntity150 If the method is called asynchronously,151 returns the request thread.152 """153 all_params = ['body', 'request_headers', 'routing_key'] # noqa: E501154 all_params.append('async_req')155 all_params.append('_return_http_data_only')156 all_params.append('_preload_content')157 all_params.append('_request_timeout')158 params = locals()159 for key, val in six.iteritems(params['kwargs']):160 if key not in all_params:161 raise TypeError(162 "Got an unexpected keyword argument '%s'"163 " to method process_request_using_get2" % key164 )165 params[key] = val166 del params['kwargs']167 # verify the required parameter 'body' is set168 if ('body' not in params or169 params['body'] is None):170 raise ValueError("Missing the required parameter `body` when calling `process_request_using_get2`") # noqa: E501171 # verify the required parameter 'request_headers' is set172 if ('request_headers' not in params or173 params['request_headers'] is None):174 raise ValueError("Missing the required parameter `request_headers` when calling `process_request_using_get2`") # noqa: E501175 # verify the required parameter 'routing_key' is set176 if ('routing_key' not in params or177 params['routing_key'] is None):178 raise ValueError("Missing the required parameter `routing_key` when calling `process_request_using_get2`") # noqa: E501179 collection_formats = {}180 path_params = {}181 if 'routing_key' in params:182 path_params['routingKey'] = params['routing_key'] # noqa: E501183 query_params = []184 header_params = {}185 if 'request_headers' in params:186 header_params['requestHeaders'] = params['request_headers'] # noqa: E501187 form_params = []188 local_var_files = {}189 body_params = None190 if 'body' in params:191 body_params = params['body']192 # HTTP header `Accept`193 header_params['Accept'] = self.api_client.select_header_accept(194 ['*/*']) # noqa: E501195 # HTTP header `Content-Type`196 header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501197 ['application/json']) # noqa: E501198 # Authentication setting199 auth_settings = ['X-Authorization'] # noqa: E501200 return self.api_client.call_api(201 '/api/v1/integrations/tmobile_iot_cdp/{routingKey}', 'GET',202 path_params,203 query_params,204 header_params,205 body=body_params,206 post_params=form_params,207 files=local_var_files,208 response_type='DeferredResultResponseEntity', # noqa: E501209 auth_settings=auth_settings,210 async_req=params.get('async_req'),211 _return_http_data_only=params.get('_return_http_data_only'),212 _preload_content=params.get('_preload_content', True),213 _request_timeout=params.get('_request_timeout'),214 collection_formats=collection_formats)215 def process_request_using_head2(self, body, request_headers, routing_key, **kwargs): # noqa: E501216 """processRequest # noqa: E501217 This method makes a synchronous HTTP request by default. To make an218 asynchronous HTTP request, please pass async_req=True219 >>> thread = api.process_request_using_head2(body, request_headers, routing_key, async_req=True)220 >>> result = thread.get()221 :param async_req bool222 :param str body: msg (required)223 :param Object request_headers: requestHeaders (required)224 :param str routing_key: routingKey (required)225 :return: DeferredResultResponseEntity226 If the method is called asynchronously,227 returns the request thread.228 """229 kwargs['_return_http_data_only'] = True230 if kwargs.get('async_req'):231 return self.process_request_using_head2_with_http_info(body, request_headers, routing_key, **kwargs) # noqa: E501232 else:233 (data) = self.process_request_using_head2_with_http_info(body, request_headers, routing_key, **kwargs) # noqa: E501234 return data235 def process_request_using_head2_with_http_info(self, body, request_headers, routing_key, **kwargs): # noqa: E501236 """processRequest # noqa: E501237 This method makes a synchronous HTTP request by default. To make an238 asynchronous HTTP request, please pass async_req=True239 >>> thread = api.process_request_using_head2_with_http_info(body, request_headers, routing_key, async_req=True)240 >>> result = thread.get()241 :param async_req bool242 :param str body: msg (required)243 :param Object request_headers: requestHeaders (required)244 :param str routing_key: routingKey (required)245 :return: DeferredResultResponseEntity246 If the method is called asynchronously,247 returns the request thread.248 """249 all_params = ['body', 'request_headers', 'routing_key'] # noqa: E501250 all_params.append('async_req')251 all_params.append('_return_http_data_only')252 all_params.append('_preload_content')253 all_params.append('_request_timeout')254 params = locals()255 for key, val in six.iteritems(params['kwargs']):256 if key not in all_params:257 raise TypeError(258 "Got an unexpected keyword argument '%s'"259 " to method process_request_using_head2" % key260 )261 params[key] = val262 del params['kwargs']263 # verify the required parameter 'body' is set264 if ('body' not in params or265 params['body'] is None):266 raise ValueError("Missing the required parameter `body` when calling `process_request_using_head2`") # noqa: E501267 # verify the required parameter 'request_headers' is set268 if ('request_headers' not in params or269 params['request_headers'] is None):270 raise ValueError("Missing the required parameter `request_headers` when calling `process_request_using_head2`") # noqa: E501271 # verify the required parameter 'routing_key' is set272 if ('routing_key' not in params or273 params['routing_key'] is None):274 raise ValueError("Missing the required parameter `routing_key` when calling `process_request_using_head2`") # noqa: E501275 collection_formats = {}276 path_params = {}277 if 'routing_key' in params:278 path_params['routingKey'] = params['routing_key'] # noqa: E501279 query_params = []280 header_params = {}281 if 'request_headers' in params:282 header_params['requestHeaders'] = params['request_headers'] # noqa: E501283 form_params = []284 local_var_files = {}285 body_params = None286 if 'body' in params:287 body_params = params['body']288 # HTTP header `Accept`289 header_params['Accept'] = self.api_client.select_header_accept(290 ['*/*']) # noqa: E501291 # HTTP header `Content-Type`292 header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501293 ['application/json']) # noqa: E501294 # Authentication setting295 auth_settings = ['X-Authorization'] # noqa: E501296 return self.api_client.call_api(297 '/api/v1/integrations/tmobile_iot_cdp/{routingKey}', 'HEAD',298 path_params,299 query_params,300 header_params,301 body=body_params,302 post_params=form_params,303 files=local_var_files,304 response_type='DeferredResultResponseEntity', # noqa: E501305 auth_settings=auth_settings,306 async_req=params.get('async_req'),307 _return_http_data_only=params.get('_return_http_data_only'),308 _preload_content=params.get('_preload_content', True),309 _request_timeout=params.get('_request_timeout'),310 collection_formats=collection_formats)311 def process_request_using_options2(self, body, request_headers, routing_key, **kwargs): # noqa: E501312 """processRequest # noqa: E501313 This method makes a synchronous HTTP request by default. To make an314 asynchronous HTTP request, please pass async_req=True315 >>> thread = api.process_request_using_options2(body, request_headers, routing_key, async_req=True)316 >>> result = thread.get()317 :param async_req bool318 :param str body: msg (required)319 :param Object request_headers: requestHeaders (required)320 :param str routing_key: routingKey (required)321 :return: DeferredResultResponseEntity322 If the method is called asynchronously,323 returns the request thread.324 """325 kwargs['_return_http_data_only'] = True326 if kwargs.get('async_req'):327 return self.process_request_using_options2_with_http_info(body, request_headers, routing_key, **kwargs) # noqa: E501328 else:329 (data) = self.process_request_using_options2_with_http_info(body, request_headers, routing_key, **kwargs) # noqa: E501330 return data331 def process_request_using_options2_with_http_info(self, body, request_headers, routing_key, **kwargs): # noqa: E501332 """processRequest # noqa: E501333 This method makes a synchronous HTTP request by default. To make an334 asynchronous HTTP request, please pass async_req=True335 >>> thread = api.process_request_using_options2_with_http_info(body, request_headers, routing_key, async_req=True)336 >>> result = thread.get()337 :param async_req bool338 :param str body: msg (required)339 :param Object request_headers: requestHeaders (required)340 :param str routing_key: routingKey (required)341 :return: DeferredResultResponseEntity342 If the method is called asynchronously,343 returns the request thread.344 """345 all_params = ['body', 'request_headers', 'routing_key'] # noqa: E501346 all_params.append('async_req')347 all_params.append('_return_http_data_only')348 all_params.append('_preload_content')349 all_params.append('_request_timeout')350 params = locals()351 for key, val in six.iteritems(params['kwargs']):352 if key not in all_params:353 raise TypeError(354 "Got an unexpected keyword argument '%s'"355 " to method process_request_using_options2" % key356 )357 params[key] = val358 del params['kwargs']359 # verify the required parameter 'body' is set360 if ('body' not in params or361 params['body'] is None):362 raise ValueError("Missing the required parameter `body` when calling `process_request_using_options2`") # noqa: E501363 # verify the required parameter 'request_headers' is set364 if ('request_headers' not in params or365 params['request_headers'] is None):366 raise ValueError("Missing the required parameter `request_headers` when calling `process_request_using_options2`") # noqa: E501367 # verify the required parameter 'routing_key' is set368 if ('routing_key' not in params or369 params['routing_key'] is None):370 raise ValueError("Missing the required parameter `routing_key` when calling `process_request_using_options2`") # noqa: E501371 collection_formats = {}372 path_params = {}373 if 'routing_key' in params:374 path_params['routingKey'] = params['routing_key'] # noqa: E501375 query_params = []376 header_params = {}377 if 'request_headers' in params:378 header_params['requestHeaders'] = params['request_headers'] # noqa: E501379 form_params = []380 local_var_files = {}381 body_params = None382 if 'body' in params:383 body_params = params['body']384 # HTTP header `Accept`385 header_params['Accept'] = self.api_client.select_header_accept(386 ['*/*']) # noqa: E501387 # HTTP header `Content-Type`388 header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501389 ['application/json']) # noqa: E501390 # Authentication setting391 auth_settings = ['X-Authorization'] # noqa: E501392 return self.api_client.call_api(393 '/api/v1/integrations/tmobile_iot_cdp/{routingKey}', 'OPTIONS',394 path_params,395 query_params,396 header_params,397 body=body_params,398 post_params=form_params,399 files=local_var_files,400 response_type='DeferredResultResponseEntity', # noqa: E501401 auth_settings=auth_settings,402 async_req=params.get('async_req'),403 _return_http_data_only=params.get('_return_http_data_only'),404 _preload_content=params.get('_preload_content', True),405 _request_timeout=params.get('_request_timeout'),406 collection_formats=collection_formats)407 def process_request_using_patch2(self, body, request_headers, routing_key, **kwargs): # noqa: E501408 """processRequest # noqa: E501409 This method makes a synchronous HTTP request by default. To make an410 asynchronous HTTP request, please pass async_req=True411 >>> thread = api.process_request_using_patch2(body, request_headers, routing_key, async_req=True)412 >>> result = thread.get()413 :param async_req bool414 :param str body: msg (required)415 :param Object request_headers: requestHeaders (required)416 :param str routing_key: routingKey (required)417 :return: DeferredResultResponseEntity418 If the method is called asynchronously,419 returns the request thread.420 """421 kwargs['_return_http_data_only'] = True422 if kwargs.get('async_req'):423 return self.process_request_using_patch2_with_http_info(body, request_headers, routing_key, **kwargs) # noqa: E501424 else:425 (data) = self.process_request_using_patch2_with_http_info(body, request_headers, routing_key, **kwargs) # noqa: E501426 return data427 def process_request_using_patch2_with_http_info(self, body, request_headers, routing_key, **kwargs): # noqa: E501428 """processRequest # noqa: E501429 This method makes a synchronous HTTP request by default. To make an430 asynchronous HTTP request, please pass async_req=True431 >>> thread = api.process_request_using_patch2_with_http_info(body, request_headers, routing_key, async_req=True)432 >>> result = thread.get()433 :param async_req bool434 :param str body: msg (required)435 :param Object request_headers: requestHeaders (required)436 :param str routing_key: routingKey (required)437 :return: DeferredResultResponseEntity438 If the method is called asynchronously,439 returns the request thread.440 """441 all_params = ['body', 'request_headers', 'routing_key'] # noqa: E501442 all_params.append('async_req')443 all_params.append('_return_http_data_only')444 all_params.append('_preload_content')445 all_params.append('_request_timeout')446 params = locals()447 for key, val in six.iteritems(params['kwargs']):448 if key not in all_params:449 raise TypeError(450 "Got an unexpected keyword argument '%s'"451 " to method process_request_using_patch2" % key452 )453 params[key] = val454 del params['kwargs']455 # verify the required parameter 'body' is set456 if ('body' not in params or457 params['body'] is None):458 raise ValueError("Missing the required parameter `body` when calling `process_request_using_patch2`") # noqa: E501459 # verify the required parameter 'request_headers' is set460 if ('request_headers' not in params or461 params['request_headers'] is None):462 raise ValueError("Missing the required parameter `request_headers` when calling `process_request_using_patch2`") # noqa: E501463 # verify the required parameter 'routing_key' is set464 if ('routing_key' not in params or465 params['routing_key'] is None):466 raise ValueError("Missing the required parameter `routing_key` when calling `process_request_using_patch2`") # noqa: E501467 collection_formats = {}468 path_params = {}469 if 'routing_key' in params:470 path_params['routingKey'] = params['routing_key'] # noqa: E501471 query_params = []472 header_params = {}473 if 'request_headers' in params:474 header_params['requestHeaders'] = params['request_headers'] # noqa: E501475 form_params = []476 local_var_files = {}477 body_params = None478 if 'body' in params:479 body_params = params['body']480 # HTTP header `Accept`481 header_params['Accept'] = self.api_client.select_header_accept(482 ['*/*']) # noqa: E501483 # HTTP header `Content-Type`484 header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501485 ['application/json']) # noqa: E501486 # Authentication setting487 auth_settings = ['X-Authorization'] # noqa: E501488 return self.api_client.call_api(489 '/api/v1/integrations/tmobile_iot_cdp/{routingKey}', 'PATCH',490 path_params,491 query_params,492 header_params,493 body=body_params,494 post_params=form_params,495 files=local_var_files,496 response_type='DeferredResultResponseEntity', # noqa: E501497 auth_settings=auth_settings,498 async_req=params.get('async_req'),499 _return_http_data_only=params.get('_return_http_data_only'),500 _preload_content=params.get('_preload_content', True),501 _request_timeout=params.get('_request_timeout'),502 collection_formats=collection_formats)503 def process_request_using_post4(self, body, request_headers, routing_key, **kwargs): # noqa: E501504 """processRequest # noqa: E501505 This method makes a synchronous HTTP request by default. To make an506 asynchronous HTTP request, please pass async_req=True507 >>> thread = api.process_request_using_post4(body, request_headers, routing_key, async_req=True)508 >>> result = thread.get()509 :param async_req bool510 :param str body: msg (required)511 :param Object request_headers: requestHeaders (required)512 :param str routing_key: routingKey (required)513 :return: DeferredResultResponseEntity514 If the method is called asynchronously,515 returns the request thread.516 """517 kwargs['_return_http_data_only'] = True518 if kwargs.get('async_req'):519 return self.process_request_using_post4_with_http_info(body, request_headers, routing_key, **kwargs) # noqa: E501520 else:521 (data) = self.process_request_using_post4_with_http_info(body, request_headers, routing_key, **kwargs) # noqa: E501522 return data523 def process_request_using_post4_with_http_info(self, body, request_headers, routing_key, **kwargs): # noqa: E501524 """processRequest # noqa: E501525 This method makes a synchronous HTTP request by default. To make an526 asynchronous HTTP request, please pass async_req=True527 >>> thread = api.process_request_using_post4_with_http_info(body, request_headers, routing_key, async_req=True)528 >>> result = thread.get()529 :param async_req bool530 :param str body: msg (required)531 :param Object request_headers: requestHeaders (required)532 :param str routing_key: routingKey (required)533 :return: DeferredResultResponseEntity534 If the method is called asynchronously,535 returns the request thread.536 """537 all_params = ['body', 'request_headers', 'routing_key'] # noqa: E501538 all_params.append('async_req')539 all_params.append('_return_http_data_only')540 all_params.append('_preload_content')541 all_params.append('_request_timeout')542 params = locals()543 for key, val in six.iteritems(params['kwargs']):544 if key not in all_params:545 raise TypeError(546 "Got an unexpected keyword argument '%s'"547 " to method process_request_using_post4" % key548 )549 params[key] = val550 del params['kwargs']551 # verify the required parameter 'body' is set552 if ('body' not in params or553 params['body'] is None):554 raise ValueError("Missing the required parameter `body` when calling `process_request_using_post4`") # noqa: E501555 # verify the required parameter 'request_headers' is set556 if ('request_headers' not in params or557 params['request_headers'] is None):558 raise ValueError("Missing the required parameter `request_headers` when calling `process_request_using_post4`") # noqa: E501559 # verify the required parameter 'routing_key' is set560 if ('routing_key' not in params or561 params['routing_key'] is None):562 raise ValueError("Missing the required parameter `routing_key` when calling `process_request_using_post4`") # noqa: E501563 collection_formats = {}564 path_params = {}565 if 'routing_key' in params:566 path_params['routingKey'] = params['routing_key'] # noqa: E501567 query_params = []568 header_params = {}569 if 'request_headers' in params:570 header_params['requestHeaders'] = params['request_headers'] # noqa: E501571 form_params = []572 local_var_files = {}573 body_params = None574 if 'body' in params:575 body_params = params['body']576 # HTTP header `Accept`577 header_params['Accept'] = self.api_client.select_header_accept(578 ['*/*']) # noqa: E501579 # HTTP header `Content-Type`580 header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501581 ['application/json']) # noqa: E501582 # Authentication setting583 auth_settings = ['X-Authorization'] # noqa: E501584 return self.api_client.call_api(585 '/api/v1/integrations/tmobile_iot_cdp/{routingKey}', 'POST',586 path_params,587 query_params,588 header_params,589 body=body_params,590 post_params=form_params,591 files=local_var_files,592 response_type='DeferredResultResponseEntity', # noqa: E501593 auth_settings=auth_settings,594 async_req=params.get('async_req'),595 _return_http_data_only=params.get('_return_http_data_only'),596 _preload_content=params.get('_preload_content', True),597 _request_timeout=params.get('_request_timeout'),598 collection_formats=collection_formats)599 def process_request_using_put2(self, body, request_headers, routing_key, **kwargs): # noqa: E501600 """processRequest # noqa: E501601 This method makes a synchronous HTTP request by default. To make an602 asynchronous HTTP request, please pass async_req=True603 >>> thread = api.process_request_using_put2(body, request_headers, routing_key, async_req=True)604 >>> result = thread.get()605 :param async_req bool606 :param str body: msg (required)607 :param Object request_headers: requestHeaders (required)608 :param str routing_key: routingKey (required)609 :return: DeferredResultResponseEntity610 If the method is called asynchronously,611 returns the request thread.612 """613 kwargs['_return_http_data_only'] = True614 if kwargs.get('async_req'):615 return self.process_request_using_put2_with_http_info(body, request_headers, routing_key, **kwargs) # noqa: E501616 else:617 (data) = self.process_request_using_put2_with_http_info(body, request_headers, routing_key, **kwargs) # noqa: E501618 return data619 def process_request_using_put2_with_http_info(self, body, request_headers, routing_key, **kwargs): # noqa: E501620 """processRequest # noqa: E501621 This method makes a synchronous HTTP request by default. To make an622 asynchronous HTTP request, please pass async_req=True623 >>> thread = api.process_request_using_put2_with_http_info(body, request_headers, routing_key, async_req=True)624 >>> result = thread.get()625 :param async_req bool626 :param str body: msg (required)627 :param Object request_headers: requestHeaders (required)628 :param str routing_key: routingKey (required)629 :return: DeferredResultResponseEntity630 If the method is called asynchronously,631 returns the request thread.632 """633 all_params = ['body', 'request_headers', 'routing_key'] # noqa: E501634 all_params.append('async_req')635 all_params.append('_return_http_data_only')636 all_params.append('_preload_content')637 all_params.append('_request_timeout')638 params = locals()639 for key, val in six.iteritems(params['kwargs']):640 if key not in all_params:641 raise TypeError(642 "Got an unexpected keyword argument '%s'"643 " to method process_request_using_put2" % key644 )645 params[key] = val646 del params['kwargs']647 # verify the required parameter 'body' is set648 if ('body' not in params or649 params['body'] is None):650 raise ValueError("Missing the required parameter `body` when calling `process_request_using_put2`") # noqa: E501651 # verify the required parameter 'request_headers' is set652 if ('request_headers' not in params or653 params['request_headers'] is None):654 raise ValueError("Missing the required parameter `request_headers` when calling `process_request_using_put2`") # noqa: E501655 # verify the required parameter 'routing_key' is set656 if ('routing_key' not in params or657 params['routing_key'] is None):658 raise ValueError("Missing the required parameter `routing_key` when calling `process_request_using_put2`") # noqa: E501659 collection_formats = {}660 path_params = {}661 if 'routing_key' in params:662 path_params['routingKey'] = params['routing_key'] # noqa: E501663 query_params = []664 header_params = {}665 if 'request_headers' in params:666 header_params['requestHeaders'] = params['request_headers'] # noqa: E501667 form_params = []668 local_var_files = {}669 body_params = None670 if 'body' in params:671 body_params = params['body']672 # HTTP header `Accept`673 header_params['Accept'] = self.api_client.select_header_accept(674 ['*/*']) # noqa: E501675 # HTTP header `Content-Type`676 header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501677 ['application/json']) # noqa: E501678 # Authentication setting679 auth_settings = ['X-Authorization'] # noqa: E501680 return self.api_client.call_api(681 '/api/v1/integrations/tmobile_iot_cdp/{routingKey}', 'PUT',682 path_params,683 query_params,684 header_params,685 body=body_params,686 post_params=form_params,687 files=local_var_files,688 response_type='DeferredResultResponseEntity', # noqa: E501689 auth_settings=auth_settings,690 async_req=params.get('async_req'),691 _return_http_data_only=params.get('_return_http_data_only'),692 _preload_content=params.get('_preload_content', True),693 _request_timeout=params.get('_request_timeout'),...

Full Screen

Full Screen

sig_fox_integration_controller_api.py

Source:sig_fox_integration_controller_api.py Github

copy

Full Screen

1# coding: utf-82"""3 Thingsboard REST API4 For instructions how to authorize requests please visit <a href='http://thingsboard.io/docs/reference/rest-api/'>REST API documentation page</a>. # noqa: E5015 OpenAPI spec version: 2.06 Contact: info@thingsboard.io7 Generated by: https://github.com/swagger-api/swagger-codegen.git8"""9from __future__ import absolute_import10import re # noqa: F40111# python 2 and python 3 compatibility library12import six13from pyTB.api_client import ApiClient14class SigFoxIntegrationControllerApi(object):15 """NOTE: This class is auto generated by the swagger code generator program.16 Do not edit the class manually.17 Ref: https://github.com/swagger-api/swagger-codegen18 """19 def __init__(self, api_client=None):20 if api_client is None:21 api_client = ApiClient()22 self.api_client = api_client23 def process_request_using_delete1(self, body, request_headers, routing_key, **kwargs): # noqa: E50124 """processRequest # noqa: E50125 This method makes a synchronous HTTP request by default. To make an26 asynchronous HTTP request, please pass async_req=True27 >>> thread = api.process_request_using_delete1(body, request_headers, routing_key, async_req=True)28 >>> result = thread.get()29 :param async_req bool30 :param str body: msg (required)31 :param Object request_headers: requestHeaders (required)32 :param str routing_key: routingKey (required)33 :return: DeferredResultResponseEntity34 If the method is called asynchronously,35 returns the request thread.36 """37 kwargs['_return_http_data_only'] = True38 if kwargs.get('async_req'):39 return self.process_request_using_delete1_with_http_info(body, request_headers, routing_key, **kwargs) # noqa: E50140 else:41 (data) = self.process_request_using_delete1_with_http_info(body, request_headers, routing_key, **kwargs) # noqa: E50142 return data43 def process_request_using_delete1_with_http_info(self, body, request_headers, routing_key, **kwargs): # noqa: E50144 """processRequest # noqa: E50145 This method makes a synchronous HTTP request by default. To make an46 asynchronous HTTP request, please pass async_req=True47 >>> thread = api.process_request_using_delete1_with_http_info(body, request_headers, routing_key, async_req=True)48 >>> result = thread.get()49 :param async_req bool50 :param str body: msg (required)51 :param Object request_headers: requestHeaders (required)52 :param str routing_key: routingKey (required)53 :return: DeferredResultResponseEntity54 If the method is called asynchronously,55 returns the request thread.56 """57 all_params = ['body', 'request_headers', 'routing_key'] # noqa: E50158 all_params.append('async_req')59 all_params.append('_return_http_data_only')60 all_params.append('_preload_content')61 all_params.append('_request_timeout')62 params = locals()63 for key, val in six.iteritems(params['kwargs']):64 if key not in all_params:65 raise TypeError(66 "Got an unexpected keyword argument '%s'"67 " to method process_request_using_delete1" % key68 )69 params[key] = val70 del params['kwargs']71 # verify the required parameter 'body' is set72 if ('body' not in params or73 params['body'] is None):74 raise ValueError("Missing the required parameter `body` when calling `process_request_using_delete1`") # noqa: E50175 # verify the required parameter 'request_headers' is set76 if ('request_headers' not in params or77 params['request_headers'] is None):78 raise ValueError("Missing the required parameter `request_headers` when calling `process_request_using_delete1`") # noqa: E50179 # verify the required parameter 'routing_key' is set80 if ('routing_key' not in params or81 params['routing_key'] is None):82 raise ValueError("Missing the required parameter `routing_key` when calling `process_request_using_delete1`") # noqa: E50183 collection_formats = {}84 path_params = {}85 if 'routing_key' in params:86 path_params['routingKey'] = params['routing_key'] # noqa: E50187 query_params = []88 header_params = {}89 if 'request_headers' in params:90 header_params['requestHeaders'] = params['request_headers'] # noqa: E50191 form_params = []92 local_var_files = {}93 body_params = None94 if 'body' in params:95 body_params = params['body']96 # HTTP header `Accept`97 header_params['Accept'] = self.api_client.select_header_accept(98 ['*/*']) # noqa: E50199 # HTTP header `Content-Type`100 header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501101 ['application/json']) # noqa: E501102 # Authentication setting103 auth_settings = ['X-Authorization'] # noqa: E501104 return self.api_client.call_api(105 '/api/v1/integrations/sigfox/{routingKey}', 'DELETE',106 path_params,107 query_params,108 header_params,109 body=body_params,110 post_params=form_params,111 files=local_var_files,112 response_type='DeferredResultResponseEntity', # noqa: E501113 auth_settings=auth_settings,114 async_req=params.get('async_req'),115 _return_http_data_only=params.get('_return_http_data_only'),116 _preload_content=params.get('_preload_content', True),117 _request_timeout=params.get('_request_timeout'),118 collection_formats=collection_formats)119 def process_request_using_get1(self, body, request_headers, routing_key, **kwargs): # noqa: E501120 """processRequest # noqa: E501121 This method makes a synchronous HTTP request by default. To make an122 asynchronous HTTP request, please pass async_req=True123 >>> thread = api.process_request_using_get1(body, request_headers, routing_key, async_req=True)124 >>> result = thread.get()125 :param async_req bool126 :param str body: msg (required)127 :param Object request_headers: requestHeaders (required)128 :param str routing_key: routingKey (required)129 :return: DeferredResultResponseEntity130 If the method is called asynchronously,131 returns the request thread.132 """133 kwargs['_return_http_data_only'] = True134 if kwargs.get('async_req'):135 return self.process_request_using_get1_with_http_info(body, request_headers, routing_key, **kwargs) # noqa: E501136 else:137 (data) = self.process_request_using_get1_with_http_info(body, request_headers, routing_key, **kwargs) # noqa: E501138 return data139 def process_request_using_get1_with_http_info(self, body, request_headers, routing_key, **kwargs): # noqa: E501140 """processRequest # noqa: E501141 This method makes a synchronous HTTP request by default. To make an142 asynchronous HTTP request, please pass async_req=True143 >>> thread = api.process_request_using_get1_with_http_info(body, request_headers, routing_key, async_req=True)144 >>> result = thread.get()145 :param async_req bool146 :param str body: msg (required)147 :param Object request_headers: requestHeaders (required)148 :param str routing_key: routingKey (required)149 :return: DeferredResultResponseEntity150 If the method is called asynchronously,151 returns the request thread.152 """153 all_params = ['body', 'request_headers', 'routing_key'] # noqa: E501154 all_params.append('async_req')155 all_params.append('_return_http_data_only')156 all_params.append('_preload_content')157 all_params.append('_request_timeout')158 params = locals()159 for key, val in six.iteritems(params['kwargs']):160 if key not in all_params:161 raise TypeError(162 "Got an unexpected keyword argument '%s'"163 " to method process_request_using_get1" % key164 )165 params[key] = val166 del params['kwargs']167 # verify the required parameter 'body' is set168 if ('body' not in params or169 params['body'] is None):170 raise ValueError("Missing the required parameter `body` when calling `process_request_using_get1`") # noqa: E501171 # verify the required parameter 'request_headers' is set172 if ('request_headers' not in params or173 params['request_headers'] is None):174 raise ValueError("Missing the required parameter `request_headers` when calling `process_request_using_get1`") # noqa: E501175 # verify the required parameter 'routing_key' is set176 if ('routing_key' not in params or177 params['routing_key'] is None):178 raise ValueError("Missing the required parameter `routing_key` when calling `process_request_using_get1`") # noqa: E501179 collection_formats = {}180 path_params = {}181 if 'routing_key' in params:182 path_params['routingKey'] = params['routing_key'] # noqa: E501183 query_params = []184 header_params = {}185 if 'request_headers' in params:186 header_params['requestHeaders'] = params['request_headers'] # noqa: E501187 form_params = []188 local_var_files = {}189 body_params = None190 if 'body' in params:191 body_params = params['body']192 # HTTP header `Accept`193 header_params['Accept'] = self.api_client.select_header_accept(194 ['*/*']) # noqa: E501195 # HTTP header `Content-Type`196 header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501197 ['application/json']) # noqa: E501198 # Authentication setting199 auth_settings = ['X-Authorization'] # noqa: E501200 return self.api_client.call_api(201 '/api/v1/integrations/sigfox/{routingKey}', 'GET',202 path_params,203 query_params,204 header_params,205 body=body_params,206 post_params=form_params,207 files=local_var_files,208 response_type='DeferredResultResponseEntity', # noqa: E501209 auth_settings=auth_settings,210 async_req=params.get('async_req'),211 _return_http_data_only=params.get('_return_http_data_only'),212 _preload_content=params.get('_preload_content', True),213 _request_timeout=params.get('_request_timeout'),214 collection_formats=collection_formats)215 def process_request_using_head1(self, body, request_headers, routing_key, **kwargs): # noqa: E501216 """processRequest # noqa: E501217 This method makes a synchronous HTTP request by default. To make an218 asynchronous HTTP request, please pass async_req=True219 >>> thread = api.process_request_using_head1(body, request_headers, routing_key, async_req=True)220 >>> result = thread.get()221 :param async_req bool222 :param str body: msg (required)223 :param Object request_headers: requestHeaders (required)224 :param str routing_key: routingKey (required)225 :return: DeferredResultResponseEntity226 If the method is called asynchronously,227 returns the request thread.228 """229 kwargs['_return_http_data_only'] = True230 if kwargs.get('async_req'):231 return self.process_request_using_head1_with_http_info(body, request_headers, routing_key, **kwargs) # noqa: E501232 else:233 (data) = self.process_request_using_head1_with_http_info(body, request_headers, routing_key, **kwargs) # noqa: E501234 return data235 def process_request_using_head1_with_http_info(self, body, request_headers, routing_key, **kwargs): # noqa: E501236 """processRequest # noqa: E501237 This method makes a synchronous HTTP request by default. To make an238 asynchronous HTTP request, please pass async_req=True239 >>> thread = api.process_request_using_head1_with_http_info(body, request_headers, routing_key, async_req=True)240 >>> result = thread.get()241 :param async_req bool242 :param str body: msg (required)243 :param Object request_headers: requestHeaders (required)244 :param str routing_key: routingKey (required)245 :return: DeferredResultResponseEntity246 If the method is called asynchronously,247 returns the request thread.248 """249 all_params = ['body', 'request_headers', 'routing_key'] # noqa: E501250 all_params.append('async_req')251 all_params.append('_return_http_data_only')252 all_params.append('_preload_content')253 all_params.append('_request_timeout')254 params = locals()255 for key, val in six.iteritems(params['kwargs']):256 if key not in all_params:257 raise TypeError(258 "Got an unexpected keyword argument '%s'"259 " to method process_request_using_head1" % key260 )261 params[key] = val262 del params['kwargs']263 # verify the required parameter 'body' is set264 if ('body' not in params or265 params['body'] is None):266 raise ValueError("Missing the required parameter `body` when calling `process_request_using_head1`") # noqa: E501267 # verify the required parameter 'request_headers' is set268 if ('request_headers' not in params or269 params['request_headers'] is None):270 raise ValueError("Missing the required parameter `request_headers` when calling `process_request_using_head1`") # noqa: E501271 # verify the required parameter 'routing_key' is set272 if ('routing_key' not in params or273 params['routing_key'] is None):274 raise ValueError("Missing the required parameter `routing_key` when calling `process_request_using_head1`") # noqa: E501275 collection_formats = {}276 path_params = {}277 if 'routing_key' in params:278 path_params['routingKey'] = params['routing_key'] # noqa: E501279 query_params = []280 header_params = {}281 if 'request_headers' in params:282 header_params['requestHeaders'] = params['request_headers'] # noqa: E501283 form_params = []284 local_var_files = {}285 body_params = None286 if 'body' in params:287 body_params = params['body']288 # HTTP header `Accept`289 header_params['Accept'] = self.api_client.select_header_accept(290 ['*/*']) # noqa: E501291 # HTTP header `Content-Type`292 header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501293 ['application/json']) # noqa: E501294 # Authentication setting295 auth_settings = ['X-Authorization'] # noqa: E501296 return self.api_client.call_api(297 '/api/v1/integrations/sigfox/{routingKey}', 'HEAD',298 path_params,299 query_params,300 header_params,301 body=body_params,302 post_params=form_params,303 files=local_var_files,304 response_type='DeferredResultResponseEntity', # noqa: E501305 auth_settings=auth_settings,306 async_req=params.get('async_req'),307 _return_http_data_only=params.get('_return_http_data_only'),308 _preload_content=params.get('_preload_content', True),309 _request_timeout=params.get('_request_timeout'),310 collection_formats=collection_formats)311 def process_request_using_options1(self, body, request_headers, routing_key, **kwargs): # noqa: E501312 """processRequest # noqa: E501313 This method makes a synchronous HTTP request by default. To make an314 asynchronous HTTP request, please pass async_req=True315 >>> thread = api.process_request_using_options1(body, request_headers, routing_key, async_req=True)316 >>> result = thread.get()317 :param async_req bool318 :param str body: msg (required)319 :param Object request_headers: requestHeaders (required)320 :param str routing_key: routingKey (required)321 :return: DeferredResultResponseEntity322 If the method is called asynchronously,323 returns the request thread.324 """325 kwargs['_return_http_data_only'] = True326 if kwargs.get('async_req'):327 return self.process_request_using_options1_with_http_info(body, request_headers, routing_key, **kwargs) # noqa: E501328 else:329 (data) = self.process_request_using_options1_with_http_info(body, request_headers, routing_key, **kwargs) # noqa: E501330 return data331 def process_request_using_options1_with_http_info(self, body, request_headers, routing_key, **kwargs): # noqa: E501332 """processRequest # noqa: E501333 This method makes a synchronous HTTP request by default. To make an334 asynchronous HTTP request, please pass async_req=True335 >>> thread = api.process_request_using_options1_with_http_info(body, request_headers, routing_key, async_req=True)336 >>> result = thread.get()337 :param async_req bool338 :param str body: msg (required)339 :param Object request_headers: requestHeaders (required)340 :param str routing_key: routingKey (required)341 :return: DeferredResultResponseEntity342 If the method is called asynchronously,343 returns the request thread.344 """345 all_params = ['body', 'request_headers', 'routing_key'] # noqa: E501346 all_params.append('async_req')347 all_params.append('_return_http_data_only')348 all_params.append('_preload_content')349 all_params.append('_request_timeout')350 params = locals()351 for key, val in six.iteritems(params['kwargs']):352 if key not in all_params:353 raise TypeError(354 "Got an unexpected keyword argument '%s'"355 " to method process_request_using_options1" % key356 )357 params[key] = val358 del params['kwargs']359 # verify the required parameter 'body' is set360 if ('body' not in params or361 params['body'] is None):362 raise ValueError("Missing the required parameter `body` when calling `process_request_using_options1`") # noqa: E501363 # verify the required parameter 'request_headers' is set364 if ('request_headers' not in params or365 params['request_headers'] is None):366 raise ValueError("Missing the required parameter `request_headers` when calling `process_request_using_options1`") # noqa: E501367 # verify the required parameter 'routing_key' is set368 if ('routing_key' not in params or369 params['routing_key'] is None):370 raise ValueError("Missing the required parameter `routing_key` when calling `process_request_using_options1`") # noqa: E501371 collection_formats = {}372 path_params = {}373 if 'routing_key' in params:374 path_params['routingKey'] = params['routing_key'] # noqa: E501375 query_params = []376 header_params = {}377 if 'request_headers' in params:378 header_params['requestHeaders'] = params['request_headers'] # noqa: E501379 form_params = []380 local_var_files = {}381 body_params = None382 if 'body' in params:383 body_params = params['body']384 # HTTP header `Accept`385 header_params['Accept'] = self.api_client.select_header_accept(386 ['*/*']) # noqa: E501387 # HTTP header `Content-Type`388 header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501389 ['application/json']) # noqa: E501390 # Authentication setting391 auth_settings = ['X-Authorization'] # noqa: E501392 return self.api_client.call_api(393 '/api/v1/integrations/sigfox/{routingKey}', 'OPTIONS',394 path_params,395 query_params,396 header_params,397 body=body_params,398 post_params=form_params,399 files=local_var_files,400 response_type='DeferredResultResponseEntity', # noqa: E501401 auth_settings=auth_settings,402 async_req=params.get('async_req'),403 _return_http_data_only=params.get('_return_http_data_only'),404 _preload_content=params.get('_preload_content', True),405 _request_timeout=params.get('_request_timeout'),406 collection_formats=collection_formats)407 def process_request_using_patch1(self, body, request_headers, routing_key, **kwargs): # noqa: E501408 """processRequest # noqa: E501409 This method makes a synchronous HTTP request by default. To make an410 asynchronous HTTP request, please pass async_req=True411 >>> thread = api.process_request_using_patch1(body, request_headers, routing_key, async_req=True)412 >>> result = thread.get()413 :param async_req bool414 :param str body: msg (required)415 :param Object request_headers: requestHeaders (required)416 :param str routing_key: routingKey (required)417 :return: DeferredResultResponseEntity418 If the method is called asynchronously,419 returns the request thread.420 """421 kwargs['_return_http_data_only'] = True422 if kwargs.get('async_req'):423 return self.process_request_using_patch1_with_http_info(body, request_headers, routing_key, **kwargs) # noqa: E501424 else:425 (data) = self.process_request_using_patch1_with_http_info(body, request_headers, routing_key, **kwargs) # noqa: E501426 return data427 def process_request_using_patch1_with_http_info(self, body, request_headers, routing_key, **kwargs): # noqa: E501428 """processRequest # noqa: E501429 This method makes a synchronous HTTP request by default. To make an430 asynchronous HTTP request, please pass async_req=True431 >>> thread = api.process_request_using_patch1_with_http_info(body, request_headers, routing_key, async_req=True)432 >>> result = thread.get()433 :param async_req bool434 :param str body: msg (required)435 :param Object request_headers: requestHeaders (required)436 :param str routing_key: routingKey (required)437 :return: DeferredResultResponseEntity438 If the method is called asynchronously,439 returns the request thread.440 """441 all_params = ['body', 'request_headers', 'routing_key'] # noqa: E501442 all_params.append('async_req')443 all_params.append('_return_http_data_only')444 all_params.append('_preload_content')445 all_params.append('_request_timeout')446 params = locals()447 for key, val in six.iteritems(params['kwargs']):448 if key not in all_params:449 raise TypeError(450 "Got an unexpected keyword argument '%s'"451 " to method process_request_using_patch1" % key452 )453 params[key] = val454 del params['kwargs']455 # verify the required parameter 'body' is set456 if ('body' not in params or457 params['body'] is None):458 raise ValueError("Missing the required parameter `body` when calling `process_request_using_patch1`") # noqa: E501459 # verify the required parameter 'request_headers' is set460 if ('request_headers' not in params or461 params['request_headers'] is None):462 raise ValueError("Missing the required parameter `request_headers` when calling `process_request_using_patch1`") # noqa: E501463 # verify the required parameter 'routing_key' is set464 if ('routing_key' not in params or465 params['routing_key'] is None):466 raise ValueError("Missing the required parameter `routing_key` when calling `process_request_using_patch1`") # noqa: E501467 collection_formats = {}468 path_params = {}469 if 'routing_key' in params:470 path_params['routingKey'] = params['routing_key'] # noqa: E501471 query_params = []472 header_params = {}473 if 'request_headers' in params:474 header_params['requestHeaders'] = params['request_headers'] # noqa: E501475 form_params = []476 local_var_files = {}477 body_params = None478 if 'body' in params:479 body_params = params['body']480 # HTTP header `Accept`481 header_params['Accept'] = self.api_client.select_header_accept(482 ['*/*']) # noqa: E501483 # HTTP header `Content-Type`484 header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501485 ['application/json']) # noqa: E501486 # Authentication setting487 auth_settings = ['X-Authorization'] # noqa: E501488 return self.api_client.call_api(489 '/api/v1/integrations/sigfox/{routingKey}', 'PATCH',490 path_params,491 query_params,492 header_params,493 body=body_params,494 post_params=form_params,495 files=local_var_files,496 response_type='DeferredResultResponseEntity', # noqa: E501497 auth_settings=auth_settings,498 async_req=params.get('async_req'),499 _return_http_data_only=params.get('_return_http_data_only'),500 _preload_content=params.get('_preload_content', True),501 _request_timeout=params.get('_request_timeout'),502 collection_formats=collection_formats)503 def process_request_using_post3(self, body, request_headers, routing_key, **kwargs): # noqa: E501504 """processRequest # noqa: E501505 This method makes a synchronous HTTP request by default. To make an506 asynchronous HTTP request, please pass async_req=True507 >>> thread = api.process_request_using_post3(body, request_headers, routing_key, async_req=True)508 >>> result = thread.get()509 :param async_req bool510 :param str body: msg (required)511 :param Object request_headers: requestHeaders (required)512 :param str routing_key: routingKey (required)513 :return: DeferredResultResponseEntity514 If the method is called asynchronously,515 returns the request thread.516 """517 kwargs['_return_http_data_only'] = True518 if kwargs.get('async_req'):519 return self.process_request_using_post3_with_http_info(body, request_headers, routing_key, **kwargs) # noqa: E501520 else:521 (data) = self.process_request_using_post3_with_http_info(body, request_headers, routing_key, **kwargs) # noqa: E501522 return data523 def process_request_using_post3_with_http_info(self, body, request_headers, routing_key, **kwargs): # noqa: E501524 """processRequest # noqa: E501525 This method makes a synchronous HTTP request by default. To make an526 asynchronous HTTP request, please pass async_req=True527 >>> thread = api.process_request_using_post3_with_http_info(body, request_headers, routing_key, async_req=True)528 >>> result = thread.get()529 :param async_req bool530 :param str body: msg (required)531 :param Object request_headers: requestHeaders (required)532 :param str routing_key: routingKey (required)533 :return: DeferredResultResponseEntity534 If the method is called asynchronously,535 returns the request thread.536 """537 all_params = ['body', 'request_headers', 'routing_key'] # noqa: E501538 all_params.append('async_req')539 all_params.append('_return_http_data_only')540 all_params.append('_preload_content')541 all_params.append('_request_timeout')542 params = locals()543 for key, val in six.iteritems(params['kwargs']):544 if key not in all_params:545 raise TypeError(546 "Got an unexpected keyword argument '%s'"547 " to method process_request_using_post3" % key548 )549 params[key] = val550 del params['kwargs']551 # verify the required parameter 'body' is set552 if ('body' not in params or553 params['body'] is None):554 raise ValueError("Missing the required parameter `body` when calling `process_request_using_post3`") # noqa: E501555 # verify the required parameter 'request_headers' is set556 if ('request_headers' not in params or557 params['request_headers'] is None):558 raise ValueError("Missing the required parameter `request_headers` when calling `process_request_using_post3`") # noqa: E501559 # verify the required parameter 'routing_key' is set560 if ('routing_key' not in params or561 params['routing_key'] is None):562 raise ValueError("Missing the required parameter `routing_key` when calling `process_request_using_post3`") # noqa: E501563 collection_formats = {}564 path_params = {}565 if 'routing_key' in params:566 path_params['routingKey'] = params['routing_key'] # noqa: E501567 query_params = []568 header_params = {}569 if 'request_headers' in params:570 header_params['requestHeaders'] = params['request_headers'] # noqa: E501571 form_params = []572 local_var_files = {}573 body_params = None574 if 'body' in params:575 body_params = params['body']576 # HTTP header `Accept`577 header_params['Accept'] = self.api_client.select_header_accept(578 ['*/*']) # noqa: E501579 # HTTP header `Content-Type`580 header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501581 ['application/json']) # noqa: E501582 # Authentication setting583 auth_settings = ['X-Authorization'] # noqa: E501584 return self.api_client.call_api(585 '/api/v1/integrations/sigfox/{routingKey}', 'POST',586 path_params,587 query_params,588 header_params,589 body=body_params,590 post_params=form_params,591 files=local_var_files,592 response_type='DeferredResultResponseEntity', # noqa: E501593 auth_settings=auth_settings,594 async_req=params.get('async_req'),595 _return_http_data_only=params.get('_return_http_data_only'),596 _preload_content=params.get('_preload_content', True),597 _request_timeout=params.get('_request_timeout'),598 collection_formats=collection_formats)599 def process_request_using_put1(self, body, request_headers, routing_key, **kwargs): # noqa: E501600 """processRequest # noqa: E501601 This method makes a synchronous HTTP request by default. To make an602 asynchronous HTTP request, please pass async_req=True603 >>> thread = api.process_request_using_put1(body, request_headers, routing_key, async_req=True)604 >>> result = thread.get()605 :param async_req bool606 :param str body: msg (required)607 :param Object request_headers: requestHeaders (required)608 :param str routing_key: routingKey (required)609 :return: DeferredResultResponseEntity610 If the method is called asynchronously,611 returns the request thread.612 """613 kwargs['_return_http_data_only'] = True614 if kwargs.get('async_req'):615 return self.process_request_using_put1_with_http_info(body, request_headers, routing_key, **kwargs) # noqa: E501616 else:617 (data) = self.process_request_using_put1_with_http_info(body, request_headers, routing_key, **kwargs) # noqa: E501618 return data619 def process_request_using_put1_with_http_info(self, body, request_headers, routing_key, **kwargs): # noqa: E501620 """processRequest # noqa: E501621 This method makes a synchronous HTTP request by default. To make an622 asynchronous HTTP request, please pass async_req=True623 >>> thread = api.process_request_using_put1_with_http_info(body, request_headers, routing_key, async_req=True)624 >>> result = thread.get()625 :param async_req bool626 :param str body: msg (required)627 :param Object request_headers: requestHeaders (required)628 :param str routing_key: routingKey (required)629 :return: DeferredResultResponseEntity630 If the method is called asynchronously,631 returns the request thread.632 """633 all_params = ['body', 'request_headers', 'routing_key'] # noqa: E501634 all_params.append('async_req')635 all_params.append('_return_http_data_only')636 all_params.append('_preload_content')637 all_params.append('_request_timeout')638 params = locals()639 for key, val in six.iteritems(params['kwargs']):640 if key not in all_params:641 raise TypeError(642 "Got an unexpected keyword argument '%s'"643 " to method process_request_using_put1" % key644 )645 params[key] = val646 del params['kwargs']647 # verify the required parameter 'body' is set648 if ('body' not in params or649 params['body'] is None):650 raise ValueError("Missing the required parameter `body` when calling `process_request_using_put1`") # noqa: E501651 # verify the required parameter 'request_headers' is set652 if ('request_headers' not in params or653 params['request_headers'] is None):654 raise ValueError("Missing the required parameter `request_headers` when calling `process_request_using_put1`") # noqa: E501655 # verify the required parameter 'routing_key' is set656 if ('routing_key' not in params or657 params['routing_key'] is None):658 raise ValueError("Missing the required parameter `routing_key` when calling `process_request_using_put1`") # noqa: E501659 collection_formats = {}660 path_params = {}661 if 'routing_key' in params:662 path_params['routingKey'] = params['routing_key'] # noqa: E501663 query_params = []664 header_params = {}665 if 'request_headers' in params:666 header_params['requestHeaders'] = params['request_headers'] # noqa: E501667 form_params = []668 local_var_files = {}669 body_params = None670 if 'body' in params:671 body_params = params['body']672 # HTTP header `Accept`673 header_params['Accept'] = self.api_client.select_header_accept(674 ['*/*']) # noqa: E501675 # HTTP header `Content-Type`676 header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501677 ['application/json']) # noqa: E501678 # Authentication setting679 auth_settings = ['X-Authorization'] # noqa: E501680 return self.api_client.call_api(681 '/api/v1/integrations/sigfox/{routingKey}', 'PUT',682 path_params,683 query_params,684 header_params,685 body=body_params,686 post_params=form_params,687 files=local_var_files,688 response_type='DeferredResultResponseEntity', # noqa: E501689 auth_settings=auth_settings,690 async_req=params.get('async_req'),691 _return_http_data_only=params.get('_return_http_data_only'),692 _preload_content=params.get('_preload_content', True),693 _request_timeout=params.get('_request_timeout'),...

Full Screen

Full Screen

ocean_connect_integration_controller_api.py

Source:ocean_connect_integration_controller_api.py Github

copy

Full Screen

1# coding: utf-82"""3 Thingsboard REST API4 For instructions how to authorize requests please visit <a href='http://thingsboard.io/docs/reference/rest-api/'>REST API documentation page</a>. # noqa: E5015 OpenAPI spec version: 2.06 Contact: info@thingsboard.io7 Generated by: https://github.com/swagger-api/swagger-codegen.git8"""9from __future__ import absolute_import10import re # noqa: F40111# python 2 and python 3 compatibility library12import six13from pyTB.api_client import ApiClient14class OceanConnectIntegrationControllerApi(object):15 """NOTE: This class is auto generated by the swagger code generator program.16 Do not edit the class manually.17 Ref: https://github.com/swagger-api/swagger-codegen18 """19 def __init__(self, api_client=None):20 if api_client is None:21 api_client = ApiClient()22 self.api_client = api_client23 def process_request_using_delete(self, body, request_headers, routing_key, **kwargs): # noqa: E50124 """processRequest # noqa: E50125 This method makes a synchronous HTTP request by default. To make an26 asynchronous HTTP request, please pass async_req=True27 >>> thread = api.process_request_using_delete(body, request_headers, routing_key, async_req=True)28 >>> result = thread.get()29 :param async_req bool30 :param str body: msg (required)31 :param Object request_headers: requestHeaders (required)32 :param str routing_key: routingKey (required)33 :return: DeferredResultResponseEntity34 If the method is called asynchronously,35 returns the request thread.36 """37 kwargs['_return_http_data_only'] = True38 if kwargs.get('async_req'):39 return self.process_request_using_delete_with_http_info(body, request_headers, routing_key, **kwargs) # noqa: E50140 else:41 (data) = self.process_request_using_delete_with_http_info(body, request_headers, routing_key, **kwargs) # noqa: E50142 return data43 def process_request_using_delete_with_http_info(self, body, request_headers, routing_key, **kwargs): # noqa: E50144 """processRequest # noqa: E50145 This method makes a synchronous HTTP request by default. To make an46 asynchronous HTTP request, please pass async_req=True47 >>> thread = api.process_request_using_delete_with_http_info(body, request_headers, routing_key, async_req=True)48 >>> result = thread.get()49 :param async_req bool50 :param str body: msg (required)51 :param Object request_headers: requestHeaders (required)52 :param str routing_key: routingKey (required)53 :return: DeferredResultResponseEntity54 If the method is called asynchronously,55 returns the request thread.56 """57 all_params = ['body', 'request_headers', 'routing_key'] # noqa: E50158 all_params.append('async_req')59 all_params.append('_return_http_data_only')60 all_params.append('_preload_content')61 all_params.append('_request_timeout')62 params = locals()63 for key, val in six.iteritems(params['kwargs']):64 if key not in all_params:65 raise TypeError(66 "Got an unexpected keyword argument '%s'"67 " to method process_request_using_delete" % key68 )69 params[key] = val70 del params['kwargs']71 # verify the required parameter 'body' is set72 if ('body' not in params or73 params['body'] is None):74 raise ValueError("Missing the required parameter `body` when calling `process_request_using_delete`") # noqa: E50175 # verify the required parameter 'request_headers' is set76 if ('request_headers' not in params or77 params['request_headers'] is None):78 raise ValueError("Missing the required parameter `request_headers` when calling `process_request_using_delete`") # noqa: E50179 # verify the required parameter 'routing_key' is set80 if ('routing_key' not in params or81 params['routing_key'] is None):82 raise ValueError("Missing the required parameter `routing_key` when calling `process_request_using_delete`") # noqa: E50183 collection_formats = {}84 path_params = {}85 if 'routing_key' in params:86 path_params['routingKey'] = params['routing_key'] # noqa: E50187 query_params = []88 header_params = {}89 if 'request_headers' in params:90 header_params['requestHeaders'] = params['request_headers'] # noqa: E50191 form_params = []92 local_var_files = {}93 body_params = None94 if 'body' in params:95 body_params = params['body']96 # HTTP header `Accept`97 header_params['Accept'] = self.api_client.select_header_accept(98 ['*/*']) # noqa: E50199 # HTTP header `Content-Type`100 header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501101 ['application/json']) # noqa: E501102 # Authentication setting103 auth_settings = ['X-Authorization'] # noqa: E501104 return self.api_client.call_api(105 '/api/v1/integrations/oceanconnect/{routingKey}', 'DELETE',106 path_params,107 query_params,108 header_params,109 body=body_params,110 post_params=form_params,111 files=local_var_files,112 response_type='DeferredResultResponseEntity', # noqa: E501113 auth_settings=auth_settings,114 async_req=params.get('async_req'),115 _return_http_data_only=params.get('_return_http_data_only'),116 _preload_content=params.get('_preload_content', True),117 _request_timeout=params.get('_request_timeout'),118 collection_formats=collection_formats)119 def process_request_using_get(self, body, request_headers, routing_key, **kwargs): # noqa: E501120 """processRequest # noqa: E501121 This method makes a synchronous HTTP request by default. To make an122 asynchronous HTTP request, please pass async_req=True123 >>> thread = api.process_request_using_get(body, request_headers, routing_key, async_req=True)124 >>> result = thread.get()125 :param async_req bool126 :param str body: msg (required)127 :param Object request_headers: requestHeaders (required)128 :param str routing_key: routingKey (required)129 :return: DeferredResultResponseEntity130 If the method is called asynchronously,131 returns the request thread.132 """133 kwargs['_return_http_data_only'] = True134 if kwargs.get('async_req'):135 return self.process_request_using_get_with_http_info(body, request_headers, routing_key, **kwargs) # noqa: E501136 else:137 (data) = self.process_request_using_get_with_http_info(body, request_headers, routing_key, **kwargs) # noqa: E501138 return data139 def process_request_using_get_with_http_info(self, body, request_headers, routing_key, **kwargs): # noqa: E501140 """processRequest # noqa: E501141 This method makes a synchronous HTTP request by default. To make an142 asynchronous HTTP request, please pass async_req=True143 >>> thread = api.process_request_using_get_with_http_info(body, request_headers, routing_key, async_req=True)144 >>> result = thread.get()145 :param async_req bool146 :param str body: msg (required)147 :param Object request_headers: requestHeaders (required)148 :param str routing_key: routingKey (required)149 :return: DeferredResultResponseEntity150 If the method is called asynchronously,151 returns the request thread.152 """153 all_params = ['body', 'request_headers', 'routing_key'] # noqa: E501154 all_params.append('async_req')155 all_params.append('_return_http_data_only')156 all_params.append('_preload_content')157 all_params.append('_request_timeout')158 params = locals()159 for key, val in six.iteritems(params['kwargs']):160 if key not in all_params:161 raise TypeError(162 "Got an unexpected keyword argument '%s'"163 " to method process_request_using_get" % key164 )165 params[key] = val166 del params['kwargs']167 # verify the required parameter 'body' is set168 if ('body' not in params or169 params['body'] is None):170 raise ValueError("Missing the required parameter `body` when calling `process_request_using_get`") # noqa: E501171 # verify the required parameter 'request_headers' is set172 if ('request_headers' not in params or173 params['request_headers'] is None):174 raise ValueError("Missing the required parameter `request_headers` when calling `process_request_using_get`") # noqa: E501175 # verify the required parameter 'routing_key' is set176 if ('routing_key' not in params or177 params['routing_key'] is None):178 raise ValueError("Missing the required parameter `routing_key` when calling `process_request_using_get`") # noqa: E501179 collection_formats = {}180 path_params = {}181 if 'routing_key' in params:182 path_params['routingKey'] = params['routing_key'] # noqa: E501183 query_params = []184 header_params = {}185 if 'request_headers' in params:186 header_params['requestHeaders'] = params['request_headers'] # noqa: E501187 form_params = []188 local_var_files = {}189 body_params = None190 if 'body' in params:191 body_params = params['body']192 # HTTP header `Accept`193 header_params['Accept'] = self.api_client.select_header_accept(194 ['*/*']) # noqa: E501195 # HTTP header `Content-Type`196 header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501197 ['application/json']) # noqa: E501198 # Authentication setting199 auth_settings = ['X-Authorization'] # noqa: E501200 return self.api_client.call_api(201 '/api/v1/integrations/oceanconnect/{routingKey}', 'GET',202 path_params,203 query_params,204 header_params,205 body=body_params,206 post_params=form_params,207 files=local_var_files,208 response_type='DeferredResultResponseEntity', # noqa: E501209 auth_settings=auth_settings,210 async_req=params.get('async_req'),211 _return_http_data_only=params.get('_return_http_data_only'),212 _preload_content=params.get('_preload_content', True),213 _request_timeout=params.get('_request_timeout'),214 collection_formats=collection_formats)215 def process_request_using_head(self, body, request_headers, routing_key, **kwargs): # noqa: E501216 """processRequest # noqa: E501217 This method makes a synchronous HTTP request by default. To make an218 asynchronous HTTP request, please pass async_req=True219 >>> thread = api.process_request_using_head(body, request_headers, routing_key, async_req=True)220 >>> result = thread.get()221 :param async_req bool222 :param str body: msg (required)223 :param Object request_headers: requestHeaders (required)224 :param str routing_key: routingKey (required)225 :return: DeferredResultResponseEntity226 If the method is called asynchronously,227 returns the request thread.228 """229 kwargs['_return_http_data_only'] = True230 if kwargs.get('async_req'):231 return self.process_request_using_head_with_http_info(body, request_headers, routing_key, **kwargs) # noqa: E501232 else:233 (data) = self.process_request_using_head_with_http_info(body, request_headers, routing_key, **kwargs) # noqa: E501234 return data235 def process_request_using_head_with_http_info(self, body, request_headers, routing_key, **kwargs): # noqa: E501236 """processRequest # noqa: E501237 This method makes a synchronous HTTP request by default. To make an238 asynchronous HTTP request, please pass async_req=True239 >>> thread = api.process_request_using_head_with_http_info(body, request_headers, routing_key, async_req=True)240 >>> result = thread.get()241 :param async_req bool242 :param str body: msg (required)243 :param Object request_headers: requestHeaders (required)244 :param str routing_key: routingKey (required)245 :return: DeferredResultResponseEntity246 If the method is called asynchronously,247 returns the request thread.248 """249 all_params = ['body', 'request_headers', 'routing_key'] # noqa: E501250 all_params.append('async_req')251 all_params.append('_return_http_data_only')252 all_params.append('_preload_content')253 all_params.append('_request_timeout')254 params = locals()255 for key, val in six.iteritems(params['kwargs']):256 if key not in all_params:257 raise TypeError(258 "Got an unexpected keyword argument '%s'"259 " to method process_request_using_head" % key260 )261 params[key] = val262 del params['kwargs']263 # verify the required parameter 'body' is set264 if ('body' not in params or265 params['body'] is None):266 raise ValueError("Missing the required parameter `body` when calling `process_request_using_head`") # noqa: E501267 # verify the required parameter 'request_headers' is set268 if ('request_headers' not in params or269 params['request_headers'] is None):270 raise ValueError("Missing the required parameter `request_headers` when calling `process_request_using_head`") # noqa: E501271 # verify the required parameter 'routing_key' is set272 if ('routing_key' not in params or273 params['routing_key'] is None):274 raise ValueError("Missing the required parameter `routing_key` when calling `process_request_using_head`") # noqa: E501275 collection_formats = {}276 path_params = {}277 if 'routing_key' in params:278 path_params['routingKey'] = params['routing_key'] # noqa: E501279 query_params = []280 header_params = {}281 if 'request_headers' in params:282 header_params['requestHeaders'] = params['request_headers'] # noqa: E501283 form_params = []284 local_var_files = {}285 body_params = None286 if 'body' in params:287 body_params = params['body']288 # HTTP header `Accept`289 header_params['Accept'] = self.api_client.select_header_accept(290 ['*/*']) # noqa: E501291 # HTTP header `Content-Type`292 header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501293 ['application/json']) # noqa: E501294 # Authentication setting295 auth_settings = ['X-Authorization'] # noqa: E501296 return self.api_client.call_api(297 '/api/v1/integrations/oceanconnect/{routingKey}', 'HEAD',298 path_params,299 query_params,300 header_params,301 body=body_params,302 post_params=form_params,303 files=local_var_files,304 response_type='DeferredResultResponseEntity', # noqa: E501305 auth_settings=auth_settings,306 async_req=params.get('async_req'),307 _return_http_data_only=params.get('_return_http_data_only'),308 _preload_content=params.get('_preload_content', True),309 _request_timeout=params.get('_request_timeout'),310 collection_formats=collection_formats)311 def process_request_using_options(self, body, request_headers, routing_key, **kwargs): # noqa: E501312 """processRequest # noqa: E501313 This method makes a synchronous HTTP request by default. To make an314 asynchronous HTTP request, please pass async_req=True315 >>> thread = api.process_request_using_options(body, request_headers, routing_key, async_req=True)316 >>> result = thread.get()317 :param async_req bool318 :param str body: msg (required)319 :param Object request_headers: requestHeaders (required)320 :param str routing_key: routingKey (required)321 :return: DeferredResultResponseEntity322 If the method is called asynchronously,323 returns the request thread.324 """325 kwargs['_return_http_data_only'] = True326 if kwargs.get('async_req'):327 return self.process_request_using_options_with_http_info(body, request_headers, routing_key, **kwargs) # noqa: E501328 else:329 (data) = self.process_request_using_options_with_http_info(body, request_headers, routing_key, **kwargs) # noqa: E501330 return data331 def process_request_using_options_with_http_info(self, body, request_headers, routing_key, **kwargs): # noqa: E501332 """processRequest # noqa: E501333 This method makes a synchronous HTTP request by default. To make an334 asynchronous HTTP request, please pass async_req=True335 >>> thread = api.process_request_using_options_with_http_info(body, request_headers, routing_key, async_req=True)336 >>> result = thread.get()337 :param async_req bool338 :param str body: msg (required)339 :param Object request_headers: requestHeaders (required)340 :param str routing_key: routingKey (required)341 :return: DeferredResultResponseEntity342 If the method is called asynchronously,343 returns the request thread.344 """345 all_params = ['body', 'request_headers', 'routing_key'] # noqa: E501346 all_params.append('async_req')347 all_params.append('_return_http_data_only')348 all_params.append('_preload_content')349 all_params.append('_request_timeout')350 params = locals()351 for key, val in six.iteritems(params['kwargs']):352 if key not in all_params:353 raise TypeError(354 "Got an unexpected keyword argument '%s'"355 " to method process_request_using_options" % key356 )357 params[key] = val358 del params['kwargs']359 # verify the required parameter 'body' is set360 if ('body' not in params or361 params['body'] is None):362 raise ValueError("Missing the required parameter `body` when calling `process_request_using_options`") # noqa: E501363 # verify the required parameter 'request_headers' is set364 if ('request_headers' not in params or365 params['request_headers'] is None):366 raise ValueError("Missing the required parameter `request_headers` when calling `process_request_using_options`") # noqa: E501367 # verify the required parameter 'routing_key' is set368 if ('routing_key' not in params or369 params['routing_key'] is None):370 raise ValueError("Missing the required parameter `routing_key` when calling `process_request_using_options`") # noqa: E501371 collection_formats = {}372 path_params = {}373 if 'routing_key' in params:374 path_params['routingKey'] = params['routing_key'] # noqa: E501375 query_params = []376 header_params = {}377 if 'request_headers' in params:378 header_params['requestHeaders'] = params['request_headers'] # noqa: E501379 form_params = []380 local_var_files = {}381 body_params = None382 if 'body' in params:383 body_params = params['body']384 # HTTP header `Accept`385 header_params['Accept'] = self.api_client.select_header_accept(386 ['*/*']) # noqa: E501387 # HTTP header `Content-Type`388 header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501389 ['application/json']) # noqa: E501390 # Authentication setting391 auth_settings = ['X-Authorization'] # noqa: E501392 return self.api_client.call_api(393 '/api/v1/integrations/oceanconnect/{routingKey}', 'OPTIONS',394 path_params,395 query_params,396 header_params,397 body=body_params,398 post_params=form_params,399 files=local_var_files,400 response_type='DeferredResultResponseEntity', # noqa: E501401 auth_settings=auth_settings,402 async_req=params.get('async_req'),403 _return_http_data_only=params.get('_return_http_data_only'),404 _preload_content=params.get('_preload_content', True),405 _request_timeout=params.get('_request_timeout'),406 collection_formats=collection_formats)407 def process_request_using_patch(self, body, request_headers, routing_key, **kwargs): # noqa: E501408 """processRequest # noqa: E501409 This method makes a synchronous HTTP request by default. To make an410 asynchronous HTTP request, please pass async_req=True411 >>> thread = api.process_request_using_patch(body, request_headers, routing_key, async_req=True)412 >>> result = thread.get()413 :param async_req bool414 :param str body: msg (required)415 :param Object request_headers: requestHeaders (required)416 :param str routing_key: routingKey (required)417 :return: DeferredResultResponseEntity418 If the method is called asynchronously,419 returns the request thread.420 """421 kwargs['_return_http_data_only'] = True422 if kwargs.get('async_req'):423 return self.process_request_using_patch_with_http_info(body, request_headers, routing_key, **kwargs) # noqa: E501424 else:425 (data) = self.process_request_using_patch_with_http_info(body, request_headers, routing_key, **kwargs) # noqa: E501426 return data427 def process_request_using_patch_with_http_info(self, body, request_headers, routing_key, **kwargs): # noqa: E501428 """processRequest # noqa: E501429 This method makes a synchronous HTTP request by default. To make an430 asynchronous HTTP request, please pass async_req=True431 >>> thread = api.process_request_using_patch_with_http_info(body, request_headers, routing_key, async_req=True)432 >>> result = thread.get()433 :param async_req bool434 :param str body: msg (required)435 :param Object request_headers: requestHeaders (required)436 :param str routing_key: routingKey (required)437 :return: DeferredResultResponseEntity438 If the method is called asynchronously,439 returns the request thread.440 """441 all_params = ['body', 'request_headers', 'routing_key'] # noqa: E501442 all_params.append('async_req')443 all_params.append('_return_http_data_only')444 all_params.append('_preload_content')445 all_params.append('_request_timeout')446 params = locals()447 for key, val in six.iteritems(params['kwargs']):448 if key not in all_params:449 raise TypeError(450 "Got an unexpected keyword argument '%s'"451 " to method process_request_using_patch" % key452 )453 params[key] = val454 del params['kwargs']455 # verify the required parameter 'body' is set456 if ('body' not in params or457 params['body'] is None):458 raise ValueError("Missing the required parameter `body` when calling `process_request_using_patch`") # noqa: E501459 # verify the required parameter 'request_headers' is set460 if ('request_headers' not in params or461 params['request_headers'] is None):462 raise ValueError("Missing the required parameter `request_headers` when calling `process_request_using_patch`") # noqa: E501463 # verify the required parameter 'routing_key' is set464 if ('routing_key' not in params or465 params['routing_key'] is None):466 raise ValueError("Missing the required parameter `routing_key` when calling `process_request_using_patch`") # noqa: E501467 collection_formats = {}468 path_params = {}469 if 'routing_key' in params:470 path_params['routingKey'] = params['routing_key'] # noqa: E501471 query_params = []472 header_params = {}473 if 'request_headers' in params:474 header_params['requestHeaders'] = params['request_headers'] # noqa: E501475 form_params = []476 local_var_files = {}477 body_params = None478 if 'body' in params:479 body_params = params['body']480 # HTTP header `Accept`481 header_params['Accept'] = self.api_client.select_header_accept(482 ['*/*']) # noqa: E501483 # HTTP header `Content-Type`484 header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501485 ['application/json']) # noqa: E501486 # Authentication setting487 auth_settings = ['X-Authorization'] # noqa: E501488 return self.api_client.call_api(489 '/api/v1/integrations/oceanconnect/{routingKey}', 'PATCH',490 path_params,491 query_params,492 header_params,493 body=body_params,494 post_params=form_params,495 files=local_var_files,496 response_type='DeferredResultResponseEntity', # noqa: E501497 auth_settings=auth_settings,498 async_req=params.get('async_req'),499 _return_http_data_only=params.get('_return_http_data_only'),500 _preload_content=params.get('_preload_content', True),501 _request_timeout=params.get('_request_timeout'),502 collection_formats=collection_formats)503 def process_request_using_post2(self, body, request_headers, routing_key, **kwargs): # noqa: E501504 """processRequest # noqa: E501505 This method makes a synchronous HTTP request by default. To make an506 asynchronous HTTP request, please pass async_req=True507 >>> thread = api.process_request_using_post2(body, request_headers, routing_key, async_req=True)508 >>> result = thread.get()509 :param async_req bool510 :param str body: msg (required)511 :param Object request_headers: requestHeaders (required)512 :param str routing_key: routingKey (required)513 :return: DeferredResultResponseEntity514 If the method is called asynchronously,515 returns the request thread.516 """517 kwargs['_return_http_data_only'] = True518 if kwargs.get('async_req'):519 return self.process_request_using_post2_with_http_info(body, request_headers, routing_key, **kwargs) # noqa: E501520 else:521 (data) = self.process_request_using_post2_with_http_info(body, request_headers, routing_key, **kwargs) # noqa: E501522 return data523 def process_request_using_post2_with_http_info(self, body, request_headers, routing_key, **kwargs): # noqa: E501524 """processRequest # noqa: E501525 This method makes a synchronous HTTP request by default. To make an526 asynchronous HTTP request, please pass async_req=True527 >>> thread = api.process_request_using_post2_with_http_info(body, request_headers, routing_key, async_req=True)528 >>> result = thread.get()529 :param async_req bool530 :param str body: msg (required)531 :param Object request_headers: requestHeaders (required)532 :param str routing_key: routingKey (required)533 :return: DeferredResultResponseEntity534 If the method is called asynchronously,535 returns the request thread.536 """537 all_params = ['body', 'request_headers', 'routing_key'] # noqa: E501538 all_params.append('async_req')539 all_params.append('_return_http_data_only')540 all_params.append('_preload_content')541 all_params.append('_request_timeout')542 params = locals()543 for key, val in six.iteritems(params['kwargs']):544 if key not in all_params:545 raise TypeError(546 "Got an unexpected keyword argument '%s'"547 " to method process_request_using_post2" % key548 )549 params[key] = val550 del params['kwargs']551 # verify the required parameter 'body' is set552 if ('body' not in params or553 params['body'] is None):554 raise ValueError("Missing the required parameter `body` when calling `process_request_using_post2`") # noqa: E501555 # verify the required parameter 'request_headers' is set556 if ('request_headers' not in params or557 params['request_headers'] is None):558 raise ValueError("Missing the required parameter `request_headers` when calling `process_request_using_post2`") # noqa: E501559 # verify the required parameter 'routing_key' is set560 if ('routing_key' not in params or561 params['routing_key'] is None):562 raise ValueError("Missing the required parameter `routing_key` when calling `process_request_using_post2`") # noqa: E501563 collection_formats = {}564 path_params = {}565 if 'routing_key' in params:566 path_params['routingKey'] = params['routing_key'] # noqa: E501567 query_params = []568 header_params = {}569 if 'request_headers' in params:570 header_params['requestHeaders'] = params['request_headers'] # noqa: E501571 form_params = []572 local_var_files = {}573 body_params = None574 if 'body' in params:575 body_params = params['body']576 # HTTP header `Accept`577 header_params['Accept'] = self.api_client.select_header_accept(578 ['*/*']) # noqa: E501579 # HTTP header `Content-Type`580 header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501581 ['application/json']) # noqa: E501582 # Authentication setting583 auth_settings = ['X-Authorization'] # noqa: E501584 return self.api_client.call_api(585 '/api/v1/integrations/oceanconnect/{routingKey}', 'POST',586 path_params,587 query_params,588 header_params,589 body=body_params,590 post_params=form_params,591 files=local_var_files,592 response_type='DeferredResultResponseEntity', # noqa: E501593 auth_settings=auth_settings,594 async_req=params.get('async_req'),595 _return_http_data_only=params.get('_return_http_data_only'),596 _preload_content=params.get('_preload_content', True),597 _request_timeout=params.get('_request_timeout'),598 collection_formats=collection_formats)599 def process_request_using_put(self, body, request_headers, routing_key, **kwargs): # noqa: E501600 """processRequest # noqa: E501601 This method makes a synchronous HTTP request by default. To make an602 asynchronous HTTP request, please pass async_req=True603 >>> thread = api.process_request_using_put(body, request_headers, routing_key, async_req=True)604 >>> result = thread.get()605 :param async_req bool606 :param str body: msg (required)607 :param Object request_headers: requestHeaders (required)608 :param str routing_key: routingKey (required)609 :return: DeferredResultResponseEntity610 If the method is called asynchronously,611 returns the request thread.612 """613 kwargs['_return_http_data_only'] = True614 if kwargs.get('async_req'):615 return self.process_request_using_put_with_http_info(body, request_headers, routing_key, **kwargs) # noqa: E501616 else:617 (data) = self.process_request_using_put_with_http_info(body, request_headers, routing_key, **kwargs) # noqa: E501618 return data619 def process_request_using_put_with_http_info(self, body, request_headers, routing_key, **kwargs): # noqa: E501620 """processRequest # noqa: E501621 This method makes a synchronous HTTP request by default. To make an622 asynchronous HTTP request, please pass async_req=True623 >>> thread = api.process_request_using_put_with_http_info(body, request_headers, routing_key, async_req=True)624 >>> result = thread.get()625 :param async_req bool626 :param str body: msg (required)627 :param Object request_headers: requestHeaders (required)628 :param str routing_key: routingKey (required)629 :return: DeferredResultResponseEntity630 If the method is called asynchronously,631 returns the request thread.632 """633 all_params = ['body', 'request_headers', 'routing_key'] # noqa: E501634 all_params.append('async_req')635 all_params.append('_return_http_data_only')636 all_params.append('_preload_content')637 all_params.append('_request_timeout')638 params = locals()639 for key, val in six.iteritems(params['kwargs']):640 if key not in all_params:641 raise TypeError(642 "Got an unexpected keyword argument '%s'"643 " to method process_request_using_put" % key644 )645 params[key] = val646 del params['kwargs']647 # verify the required parameter 'body' is set648 if ('body' not in params or649 params['body'] is None):650 raise ValueError("Missing the required parameter `body` when calling `process_request_using_put`") # noqa: E501651 # verify the required parameter 'request_headers' is set652 if ('request_headers' not in params or653 params['request_headers'] is None):654 raise ValueError("Missing the required parameter `request_headers` when calling `process_request_using_put`") # noqa: E501655 # verify the required parameter 'routing_key' is set656 if ('routing_key' not in params or657 params['routing_key'] is None):658 raise ValueError("Missing the required parameter `routing_key` when calling `process_request_using_put`") # noqa: E501659 collection_formats = {}660 path_params = {}661 if 'routing_key' in params:662 path_params['routingKey'] = params['routing_key'] # noqa: E501663 query_params = []664 header_params = {}665 if 'request_headers' in params:666 header_params['requestHeaders'] = params['request_headers'] # noqa: E501667 form_params = []668 local_var_files = {}669 body_params = None670 if 'body' in params:671 body_params = params['body']672 # HTTP header `Accept`673 header_params['Accept'] = self.api_client.select_header_accept(674 ['*/*']) # noqa: E501675 # HTTP header `Content-Type`676 header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501677 ['application/json']) # noqa: E501678 # Authentication setting679 auth_settings = ['X-Authorization'] # noqa: E501680 return self.api_client.call_api(681 '/api/v1/integrations/oceanconnect/{routingKey}', 'PUT',682 path_params,683 query_params,684 header_params,685 body=body_params,686 post_params=form_params,687 files=local_var_files,688 response_type='DeferredResultResponseEntity', # noqa: E501689 auth_settings=auth_settings,690 async_req=params.get('async_req'),691 _return_http_data_only=params.get('_return_http_data_only'),692 _preload_content=params.get('_preload_content', True),693 _request_timeout=params.get('_request_timeout'),...

Full Screen

Full Screen

httparchive_test.py

Source:httparchive_test.py Github

copy

Full Screen

1#!/usr/bin/env python2# Copyright 2011 Google Inc. All Rights Reserved.3#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 at7#8# http://www.apache.org/licenses/LICENSE-2.09#10# Unless required by applicable law or agreed to in writing, software11# 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 and14# limitations under the License.15import calendar16import email.utils17import httparchive18import unittest19def create_request(headers):20 return httparchive.ArchivedHttpRequest(21 'GET', 'www.test.com', '/', None, headers)22def create_response(headers):23 return httparchive.ArchivedHttpResponse(24 11, 200, 'OK', headers, '')25class HttpArchiveTest(unittest.TestCase):26 REQUEST_HEADERS = {}27 REQUEST = create_request(REQUEST_HEADERS)28 # Used for if-(un)modified-since checks29 DATE_PAST = 'Wed, 13 Jul 2011 03:58:08 GMT'30 DATE_PRESENT = 'Wed, 20 Jul 2011 04:58:08 GMT'31 DATE_FUTURE = 'Wed, 27 Jul 2011 05:58:08 GMT'32 DATE_INVALID = 'This is an invalid date!!'33 # etag values34 ETAG_VALID = 'etag'35 ETAG_INVALID = 'This is an invalid etag value!!'36 RESPONSE_HEADERS = [('last-modified', DATE_PRESENT), ('etag', ETAG_VALID)]37 RESPONSE = create_response(RESPONSE_HEADERS)38 def setUp(self):39 self.archive = httparchive.HttpArchive()40 self.archive[self.REQUEST] = self.RESPONSE41 # Also add an identical POST request for testing42 request = httparchive.ArchivedHttpRequest(43 'POST', 'www.test.com', '/', None, self.REQUEST_HEADERS)44 self.archive[request] = self.RESPONSE45 def tearDown(self):46 pass47 def test_init(self):48 archive = httparchive.HttpArchive()49 self.assertEqual(len(archive), 0)50 def test_request__TrimHeaders(self):51 request = httparchive.ArchivedHttpRequest52 header1 = {'accept-encoding': 'gzip,deflate'}53 self.assertEqual(request._TrimHeaders(header1),54 [(k, v) for k, v in header1.items()])55 header2 = {'referer': 'www.google.com'}56 self.assertEqual(request._TrimHeaders(header2), [])57 header3 = {'referer': 'www.google.com', 'cookie': 'cookie_monster!',58 'hello': 'world'}59 self.assertEqual(request._TrimHeaders(header3), [('hello', 'world')])60 # Tests that spaces and trailing comma get stripped.61 header4 = {'accept-encoding': 'gzip, deflate,, '}62 self.assertEqual(request._TrimHeaders(header4),63 [('accept-encoding', 'gzip,deflate')])64 # Tests that 'lzma' gets stripped.65 header5 = {'accept-encoding': 'gzip, deflate, lzma'}66 self.assertEqual(request._TrimHeaders(header5),67 [('accept-encoding', 'gzip,deflate')])68 # Tests that x-client-data gets stripped.69 header6 = {'x-client-data': 'testdata'}70 self.assertEqual(request._TrimHeaders(header6), [])71 def test_matches(self):72 headers = {}73 request1 = httparchive.ArchivedHttpRequest(74 'GET', 'www.test.com', '/index.html?hello=world', None, headers)75 request2 = httparchive.ArchivedHttpRequest(76 'GET', 'www.test.com', '/index.html?foo=bar', None, headers)77 self.assert_(not request1.matches(78 request2.command, request2.host, request2.full_path, use_query=True))79 self.assert_(request1.matches(80 request2.command, request2.host, request2.full_path, use_query=False))81 self.assert_(request1.matches(82 request2.command, request2.host, None, use_query=True))83 self.assert_(request1.matches(84 request2.command, None, request2.full_path, use_query=False))85 empty_request = httparchive.ArchivedHttpRequest(86 None, None, None, None, headers)87 self.assert_(not empty_request.matches(88 request2.command, request2.host, None, use_query=True))89 self.assert_(not empty_request.matches(90 request2.command, None, request2.full_path, use_query=False))91 def setup_find_closest_request(self):92 headers = {}93 request1 = httparchive.ArchivedHttpRequest(94 'GET', 'www.test.com', '/a?hello=world', None, headers)95 request2 = httparchive.ArchivedHttpRequest(96 'GET', 'www.test.com', '/a?foo=bar', None, headers)97 request3 = httparchive.ArchivedHttpRequest(98 'GET', 'www.test.com', '/b?hello=world', None, headers)99 request4 = httparchive.ArchivedHttpRequest(100 'GET', 'www.test.com', '/c?hello=world', None, headers)101 archive = httparchive.HttpArchive()102 # Add requests 2 and 3 and find closest match with request1103 archive[request2] = self.RESPONSE104 archive[request3] = self.RESPONSE105 return archive, request1, request2, request3, request4106 def test_find_closest_request(self):107 archive, request1, request2, request3, request4 = (108 self.setup_find_closest_request())109 # Always favor requests with same paths, even if use_path=False.110 self.assertEqual(111 request2, archive.find_closest_request(request1, use_path=False))112 # If we match strictly on path, request2 is the only match113 self.assertEqual(114 request2, archive.find_closest_request(request1, use_path=True))115 # request4 can be matched with request3, if use_path=False116 self.assertEqual(117 request3, archive.find_closest_request(request4, use_path=False))118 # ...but None, if use_path=True119 self.assertEqual(120 None, archive.find_closest_request(request4, use_path=True))121 def test_find_closest_request_delete_simple(self):122 archive, request1, request2, request3, request4 = (123 self.setup_find_closest_request())124 del archive[request3]125 self.assertEqual(126 request2, archive.find_closest_request(request1, use_path=False))127 self.assertEqual(128 request2, archive.find_closest_request(request1, use_path=True))129 def test_find_closest_request_delete_complex(self):130 archive, request1, request2, request3, request4 = (131 self.setup_find_closest_request())132 del archive[request2]133 self.assertEqual(134 request3, archive.find_closest_request(request1, use_path=False))135 self.assertEqual(136 None, archive.find_closest_request(request1, use_path=True))137 def test_find_closest_request_timestamp(self):138 headers = {}139 request1 = httparchive.ArchivedHttpRequest(140 'GET', 'www.test.com', '/index.html?time=100000000&important=true',141 None, headers)142 request2 = httparchive.ArchivedHttpRequest(143 'GET', 'www.test.com', '/index.html?time=99999999&important=true',144 None, headers)145 request3 = httparchive.ArchivedHttpRequest(146 'GET', 'www.test.com', '/index.html?time=10000000&important=false',147 None, headers)148 archive = httparchive.HttpArchive()149 # Add requests 2 and 3 and find closest match with request1150 archive[request2] = self.RESPONSE151 archive[request3] = self.RESPONSE152 # Although request3 is lexicographically closer, request2 is semantically153 # more similar.154 self.assertEqual(155 request2, archive.find_closest_request(request1, use_path=True))156 def test_get_cmp_seq(self):157 # The order of key-value pairs in query and header respectively should not158 # matter.159 headers = {'k2': 'v2', 'k1': 'v1'}160 request = httparchive.ArchivedHttpRequest(161 'GET', 'www.test.com', '/a?c=d&a=b;e=f', None, headers)162 self.assertEqual([('a', 'b'), ('c', 'd'), ('e', 'f'),163 ('k1', 'v1'), ('k2', 'v2')],164 request._GetCmpSeq('c=d&a=b;e=f'))165 def test_get_simple(self):166 request = self.REQUEST167 response = self.RESPONSE168 archive = self.archive169 self.assertEqual(archive.get(request), response)170 false_request_headers = {'foo': 'bar'}171 false_request = create_request(false_request_headers)172 self.assertEqual(archive.get(false_request, default=None), None)173 def test_get_modified_headers(self):174 request = self.REQUEST175 response = self.RESPONSE176 archive = self.archive177 not_modified_response = httparchive.create_response(304)178 # Fail check and return response again179 request_headers = {'if-modified-since': self.DATE_PAST}180 request = create_request(request_headers)181 self.assertEqual(archive.get(request), response)182 # Succeed check and return 304 Not Modified183 request_headers = {'if-modified-since': self.DATE_FUTURE}184 request = create_request(request_headers)185 self.assertEqual(archive.get(request), not_modified_response)186 # Succeed check and return 304 Not Modified187 request_headers = {'if-modified-since': self.DATE_PRESENT}188 request = create_request(request_headers)189 self.assertEqual(archive.get(request), not_modified_response)190 # Invalid date, fail check and return response again191 request_headers = {'if-modified-since': self.DATE_INVALID}192 request = create_request(request_headers)193 self.assertEqual(archive.get(request), response)194 # fail check since the request is not a GET or HEAD request (as per RFC)195 request_headers = {'if-modified-since': self.DATE_FUTURE}196 request = httparchive.ArchivedHttpRequest(197 'POST', 'www.test.com', '/', None, request_headers)198 self.assertEqual(archive.get(request), response)199 def test_get_unmodified_headers(self):200 request = self.REQUEST201 response = self.RESPONSE202 archive = self.archive203 not_modified_response = httparchive.create_response(304)204 # Succeed check205 request_headers = {'if-unmodified-since': self.DATE_PAST}206 request = create_request(request_headers)207 self.assertEqual(archive.get(request), not_modified_response)208 # Fail check209 request_headers = {'if-unmodified-since': self.DATE_FUTURE}210 request = create_request(request_headers)211 self.assertEqual(archive.get(request), response)212 # Succeed check213 request_headers = {'if-unmodified-since': self.DATE_PRESENT}214 request = create_request(request_headers)215 self.assertEqual(archive.get(request), not_modified_response)216 # Fail check217 request_headers = {'if-unmodified-since': self.DATE_INVALID}218 request = create_request(request_headers)219 self.assertEqual(archive.get(request), response)220 # Fail check since the request is not a GET or HEAD request (as per RFC)221 request_headers = {'if-modified-since': self.DATE_PAST}222 request = httparchive.ArchivedHttpRequest(223 'POST', 'www.test.com', '/', None, request_headers)224 self.assertEqual(archive.get(request), response)225 def test_get_etags(self):226 request = self.REQUEST227 response = self.RESPONSE228 archive = self.archive229 not_modified_response = httparchive.create_response(304)230 precondition_failed_response = httparchive.create_response(412)231 # if-match headers232 request_headers = {'if-match': self.ETAG_VALID}233 request = create_request(request_headers)234 self.assertEqual(archive.get(request), response)235 request_headers = {'if-match': self.ETAG_INVALID}236 request = create_request(request_headers)237 self.assertEqual(archive.get(request), precondition_failed_response)238 # if-none-match headers239 request_headers = {'if-none-match': self.ETAG_VALID}240 request = create_request(request_headers)241 self.assertEqual(archive.get(request), not_modified_response)242 request_headers = {'if-none-match': self.ETAG_INVALID}243 request = create_request(request_headers)244 self.assertEqual(archive.get(request), response)245 def test_get_multiple_match_headers(self):246 request = self.REQUEST247 response = self.RESPONSE248 archive = self.archive249 not_modified_response = httparchive.create_response(304)250 precondition_failed_response = httparchive.create_response(412)251 # if-match headers252 # If the request would, without the If-Match header field,253 # result in anything other than a 2xx or 412 status,254 # then the If-Match header MUST be ignored.255 request_headers = {256 'if-match': self.ETAG_VALID,257 'if-modified-since': self.DATE_PAST,258 }259 request = create_request(request_headers)260 self.assertEqual(archive.get(request), response)261 # Invalid etag, precondition failed262 request_headers = {263 'if-match': self.ETAG_INVALID,264 'if-modified-since': self.DATE_PAST,265 }266 request = create_request(request_headers)267 self.assertEqual(archive.get(request), precondition_failed_response)268 # 304 response; ignore if-match header269 request_headers = {270 'if-match': self.ETAG_VALID,271 'if-modified-since': self.DATE_FUTURE,272 }273 request = create_request(request_headers)274 self.assertEqual(archive.get(request), not_modified_response)275 # 304 response; ignore if-match header276 request_headers = {277 'if-match': self.ETAG_INVALID,278 'if-modified-since': self.DATE_PRESENT,279 }280 request = create_request(request_headers)281 self.assertEqual(archive.get(request), not_modified_response)282 # Invalid etag, precondition failed283 request_headers = {284 'if-match': self.ETAG_INVALID,285 'if-modified-since': self.DATE_INVALID,286 }287 request = create_request(request_headers)288 self.assertEqual(archive.get(request), precondition_failed_response)289 def test_get_multiple_none_match_headers(self):290 request = self.REQUEST291 response = self.RESPONSE292 archive = self.archive293 not_modified_response = httparchive.create_response(304)294 precondition_failed_response = httparchive.create_response(412)295 # if-none-match headers296 # If the request would, without the If-None-Match header field,297 # result in anything other than a 2xx or 304 status,298 # then the If-None-Match header MUST be ignored.299 request_headers = {300 'if-none-match': self.ETAG_VALID,301 'if-modified-since': self.DATE_PAST,302 }303 request = create_request(request_headers)304 self.assertEqual(archive.get(request), response)305 request_headers = {306 'if-none-match': self.ETAG_INVALID,307 'if-modified-since': self.DATE_PAST,308 }309 request = create_request(request_headers)310 self.assertEqual(archive.get(request), response)311 # etag match, precondition failed312 request_headers = {313 'if-none-match': self.ETAG_VALID,314 'if-modified-since': self.DATE_FUTURE,315 }316 request = create_request(request_headers)317 self.assertEqual(archive.get(request), not_modified_response)318 request_headers = {319 'if-none-match': self.ETAG_INVALID,320 'if-modified-since': self.DATE_PRESENT,321 }322 request = create_request(request_headers)323 self.assertEqual(archive.get(request), not_modified_response)324 request_headers = {325 'if-none-match': self.ETAG_INVALID,326 'if-modified-since': self.DATE_INVALID,327 }328 request = create_request(request_headers)329 self.assertEqual(archive.get(request), response)330 def test_response__TrimHeaders(self):331 response = httparchive.ArchivedHttpResponse332 header1 = [('access-control-allow-origin', '*'),333 ('content-type', 'image/jpeg'),334 ('content-length', 2878)]335 self.assertEqual(response._TrimHeaders(header1), header1)336 header2 = [('content-type', 'text/javascript; charset=utf-8'),337 ('connection', 'keep-alive'),338 ('cache-control', 'private, must-revalidate, max-age=0'),339 ('content-encoding', 'gzip')]340 self.assertEqual(response._TrimHeaders(header2), header2)341 header3 = [('content-security-policy', """\342default-src 'self' http://*.cnn.com:* https://*.cnn.com:* \343*.cnn.net:* *.turner.com:* *.ugdturner.com:* *.vgtf.net:*; \344script-src 'unsafe-inline' 'unsafe-eval' 'self' *; \345style-src 'unsafe-inline' 'self' *; frame-src 'self' *; \346object-src 'self' *; img-src 'self' * data:; media-src 'self' *; \347font-src 'self' *; connect-src 'self' *"""),348 ('access-control-allow-origin', '*'),349 ('content-type', 'text/html; charset=utf-8'),350 ('content-encoding', 'gzip')]351 self.assertEqual(response._TrimHeaders(header3), [352 ('access-control-allow-origin', '*'),353 ('content-type', 'text/html; charset=utf-8'),354 ('content-encoding', 'gzip')355 ])356 header4 = [('content-security-policy', """\357default-src * data: blob:;script-src *.facebook.com *.fbcdn.net \358*.facebook.net *.google-analytics.com *.virtualearth.net *.google.com \359127.0.0.1:* *.spotilocal.com:* 'unsafe-inline' 'unsafe-eval' \360fbstatic-a.akamaihd.net fbcdn-static-b-a.akamaihd.net *.atlassolutions.com \361blob: chrome-extension://lifbcibllhkdhoafpjfnlhfpfgnpldfl \362*.liverail.com;style-src * 'unsafe-inline' data:;connect-src *.facebook.com \363*.fbcdn.net *.facebook.net *.spotilocal.com:* *.akamaihd.net \364wss://*.facebook.com:* https://fb.scanandcleanlocal.com:* \365*.atlassolutions.com attachment.fbsbx.com ws://localhost:* \366blob: 127.0.0.1:* *.liverail.com""")]367 self.assertEqual(response._TrimHeaders(header4), [])368class ArchivedHttpResponse(unittest.TestCase):369 PAST_DATE_A = 'Tue, 13 Jul 2010 03:47:07 GMT'370 PAST_DATE_B = 'Tue, 13 Jul 2010 02:47:07 GMT' # PAST_DATE_A -1 hour371 PAST_DATE_C = 'Tue, 13 Jul 2010 04:47:07 GMT' # PAST_DATE_A +1 hour372 NOW_DATE_A = 'Wed, 20 Jul 2011 04:58:08 GMT'373 NOW_DATE_B = 'Wed, 20 Jul 2011 03:58:08 GMT' # NOW_DATE_A -1 hour374 NOW_DATE_C = 'Wed, 20 Jul 2011 05:58:08 GMT' # NOW_DATE_A +1 hour375 NOW_SECONDS = calendar.timegm(email.utils.parsedate(NOW_DATE_A))376 def setUp(self):377 self.response = create_response([('date', self.PAST_DATE_A)])378 def test_update_date_same_date(self):379 self.assertEqual(380 self.response.update_date(self.PAST_DATE_A, now=self.NOW_SECONDS),381 self.NOW_DATE_A)382 def test_update_date_before_date(self):383 self.assertEqual(384 self.response.update_date(self.PAST_DATE_B, now=self.NOW_SECONDS),385 self.NOW_DATE_B)386 def test_update_date_after_date(self):387 self.assertEqual(388 self.response.update_date(self.PAST_DATE_C, now=self.NOW_SECONDS),389 self.NOW_DATE_C)390 def test_update_date_bad_date_param(self):391 self.assertEqual(392 self.response.update_date('garbage date', now=self.NOW_SECONDS),393 'garbage date')394 def test_update_date_bad_date_header(self):395 self.response.set_header('date', 'garbage date')396 self.assertEqual(397 self.response.update_date(self.PAST_DATE_B, now=self.NOW_SECONDS),398 self.PAST_DATE_B)399if __name__ == '__main__':...

Full Screen

Full Screen

test_form.py

Source:test_form.py Github

copy

Full Screen

1from fooster.web import web, form2import mock3import pytest4test_body = b'test'5test_chunks = b'a' * (web.max_line_size + 1)6test_encoded = b'test=t%C3%ABst&foo=bar&wow&such=dog'7test_binary = 'thisisatëst'.encode(web.default_encoding)8test_boundary = 'boundåry'9test_mime_empty = ('--' + test_boundary + '\r\nContent-Disposition: form-data; name="empty"; filename="empty"\r\n\r\n').encode(web.http_encoding)10test_mime_basic = ('--' + test_boundary + '\r\nContent-Disposition: form-data; name="body"\r\n\r\n').encode(web.http_encoding) + test_body11test_mime_bad = ('--' + test_boundary + '\r\nContent-Disposition: form-data; name="body"\r\nContent-Length: ' + str(len(test_body) + 1) + '\r\n\r\n').encode(web.http_encoding) + test_body12test_mime_chunks = ('--' + test_boundary + '\r\nContent-Disposition: form-data; name="body"\r\n\r\n').encode(web.http_encoding) + test_chunks13test_mime_too_long = ('--' + test_boundary + '\r\nContent-Disposition: form-data; name="body"\r\n\r\n').encode(web.http_encoding) + b'a' * (form.max_memory_size + web.max_line_size + 1)14test_mime_length = ('--' + test_boundary + '\r\nContent-Disposition: form-data; name="body"\r\nContent-Length: ' + str(len(test_body)) + '\r\n\r\n').encode(web.http_encoding) + test_body15test_mime_no_disposition = ('--' + test_boundary + '\r\n\r\n').encode(web.http_encoding) + test_body16test_mime_bad_disposition = ('--' + test_boundary + '\r\nContent-Disposition: bad-data; name="body"\r\n\r\n').encode(web.http_encoding) + test_body17test_mime_bad_length = ('--' + test_boundary + '\r\nContent-Disposition: form-data; name="body"\r\nContent-Length: "bad"\r\n\r\n').encode(web.http_encoding) + test_body18test_mime_filename = ('--' + test_boundary + '\r\nContent-Disposition: form-data; name="binary"; filename="binary"\r\nContent-Type: application/octet-stream\r\nContent-Length: ' + str(len(test_binary)) + '\r\n\r\n').encode(web.http_encoding) + test_binary19test_mime_filename_bad = ('--' + test_boundary + '\r\nContent-Disposition: form-data; name="binary_attached"; filename="binary"\r\nContent-Type: application/octet-stream\r\nContent-Length: ' + str(len(test_binary) + 1) + '\r\n\r\n').encode(web.http_encoding) + test_binary20test_mime_filename_bad_type = ('--' + test_boundary + '\r\nContent-Disposition: form-data; name="binary"; filename="binary"\r\nContent-Type: ;\r\nContent-Length: ' + str(len(test_binary)) + '\r\n\r\n').encode(web.http_encoding) + test_binary21test_mime_filename_no_length = ('--' + test_boundary + '\r\nContent-Disposition: form-data; name="binary"; filename="binary"\r\nContent-Type: application/octet-stream\r\n\r\n').encode(web.http_encoding) + test_binary22test_mime_filename_too_long = ('--' + test_boundary + '\r\nContent-Disposition: form-data; name="binary"; filename="binary"\r\nContent-Type: application/octet-stream\r\n\r\n').encode(web.http_encoding) + b'a' * (form.max_file_size + web.max_line_size + 1)23test_mime_utf8 = ('--' + test_boundary + '\r\nContent-Disposition: form-data; name="binary_utf8"\r\nContent-Type: text/plain; charset=utf-8\r\n\r\n').encode(web.http_encoding) + test_binary24test_mime_extra = ('--' + test_boundary + '\r\nContent-Disposition: form-data; name="binary_utf8"\r\nContent-Type: text/plain; charset=utf-8\r\nMIME-Version: 1.0\r\nHeader: Value\r\n\r\n').encode(web.http_encoding) + test_binary25test_separator = '\r\n'.encode(web.http_encoding)26test_end = ('--' + test_boundary + '--\r\n').encode(web.http_encoding)27class EchoHandler(form.FormHandler):28 def do_get(self):29 return 204, ''30 def do_post(self):31 return 200, self.request.body32def test_form_get():33 request = mock.MockHTTPRequest(None, ('', 0), None, method='GET', handler=EchoHandler)34 response = request.handler.respond()35 assert response[0] == 20436 assert response[1] == ''37def test_form_post():38 request = mock.MockHTTPRequest(None, ('', 0), None, body=test_body, method='POST', handler=EchoHandler)39 response = request.handler.respond()40 assert request.body == test_body41 assert response[0] == 20042 assert response[1] == test_body43def test_form_urlencoded():44 request_headers = web.HTTPHeaders()45 request_headers.set('Content-Type', 'application/x-www-form-urlencoded')46 request = mock.MockHTTPRequest(None, ('', 0), None, body=test_encoded, headers=request_headers, method='POST', handler=EchoHandler)47 request.handler.respond()48 assert request.body['test'] == 'tëst'49 assert request.body['foo'] == 'bar'50 assert request.body['wow'] == ''51 assert request.body['such'] == 'dog'52def test_form_urlencoded_bad():53 request_headers = web.HTTPHeaders()54 request_headers.set('Content-Type', 'application/x-www-form-urlencoded')55 request = mock.MockHTTPRequest(None, ('', 0), None, body=test_encoded + 'å'.encode(web.default_encoding), headers=request_headers, method='POST', handler=EchoHandler)56 request.handler.respond()57 assert request.body['test'] == 'tëst'58 assert request.body['foo'] == 'bar'59 assert request.body['wow'] == ''60 assert request.body['such'] == 'dogå'61def test_form_multipart_basic():62 request_headers = web.HTTPHeaders()63 request_headers.set('Content-Type', 'multipart/form-data; boundary=' + test_boundary)64 request = mock.MockHTTPRequest(None, ('', 0), None, body=test_mime_basic + test_separator + test_end, headers=request_headers, method='POST', handler=EchoHandler)65 request.handler.respond()66 assert request.body['body'] == test_body.decode()67def test_form_multipart_bad():68 request_headers = web.HTTPHeaders()69 request_headers.set('Content-Type', 'multipart/form-data; boundary=' + test_boundary)70 request = mock.MockHTTPRequest(None, ('', 0), None, body=test_mime_bad + test_separator + test_end, headers=request_headers, method='POST', handler=EchoHandler)71 with pytest.raises(web.HTTPError) as error:72 request.handler.respond()73 assert error.value.code == 40074def test_form_multipart_chunks():75 request_headers = web.HTTPHeaders()76 request_headers.set('Content-Type', 'multipart/form-data; boundary=' + test_boundary)77 request = mock.MockHTTPRequest(None, ('', 0), None, body=test_mime_chunks + test_separator + test_end, headers=request_headers, method='POST', handler=EchoHandler)78 request.handler.respond()79 assert request.body['body'] == test_chunks.decode()80def test_form_multipart_basic_too_long():81 request_headers = web.HTTPHeaders()82 request_headers.set('Content-Type', 'multipart/form-data; boundary=' + test_boundary)83 request = mock.MockHTTPRequest(None, ('', 0), None, body=test_mime_too_long + test_separator + test_end, headers=request_headers, method='POST', handler=EchoHandler)84 with pytest.raises(web.HTTPError) as error:85 request.handler.respond()86 assert error.value.code == 41387def test_form_multipart_basic_length():88 request_headers = web.HTTPHeaders()89 request_headers.set('Content-Type', 'multipart/form-data; boundary=' + test_boundary)90 request = mock.MockHTTPRequest(None, ('', 0), None, body=test_mime_length + test_separator + test_end, headers=request_headers, method='POST', handler=EchoHandler)91 request.handler.respond()92 assert request.body['body'] == test_body.decode()93def test_form_multipart_expect():94 request_headers = web.HTTPHeaders()95 request_headers.set('Expect', '100-continue')96 request_headers.set('Content-Type', 'multipart/form-data; boundary=' + test_boundary)97 request = mock.MockHTTPRequest(None, ('', 0), None, body=test_mime_basic + test_separator + test_end, headers=request_headers, method='POST', handler=EchoHandler)98 request.handler.respond()99 assert request.body['body'] == test_body.decode()100def test_form_multipart_bad_mime():101 request_headers = web.HTTPHeaders()102 request_headers.set('Content-Length', str(len(test_mime_basic + test_separator + test_end) + 1))103 request_headers.set('Content-Type', 'multipart/form-data; boundary=' + test_boundary)104 request = mock.MockHTTPRequest(None, ('', 0), None, body=test_mime_basic + test_separator + test_end, headers=request_headers, method='POST', handler=EchoHandler)105 with pytest.raises(web.HTTPError) as error:106 request.handler.respond()107 assert error.value.code == 400108def test_form_multipart_bad_mime_length():109 request_headers = web.HTTPHeaders()110 request_headers.set('Content-Length', '"bad"')111 request_headers.set('Content-Type', 'multipart/form-data; boundary=' + test_boundary)112 request = mock.MockHTTPRequest(None, ('', 0), None, body=test_mime_basic + test_separator + test_end, headers=request_headers, method='POST', handler=EchoHandler)113 with pytest.raises(web.HTTPError) as error:114 request.handler.respond()115 assert error.value.code == 400116def test_form_multipart_too_long():117 request_headers = web.HTTPHeaders()118 request_headers.set('Content-Length', str(form.max_multipart_fragments * form.max_file_size + 1))119 request_headers.set('Content-Type', 'multipart/form-data; boundary=' + test_boundary)120 request = mock.MockHTTPRequest(None, ('', 0), None, body=test_mime_basic + test_separator + test_end, headers=request_headers, method='POST', handler=EchoHandler)121 with pytest.raises(web.HTTPError) as error:122 request.handler.respond()123 assert error.value.code == 413124def test_form_multipart_bad_boundary():125 request_headers = web.HTTPHeaders()126 request_headers.set('Content-Type', 'multipart/form-data; boundary=a' + test_boundary)127 request = mock.MockHTTPRequest(None, ('', 0), None, body=test_mime_basic + test_separator + test_end, headers=request_headers, method='POST', handler=EchoHandler)128 with pytest.raises(web.HTTPError) as error:129 request.handler.respond()130 assert error.value.code == 400131def test_form_multipart_too_many():132 request_headers = web.HTTPHeaders()133 request_headers.set('Content-Type', 'multipart/form-data; boundary=' + test_boundary)134 request = mock.MockHTTPRequest(None, ('', 0), None, body=(test_mime_basic + test_separator) * (form.max_multipart_fragments + 1) + test_end, headers=request_headers, method='POST', handler=EchoHandler)135 with pytest.raises(web.HTTPError) as error:136 request.handler.respond()137 assert error.value.code == 413138def test_form_multipart_no_disposition():139 request_headers = web.HTTPHeaders()140 request_headers.set('Content-Type', 'multipart/form-data; boundary=' + test_boundary)141 request = mock.MockHTTPRequest(None, ('', 0), None, body=test_mime_no_disposition + test_separator + test_end, headers=request_headers, method='POST', handler=EchoHandler)142 with pytest.raises(web.HTTPError) as error:143 request.handler.respond()144 assert error.value.code == 400145def test_form_multipart_bad_disposition():146 request_headers = web.HTTPHeaders()147 request_headers.set('Content-Type', 'multipart/form-data; boundary=' + test_boundary)148 request = mock.MockHTTPRequest(None, ('', 0), None, body=test_mime_bad_disposition + test_separator + test_end, headers=request_headers, method='POST', handler=EchoHandler)149 with pytest.raises(web.HTTPError) as error:150 request.handler.respond()151 assert error.value.code == 400152def test_form_multipart_bad_length():153 request_headers = web.HTTPHeaders()154 request_headers.set('Content-Type', 'multipart/form-data; boundary=' + test_boundary)155 request = mock.MockHTTPRequest(None, ('', 0), None, body=test_mime_bad_length + test_separator + test_end, headers=request_headers, method='POST', handler=EchoHandler)156 with pytest.raises(web.HTTPError) as error:157 request.handler.respond()158 assert error.value.code == 400159def test_form_multipart_bad_read():160 request_headers = web.HTTPHeaders()161 request_headers.set('Content-Type', 'multipart/form-data; boundary=' + test_boundary)162 request = mock.MockHTTPRequest(None, ('', 0), None, body=test_mime_empty, headers=request_headers, method='POST', handler=EchoHandler)163 with pytest.raises(web.HTTPError) as error:164 request.handler.respond()165 assert error.value.code == 500166def test_form_multipart_filename():167 request_headers = web.HTTPHeaders()168 request_headers.set('Content-Type', 'multipart/form-data; boundary=' + test_boundary)169 request = mock.MockHTTPRequest(None, ('', 0), None, body=test_mime_filename + test_separator + test_end, headers=request_headers, method='POST', handler=EchoHandler)170 request.handler.respond()171 assert request.body['binary']['filename'] == 'binary'172 assert request.body['binary']['type'] == 'application/octet-stream'173 assert request.body['binary']['length'] == len(test_binary)174 assert request.body['binary']['file'].read() == test_binary175def test_form_multipart_filename_no_length():176 request_headers = web.HTTPHeaders()177 request_headers.set('Content-Type', 'multipart/form-data; boundary=' + test_boundary)178 request = mock.MockHTTPRequest(None, ('', 0), None, body=test_mime_filename_no_length + test_separator + test_end, headers=request_headers, method='POST', handler=EchoHandler)179 request.handler.respond()180 assert request.body['binary']['filename'] == 'binary'181 assert request.body['binary']['type'] == 'application/octet-stream'182 assert request.body['binary']['length'] == len(test_binary)183 assert request.body['binary']['file'].read() == test_binary184def test_form_multipart_filename_too_long():185 request_headers = web.HTTPHeaders()186 request_headers.set('Content-Type', 'multipart/form-data; boundary=' + test_boundary)187 request = mock.MockHTTPRequest(None, ('', 0), None, body=test_mime_filename_too_long + test_separator + test_end, headers=request_headers, method='POST', handler=EchoHandler)188 with pytest.raises(web.HTTPError) as error:189 request.handler.respond()190 assert error.value.code == 413191def test_form_multipart_filename_bad():192 request_headers = web.HTTPHeaders()193 request_headers.set('Content-Type', 'multipart/form-data; boundary=' + test_boundary)194 request = mock.MockHTTPRequest(None, ('', 0), None, body=test_mime_filename_bad + test_separator + test_end, headers=request_headers, method='POST', handler=EchoHandler)195 with pytest.raises(web.HTTPError) as error:196 request.handler.respond()197 assert error.value.code == 400198def test_form_multipart_filename_bad_type():199 request_headers = web.HTTPHeaders()200 request_headers.set('Content-Type', 'multipart/form-data; boundary=' + test_boundary)201 request = mock.MockHTTPRequest(None, ('', 0), None, body=test_mime_filename_bad_type + test_separator + test_end, headers=request_headers, method='POST', handler=EchoHandler)202 request.handler.respond()203 assert request.body['binary']['filename'] == 'binary'204 assert request.body['binary']['type'] == 'text/plain'205 assert request.body['binary']['length'] == len(test_binary)206 assert request.body['binary']['file'].read() == test_binary207def test_form_multipart_utf8():208 request_headers = web.HTTPHeaders()209 request_headers.set('Content-Type', 'multipart/form-data; boundary=' + test_boundary)210 request = mock.MockHTTPRequest(None, ('', 0), None, body=test_mime_utf8 + test_separator + test_end, headers=request_headers, method='POST', handler=EchoHandler)211 request.handler.respond()212 assert request.body['binary_utf8'] == test_binary.decode()213def test_form_multipart_extra():214 request_headers = web.HTTPHeaders()215 request_headers.set('Content-Type', 'multipart/form-data; boundary=' + test_boundary)216 request = mock.MockHTTPRequest(None, ('', 0), None, body=test_mime_extra + test_separator + test_end, headers=request_headers, method='POST', handler=EchoHandler)217 request.handler.respond()218 assert request.body['binary_utf8'] == test_binary.decode()219def test_form_multipart_multi():220 request_headers = web.HTTPHeaders()221 request_headers.set('Content-Type', 'multipart/form-data; boundary=' + test_boundary)222 request = mock.MockHTTPRequest(None, ('', 0), None, body=test_mime_basic + test_separator + test_mime_filename + test_separator + test_mime_utf8 + test_separator + test_end, headers=request_headers, method='POST', handler=EchoHandler)223 request.handler.respond()224 assert request.body['body'] == test_body.decode()225 assert request.body['binary']['filename'] == 'binary'226 assert request.body['binary']['type'] == 'application/octet-stream'227 assert request.body['binary']['length'] == len(test_binary)228 assert request.body['binary']['file'].read() == test_binary...

Full Screen

Full Screen

jobs_threads.py

Source:jobs_threads.py Github

copy

Full Screen

1'''2Created on May 13, 20193@author: Tim Kreuzer4'''5from app import jobs_threads_docker, jobs_threads_unicore, utils_common6from app import utils_db7from app import utils_hub_update8def get(app_logger, uuidcode, request_headers, app_urls, app_database):9 try:10 app_logger.trace("uuidcode={} - Begin of get thread.".format(uuidcode))11 # Check if the server is still spawning.12 spawning = utils_db.get_spawning(app_logger,13 uuidcode,14 request_headers.get('servername', '<no_servername>'),15 app_database)16 if len(spawning) == 0 or spawning[0]:17 app_logger.debug("uuidcode={} - Do nothing. userserver={} is still spawning so we need no update".format(uuidcode, request_headers.get('servername', '<no_servername>')))18 return19 # Check if another get call is already running for this servername20 skip = utils_db.get_skip(app_logger,21 uuidcode,22 request_headers.get('servername', '<no_servername>'),23 app_database)24 if len(skip) == 0 or skip[0]:25 app_logger.debug("uuidcode={} - Do nothing. userserver={} is already checked. Skip it.".format(uuidcode, request_headers.get('servername', '<no_servername>')))26 return27 try:28 # Get OAuth tokens from JupyterHub29 request_headers['accesstoken'], request_headers['refreshtoken'], request_headers['expire'] = \30 utils_hub_update.get_tokens(app_logger,31 uuidcode,32 app_urls.get('hub', {}).get('url_proxy_route'),33 app_urls.get('hub', {}).get('url_token'),34 request_headers.get('jhubtoken', '<no_jhubtoken>'),35 request_headers.get('escapedusername'),36 request_headers.get('servername'))37 except:38 app_logger.error("uuidcode={} - Could not get token from JupyterHub".format(uuidcode))39 return40 # Get stored information for all server with this name (should be one) in database41 infos = utils_db.get_entry_infos(app_logger,42 uuidcode,43 request_headers.get('servername'),44 app_database)45 app_logger.trace("uuidcode={} - Result of get_entry_infos: {}".format(uuidcode, infos))46 if len(infos) == 0:47 # We don't know this server (yet). This usually happens when we're starting it right 48 # now and the cron job wants to check the status. So just do nothing49 app_logger.debug("uuidcode={} - Len(infos) == 0, but since this is the cronjob, we just do nothing".format(uuidcode))50 return51 if len(infos) > 1:52 # should not happen. Let's inform an admin via mail53 app_logger.error("uuidcode={} - Found multiple Server with the servername {}: {}".format(uuidcode, request_headers.get('servername'), infos))54 return55 info = infos[0]56 # Block this server for other calls (If a call takes more than 30 seconds, we would have multiple checks for the same server)57 utils_db.set_skip(app_logger,58 uuidcode,59 request_headers.get('servername'),60 app_database,61 'True')62 try:63 if info.get('system').lower() == "docker" or infos.get('system') == "HDF-Cloud":64 running = jobs_threads_docker.check_docker_status_new(app_logger,65 uuidcode,66 request_headers.get('servername'))67 if running:68 # Inform JupyterHub that the JupyterLab is still running69 utils_hub_update.status(app_logger,70 uuidcode,71 app_urls.get('hub', {}).get('url_proxy_route'),72 app_urls.get('hub', {}).get('url_status'),73 info.get('jhubtoken'),74 'running',75 request_headers.get('escapedusername'),76 request_headers.get('servername'))77 else:78 # Input is not true, so the Docker Container has stopped79 utils_hub_update.status(app_logger,80 uuidcode,81 app_urls.get('hub', {}).get('url_proxy_route'),82 app_urls.get('hub', {}).get('url_status'),83 info.get('jhubtoken'),84 'stopped',85 request_headers.get('escapedusername'),86 request_headers.get('servername'))87 utils_db.remove_entrys(app_logger,88 uuidcode,89 request_headers.get('servername'),90 app_database)91 92 # Unblock this server for other calls93 utils_db.set_skip(app_logger,94 uuidcode,95 request_headers.get('servername'),96 app_database,97 'False')98 else:99 # Let's J4J_UNICORE do the work. We just call it.100 jobs_threads_unicore.check_unicore_job_status(app_logger,101 uuidcode,102 app_urls,103 app_database,104 request_headers,105 request_headers.get('escapedusername'),106 request_headers.get('servername'),107 info)108 except:109 app_logger.exception("Could not check status")110 # Unblock this server for other calls111 utils_db.set_skip(app_logger,112 uuidcode,113 request_headers.get('servername'),114 app_database,115 'False')116 117 except:118 app_logger.exception("Unexpected error. Bugfix required")119 return120def post(app_logger, uuidcode, request_headers, request_json, app_urls, app_database):121 try:122 app_logger.trace("uuidcode={} - Begin of post thread.".format(uuidcode))123 if request_json.get('system').lower() == 'docker' or request_json.get('system') == "HDF-Cloud":124 running = jobs_threads_docker.start_docker_new(app_logger,125 uuidcode,126 app_database,127 request_headers,128 request_json.get('port'),129 request_json.get('service'),130 request_json.get('dashboard'),131 request_json.get('Environment', {}),132 app_urls)133 if running:134 utils_hub_update.status(app_logger,135 uuidcode,136 app_urls.get('hub', {}).get('url_proxy_route'),137 app_urls.get('hub', {}).get('url_status'),138 request_headers.get('jhubtoken'),139 'running',140 request_headers.get('escapedusername'),141 request_headers.get('servername'))142 else:143 utils_hub_update.cancel(app_logger,144 uuidcode,145 app_urls.get('hub', {}).get('url_proxy_route'),146 app_urls.get('hub', {}).get('url_cancel'),147 request_headers.get('jhubtoken'),148 "Could not start. An Administrator is informed.",149 request_headers.get('escapedusername'),150 request_headers.get('servername'))151 # set spawning to False (it will be set True when it's created)152 utils_db.set_spawning(app_logger,153 uuidcode,154 request_headers.get('servername'),155 app_database,156 'False')157 else:158 jobs_threads_unicore.start_unicore_job(app_logger,159 uuidcode,160 request_headers,161 request_json,162 app_urls,163 app_database)164 except:165 app_logger.exception("Jobs_Threads failed: Bugfix required")166 return167def delete(app_logger, uuidcode, request_headers, app_urls, app_database):168 app_logger.trace("uuidcode={} - Begin of delete thread.".format(uuidcode))169 if not request_headers.get('servername'):170 app_logger.warning("uuidcode={} - No servername. Headers: {}".format(uuidcode, utils_common.remove_secret(request_headers)))171 return172 servers = utils_db.get_entry_servername(app_logger,173 uuidcode,174 request_headers.get('servername'),175 app_database)176 # nothing to delete177 if len(servers) == 0:178 return {}179 # remove entrys180 utils_db.remove_entrys(app_logger,181 uuidcode,182 request_headers.get('servername'),183 app_database)184 headers = {}185 delete_header = {}186 for server in servers:187 docker = False188 try:189 system, kernelurl, filedir, port, account, project = server190 if system.lower() == "docker" or system == "HDF-Cloud":191 jobs_threads_docker.delete_docker_new(app_logger,192 uuidcode,193 request_headers.get('servername'),194 app_urls)195 continue196 else:197 headers, delete_header = jobs_threads_unicore.delete_job(app_logger,198 uuidcode,199 request_headers,200 delete_header,201 app_urls,202 system,203 kernelurl,204 filedir,205 port,206 account,207 project)208 except:209 if docker:210 app_logger.exception("uuidcode={} - Could not delete docker container".format(uuidcode))211 else:212 app_logger.exception("uuidcode={} - J4J_UNICORE communication failed. {}".format(uuidcode, server))...

Full Screen

Full Screen

test_auth.py

Source:test_auth.py Github

copy

Full Screen

1import base642from fooster.web import web, auth3import mock4import pytest5test_header = 'Test'6test_value = 'value'7test_realm = 'Tests'8test_token = 'abcdef'9class Handler(auth.AuthHandler):10 realm = test_realm11 def auth_any(self, auth):12 return None13 def do_get(self):14 return 204, ''15class ErrorHeaderHandler(auth.AuthHandler):16 realm = test_realm17 def auth_any(self, _):18 headers = web.HTTPHeaders()19 headers.set(test_header, test_value)20 raise auth.AuthError(self.scheme, test_realm, headers=headers)21 def do_get(self):22 return 204, ''23class ForbiddenHandler(auth.AuthHandler):24 realm = test_realm25 def forbidden(self):26 return True27 def auth_any(self, auth):28 return None29 def do_get(self):30 return 204, ''31class BasicHandler(auth.BasicAuthHandler):32 realm = test_realm33 def login(self, user, password):34 return user == password35 def do_get(self):36 return 204, ''37class TokenHandler(auth.TokenAuthHandler):38 realm = test_realm39 def token(self, token):40 return token == test_token41 def do_get(self):42 return 204, ''43def test_auth_none():44 request = mock.MockHTTPRequest(None, ('', 0), None, method='GET', handler=Handler)45 with pytest.raises(web.HTTPError) as error:46 request.handler.respond()47 assert error.value.headers.get('WWW-Authenticate') == 'Any realm="' + test_realm + '"'48 assert error.value.code == 40149def test_auth_nonexistent():50 request_headers = web.HTTPHeaders()51 request_headers.set('Authorization', 'Nonexistent none')52 request = mock.MockHTTPRequest(None, ('', 0), None, headers=request_headers, method='GET', handler=Handler)53 with pytest.raises(web.HTTPError) as error:54 request.handler.respond()55 assert error.value.headers.get('WWW-Authenticate') == 'Any realm="' + test_realm + '"'56 assert error.value.code == 40157def test_auth_any():58 request_headers = web.HTTPHeaders()59 request_headers.set('Authorization', 'Any none')60 request = mock.MockHTTPRequest(None, ('', 0), None, headers=request_headers, method='GET', handler=Handler)61 headers, response = request.response.headers, request.handler.respond()62 assert headers.get('WWW-Authenticate') is None63 assert response[0] == 20464def test_auth_any_error_headers():65 request_headers = web.HTTPHeaders()66 request_headers.set('Authorization', 'Any none')67 request = mock.MockHTTPRequest(None, ('', 0), None, headers=request_headers, method='GET', handler=ErrorHeaderHandler)68 with pytest.raises(web.HTTPError) as error:69 request.handler.respond()70 assert error.value.headers.get('WWW-Authenticate') == 'Any realm="' + test_realm + '"'71 assert error.value.headers.get(test_header) == test_value72 assert error.value.code == 40173def test_auth_any_forbidden():74 request_headers = web.HTTPHeaders()75 request_headers.set('Authorization', 'Any none')76 request = mock.MockHTTPRequest(None, ('', 0), None, headers=request_headers, method='GET', handler=ForbiddenHandler)77 with pytest.raises(web.HTTPError) as error:78 request.handler.respond()79 assert error.value.headers is None80 assert error.value.code == 40381def test_auth_basic():82 request_headers = web.HTTPHeaders()83 request_headers.set('Authorization', 'Basic ' + base64.b64encode(b'a:a').decode())84 request = mock.MockHTTPRequest(None, ('', 0), None, headers=request_headers, method='GET', handler=BasicHandler)85 headers, response = request.response.headers, request.handler.respond()86 assert headers.get('WWW-Authenticate') is None87 assert response[0] == 20488def test_auth_basic_fail():89 request_headers = web.HTTPHeaders()90 request_headers.set('Authorization', 'Basic ' + base64.b64encode(b'a:b').decode())91 request = mock.MockHTTPRequest(None, ('', 0), None, headers=request_headers, method='GET', handler=BasicHandler)92 with pytest.raises(web.HTTPError) as error:93 request.handler.respond()94 assert error.value.headers.get('WWW-Authenticate') == 'Basic realm="' + test_realm + '"'95 assert error.value.code == 40196def test_auth_token():97 request_headers = web.HTTPHeaders()98 request_headers.set('Authorization', 'Token ' + test_token)99 request = mock.MockHTTPRequest(None, ('', 0), None, headers=request_headers, method='GET', handler=TokenHandler)100 headers, response = request.response.headers, request.handler.respond()101 assert headers.get('WWW-Authenticate') is None102 assert response[0] == 204103def test_auth_token_fail():104 request_headers = web.HTTPHeaders()105 request_headers.set('Authorization', 'Token fake')106 request = mock.MockHTTPRequest(None, ('', 0), None, headers=request_headers, method='GET', handler=TokenHandler)107 with pytest.raises(web.HTTPError) as error:108 request.handler.respond()109 assert error.value.headers.get('WWW-Authenticate') == 'Token realm="' + test_realm + '"'...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('webpagetest');2var wpt = new WebPageTest('www.webpagetest.org');3 if (err) return console.error(err);4 console.log(data);5});6var wpt = require('webpagetest');7var wpt = new WebPageTest('www.webpagetest.org');8 if (err) return console.error(err);9 console.log(data);10});

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('webpagetest');2var options = {3};4var test = wpt(options);5 if (err) {6 console.log(err);7 } else {8 console.log(data);9 test.requestHeaders(data.data.testId, function(err, data) {10 if (err) {11 console.log(err);12 } else {13 console.log(data);14 }15 });16 }17});18{ statusCode: 200,19 { testId: '150109_8Y_2c2d2e2f2g2h2i2j2k2l2m2n2o2p2q2r2s2t2u2v2w2x2y2z',

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('webpagetest');2var webpagetest = new wpt('www.webpagetest.org', 'A.5f5e5e5d5e5e5e5e5e5e5e5e5e5e5e5');3var params = {4};5webpagetest.runTest(url, params, function(err, data) {6 if (err) {7 console.log('Error: ' + err);8 } else {9 console.log('Test ID: ' + data.data.testId);10 var testId = data.data.testId;11 var location = data.data.location;12 var url = data.data.summary;13 var json = webpagetest.request_headers(testId, location, url, function(err, data) {14 if (err) {15 console.log('Error: ' + err);16 } else {17 console.log('Headers: ' + data);18 }19 });20 }21});

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run wpt automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful