Coverage for fingerprint_pro_server_api_sdk/api/fingerprint_api.py: 88%
196 statements
« prev ^ index » next coverage.py v7.6.9, created at 2024-12-09 17:50 +0000
« prev ^ index » next coverage.py v7.6.9, created at 2024-12-09 17:50 +0000
1# coding: utf-8
3"""
4 Fingerprint Pro Server API
6 Fingerprint Pro Server API allows you to get information about visitors and about individual events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. # noqa: E501
8 OpenAPI spec version: 3
9 Contact: support@fingerprint.com
10 Generated by: https://github.com/swagger-api/swagger-codegen.git
11"""
13import re # noqa: F401
14from multiprocessing import Pool
15from multiprocessing.pool import ApplyResult as AsyncResult
16from typing import Optional, Union
18from fingerprint_pro_server_api_sdk.configuration import Configuration
19from fingerprint_pro_server_api_sdk.api_client import ApiClient
20from fingerprint_pro_server_api_sdk.extend_exception import extend_exception
21from fingerprint_pro_server_api_sdk.rest import ApiException
22from fingerprint_pro_server_api_sdk.models.error_plain_response import ErrorPlainResponse # noqa: F401
23from fingerprint_pro_server_api_sdk.models.error_response import ErrorResponse # noqa: F401
24from fingerprint_pro_server_api_sdk.models.events_get_response import EventsGetResponse # noqa: F401
25from fingerprint_pro_server_api_sdk.models.events_update_request import EventsUpdateRequest # noqa: F401
26from fingerprint_pro_server_api_sdk.models.visitors_get_response import VisitorsGetResponse # noqa: F401
29class FingerprintApi:
30 """NOTE: This class is auto generated by the swagger code generator program.
32 Do not edit the class manually.
33 Ref: https://github.com/swagger-api/swagger-codegen
34 """
36 def __init__(self, configuration: Optional[Configuration] = None, pool: Optional[Pool] = None):
37 if configuration is None:
38 raise ValueError("Missing the required parameter `configuration` when calling `FingerprintApi`") # noqa: E501
39 self.api_client = ApiClient(configuration, pool=pool)
41 def delete_visitor_data(self, visitor_id: str, **kwargs) -> Union[None, AsyncResult[None]]: # noqa: E501
42 """Delete data by visitor ID # noqa: E501
44 Request deleting all data associated with the specified visitor ID. This API is useful for compliance with privacy regulations. ### Which data is deleted? - Browser (or device) properties - Identification requests made from this browser (or device) #### Browser (or device) properties - Represents the data that Fingerprint collected from this specific browser (or device) and everything inferred and derived from it. - Upon request to delete, this data is deleted asynchronously (typically within a few minutes) and it will no longer be used to identify this browser (or device) for your [Fingerprint Application](https://dev.fingerprint.com/docs/glossary#fingerprint-application). #### Identification requests made from this browser (or device) - Fingerprint stores the identification requests made from a browser (or device) for up to 30 (or 90) days depending on your plan. To learn more, see [Data Retention](https://dev.fingerprint.com/docs/regions#data-retention). - Upon request to delete, the identification requests that were made by this browser - Within the past 10 days are deleted within 24 hrs. - Outside of 10 days are allowed to purge as per your data retention period. ### Corollary After requesting to delete a visitor ID, - If the same browser (or device) requests to identify, it will receive a different visitor ID. - If you request [`/events` API](https://dev.fingerprint.com/reference/getevent) with a `request_id` that was made outside of the 10 days, you will still receive a valid response. - If you request [`/visitors` API](https://dev.fingerprint.com/reference/getvisits) for the deleted visitor ID, the response will include identification requests that were made outside of those 10 days. ### Interested? Please [contact our support team](https://fingerprint.com/support/) to enable it for you. Otherwise, you will receive a 403. # noqa: E501
45 This method makes a synchronous HTTP request by default. To make an
46 asynchronous HTTP request, please pass async_req=True
47 >>> thread = api.delete_visitor_data(visitor_id, async_req=True)
48 >>> result = thread.get()
50 :param async_req bool
51 :param visitor_id: The [visitor ID](https://dev.fingerprint.com/reference/get-function#visitorid) you want to delete. (required)
52 :return: None
53 If the method is called asynchronously,
54 returns the request thread.
55 """
56 kwargs['_return_http_data_only'] = True
57 if kwargs.get('async_req'):
58 return self.delete_visitor_data_with_http_info(visitor_id, **kwargs) # noqa: E501
59 else:
60 (data) = self.delete_visitor_data_with_http_info(visitor_id, **kwargs) # noqa: E501
61 return data
63 def delete_visitor_data_with_http_info(self, visitor_id: str, **kwargs): # noqa: E501
64 """Delete data by visitor ID # noqa: E501
66 Request deleting all data associated with the specified visitor ID. This API is useful for compliance with privacy regulations. ### Which data is deleted? - Browser (or device) properties - Identification requests made from this browser (or device) #### Browser (or device) properties - Represents the data that Fingerprint collected from this specific browser (or device) and everything inferred and derived from it. - Upon request to delete, this data is deleted asynchronously (typically within a few minutes) and it will no longer be used to identify this browser (or device) for your [Fingerprint Application](https://dev.fingerprint.com/docs/glossary#fingerprint-application). #### Identification requests made from this browser (or device) - Fingerprint stores the identification requests made from a browser (or device) for up to 30 (or 90) days depending on your plan. To learn more, see [Data Retention](https://dev.fingerprint.com/docs/regions#data-retention). - Upon request to delete, the identification requests that were made by this browser - Within the past 10 days are deleted within 24 hrs. - Outside of 10 days are allowed to purge as per your data retention period. ### Corollary After requesting to delete a visitor ID, - If the same browser (or device) requests to identify, it will receive a different visitor ID. - If you request [`/events` API](https://dev.fingerprint.com/reference/getevent) with a `request_id` that was made outside of the 10 days, you will still receive a valid response. - If you request [`/visitors` API](https://dev.fingerprint.com/reference/getvisits) for the deleted visitor ID, the response will include identification requests that were made outside of those 10 days. ### Interested? Please [contact our support team](https://fingerprint.com/support/) to enable it for you. Otherwise, you will receive a 403. # noqa: E501
67 This method makes a synchronous HTTP request by default. To make an
68 asynchronous HTTP request, please pass async_req=True
69 >>> thread = api.delete_visitor_data_with_http_info(visitor_id, async_req=True)
70 >>> result = thread.get()
72 :param async_req bool
73 :param str visitor_id: The [visitor ID](https://dev.fingerprint.com/reference/get-function#visitorid) you want to delete. (required)
74 :return: None
75 If the method is called asynchronously,
76 returns the request thread.
77 """
79 all_params = [
80 'visitor_id',
81 'async_req',
82 '_return_http_data_only',
83 '_preload_content',
84 '_request_timeout']
86 params = locals()
87 for key, val in params['kwargs'].items():
88 if key not in all_params:
89 raise TypeError(
90 "Got an unexpected keyword argument '%s'"
91 " to method delete_visitor_data" % key
92 )
93 params[key] = val
94 del params['kwargs']
95 # verify the required parameter 'visitor_id' is set
96 if 'visitor_id' not in params or params['visitor_id'] is None:
97 raise ValueError("Missing the required parameter `visitor_id` when calling `delete_visitor_data`") # noqa: E501
99 collection_formats = {}
101 path_params = {}
102 if 'visitor_id' in params:
103 path_params['visitor_id'] = params['visitor_id'] # noqa: E501
105 query_params = [('ii', 'fingerprint-pro-server-python-sdk/8.1.0')]
107 header_params = {}
109 form_params = []
110 local_var_files = {}
112 body_params = None
113 # HTTP header `Accept`
114 header_params['Accept'] = self.api_client.select_header_accept(
115 ['application/json']) # noqa: E501
117 # Authentication setting
118 auth_settings = ['ApiKeyHeader', 'ApiKeyQuery'] # noqa: E501
120 try:
121 return self.api_client.call_api(
122 '/visitors/{visitor_id}', 'DELETE',
123 path_params,
124 query_params,
125 header_params,
126 body=body_params,
127 post_params=form_params,
128 files=local_var_files,
129 response_type=None, # noqa: E501
130 auth_settings=auth_settings,
131 async_req=params.get('async_req'),
132 _return_http_data_only=params.get('_return_http_data_only'),
133 _preload_content=params.get('_preload_content', True),
134 _request_timeout=params.get('_request_timeout'),
135 collection_formats=collection_formats)
136 except ApiException as e:
137 if e.status == 400:
138 error = self.api_client.deserialize(e, 'ErrorResponse', True)
139 raise extend_exception(e, error)
140 if e.status == 403:
141 error = self.api_client.deserialize(e, 'ErrorResponse', True)
142 raise extend_exception(e, error)
143 if e.status == 404:
144 error = self.api_client.deserialize(e, 'ErrorResponse', True)
145 raise extend_exception(e, error)
146 if e.status == 429:
147 error = self.api_client.deserialize(e, 'ErrorResponse', True)
148 raise extend_exception(e, error)
149 raise e
151 def get_event(self, request_id: str, **kwargs) -> Union[EventsGetResponse, AsyncResult[EventsGetResponse]]: # noqa: E501
152 """Get event by request ID # noqa: E501
154 Get a detailed analysis of an individual identification event, including Smart Signals. Please note that the response includes mobile signals (e.g. `rootApps`) even if the request originated from a non-mobile platform. It is highly recommended that you **ignore** the mobile signals for such requests. Use `requestId` as the URL path parameter. This API method is scoped to a request, i.e. all returned information is by `requestId`. # noqa: E501
155 This method makes a synchronous HTTP request by default. To make an
156 asynchronous HTTP request, please pass async_req=True
157 >>> thread = api.get_event(request_id, async_req=True)
158 >>> result = thread.get()
160 :param async_req bool
161 :param request_id: The unique [identifier](https://dev.fingerprint.com/reference/get-function#requestid) of each identification request. (required)
162 :return: EventsGetResponse
163 If the method is called asynchronously,
164 returns the request thread.
165 """
166 kwargs['_return_http_data_only'] = True
167 if kwargs.get('async_req'):
168 return self.get_event_with_http_info(request_id, **kwargs) # noqa: E501
169 else:
170 (data) = self.get_event_with_http_info(request_id, **kwargs) # noqa: E501
171 return data
173 def get_event_with_http_info(self, request_id: str, **kwargs): # noqa: E501
174 """Get event by request ID # noqa: E501
176 Get a detailed analysis of an individual identification event, including Smart Signals. Please note that the response includes mobile signals (e.g. `rootApps`) even if the request originated from a non-mobile platform. It is highly recommended that you **ignore** the mobile signals for such requests. Use `requestId` as the URL path parameter. This API method is scoped to a request, i.e. all returned information is by `requestId`. # noqa: E501
177 This method makes a synchronous HTTP request by default. To make an
178 asynchronous HTTP request, please pass async_req=True
179 >>> thread = api.get_event_with_http_info(request_id, async_req=True)
180 >>> result = thread.get()
182 :param async_req bool
183 :param str request_id: The unique [identifier](https://dev.fingerprint.com/reference/get-function#requestid) of each identification request. (required)
184 :return: EventsGetResponse
185 If the method is called asynchronously,
186 returns the request thread.
187 """
189 all_params = [
190 'request_id',
191 'async_req',
192 '_return_http_data_only',
193 '_preload_content',
194 '_request_timeout']
196 params = locals()
197 for key, val in params['kwargs'].items():
198 if key not in all_params:
199 raise TypeError(
200 "Got an unexpected keyword argument '%s'"
201 " to method get_event" % key
202 )
203 params[key] = val
204 del params['kwargs']
205 # verify the required parameter 'request_id' is set
206 if 'request_id' not in params or params['request_id'] is None:
207 raise ValueError("Missing the required parameter `request_id` when calling `get_event`") # noqa: E501
209 collection_formats = {}
211 path_params = {}
212 if 'request_id' in params:
213 path_params['request_id'] = params['request_id'] # noqa: E501
215 query_params = [('ii', 'fingerprint-pro-server-python-sdk/8.1.0')]
217 header_params = {}
219 form_params = []
220 local_var_files = {}
222 body_params = None
223 # HTTP header `Accept`
224 header_params['Accept'] = self.api_client.select_header_accept(
225 ['application/json']) # noqa: E501
227 # Authentication setting
228 auth_settings = ['ApiKeyHeader', 'ApiKeyQuery'] # noqa: E501
230 try:
231 return self.api_client.call_api(
232 '/events/{request_id}', 'GET',
233 path_params,
234 query_params,
235 header_params,
236 body=body_params,
237 post_params=form_params,
238 files=local_var_files,
239 response_type='EventsGetResponse', # noqa: E501
240 auth_settings=auth_settings,
241 async_req=params.get('async_req'),
242 _return_http_data_only=params.get('_return_http_data_only'),
243 _preload_content=params.get('_preload_content', True),
244 _request_timeout=params.get('_request_timeout'),
245 collection_formats=collection_formats)
246 except ApiException as e:
247 if e.status == 403:
248 error = self.api_client.deserialize(e, 'ErrorResponse', True)
249 raise extend_exception(e, error)
250 if e.status == 404:
251 error = self.api_client.deserialize(e, 'ErrorResponse', True)
252 raise extend_exception(e, error)
253 raise e
255 def get_visits(self, visitor_id: str, **kwargs) -> Union[VisitorsGetResponse, AsyncResult[VisitorsGetResponse]]: # noqa: E501
256 """Get visits by visitor ID # noqa: E501
258 Get a history of visits (identification events) for a specific `visitorId`. Use the `visitorId` as a URL path parameter. Only information from the _Identification_ product is returned. #### Headers * `Retry-After` — Present in case of `429 Too many requests`. Indicates how long you should wait before making a follow-up request. The value is non-negative decimal integer indicating the seconds to delay after the response is received. # noqa: E501
259 This method makes a synchronous HTTP request by default. To make an
260 asynchronous HTTP request, please pass async_req=True
261 >>> thread = api.get_visits(visitor_id, async_req=True)
262 >>> result = thread.get()
264 :param async_req bool
265 :param visitor_id: Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Pro. (required)
266 :param request_id: Filter visits by `requestId`. Every identification request has a unique identifier associated with it called `requestId`. This identifier is returned to the client in the identification [result](https://dev.fingerprint.com/reference/get-function#requestid). When you filter visits by `requestId`, only one visit will be returned.
267 :param linked_id: Filter visits by your custom identifier. You can use [`linkedId`](https://dev.fingerprint.com/reference/get-function#linkedid) to associate identification requests with your own identifier, for example: session ID, purchase ID, or transaction ID. You can then use this `linked_id` parameter to retrieve all events associated with your custom identifier.
268 :param limit: Limit scanned results. For performance reasons, the API first scans some number of events before filtering them. Use `limit` to specify how many events are scanned before they are filtered by `requestId` or `linkedId`. Results are always returned sorted by the timestamp (most recent first). By default, the most recent 100 visits are scanned, the maximum is 500.
269 :param pagination_key: Use `paginationKey` to get the next page of results. When more results are available (e.g., you requested 200 results using `limit` parameter, but a total of 600 results are available), the `paginationKey` top-level attribute is added to the response. The key corresponds to the `requestId` of the last returned event. In the following request, use that value in the `paginationKey` parameter to get the next page of results: 1. First request, returning most recent 200 events: `GET api-base-url/visitors/:visitorId?limit=200` 2. Use `response.paginationKey` to get the next page of results: `GET api-base-url/visitors/:visitorId?limit=200&paginationKey=1683900801733.Ogvu1j` Pagination happens during scanning and before filtering, so you can get less visits than the `limit` you specified with more available on the next page. When there are no more results available for scanning, the `paginationKey` attribute is not returned.
270 :param before: ⚠️ Deprecated pagination method, please use `paginationKey` instead. Timestamp (in milliseconds since epoch) used to paginate results.
271 :return: VisitorsGetResponse
272 If the method is called asynchronously,
273 returns the request thread.
274 """
275 kwargs['_return_http_data_only'] = True
276 if kwargs.get('async_req'):
277 return self.get_visits_with_http_info(visitor_id, **kwargs) # noqa: E501
278 else:
279 (data) = self.get_visits_with_http_info(visitor_id, **kwargs) # noqa: E501
280 return data
282 def get_visits_with_http_info(self, visitor_id: str, **kwargs): # noqa: E501
283 """Get visits by visitor ID # noqa: E501
285 Get a history of visits (identification events) for a specific `visitorId`. Use the `visitorId` as a URL path parameter. Only information from the _Identification_ product is returned. #### Headers * `Retry-After` — Present in case of `429 Too many requests`. Indicates how long you should wait before making a follow-up request. The value is non-negative decimal integer indicating the seconds to delay after the response is received. # noqa: E501
286 This method makes a synchronous HTTP request by default. To make an
287 asynchronous HTTP request, please pass async_req=True
288 >>> thread = api.get_visits_with_http_info(visitor_id, async_req=True)
289 >>> result = thread.get()
291 :param async_req bool
292 :param str visitor_id: Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Pro. (required)
293 :param str request_id: Filter visits by `requestId`. Every identification request has a unique identifier associated with it called `requestId`. This identifier is returned to the client in the identification [result](https://dev.fingerprint.com/reference/get-function#requestid). When you filter visits by `requestId`, only one visit will be returned.
294 :param str linked_id: Filter visits by your custom identifier. You can use [`linkedId`](https://dev.fingerprint.com/reference/get-function#linkedid) to associate identification requests with your own identifier, for example: session ID, purchase ID, or transaction ID. You can then use this `linked_id` parameter to retrieve all events associated with your custom identifier.
295 :param int limit: Limit scanned results. For performance reasons, the API first scans some number of events before filtering them. Use `limit` to specify how many events are scanned before they are filtered by `requestId` or `linkedId`. Results are always returned sorted by the timestamp (most recent first). By default, the most recent 100 visits are scanned, the maximum is 500.
296 :param str pagination_key: Use `paginationKey` to get the next page of results. When more results are available (e.g., you requested 200 results using `limit` parameter, but a total of 600 results are available), the `paginationKey` top-level attribute is added to the response. The key corresponds to the `requestId` of the last returned event. In the following request, use that value in the `paginationKey` parameter to get the next page of results: 1. First request, returning most recent 200 events: `GET api-base-url/visitors/:visitorId?limit=200` 2. Use `response.paginationKey` to get the next page of results: `GET api-base-url/visitors/:visitorId?limit=200&paginationKey=1683900801733.Ogvu1j` Pagination happens during scanning and before filtering, so you can get less visits than the `limit` you specified with more available on the next page. When there are no more results available for scanning, the `paginationKey` attribute is not returned.
297 :param int before: ⚠️ Deprecated pagination method, please use `paginationKey` instead. Timestamp (in milliseconds since epoch) used to paginate results.
298 :return: VisitorsGetResponse
299 If the method is called asynchronously,
300 returns the request thread.
301 """
303 all_params = [
304 'visitor_id',
305 'request_id',
306 'linked_id',
307 'limit',
308 'pagination_key',
309 'before',
310 'async_req',
311 '_return_http_data_only',
312 '_preload_content',
313 '_request_timeout']
315 params = locals()
316 for key, val in params['kwargs'].items():
317 if key not in all_params:
318 raise TypeError(
319 "Got an unexpected keyword argument '%s'"
320 " to method get_visits" % key
321 )
322 params[key] = val
323 del params['kwargs']
324 # verify the required parameter 'visitor_id' is set
325 if 'visitor_id' not in params or params['visitor_id'] is None:
326 raise ValueError("Missing the required parameter `visitor_id` when calling `get_visits`") # noqa: E501
328 collection_formats = {}
330 path_params = {}
331 if 'visitor_id' in params:
332 path_params['visitor_id'] = params['visitor_id'] # noqa: E501
334 query_params = [('ii', 'fingerprint-pro-server-python-sdk/8.1.0')]
335 if 'request_id' in params:
336 query_params.append(('request_id', params['request_id'])) # noqa: E501
337 if 'linked_id' in params:
338 query_params.append(('linked_id', params['linked_id'])) # noqa: E501
339 if 'limit' in params:
340 query_params.append(('limit', params['limit'])) # noqa: E501
341 if 'pagination_key' in params:
342 query_params.append(('paginationKey', params['pagination_key'])) # noqa: E501
343 if 'before' in params:
344 query_params.append(('before', params['before'])) # noqa: E501
346 header_params = {}
348 form_params = []
349 local_var_files = {}
351 body_params = None
352 # HTTP header `Accept`
353 header_params['Accept'] = self.api_client.select_header_accept(
354 ['application/json']) # noqa: E501
356 # Authentication setting
357 auth_settings = ['ApiKeyHeader', 'ApiKeyQuery'] # noqa: E501
359 try:
360 return self.api_client.call_api(
361 '/visitors/{visitor_id}', 'GET',
362 path_params,
363 query_params,
364 header_params,
365 body=body_params,
366 post_params=form_params,
367 files=local_var_files,
368 response_type='VisitorsGetResponse', # noqa: E501
369 auth_settings=auth_settings,
370 async_req=params.get('async_req'),
371 _return_http_data_only=params.get('_return_http_data_only'),
372 _preload_content=params.get('_preload_content', True),
373 _request_timeout=params.get('_request_timeout'),
374 collection_formats=collection_formats)
375 except ApiException as e:
376 if e.status == 400:
377 error = self.api_client.deserialize(e, 'ErrorPlainResponse', True)
378 raise extend_exception(e, error)
379 if e.status == 403:
380 error = self.api_client.deserialize(e, 'ErrorPlainResponse', True)
381 raise extend_exception(e, error)
382 if e.status == 429:
383 error = self.api_client.deserialize(e, 'ErrorPlainResponse', True)
384 raise extend_exception(e, error)
385 raise e
387 def update_event(self, body: EventsUpdateRequest, request_id: str, **kwargs) -> Union[None, AsyncResult[None]]: # noqa: E501
388 """Update an event with a given request ID # noqa: E501
390 Change information in existing events specified by `requestId` or *flag suspicious events*. When an event is created, it is assigned `linkedId` and `tag` submitted through the JS agent parameters. This information might not be available on the client so the Server API allows for updating the attributes after the fact. **Warning** It's not possible to update events older than 10 days. # noqa: E501
391 This method makes a synchronous HTTP request by default. To make an
392 asynchronous HTTP request, please pass async_req=True
393 >>> thread = api.update_event(body, request_id, async_req=True)
394 >>> result = thread.get()
396 :param async_req bool
397 :param body: (required)
398 :param request_id: The unique event [identifier](https://dev.fingerprint.com/reference/get-function#requestid). (required)
399 :return: None
400 If the method is called asynchronously,
401 returns the request thread.
402 """
403 kwargs['_return_http_data_only'] = True
404 if kwargs.get('async_req'):
405 return self.update_event_with_http_info(body, request_id, **kwargs) # noqa: E501
406 else:
407 (data) = self.update_event_with_http_info(body, request_id, **kwargs) # noqa: E501
408 return data
410 def update_event_with_http_info(self, body: EventsUpdateRequest, request_id: str, **kwargs): # noqa: E501
411 """Update an event with a given request ID # noqa: E501
413 Change information in existing events specified by `requestId` or *flag suspicious events*. When an event is created, it is assigned `linkedId` and `tag` submitted through the JS agent parameters. This information might not be available on the client so the Server API allows for updating the attributes after the fact. **Warning** It's not possible to update events older than 10 days. # noqa: E501
414 This method makes a synchronous HTTP request by default. To make an
415 asynchronous HTTP request, please pass async_req=True
416 >>> thread = api.update_event_with_http_info(body, request_id, async_req=True)
417 >>> result = thread.get()
419 :param async_req bool
420 :param EventsUpdateRequest body: (required)
421 :param str request_id: The unique event [identifier](https://dev.fingerprint.com/reference/get-function#requestid). (required)
422 :return: None
423 If the method is called asynchronously,
424 returns the request thread.
425 """
427 all_params = [
428 'body',
429 'request_id',
430 'async_req',
431 '_return_http_data_only',
432 '_preload_content',
433 '_request_timeout']
435 params = locals()
436 for key, val in params['kwargs'].items():
437 if key not in all_params:
438 raise TypeError(
439 "Got an unexpected keyword argument '%s'"
440 " to method update_event" % key
441 )
442 params[key] = val
443 del params['kwargs']
444 # verify the required parameter 'body' is set
445 if 'body' not in params or params['body'] is None:
446 raise ValueError("Missing the required parameter `body` when calling `update_event`") # noqa: E501
447 # verify the required parameter 'request_id' is set
448 if 'request_id' not in params or params['request_id'] is None:
449 raise ValueError("Missing the required parameter `request_id` when calling `update_event`") # noqa: E501
451 collection_formats = {}
453 path_params = {}
454 if 'request_id' in params:
455 path_params['request_id'] = params['request_id'] # noqa: E501
457 query_params = [('ii', 'fingerprint-pro-server-python-sdk/8.1.0')]
459 header_params = {}
461 form_params = []
462 local_var_files = {}
464 body_params = None
465 if 'body' in params:
466 body_params = params['body']
467 # HTTP header `Accept`
468 header_params['Accept'] = self.api_client.select_header_accept(
469 ['application/json']) # noqa: E501
471 # HTTP header `Content-Type`
472 header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
473 ['application/json']) # noqa: E501
475 # Authentication setting
476 auth_settings = ['ApiKeyHeader', 'ApiKeyQuery'] # noqa: E501
478 try:
479 return self.api_client.call_api(
480 '/events/{request_id}', 'PUT',
481 path_params,
482 query_params,
483 header_params,
484 body=body_params,
485 post_params=form_params,
486 files=local_var_files,
487 response_type=None, # noqa: E501
488 auth_settings=auth_settings,
489 async_req=params.get('async_req'),
490 _return_http_data_only=params.get('_return_http_data_only'),
491 _preload_content=params.get('_preload_content', True),
492 _request_timeout=params.get('_request_timeout'),
493 collection_formats=collection_formats)
494 except ApiException as e:
495 if e.status == 400:
496 error = self.api_client.deserialize(e, 'ErrorResponse', True)
497 raise extend_exception(e, error)
498 if e.status == 403:
499 error = self.api_client.deserialize(e, 'ErrorResponse', True)
500 raise extend_exception(e, error)
501 if e.status == 404:
502 error = self.api_client.deserialize(e, 'ErrorResponse', True)
503 raise extend_exception(e, error)
504 if e.status == 409:
505 error = self.api_client.deserialize(e, 'ErrorResponse', True)
506 raise extend_exception(e, error)
507 raise e