Coverage for fingerprint_pro_server_api_sdk/api/fingerprint_api.py: 91%
328 statements
« prev ^ index » next coverage.py v7.8.0, created at 2025-04-25 12:47 +0000
« prev ^ index » next coverage.py v7.8.0, created at 2025-04-25 12:47 +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.related_visitors_response import RelatedVisitorsResponse # noqa: F401
27from fingerprint_pro_server_api_sdk.models.search_events_response import SearchEventsResponse # noqa: F401
28from fingerprint_pro_server_api_sdk.models.visitors_get_response import VisitorsGetResponse # noqa: F401
31class FingerprintApi:
32 """NOTE: This class is auto generated by the swagger code generator program.
34 Do not edit the class manually.
35 Ref: https://github.com/swagger-api/swagger-codegen
36 """
38 def __init__(self, configuration: Optional[Configuration] = None, pool: Optional[Pool] = None):
39 if configuration is None:
40 raise ValueError("Missing the required parameter `configuration` when calling `FingerprintApi`") # noqa: E501
41 self.api_client = ApiClient(configuration, pool=pool)
43 def delete_visitor_data(self, visitor_id: str, **kwargs) -> Union[None, AsyncResult[None]]: # noqa: E501
44 """Delete data by visitor ID # noqa: E501
46 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 Workspace](https://dev.fingerprint.com/docs/glossary#fingerprint-workspace). #### 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
47 This method makes a synchronous HTTP request by default. To make an
48 asynchronous HTTP request, please pass async_req=True
49 >>> thread = api.delete_visitor_data(visitor_id, async_req=True)
50 >>> result = thread.get()
52 :param async_req bool
53 :param visitor_id: The [visitor ID](https://dev.fingerprint.com/reference/get-function#visitorid) you want to delete. (required)
54 :return: None
55 If the method is called asynchronously,
56 returns the request thread.
57 """
58 kwargs['_return_http_data_only'] = True
59 if kwargs.get('async_req'):
60 return self.delete_visitor_data_with_http_info(visitor_id, **kwargs) # noqa: E501
61 else:
62 (data) = self.delete_visitor_data_with_http_info(visitor_id, **kwargs) # noqa: E501
63 return data
65 def delete_visitor_data_with_http_info(self, visitor_id: str, **kwargs): # noqa: E501
66 """Delete data by visitor ID # noqa: E501
68 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 Workspace](https://dev.fingerprint.com/docs/glossary#fingerprint-workspace). #### 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
69 This method makes a synchronous HTTP request by default. To make an
70 asynchronous HTTP request, please pass async_req=True
71 >>> thread = api.delete_visitor_data_with_http_info(visitor_id, async_req=True)
72 >>> result = thread.get()
74 :param async_req bool
75 :param str visitor_id: The [visitor ID](https://dev.fingerprint.com/reference/get-function#visitorid) you want to delete. (required)
76 :return: None
77 If the method is called asynchronously,
78 returns the request thread.
79 """
81 all_params = [
82 'visitor_id',
83 'async_req',
84 '_return_http_data_only',
85 '_preload_content',
86 '_request_timeout']
88 params = locals()
89 for key, val in params['kwargs'].items():
90 if key not in all_params:
91 raise TypeError(
92 "Got an unexpected keyword argument '%s'"
93 " to method delete_visitor_data" % key
94 )
95 params[key] = val
96 del params['kwargs']
97 # verify the required parameter 'visitor_id' is set
98 if 'visitor_id' not in params or params['visitor_id'] is None:
99 raise ValueError("Missing the required parameter `visitor_id` when calling `delete_visitor_data`") # noqa: E501
101 collection_formats = {}
103 path_params = {}
104 if 'visitor_id' in params:
105 path_params['visitor_id'] = params['visitor_id'] # noqa: E501
107 query_params = [('ii', 'fingerprint-pro-server-python-sdk/8.6.0-rc.0')]
109 header_params = {}
111 form_params = []
112 local_var_files = {}
114 body_params = None
115 # HTTP header `Accept`
116 header_params['Accept'] = self.api_client.select_header_accept(
117 ['application/json']) # noqa: E501
119 # Authentication setting
120 auth_settings = ['ApiKeyHeader', 'ApiKeyQuery'] # noqa: E501
122 try:
123 return self.api_client.call_api(
124 '/visitors/{visitor_id}', 'DELETE',
125 path_params,
126 query_params,
127 header_params,
128 body=body_params,
129 post_params=form_params,
130 files=local_var_files,
131 response_type=None, # noqa: E501
132 auth_settings=auth_settings,
133 async_req=params.get('async_req'),
134 _return_http_data_only=params.get('_return_http_data_only'),
135 _preload_content=params.get('_preload_content', True),
136 _request_timeout=params.get('_request_timeout'),
137 collection_formats=collection_formats)
138 except ApiException as e:
139 if e.status == 400:
140 error = self.api_client.deserialize(e, 'ErrorResponse', True)
141 raise extend_exception(e, error)
142 if e.status == 403:
143 error = self.api_client.deserialize(e, 'ErrorResponse', True)
144 raise extend_exception(e, error)
145 if e.status == 404:
146 error = self.api_client.deserialize(e, 'ErrorResponse', True)
147 raise extend_exception(e, error)
148 if e.status == 429:
149 error = self.api_client.deserialize(e, 'ErrorResponse', True)
150 raise extend_exception(e, error)
151 raise e
153 def get_event(self, request_id: str, **kwargs) -> Union[EventsGetResponse, AsyncResult[EventsGetResponse]]: # noqa: E501
154 """Get event by request ID # noqa: E501
156 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
157 This method makes a synchronous HTTP request by default. To make an
158 asynchronous HTTP request, please pass async_req=True
159 >>> thread = api.get_event(request_id, async_req=True)
160 >>> result = thread.get()
162 :param async_req bool
163 :param request_id: The unique [identifier](https://dev.fingerprint.com/reference/get-function#requestid) of each identification request. (required)
164 :return: EventsGetResponse
165 If the method is called asynchronously,
166 returns the request thread.
167 """
168 kwargs['_return_http_data_only'] = True
169 if kwargs.get('async_req'):
170 return self.get_event_with_http_info(request_id, **kwargs) # noqa: E501
171 else:
172 (data) = self.get_event_with_http_info(request_id, **kwargs) # noqa: E501
173 return data
175 def get_event_with_http_info(self, request_id: str, **kwargs): # noqa: E501
176 """Get event by request ID # noqa: E501
178 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
179 This method makes a synchronous HTTP request by default. To make an
180 asynchronous HTTP request, please pass async_req=True
181 >>> thread = api.get_event_with_http_info(request_id, async_req=True)
182 >>> result = thread.get()
184 :param async_req bool
185 :param str request_id: The unique [identifier](https://dev.fingerprint.com/reference/get-function#requestid) of each identification request. (required)
186 :return: EventsGetResponse
187 If the method is called asynchronously,
188 returns the request thread.
189 """
191 all_params = [
192 'request_id',
193 'async_req',
194 '_return_http_data_only',
195 '_preload_content',
196 '_request_timeout']
198 params = locals()
199 for key, val in params['kwargs'].items():
200 if key not in all_params:
201 raise TypeError(
202 "Got an unexpected keyword argument '%s'"
203 " to method get_event" % key
204 )
205 params[key] = val
206 del params['kwargs']
207 # verify the required parameter 'request_id' is set
208 if 'request_id' not in params or params['request_id'] is None:
209 raise ValueError("Missing the required parameter `request_id` when calling `get_event`") # noqa: E501
211 collection_formats = {}
213 path_params = {}
214 if 'request_id' in params:
215 path_params['request_id'] = params['request_id'] # noqa: E501
217 query_params = [('ii', 'fingerprint-pro-server-python-sdk/8.6.0-rc.0')]
219 header_params = {}
221 form_params = []
222 local_var_files = {}
224 body_params = None
225 # HTTP header `Accept`
226 header_params['Accept'] = self.api_client.select_header_accept(
227 ['application/json']) # noqa: E501
229 # Authentication setting
230 auth_settings = ['ApiKeyHeader', 'ApiKeyQuery'] # noqa: E501
232 try:
233 return self.api_client.call_api(
234 '/events/{request_id}', 'GET',
235 path_params,
236 query_params,
237 header_params,
238 body=body_params,
239 post_params=form_params,
240 files=local_var_files,
241 response_type='EventsGetResponse', # noqa: E501
242 auth_settings=auth_settings,
243 async_req=params.get('async_req'),
244 _return_http_data_only=params.get('_return_http_data_only'),
245 _preload_content=params.get('_preload_content', True),
246 _request_timeout=params.get('_request_timeout'),
247 collection_formats=collection_formats)
248 except ApiException as e:
249 if e.status == 403:
250 error = self.api_client.deserialize(e, 'ErrorResponse', True)
251 raise extend_exception(e, error)
252 if e.status == 404:
253 error = self.api_client.deserialize(e, 'ErrorResponse', True)
254 raise extend_exception(e, error)
255 raise e
257 def get_related_visitors(self, visitor_id: str, **kwargs) -> Union[RelatedVisitorsResponse, AsyncResult[RelatedVisitorsResponse]]: # noqa: E501
258 """Get Related Visitors # noqa: E501
260 Related visitors API lets you link web visits and in-app browser visits that originated from the same mobile device. It searches the past 6 months of identification events to find the visitor IDs that belong to the same mobile device as the given visitor ID. ⚠️ Please note that this API is not enabled by default and is billable separately. ⚠️ If you would like to use Related visitors API, please contact our [support team](https://fingerprint.com/support). To learn more, see [Related visitors API reference](https://dev.fingerprint.com/reference/related-visitors-api). # noqa: E501
261 This method makes a synchronous HTTP request by default. To make an
262 asynchronous HTTP request, please pass async_req=True
263 >>> thread = api.get_related_visitors(visitor_id, async_req=True)
264 >>> result = thread.get()
266 :param async_req bool
267 :param visitor_id: The [visitor ID](https://dev.fingerprint.com/reference/get-function#visitorid) for which you want to find the other visitor IDs that originated from the same mobile device. (required)
268 :return: RelatedVisitorsResponse
269 If the method is called asynchronously,
270 returns the request thread.
271 """
272 kwargs['_return_http_data_only'] = True
273 if kwargs.get('async_req'):
274 return self.get_related_visitors_with_http_info(visitor_id, **kwargs) # noqa: E501
275 else:
276 (data) = self.get_related_visitors_with_http_info(visitor_id, **kwargs) # noqa: E501
277 return data
279 def get_related_visitors_with_http_info(self, visitor_id: str, **kwargs): # noqa: E501
280 """Get Related Visitors # noqa: E501
282 Related visitors API lets you link web visits and in-app browser visits that originated from the same mobile device. It searches the past 6 months of identification events to find the visitor IDs that belong to the same mobile device as the given visitor ID. ⚠️ Please note that this API is not enabled by default and is billable separately. ⚠️ If you would like to use Related visitors API, please contact our [support team](https://fingerprint.com/support). To learn more, see [Related visitors API reference](https://dev.fingerprint.com/reference/related-visitors-api). # noqa: E501
283 This method makes a synchronous HTTP request by default. To make an
284 asynchronous HTTP request, please pass async_req=True
285 >>> thread = api.get_related_visitors_with_http_info(visitor_id, async_req=True)
286 >>> result = thread.get()
288 :param async_req bool
289 :param str visitor_id: The [visitor ID](https://dev.fingerprint.com/reference/get-function#visitorid) for which you want to find the other visitor IDs that originated from the same mobile device. (required)
290 :return: RelatedVisitorsResponse
291 If the method is called asynchronously,
292 returns the request thread.
293 """
295 all_params = [
296 'visitor_id',
297 'async_req',
298 '_return_http_data_only',
299 '_preload_content',
300 '_request_timeout']
302 params = locals()
303 for key, val in params['kwargs'].items():
304 if key not in all_params:
305 raise TypeError(
306 "Got an unexpected keyword argument '%s'"
307 " to method get_related_visitors" % key
308 )
309 params[key] = val
310 del params['kwargs']
311 # verify the required parameter 'visitor_id' is set
312 if 'visitor_id' not in params or params['visitor_id'] is None:
313 raise ValueError("Missing the required parameter `visitor_id` when calling `get_related_visitors`") # noqa: E501
315 collection_formats = {}
317 path_params = {}
319 query_params = [('ii', 'fingerprint-pro-server-python-sdk/8.6.0-rc.0')]
320 if 'visitor_id' in params:
321 query_params.append(('visitor_id', params['visitor_id'])) # noqa: E501
323 header_params = {}
325 form_params = []
326 local_var_files = {}
328 body_params = None
329 # HTTP header `Accept`
330 header_params['Accept'] = self.api_client.select_header_accept(
331 ['application/json']) # noqa: E501
333 # Authentication setting
334 auth_settings = ['ApiKeyHeader', 'ApiKeyQuery'] # noqa: E501
336 try:
337 return self.api_client.call_api(
338 '/related-visitors', 'GET',
339 path_params,
340 query_params,
341 header_params,
342 body=body_params,
343 post_params=form_params,
344 files=local_var_files,
345 response_type='RelatedVisitorsResponse', # noqa: E501
346 auth_settings=auth_settings,
347 async_req=params.get('async_req'),
348 _return_http_data_only=params.get('_return_http_data_only'),
349 _preload_content=params.get('_preload_content', True),
350 _request_timeout=params.get('_request_timeout'),
351 collection_formats=collection_formats)
352 except ApiException as e:
353 if e.status == 400:
354 error = self.api_client.deserialize(e, 'ErrorResponse', True)
355 raise extend_exception(e, error)
356 if e.status == 403:
357 error = self.api_client.deserialize(e, 'ErrorResponse', True)
358 raise extend_exception(e, error)
359 if e.status == 404:
360 error = self.api_client.deserialize(e, 'ErrorResponse', True)
361 raise extend_exception(e, error)
362 if e.status == 429:
363 error = self.api_client.deserialize(e, 'ErrorResponse', True)
364 raise extend_exception(e, error)
365 raise e
367 def get_visits(self, visitor_id: str, **kwargs) -> Union[VisitorsGetResponse, AsyncResult[VisitorsGetResponse]]: # noqa: E501
368 """Get visits by visitor ID # noqa: E501
370 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
371 This method makes a synchronous HTTP request by default. To make an
372 asynchronous HTTP request, please pass async_req=True
373 >>> thread = api.get_visits(visitor_id, async_req=True)
374 >>> result = thread.get()
376 :param async_req bool
377 :param visitor_id: Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Pro. (required)
378 :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.
379 :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.
380 :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.
381 :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.
382 :param before: ⚠️ Deprecated pagination method, please use `paginationKey` instead. Timestamp (in milliseconds since epoch) used to paginate results.
383 :return: VisitorsGetResponse
384 If the method is called asynchronously,
385 returns the request thread.
386 """
387 kwargs['_return_http_data_only'] = True
388 if kwargs.get('async_req'):
389 return self.get_visits_with_http_info(visitor_id, **kwargs) # noqa: E501
390 else:
391 (data) = self.get_visits_with_http_info(visitor_id, **kwargs) # noqa: E501
392 return data
394 def get_visits_with_http_info(self, visitor_id: str, **kwargs): # noqa: E501
395 """Get visits by visitor ID # noqa: E501
397 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
398 This method makes a synchronous HTTP request by default. To make an
399 asynchronous HTTP request, please pass async_req=True
400 >>> thread = api.get_visits_with_http_info(visitor_id, async_req=True)
401 >>> result = thread.get()
403 :param async_req bool
404 :param str visitor_id: Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Pro. (required)
405 :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.
406 :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.
407 :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.
408 :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.
409 :param int before: ⚠️ Deprecated pagination method, please use `paginationKey` instead. Timestamp (in milliseconds since epoch) used to paginate results.
410 :return: VisitorsGetResponse
411 If the method is called asynchronously,
412 returns the request thread.
413 """
415 all_params = [
416 'visitor_id',
417 'request_id',
418 'linked_id',
419 'limit',
420 'pagination_key',
421 'before',
422 'async_req',
423 '_return_http_data_only',
424 '_preload_content',
425 '_request_timeout']
427 params = locals()
428 for key, val in params['kwargs'].items():
429 if key not in all_params:
430 raise TypeError(
431 "Got an unexpected keyword argument '%s'"
432 " to method get_visits" % key
433 )
434 params[key] = val
435 del params['kwargs']
436 # verify the required parameter 'visitor_id' is set
437 if 'visitor_id' not in params or params['visitor_id'] is None:
438 raise ValueError("Missing the required parameter `visitor_id` when calling `get_visits`") # noqa: E501
440 collection_formats = {}
442 path_params = {}
443 if 'visitor_id' in params:
444 path_params['visitor_id'] = params['visitor_id'] # noqa: E501
446 query_params = [('ii', 'fingerprint-pro-server-python-sdk/8.6.0-rc.0')]
447 if 'request_id' in params:
448 query_params.append(('request_id', params['request_id'])) # noqa: E501
449 if 'linked_id' in params:
450 query_params.append(('linked_id', params['linked_id'])) # noqa: E501
451 if 'limit' in params:
452 query_params.append(('limit', params['limit'])) # noqa: E501
453 if 'pagination_key' in params:
454 query_params.append(('paginationKey', params['pagination_key'])) # noqa: E501
455 if 'before' in params:
456 query_params.append(('before', params['before'])) # noqa: E501
458 header_params = {}
460 form_params = []
461 local_var_files = {}
463 body_params = None
464 # HTTP header `Accept`
465 header_params['Accept'] = self.api_client.select_header_accept(
466 ['application/json']) # noqa: E501
468 # Authentication setting
469 auth_settings = ['ApiKeyHeader', 'ApiKeyQuery'] # noqa: E501
471 try:
472 return self.api_client.call_api(
473 '/visitors/{visitor_id}', 'GET',
474 path_params,
475 query_params,
476 header_params,
477 body=body_params,
478 post_params=form_params,
479 files=local_var_files,
480 response_type='VisitorsGetResponse', # noqa: E501
481 auth_settings=auth_settings,
482 async_req=params.get('async_req'),
483 _return_http_data_only=params.get('_return_http_data_only'),
484 _preload_content=params.get('_preload_content', True),
485 _request_timeout=params.get('_request_timeout'),
486 collection_formats=collection_formats)
487 except ApiException as e:
488 if e.status == 400:
489 error = self.api_client.deserialize(e, 'ErrorPlainResponse', True)
490 raise extend_exception(e, error)
491 if e.status == 403:
492 error = self.api_client.deserialize(e, 'ErrorPlainResponse', True)
493 raise extend_exception(e, error)
494 if e.status == 429:
495 error = self.api_client.deserialize(e, 'ErrorPlainResponse', True)
496 raise extend_exception(e, error)
497 raise e
499 def search_events(self, limit: int, **kwargs) -> Union[SearchEventsResponse, AsyncResult[SearchEventsResponse]]: # noqa: E501
500 """Get events via search # noqa: E501
502 Search for identification events, including Smart Signals, using multiple filtering criteria. If you don't provide `start` or `end` parameters, the default search range is the last 7 days. Please note that events include mobile signals (e.g. `rootApps`) even if the request originated from a non-mobile platform. We recommend you **ignore** mobile signals for such requests. # noqa: E501
503 This method makes a synchronous HTTP request by default. To make an
504 asynchronous HTTP request, please pass async_req=True
505 >>> thread = api.search_events(limit, async_req=True)
506 >>> result = thread.get()
508 :param async_req bool
509 :param limit: Limit the number of events returned. (required)
510 :param pagination_key: Use `pagination_key` to get the next page of results. When more results are available (e.g., you requested up to 200 results for your search using `limit`, but there are more than 200 events total matching your request), the `paginationKey` top-level attribute is added to the response. The key corresponds to the `timestamp` of the last returned event. In the following request, use that value in the `pagination_key` parameter to get the next page of results: 1. First request, returning most recent 200 events: `GET api-base-url/events/search?limit=200` 2. Use `response.paginationKey` to get the next page of results: `GET api-base-url/events/search?limit=200&pagination_key=1740815825085`
511 :param visitor_id: Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Pro. Filter for events matching this `visitor_id`.
512 :param bot: Filter events by the Bot Detection result, specifically: `all` - events where any kind of bot was detected. `good` - events where a good bot was detected. `bad` - events where a bad bot was detected. `none` - events where no bot was detected. > Note: When using this parameter, only events with the `products.botd.data.bot.result` property set to a valid value are returned. Events without a `products.botd` Smart Signal result are left out of the response.
513 :param ip_address: Filter events by IP address range. The range can be as specific as a single IP (/32 for IPv4 or /128 for IPv6) All ip_address filters must use CIDR notation, for example, 10.0.0.0/24, 192.168.0.1/32
514 :param linked_id: Filter events by your custom identifier. You can use [linked IDs](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.
515 :param start: Filter events with a timestamp greater than the start time, in Unix time (milliseconds).
516 :param end: Filter events with a timestamp smaller than the end time, in Unix time (milliseconds).
517 :param reverse: Sort events in reverse timestamp order.
518 :param suspect: Filter events previously tagged as suspicious via the [Update API](https://dev.fingerprint.com/reference/updateevent). > Note: When using this parameter, only events with the `suspect` property explicitly set to `true` or `false` are returned. Events with undefined `suspect` property are left out of the response.
519 :param vpn: Filter events by VPN Detection result. > Note: When using this parameter, only events with the `products.vpn.data.result` property set to `true` or `false` are returned. Events without a `products.vpn` Smart Signal result are left out of the response.
520 :param virtual_machine: Filter events by Virtual Machine Detection result. > Note: When using this parameter, only events with the `products.virtualMachine.data.result` property set to `true` or `false` are returned. Events without a `products.virtualMachine` Smart Signal result are left out of the response.
521 :param tampering: Filter events by Tampering Detection result. > Note: When using this parameter, only events with the `products.tampering.data.result` property set to `true` or `false` are returned. Events without a `products.tampering` Smart Signal result are left out of the response.
522 :param anti_detect_browser: Filter events by Anti-detect Browser Detection result. > Note: When using this parameter, only events with the `products.tampering.data.antiDetectBrowser` property set to `true` or `false` are returned. Events without a `products.tampering` Smart Signal result are left out of the response.
523 :param incognito: Filter events by Browser Incognito Detection result. > Note: When using this parameter, only events with the `products.incognito.data.result` property set to `true` or `false` are returned. Events without a `products.incognito` Smart Signal result are left out of the response.
524 :param privacy_settings: Filter events by Privacy Settings Detection result. > Note: When using this parameter, only events with the `products.privacySettings.data.result` property set to `true` or `false` are returned. Events without a `products.privacySettings` Smart Signal result are left out of the response.
525 :param jailbroken: Filter events by Jailbroken Device Detection result. > Note: When using this parameter, only events with the `products.jailbroken.data.result` property set to `true` or `false` are returned. Events without a `products.jailbroken` Smart Signal result are left out of the response.
526 :param frida: Filter events by Frida Detection result. > Note: When using this parameter, only events with the `products.frida.data.result` property set to `true` or `false` are returned. Events without a `products.frida` Smart Signal result are left out of the response.
527 :param factory_reset: Filter events by Factory Reset Detection result. > Note: When using this parameter, only events with the `products.factoryReset.data.result` property set to `true` or `false` are returned. Events without a `products.factoryReset` Smart Signal result are left out of the response.
528 :param cloned_app: Filter events by Cloned App Detection result. > Note: When using this parameter, only events with the `products.clonedApp.data.result` property set to `true` or `false` are returned. Events without a `products.clonedApp` Smart Signal result are left out of the response.
529 :param emulator: Filter events by Android Emulator Detection result. > Note: When using this parameter, only events with the `products.emulator.data.result` property set to `true` or `false` are returned. Events without a `products.emulator` Smart Signal result are left out of the response.
530 :param root_apps: Filter events by Rooted Device Detection result. > Note: When using this parameter, only events with the `products.rootApps.data.result` property set to `true` or `false` are returned. Events without a `products.rootApps` Smart Signal result are left out of the response.
531 :param vpn_confidence: Filter events by VPN Detection result confidence level. `high` - events with high VPN Detection confidence. `medium` - events with medium VPN Detection confidence. `low` - events with low VPN Detection confidence. > Note: When using this parameter, only events with the `products.vpn.data.confidence` property set to a valid value are returned. Events without a `products.vpn` Smart Signal result are left out of the response.
532 :param min_suspect_score: Filter events with Suspect Score result above a provided minimum threshold. > Note: When using this parameter, only events where the `products.suspectScore.data.result` property set to a value exceeding your threshold are returned. Events without a `products.suspectScore` Smart Signal result are left out of the response.
533 :param ip_blocklist: Filter events by IP Blocklist Detection result. > Note: When using this parameter, only events with the `products.ipBlocklist.data.result` property set to `true` or `false` are returned. Events without a `products.ipBlocklist` Smart Signal result are left out of the response.
534 :param datacenter: Filter events by Datacenter Detection result. > Note: When using this parameter, only events with the `products.ipInfo.data.v4.datacenter.result` or `products.ipInfo.data.v6.datacenter.result` property set to `true` or `false` are returned. Events without a `products.ipInfo` Smart Signal result are left out of the response.
535 :return: SearchEventsResponse
536 If the method is called asynchronously,
537 returns the request thread.
538 """
539 kwargs['_return_http_data_only'] = True
540 if kwargs.get('async_req'):
541 return self.search_events_with_http_info(limit, **kwargs) # noqa: E501
542 else:
543 (data) = self.search_events_with_http_info(limit, **kwargs) # noqa: E501
544 return data
546 def search_events_with_http_info(self, limit: int, **kwargs): # noqa: E501
547 """Get events via search # noqa: E501
549 Search for identification events, including Smart Signals, using multiple filtering criteria. If you don't provide `start` or `end` parameters, the default search range is the last 7 days. Please note that events include mobile signals (e.g. `rootApps`) even if the request originated from a non-mobile platform. We recommend you **ignore** mobile signals for such requests. # noqa: E501
550 This method makes a synchronous HTTP request by default. To make an
551 asynchronous HTTP request, please pass async_req=True
552 >>> thread = api.search_events_with_http_info(limit, async_req=True)
553 >>> result = thread.get()
555 :param async_req bool
556 :param int limit: Limit the number of events returned. (required)
557 :param str pagination_key: Use `pagination_key` to get the next page of results. When more results are available (e.g., you requested up to 200 results for your search using `limit`, but there are more than 200 events total matching your request), the `paginationKey` top-level attribute is added to the response. The key corresponds to the `timestamp` of the last returned event. In the following request, use that value in the `pagination_key` parameter to get the next page of results: 1. First request, returning most recent 200 events: `GET api-base-url/events/search?limit=200` 2. Use `response.paginationKey` to get the next page of results: `GET api-base-url/events/search?limit=200&pagination_key=1740815825085`
558 :param str visitor_id: Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Pro. Filter for events matching this `visitor_id`.
559 :param str bot: Filter events by the Bot Detection result, specifically: `all` - events where any kind of bot was detected. `good` - events where a good bot was detected. `bad` - events where a bad bot was detected. `none` - events where no bot was detected. > Note: When using this parameter, only events with the `products.botd.data.bot.result` property set to a valid value are returned. Events without a `products.botd` Smart Signal result are left out of the response.
560 :param str ip_address: Filter events by IP address range. The range can be as specific as a single IP (/32 for IPv4 or /128 for IPv6) All ip_address filters must use CIDR notation, for example, 10.0.0.0/24, 192.168.0.1/32
561 :param str linked_id: Filter events by your custom identifier. You can use [linked IDs](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.
562 :param int start: Filter events with a timestamp greater than the start time, in Unix time (milliseconds).
563 :param int end: Filter events with a timestamp smaller than the end time, in Unix time (milliseconds).
564 :param bool reverse: Sort events in reverse timestamp order.
565 :param bool suspect: Filter events previously tagged as suspicious via the [Update API](https://dev.fingerprint.com/reference/updateevent). > Note: When using this parameter, only events with the `suspect` property explicitly set to `true` or `false` are returned. Events with undefined `suspect` property are left out of the response.
566 :param bool vpn: Filter events by VPN Detection result. > Note: When using this parameter, only events with the `products.vpn.data.result` property set to `true` or `false` are returned. Events without a `products.vpn` Smart Signal result are left out of the response.
567 :param bool virtual_machine: Filter events by Virtual Machine Detection result. > Note: When using this parameter, only events with the `products.virtualMachine.data.result` property set to `true` or `false` are returned. Events without a `products.virtualMachine` Smart Signal result are left out of the response.
568 :param bool tampering: Filter events by Tampering Detection result. > Note: When using this parameter, only events with the `products.tampering.data.result` property set to `true` or `false` are returned. Events without a `products.tampering` Smart Signal result are left out of the response.
569 :param bool anti_detect_browser: Filter events by Anti-detect Browser Detection result. > Note: When using this parameter, only events with the `products.tampering.data.antiDetectBrowser` property set to `true` or `false` are returned. Events without a `products.tampering` Smart Signal result are left out of the response.
570 :param bool incognito: Filter events by Browser Incognito Detection result. > Note: When using this parameter, only events with the `products.incognito.data.result` property set to `true` or `false` are returned. Events without a `products.incognito` Smart Signal result are left out of the response.
571 :param bool privacy_settings: Filter events by Privacy Settings Detection result. > Note: When using this parameter, only events with the `products.privacySettings.data.result` property set to `true` or `false` are returned. Events without a `products.privacySettings` Smart Signal result are left out of the response.
572 :param bool jailbroken: Filter events by Jailbroken Device Detection result. > Note: When using this parameter, only events with the `products.jailbroken.data.result` property set to `true` or `false` are returned. Events without a `products.jailbroken` Smart Signal result are left out of the response.
573 :param bool frida: Filter events by Frida Detection result. > Note: When using this parameter, only events with the `products.frida.data.result` property set to `true` or `false` are returned. Events without a `products.frida` Smart Signal result are left out of the response.
574 :param bool factory_reset: Filter events by Factory Reset Detection result. > Note: When using this parameter, only events with the `products.factoryReset.data.result` property set to `true` or `false` are returned. Events without a `products.factoryReset` Smart Signal result are left out of the response.
575 :param bool cloned_app: Filter events by Cloned App Detection result. > Note: When using this parameter, only events with the `products.clonedApp.data.result` property set to `true` or `false` are returned. Events without a `products.clonedApp` Smart Signal result are left out of the response.
576 :param bool emulator: Filter events by Android Emulator Detection result. > Note: When using this parameter, only events with the `products.emulator.data.result` property set to `true` or `false` are returned. Events without a `products.emulator` Smart Signal result are left out of the response.
577 :param bool root_apps: Filter events by Rooted Device Detection result. > Note: When using this parameter, only events with the `products.rootApps.data.result` property set to `true` or `false` are returned. Events without a `products.rootApps` Smart Signal result are left out of the response.
578 :param str vpn_confidence: Filter events by VPN Detection result confidence level. `high` - events with high VPN Detection confidence. `medium` - events with medium VPN Detection confidence. `low` - events with low VPN Detection confidence. > Note: When using this parameter, only events with the `products.vpn.data.confidence` property set to a valid value are returned. Events without a `products.vpn` Smart Signal result are left out of the response.
579 :param float min_suspect_score: Filter events with Suspect Score result above a provided minimum threshold. > Note: When using this parameter, only events where the `products.suspectScore.data.result` property set to a value exceeding your threshold are returned. Events without a `products.suspectScore` Smart Signal result are left out of the response.
580 :param bool ip_blocklist: Filter events by IP Blocklist Detection result. > Note: When using this parameter, only events with the `products.ipBlocklist.data.result` property set to `true` or `false` are returned. Events without a `products.ipBlocklist` Smart Signal result are left out of the response.
581 :param bool datacenter: Filter events by Datacenter Detection result. > Note: When using this parameter, only events with the `products.ipInfo.data.v4.datacenter.result` or `products.ipInfo.data.v6.datacenter.result` property set to `true` or `false` are returned. Events without a `products.ipInfo` Smart Signal result are left out of the response.
582 :return: SearchEventsResponse
583 If the method is called asynchronously,
584 returns the request thread.
585 """
587 all_params = [
588 'limit',
589 'pagination_key',
590 'visitor_id',
591 'bot',
592 'ip_address',
593 'linked_id',
594 'start',
595 'end',
596 'reverse',
597 'suspect',
598 'vpn',
599 'virtual_machine',
600 'tampering',
601 'anti_detect_browser',
602 'incognito',
603 'privacy_settings',
604 'jailbroken',
605 'frida',
606 'factory_reset',
607 'cloned_app',
608 'emulator',
609 'root_apps',
610 'vpn_confidence',
611 'min_suspect_score',
612 'ip_blocklist',
613 'datacenter',
614 'async_req',
615 '_return_http_data_only',
616 '_preload_content',
617 '_request_timeout']
619 params = locals()
620 for key, val in params['kwargs'].items():
621 if key not in all_params:
622 raise TypeError(
623 "Got an unexpected keyword argument '%s'"
624 " to method search_events" % key
625 )
626 params[key] = val
627 del params['kwargs']
628 # verify the required parameter 'limit' is set
629 if 'limit' not in params or params['limit'] is None:
630 raise ValueError("Missing the required parameter `limit` when calling `search_events`") # noqa: E501
632 collection_formats = {}
634 path_params = {}
636 query_params = [('ii', 'fingerprint-pro-server-python-sdk/8.6.0-rc.0')]
637 if 'limit' in params:
638 query_params.append(('limit', params['limit'])) # noqa: E501
639 if 'pagination_key' in params:
640 query_params.append(('pagination_key', params['pagination_key'])) # noqa: E501
641 if 'visitor_id' in params:
642 query_params.append(('visitor_id', params['visitor_id'])) # noqa: E501
643 if 'bot' in params:
644 query_params.append(('bot', params['bot'])) # noqa: E501
645 if 'ip_address' in params:
646 query_params.append(('ip_address', params['ip_address'])) # noqa: E501
647 if 'linked_id' in params:
648 query_params.append(('linked_id', params['linked_id'])) # noqa: E501
649 if 'start' in params:
650 query_params.append(('start', params['start'])) # noqa: E501
651 if 'end' in params:
652 query_params.append(('end', params['end'])) # noqa: E501
653 if 'reverse' in params:
654 query_params.append(('reverse', params['reverse'])) # noqa: E501
655 if 'suspect' in params:
656 query_params.append(('suspect', params['suspect'])) # noqa: E501
657 if 'vpn' in params:
658 query_params.append(('vpn', params['vpn'])) # noqa: E501
659 if 'virtual_machine' in params:
660 query_params.append(('virtual_machine', params['virtual_machine'])) # noqa: E501
661 if 'tampering' in params:
662 query_params.append(('tampering', params['tampering'])) # noqa: E501
663 if 'anti_detect_browser' in params:
664 query_params.append(('anti_detect_browser', params['anti_detect_browser'])) # noqa: E501
665 if 'incognito' in params:
666 query_params.append(('incognito', params['incognito'])) # noqa: E501
667 if 'privacy_settings' in params:
668 query_params.append(('privacy_settings', params['privacy_settings'])) # noqa: E501
669 if 'jailbroken' in params:
670 query_params.append(('jailbroken', params['jailbroken'])) # noqa: E501
671 if 'frida' in params:
672 query_params.append(('frida', params['frida'])) # noqa: E501
673 if 'factory_reset' in params:
674 query_params.append(('factory_reset', params['factory_reset'])) # noqa: E501
675 if 'cloned_app' in params:
676 query_params.append(('cloned_app', params['cloned_app'])) # noqa: E501
677 if 'emulator' in params:
678 query_params.append(('emulator', params['emulator'])) # noqa: E501
679 if 'root_apps' in params:
680 query_params.append(('root_apps', params['root_apps'])) # noqa: E501
681 if 'vpn_confidence' in params:
682 query_params.append(('vpn_confidence', params['vpn_confidence'])) # noqa: E501
683 if 'min_suspect_score' in params:
684 query_params.append(('min_suspect_score', params['min_suspect_score'])) # noqa: E501
685 if 'ip_blocklist' in params:
686 query_params.append(('ip_blocklist', params['ip_blocklist'])) # noqa: E501
687 if 'datacenter' in params:
688 query_params.append(('datacenter', params['datacenter'])) # noqa: E501
690 header_params = {}
692 form_params = []
693 local_var_files = {}
695 body_params = None
696 # HTTP header `Accept`
697 header_params['Accept'] = self.api_client.select_header_accept(
698 ['application/json']) # noqa: E501
700 # Authentication setting
701 auth_settings = ['ApiKeyHeader', 'ApiKeyQuery'] # noqa: E501
703 try:
704 return self.api_client.call_api(
705 '/events/search', 'GET',
706 path_params,
707 query_params,
708 header_params,
709 body=body_params,
710 post_params=form_params,
711 files=local_var_files,
712 response_type='SearchEventsResponse', # noqa: E501
713 auth_settings=auth_settings,
714 async_req=params.get('async_req'),
715 _return_http_data_only=params.get('_return_http_data_only'),
716 _preload_content=params.get('_preload_content', True),
717 _request_timeout=params.get('_request_timeout'),
718 collection_formats=collection_formats)
719 except ApiException as e:
720 if e.status == 400:
721 error = self.api_client.deserialize(e, 'ErrorResponse', True)
722 raise extend_exception(e, error)
723 if e.status == 403:
724 error = self.api_client.deserialize(e, 'ErrorResponse', True)
725 raise extend_exception(e, error)
726 raise e
728 def update_event(self, body: EventsUpdateRequest, request_id: str, **kwargs) -> Union[None, AsyncResult[None]]: # noqa: E501
729 """Update an event with a given request ID # noqa: E501
731 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
732 This method makes a synchronous HTTP request by default. To make an
733 asynchronous HTTP request, please pass async_req=True
734 >>> thread = api.update_event(body, request_id, async_req=True)
735 >>> result = thread.get()
737 :param async_req bool
738 :param body: (required)
739 :param request_id: The unique event [identifier](https://dev.fingerprint.com/reference/get-function#requestid). (required)
740 :return: None
741 If the method is called asynchronously,
742 returns the request thread.
743 """
744 kwargs['_return_http_data_only'] = True
745 if kwargs.get('async_req'):
746 return self.update_event_with_http_info(body, request_id, **kwargs) # noqa: E501
747 else:
748 (data) = self.update_event_with_http_info(body, request_id, **kwargs) # noqa: E501
749 return data
751 def update_event_with_http_info(self, body: EventsUpdateRequest, request_id: str, **kwargs): # noqa: E501
752 """Update an event with a given request ID # noqa: E501
754 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
755 This method makes a synchronous HTTP request by default. To make an
756 asynchronous HTTP request, please pass async_req=True
757 >>> thread = api.update_event_with_http_info(body, request_id, async_req=True)
758 >>> result = thread.get()
760 :param async_req bool
761 :param EventsUpdateRequest body: (required)
762 :param str request_id: The unique event [identifier](https://dev.fingerprint.com/reference/get-function#requestid). (required)
763 :return: None
764 If the method is called asynchronously,
765 returns the request thread.
766 """
768 all_params = [
769 'body',
770 'request_id',
771 'async_req',
772 '_return_http_data_only',
773 '_preload_content',
774 '_request_timeout']
776 params = locals()
777 for key, val in params['kwargs'].items():
778 if key not in all_params:
779 raise TypeError(
780 "Got an unexpected keyword argument '%s'"
781 " to method update_event" % key
782 )
783 params[key] = val
784 del params['kwargs']
785 # verify the required parameter 'body' is set
786 if 'body' not in params or params['body'] is None:
787 raise ValueError("Missing the required parameter `body` when calling `update_event`") # noqa: E501
788 # verify the required parameter 'request_id' is set
789 if 'request_id' not in params or params['request_id'] is None:
790 raise ValueError("Missing the required parameter `request_id` when calling `update_event`") # noqa: E501
792 collection_formats = {}
794 path_params = {}
795 if 'request_id' in params:
796 path_params['request_id'] = params['request_id'] # noqa: E501
798 query_params = [('ii', 'fingerprint-pro-server-python-sdk/8.6.0-rc.0')]
800 header_params = {}
802 form_params = []
803 local_var_files = {}
805 body_params = None
806 if 'body' in params:
807 body_params = params['body']
808 # HTTP header `Accept`
809 header_params['Accept'] = self.api_client.select_header_accept(
810 ['application/json']) # noqa: E501
812 # HTTP header `Content-Type`
813 header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
814 ['application/json']) # noqa: E501
816 # Authentication setting
817 auth_settings = ['ApiKeyHeader', 'ApiKeyQuery'] # noqa: E501
819 try:
820 return self.api_client.call_api(
821 '/events/{request_id}', 'PUT',
822 path_params,
823 query_params,
824 header_params,
825 body=body_params,
826 post_params=form_params,
827 files=local_var_files,
828 response_type=None, # noqa: E501
829 auth_settings=auth_settings,
830 async_req=params.get('async_req'),
831 _return_http_data_only=params.get('_return_http_data_only'),
832 _preload_content=params.get('_preload_content', True),
833 _request_timeout=params.get('_request_timeout'),
834 collection_formats=collection_formats)
835 except ApiException as e:
836 if e.status == 400:
837 error = self.api_client.deserialize(e, 'ErrorResponse', True)
838 raise extend_exception(e, error)
839 if e.status == 403:
840 error = self.api_client.deserialize(e, 'ErrorResponse', True)
841 raise extend_exception(e, error)
842 if e.status == 404:
843 error = self.api_client.deserialize(e, 'ErrorResponse', True)
844 raise extend_exception(e, error)
845 if e.status == 409:
846 error = self.api_client.deserialize(e, 'ErrorResponse', True)
847 raise extend_exception(e, error)
848 raise e