|
24 | 24 | from fingerprint_pro_server_api_sdk.models.events_get_response import EventsGetResponse # noqa: F401
|
25 | 25 | from fingerprint_pro_server_api_sdk.models.events_update_request import EventsUpdateRequest # noqa: F401
|
26 | 26 | from fingerprint_pro_server_api_sdk.models.related_visitors_response import RelatedVisitorsResponse # noqa: F401
|
| 27 | +from fingerprint_pro_server_api_sdk.models.search_events_response import SearchEventsResponse # noqa: F401 |
27 | 28 | from fingerprint_pro_server_api_sdk.models.visitors_get_response import VisitorsGetResponse # noqa: F401
|
28 | 29 |
|
29 | 30 |
|
@@ -495,6 +496,150 @@ def get_visits_with_http_info(self, visitor_id: str, **kwargs): # noqa: E501
|
495 | 496 | raise extend_exception(e, error)
|
496 | 497 | raise e
|
497 | 498 |
|
| 499 | + def search_events(self, limit: int, **kwargs) -> Union[SearchEventsResponse, AsyncResult[SearchEventsResponse]]: # noqa: E501 |
| 500 | + """Get events via search # noqa: E501 |
| 501 | +
|
| 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() |
| 507 | +
|
| 508 | + :param async_req bool |
| 509 | + :param limit: Limit the number of events returned. (required) |
| 510 | + :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`. |
| 511 | + :param bot: Filter events by the bot detection result, specifically: - events where any kind of bot was detected. - events where a good bot was detected. - events where a bad bot was detected. - events where no bot was detected. |
| 512 | + :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 |
| 513 | + :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. |
| 514 | + :param start: Filter events with a timestamp greater than the start time, in Unix time (milliseconds). |
| 515 | + :param end: Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). |
| 516 | + :param reverse: Sort events in reverse timestamp order. |
| 517 | + :param suspect: Filter events previously tagged as suspicious via the [Update API](https://dev.fingerprint.com/reference/updateevent). |
| 518 | + :return: SearchEventsResponse |
| 519 | + If the method is called asynchronously, |
| 520 | + returns the request thread. |
| 521 | + """ |
| 522 | + kwargs['_return_http_data_only'] = True |
| 523 | + if kwargs.get('async_req'): |
| 524 | + return self.search_events_with_http_info(limit, **kwargs) # noqa: E501 |
| 525 | + else: |
| 526 | + (data) = self.search_events_with_http_info(limit, **kwargs) # noqa: E501 |
| 527 | + return data |
| 528 | + |
| 529 | + def search_events_with_http_info(self, limit: int, **kwargs): # noqa: E501 |
| 530 | + """Get events via search # noqa: E501 |
| 531 | +
|
| 532 | + 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 |
| 533 | + This method makes a synchronous HTTP request by default. To make an |
| 534 | + asynchronous HTTP request, please pass async_req=True |
| 535 | + >>> thread = api.search_events_with_http_info(limit, async_req=True) |
| 536 | + >>> result = thread.get() |
| 537 | +
|
| 538 | + :param async_req bool |
| 539 | + :param int limit: Limit the number of events returned. (required) |
| 540 | + :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`. |
| 541 | + :param str bot: Filter events by the bot detection result, specifically: - events where any kind of bot was detected. - events where a good bot was detected. - events where a bad bot was detected. - events where no bot was detected. |
| 542 | + :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 |
| 543 | + :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. |
| 544 | + :param int start: Filter events with a timestamp greater than the start time, in Unix time (milliseconds). |
| 545 | + :param int end: Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). |
| 546 | + :param bool reverse: Sort events in reverse timestamp order. |
| 547 | + :param bool suspect: Filter events previously tagged as suspicious via the [Update API](https://dev.fingerprint.com/reference/updateevent). |
| 548 | + :return: SearchEventsResponse |
| 549 | + If the method is called asynchronously, |
| 550 | + returns the request thread. |
| 551 | + """ |
| 552 | + |
| 553 | + all_params = [ |
| 554 | + 'limit', |
| 555 | + 'visitor_id', |
| 556 | + 'bot', |
| 557 | + 'ip_address', |
| 558 | + 'linked_id', |
| 559 | + 'start', |
| 560 | + 'end', |
| 561 | + 'reverse', |
| 562 | + 'suspect', |
| 563 | + 'async_req', |
| 564 | + '_return_http_data_only', |
| 565 | + '_preload_content', |
| 566 | + '_request_timeout'] |
| 567 | + |
| 568 | + params = locals() |
| 569 | + for key, val in params['kwargs'].items(): |
| 570 | + if key not in all_params: |
| 571 | + raise TypeError( |
| 572 | + "Got an unexpected keyword argument '%s'" |
| 573 | + " to method search_events" % key |
| 574 | + ) |
| 575 | + params[key] = val |
| 576 | + del params['kwargs'] |
| 577 | + # verify the required parameter 'limit' is set |
| 578 | + if 'limit' not in params or params['limit'] is None: |
| 579 | + raise ValueError("Missing the required parameter `limit` when calling `search_events`") # noqa: E501 |
| 580 | + |
| 581 | + collection_formats = {} |
| 582 | + |
| 583 | + path_params = {} |
| 584 | + |
| 585 | + query_params = [('ii', 'fingerprint-pro-server-python-sdk/8.2.1')] |
| 586 | + if 'limit' in params: |
| 587 | + query_params.append(('limit', params['limit'])) # noqa: E501 |
| 588 | + if 'visitor_id' in params: |
| 589 | + query_params.append(('visitor_id', params['visitor_id'])) # noqa: E501 |
| 590 | + if 'bot' in params: |
| 591 | + query_params.append(('bot', params['bot'])) # noqa: E501 |
| 592 | + if 'ip_address' in params: |
| 593 | + query_params.append(('ip_address', params['ip_address'])) # noqa: E501 |
| 594 | + if 'linked_id' in params: |
| 595 | + query_params.append(('linked_id', params['linked_id'])) # noqa: E501 |
| 596 | + if 'start' in params: |
| 597 | + query_params.append(('start', params['start'])) # noqa: E501 |
| 598 | + if 'end' in params: |
| 599 | + query_params.append(('end', params['end'])) # noqa: E501 |
| 600 | + if 'reverse' in params: |
| 601 | + query_params.append(('reverse', params['reverse'])) # noqa: E501 |
| 602 | + if 'suspect' in params: |
| 603 | + query_params.append(('suspect', params['suspect'])) # noqa: E501 |
| 604 | + |
| 605 | + header_params = {} |
| 606 | + |
| 607 | + form_params = [] |
| 608 | + local_var_files = {} |
| 609 | + |
| 610 | + body_params = None |
| 611 | + # HTTP header `Accept` |
| 612 | + header_params['Accept'] = self.api_client.select_header_accept( |
| 613 | + ['application/json']) # noqa: E501 |
| 614 | + |
| 615 | + # Authentication setting |
| 616 | + auth_settings = ['ApiKeyHeader', 'ApiKeyQuery'] # noqa: E501 |
| 617 | + |
| 618 | + try: |
| 619 | + return self.api_client.call_api( |
| 620 | + '/events/search', 'GET', |
| 621 | + path_params, |
| 622 | + query_params, |
| 623 | + header_params, |
| 624 | + body=body_params, |
| 625 | + post_params=form_params, |
| 626 | + files=local_var_files, |
| 627 | + response_type='SearchEventsResponse', # noqa: E501 |
| 628 | + auth_settings=auth_settings, |
| 629 | + async_req=params.get('async_req'), |
| 630 | + _return_http_data_only=params.get('_return_http_data_only'), |
| 631 | + _preload_content=params.get('_preload_content', True), |
| 632 | + _request_timeout=params.get('_request_timeout'), |
| 633 | + collection_formats=collection_formats) |
| 634 | + except ApiException as e: |
| 635 | + if e.status == 400: |
| 636 | + error = self.api_client.deserialize(e, 'ErrorResponse', True) |
| 637 | + raise extend_exception(e, error) |
| 638 | + if e.status == 403: |
| 639 | + error = self.api_client.deserialize(e, 'ErrorResponse', True) |
| 640 | + raise extend_exception(e, error) |
| 641 | + raise e |
| 642 | + |
498 | 643 | def update_event(self, body: EventsUpdateRequest, request_id: str, **kwargs) -> Union[None, AsyncResult[None]]: # noqa: E501
|
499 | 644 | """Update an event with a given request ID # noqa: E501
|
500 | 645 |
|
|
0 commit comments