Coverage for fingerprint_pro_server_api_sdk/api/fingerprint_api.py: 91%
347 statements
« prev ^ index » next coverage.py v7.10.6, created at 2025-09-15 16:20 +0000
« prev ^ index » next coverage.py v7.10.6, created at 2025-09-15 16:20 +0000
1# coding: utf-8
3"""
4 Fingerprint Server API
6 Fingerprint Server API allows you to search, update, and delete identification 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.11.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.11.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.11.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.11.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 :param developer_tools: Filter events by Developer Tools detection result. > Note: When using this parameter, only events with the `products.developerTools.data.result` property set to `true` or `false` are returned. Events without a `products.developerTools` Smart Signal result are left out of the response.
536 :param location_spoofing: Filter events by Location Spoofing detection result. > Note: When using this parameter, only events with the `products.locationSpoofing.data.result` property set to `true` or `false` are returned. Events without a `products.locationSpoofing` Smart Signal result are left out of the response.
537 :param mitm_attack: Filter events by MITM (Man-in-the-Middle) Attack detection result. > Note: When using this parameter, only events with the `products.mitmAttack.data.result` property set to `true` or `false` are returned. Events without a `products.mitmAttack` Smart Signal result are left out of the response.
538 :param proxy: Filter events by Proxy detection result. > Note: When using this parameter, only events with the `products.proxy.data.result` property set to `true` or `false` are returned. Events without a `products.proxy` Smart Signal result are left out of the response.
539 :param sdk_version: Filter events by a specific SDK version associated with the identification event. Example: `3.11.14`
540 :param sdk_platform: Filter events by the SDK Platform associated with the identification event. `js` - JavaScript agent (Web). `ios` - Apple iOS based devices. `android` - Android based devices.
541 :param environment: Filter for events by providing one or more environment IDs.
542 :param proximity_id: Filter events by the most precise Proximity ID provided by default. > Note: When using this parameter, only events with the `products.proximity.id` property matching the provided ID are returned. Events without a `products.proximity` result are left out of the response.
543 :param proximity_precision_radius: Filter events by Proximity Radius. > Note: When using this parameter, only events with the `products.proximity.precisionRadius` property set to a valid value are returned. Events without a `products.proximity` result are left out of the response.
544 :return: SearchEventsResponse
545 If the method is called asynchronously,
546 returns the request thread.
547 """
548 kwargs['_return_http_data_only'] = True
549 if kwargs.get('async_req'):
550 return self.search_events_with_http_info(limit, **kwargs) # noqa: E501
551 else:
552 (data) = self.search_events_with_http_info(limit, **kwargs) # noqa: E501
553 return data
555 def search_events_with_http_info(self, limit: int, **kwargs): # noqa: E501
556 """Get events via search # noqa: E501
558 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
559 This method makes a synchronous HTTP request by default. To make an
560 asynchronous HTTP request, please pass async_req=True
561 >>> thread = api.search_events_with_http_info(limit, async_req=True)
562 >>> result = thread.get()
564 :param async_req bool
565 :param int limit: Limit the number of events returned. (required)
566 :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`
567 :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`.
568 :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.
569 :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
570 :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.
571 :param int start: Filter events with a timestamp greater than the start time, in Unix time (milliseconds).
572 :param int end: Filter events with a timestamp smaller than the end time, in Unix time (milliseconds).
573 :param bool reverse: Sort events in reverse timestamp order.
574 :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.
575 :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.
576 :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.
577 :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.
578 :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.
579 :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.
580 :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.
581 :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.
582 :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.
583 :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.
584 :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.
585 :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.
586 :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.
587 :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.
588 :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.
589 :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.
590 :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.
591 :param bool developer_tools: Filter events by Developer Tools detection result. > Note: When using this parameter, only events with the `products.developerTools.data.result` property set to `true` or `false` are returned. Events without a `products.developerTools` Smart Signal result are left out of the response.
592 :param bool location_spoofing: Filter events by Location Spoofing detection result. > Note: When using this parameter, only events with the `products.locationSpoofing.data.result` property set to `true` or `false` are returned. Events without a `products.locationSpoofing` Smart Signal result are left out of the response.
593 :param bool mitm_attack: Filter events by MITM (Man-in-the-Middle) Attack detection result. > Note: When using this parameter, only events with the `products.mitmAttack.data.result` property set to `true` or `false` are returned. Events without a `products.mitmAttack` Smart Signal result are left out of the response.
594 :param bool proxy: Filter events by Proxy detection result. > Note: When using this parameter, only events with the `products.proxy.data.result` property set to `true` or `false` are returned. Events without a `products.proxy` Smart Signal result are left out of the response.
595 :param str sdk_version: Filter events by a specific SDK version associated with the identification event. Example: `3.11.14`
596 :param str sdk_platform: Filter events by the SDK Platform associated with the identification event. `js` - JavaScript agent (Web). `ios` - Apple iOS based devices. `android` - Android based devices.
597 :param list[str] environment: Filter for events by providing one or more environment IDs.
598 :param str proximity_id: Filter events by the most precise Proximity ID provided by default. > Note: When using this parameter, only events with the `products.proximity.id` property matching the provided ID are returned. Events without a `products.proximity` result are left out of the response.
599 :param int proximity_precision_radius: Filter events by Proximity Radius. > Note: When using this parameter, only events with the `products.proximity.precisionRadius` property set to a valid value are returned. Events without a `products.proximity` result are left out of the response.
600 :return: SearchEventsResponse
601 If the method is called asynchronously,
602 returns the request thread.
603 """
605 all_params = [
606 'limit',
607 'pagination_key',
608 'visitor_id',
609 'bot',
610 'ip_address',
611 'linked_id',
612 'start',
613 'end',
614 'reverse',
615 'suspect',
616 'vpn',
617 'virtual_machine',
618 'tampering',
619 'anti_detect_browser',
620 'incognito',
621 'privacy_settings',
622 'jailbroken',
623 'frida',
624 'factory_reset',
625 'cloned_app',
626 'emulator',
627 'root_apps',
628 'vpn_confidence',
629 'min_suspect_score',
630 'ip_blocklist',
631 'datacenter',
632 'developer_tools',
633 'location_spoofing',
634 'mitm_attack',
635 'proxy',
636 'sdk_version',
637 'sdk_platform',
638 'environment',
639 'proximity_id',
640 'proximity_precision_radius',
641 'async_req',
642 '_return_http_data_only',
643 '_preload_content',
644 '_request_timeout']
646 params = locals()
647 for key, val in params['kwargs'].items():
648 if key not in all_params:
649 raise TypeError(
650 "Got an unexpected keyword argument '%s'"
651 " to method search_events" % key
652 )
653 params[key] = val
654 del params['kwargs']
655 # verify the required parameter 'limit' is set
656 if 'limit' not in params or params['limit'] is None:
657 raise ValueError("Missing the required parameter `limit` when calling `search_events`") # noqa: E501
659 collection_formats = {}
661 path_params = {}
663 query_params = [('ii', 'fingerprint-pro-server-python-sdk/8.11.0')]
664 if 'limit' in params:
665 query_params.append(('limit', params['limit'])) # noqa: E501
666 if 'pagination_key' in params:
667 query_params.append(('pagination_key', params['pagination_key'])) # noqa: E501
668 if 'visitor_id' in params:
669 query_params.append(('visitor_id', params['visitor_id'])) # noqa: E501
670 if 'bot' in params:
671 query_params.append(('bot', params['bot'])) # noqa: E501
672 if 'ip_address' in params:
673 query_params.append(('ip_address', params['ip_address'])) # noqa: E501
674 if 'linked_id' in params:
675 query_params.append(('linked_id', params['linked_id'])) # noqa: E501
676 if 'start' in params:
677 query_params.append(('start', params['start'])) # noqa: E501
678 if 'end' in params:
679 query_params.append(('end', params['end'])) # noqa: E501
680 if 'reverse' in params:
681 query_params.append(('reverse', params['reverse'])) # noqa: E501
682 if 'suspect' in params:
683 query_params.append(('suspect', params['suspect'])) # noqa: E501
684 if 'vpn' in params:
685 query_params.append(('vpn', params['vpn'])) # noqa: E501
686 if 'virtual_machine' in params:
687 query_params.append(('virtual_machine', params['virtual_machine'])) # noqa: E501
688 if 'tampering' in params:
689 query_params.append(('tampering', params['tampering'])) # noqa: E501
690 if 'anti_detect_browser' in params:
691 query_params.append(('anti_detect_browser', params['anti_detect_browser'])) # noqa: E501
692 if 'incognito' in params:
693 query_params.append(('incognito', params['incognito'])) # noqa: E501
694 if 'privacy_settings' in params:
695 query_params.append(('privacy_settings', params['privacy_settings'])) # noqa: E501
696 if 'jailbroken' in params:
697 query_params.append(('jailbroken', params['jailbroken'])) # noqa: E501
698 if 'frida' in params:
699 query_params.append(('frida', params['frida'])) # noqa: E501
700 if 'factory_reset' in params:
701 query_params.append(('factory_reset', params['factory_reset'])) # noqa: E501
702 if 'cloned_app' in params:
703 query_params.append(('cloned_app', params['cloned_app'])) # noqa: E501
704 if 'emulator' in params:
705 query_params.append(('emulator', params['emulator'])) # noqa: E501
706 if 'root_apps' in params:
707 query_params.append(('root_apps', params['root_apps'])) # noqa: E501
708 if 'vpn_confidence' in params:
709 query_params.append(('vpn_confidence', params['vpn_confidence'])) # noqa: E501
710 if 'min_suspect_score' in params:
711 query_params.append(('min_suspect_score', params['min_suspect_score'])) # noqa: E501
712 if 'ip_blocklist' in params:
713 query_params.append(('ip_blocklist', params['ip_blocklist'])) # noqa: E501
714 if 'datacenter' in params:
715 query_params.append(('datacenter', params['datacenter'])) # noqa: E501
716 if 'developer_tools' in params:
717 query_params.append(('developer_tools', params['developer_tools'])) # noqa: E501
718 if 'location_spoofing' in params:
719 query_params.append(('location_spoofing', params['location_spoofing'])) # noqa: E501
720 if 'mitm_attack' in params:
721 query_params.append(('mitm_attack', params['mitm_attack'])) # noqa: E501
722 if 'proxy' in params:
723 query_params.append(('proxy', params['proxy'])) # noqa: E501
724 if 'sdk_version' in params:
725 query_params.append(('sdk_version', params['sdk_version'])) # noqa: E501
726 if 'sdk_platform' in params:
727 query_params.append(('sdk_platform', params['sdk_platform'])) # noqa: E501
728 if 'environment' in params:
729 query_params.append(('environment', params['environment'])) # noqa: E501
730 collection_formats['environment'] = 'multi' # noqa: E501
731 if 'proximity_id' in params:
732 query_params.append(('proximity_id', params['proximity_id'])) # noqa: E501
733 if 'proximity_precision_radius' in params:
734 query_params.append(('proximity_precision_radius', params['proximity_precision_radius'])) # noqa: E501
736 header_params = {}
738 form_params = []
739 local_var_files = {}
741 body_params = None
742 # HTTP header `Accept`
743 header_params['Accept'] = self.api_client.select_header_accept(
744 ['application/json']) # noqa: E501
746 # Authentication setting
747 auth_settings = ['ApiKeyHeader', 'ApiKeyQuery'] # noqa: E501
749 try:
750 return self.api_client.call_api(
751 '/events/search', 'GET',
752 path_params,
753 query_params,
754 header_params,
755 body=body_params,
756 post_params=form_params,
757 files=local_var_files,
758 response_type='SearchEventsResponse', # noqa: E501
759 auth_settings=auth_settings,
760 async_req=params.get('async_req'),
761 _return_http_data_only=params.get('_return_http_data_only'),
762 _preload_content=params.get('_preload_content', True),
763 _request_timeout=params.get('_request_timeout'),
764 collection_formats=collection_formats)
765 except ApiException as e:
766 if e.status == 400:
767 error = self.api_client.deserialize(e, 'ErrorResponse', True)
768 raise extend_exception(e, error)
769 if e.status == 403:
770 error = self.api_client.deserialize(e, 'ErrorResponse', True)
771 raise extend_exception(e, error)
772 raise e
774 def update_event(self, body: EventsUpdateRequest, request_id: str, **kwargs) -> Union[None, AsyncResult[None]]: # noqa: E501
775 """Update an event with a given request ID # noqa: E501
777 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
778 This method makes a synchronous HTTP request by default. To make an
779 asynchronous HTTP request, please pass async_req=True
780 >>> thread = api.update_event(body, request_id, async_req=True)
781 >>> result = thread.get()
783 :param async_req bool
784 :param body: (required)
785 :param request_id: The unique event [identifier](https://dev.fingerprint.com/reference/get-function#requestid). (required)
786 :return: None
787 If the method is called asynchronously,
788 returns the request thread.
789 """
790 kwargs['_return_http_data_only'] = True
791 if kwargs.get('async_req'):
792 return self.update_event_with_http_info(body, request_id, **kwargs) # noqa: E501
793 else:
794 (data) = self.update_event_with_http_info(body, request_id, **kwargs) # noqa: E501
795 return data
797 def update_event_with_http_info(self, body: EventsUpdateRequest, request_id: str, **kwargs): # noqa: E501
798 """Update an event with a given request ID # noqa: E501
800 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
801 This method makes a synchronous HTTP request by default. To make an
802 asynchronous HTTP request, please pass async_req=True
803 >>> thread = api.update_event_with_http_info(body, request_id, async_req=True)
804 >>> result = thread.get()
806 :param async_req bool
807 :param EventsUpdateRequest body: (required)
808 :param str request_id: The unique event [identifier](https://dev.fingerprint.com/reference/get-function#requestid). (required)
809 :return: None
810 If the method is called asynchronously,
811 returns the request thread.
812 """
814 all_params = [
815 'body',
816 'request_id',
817 'async_req',
818 '_return_http_data_only',
819 '_preload_content',
820 '_request_timeout']
822 params = locals()
823 for key, val in params['kwargs'].items():
824 if key not in all_params:
825 raise TypeError(
826 "Got an unexpected keyword argument '%s'"
827 " to method update_event" % key
828 )
829 params[key] = val
830 del params['kwargs']
831 # verify the required parameter 'body' is set
832 if 'body' not in params or params['body'] is None:
833 raise ValueError("Missing the required parameter `body` when calling `update_event`") # noqa: E501
834 # verify the required parameter 'request_id' is set
835 if 'request_id' not in params or params['request_id'] is None:
836 raise ValueError("Missing the required parameter `request_id` when calling `update_event`") # noqa: E501
838 collection_formats = {}
840 path_params = {}
841 if 'request_id' in params:
842 path_params['request_id'] = params['request_id'] # noqa: E501
844 query_params = [('ii', 'fingerprint-pro-server-python-sdk/8.11.0')]
846 header_params = {}
848 form_params = []
849 local_var_files = {}
851 body_params = None
852 if 'body' in params:
853 body_params = params['body']
854 # HTTP header `Accept`
855 header_params['Accept'] = self.api_client.select_header_accept(
856 ['application/json']) # noqa: E501
858 # HTTP header `Content-Type`
859 header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
860 ['application/json']) # noqa: E501
862 # Authentication setting
863 auth_settings = ['ApiKeyHeader', 'ApiKeyQuery'] # noqa: E501
865 try:
866 return self.api_client.call_api(
867 '/events/{request_id}', 'PUT',
868 path_params,
869 query_params,
870 header_params,
871 body=body_params,
872 post_params=form_params,
873 files=local_var_files,
874 response_type=None, # noqa: E501
875 auth_settings=auth_settings,
876 async_req=params.get('async_req'),
877 _return_http_data_only=params.get('_return_http_data_only'),
878 _preload_content=params.get('_preload_content', True),
879 _request_timeout=params.get('_request_timeout'),
880 collection_formats=collection_formats)
881 except ApiException as e:
882 if e.status == 400:
883 error = self.api_client.deserialize(e, 'ErrorResponse', True)
884 raise extend_exception(e, error)
885 if e.status == 403:
886 error = self.api_client.deserialize(e, 'ErrorResponse', True)
887 raise extend_exception(e, error)
888 if e.status == 404:
889 error = self.api_client.deserialize(e, 'ErrorResponse', True)
890 raise extend_exception(e, error)
891 if e.status == 409:
892 error = self.api_client.deserialize(e, 'ErrorResponse', True)
893 raise extend_exception(e, error)
894 raise e