Skip to content

Commit 2ce9734

Browse files
committed
feat: update OpenAPI schema
1 parent 4758d78 commit 2ce9734

14 files changed

+577
-0
lines changed

.changeset/forty-seas-prove.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'fingerprint-pro-server-api-python-sdk': minor
3+
---
4+
5+
Add `relay` detection method to the VPN Detection Smart Signal

.changeset/good-experts-watch.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'fingerprint-pro-server-api-python-sdk': minor
3+
---
4+
5+
**events-search**: Add a new `events/search` API endpoint. Allow users to search for identification events matching one or more search criteria, for example, visitor ID, IP address, bot detection result, etc.

.changeset/orange-poets-drive.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'fingerprint-pro-server-api-python-sdk': minor
3+
---
4+
5+
**events**: Add a `suspect` field to the `identification` product schema

.changeset/pre.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"mode": "pre",
3+
"tag": "rc",
4+
"initialVersions": {
5+
"fingerprint-pro-server-api-python-sdk": "8.2.1"
6+
},
7+
"changesets": []
8+
}

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ Class | Method | HTTP request | Description
256256
*FingerprintApi* | [**get_event**](docs/FingerprintApi.md#get_event) | **GET** /events/{request_id} | Get event by request ID
257257
*FingerprintApi* | [**get_related_visitors**](docs/FingerprintApi.md#get_related_visitors) | **GET** /related-visitors | Get Related Visitors
258258
*FingerprintApi* | [**get_visits**](docs/FingerprintApi.md#get_visits) | **GET** /visitors/{visitor_id} | Get visits by visitor ID
259+
*FingerprintApi* | [**search_events**](docs/FingerprintApi.md#search_events) | **GET** /events/search | Get events via search
259260
*FingerprintApi* | [**update_event**](docs/FingerprintApi.md#update_event) | **PUT** /events/{request_id} | Update an event with a given request ID
260261

261262
## Documentation For Models
@@ -330,6 +331,8 @@ Class | Method | HTTP request | Description
330331
- [RelatedVisitorsResponse](docs/RelatedVisitorsResponse.md)
331332
- [RemoteControl](docs/RemoteControl.md)
332333
- [RootApps](docs/RootApps.md)
334+
- [SearchEventsResponse](docs/SearchEventsResponse.md)
335+
- [SearchEventsResponseEvents](docs/SearchEventsResponseEvents.md)
333336
- [SuspectScore](docs/SuspectScore.md)
334337
- [Tag](docs/Tag.md)
335338
- [Tampering](docs/Tampering.md)

docs/FingerprintApi.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Method | HTTP request | Description
88
[**get_event**](FingerprintApi.md#get_event) | **GET** /events/{request_id} | Get event by request ID
99
[**get_related_visitors**](FingerprintApi.md#get_related_visitors) | **GET** /related-visitors | Get Related Visitors
1010
[**get_visits**](FingerprintApi.md#get_visits) | **GET** /visitors/{visitor_id} | Get visits by visitor ID
11+
[**search_events**](FingerprintApi.md#search_events) | **GET** /events/search | Get events via search
1112
[**update_event**](FingerprintApi.md#update_event) | **PUT** /events/{request_id} | Update an event with a given request ID
1213

1314
# **delete_visitor_data**
@@ -219,6 +220,72 @@ Name | Type | Description | Notes
219220

220221
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
221222

223+
# **search_events**
224+
> SearchEventsResponse search_events(limit, visitor_id=visitor_id, bot=bot, ip_address=ip_address, linked_id=linked_id, start=start, end=end, reverse=reverse, suspect=suspect)
225+
226+
Get events via search
227+
228+
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.
229+
230+
### Example
231+
```python
232+
import fingerprint_pro_server_api_sdk
233+
from fingerprint_pro_server_api_sdk.rest import ApiException
234+
235+
# Configure API key authorization and region
236+
configuration = fingerprint_pro_server_api_sdk.Configuration(api_key="SECRET_API_KEY")
237+
# configuration = fingerprint_pro_server_api_sdk.Configuration(api_key="SECRET_API_KEY", region="eu")
238+
239+
# create an instance of the API class
240+
api_instance = fingerprint_pro_server_api_sdk.FingerprintApi(configuration)
241+
242+
limit = 56 # int | Limit the number of events returned.
243+
visitor_id = 'visitor_id_example' # str | Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Pro. Filter for events matching this `visitor_id`. (optional)
244+
bot = 'bot_example' # str | 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. (optional)
245+
ip_address = 'ip_address_example' # str | 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 (optional)
246+
linked_id = 'linked_id_example' # str | 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. (optional)
247+
start = 789 # int | Filter events with a timestamp greater than the start time, in Unix time (milliseconds). (optional)
248+
end = 789 # int | Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). (optional)
249+
reverse = true # bool | Sort events in reverse timestamp order. (optional)
250+
suspect = true # bool | Filter events previously tagged as suspicious via the [Update API](https://dev.fingerprint.com/reference/updateevent). (optional)
251+
252+
try:
253+
# Get events via search
254+
api_response = api_instance.search_events(limit, visitor_id=visitor_id, bot=bot, ip_address=ip_address, linked_id=linked_id, start=start, end=end, reverse=reverse, suspect=suspect)
255+
print(api_response)
256+
except ApiException as e:
257+
print("Exception when calling FingerprintApi->search_events: %s\n" % e)
258+
```
259+
260+
### Parameters
261+
262+
Name | Type | Description | Notes
263+
------------- | ------------- | ------------- | -------------
264+
**limit** | **int**| Limit the number of events returned. |
265+
**visitor_id** | **str**| Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Pro. Filter for events matching this `visitor_id`. | [optional]
266+
**bot** | **str**| 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. | [optional]
267+
**ip_address** | **str**| 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 | [optional]
268+
**linked_id** | **str**| 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. | [optional]
269+
**start** | **int**| Filter events with a timestamp greater than the start time, in Unix time (milliseconds). | [optional]
270+
**end** | **int**| Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). | [optional]
271+
**reverse** | **bool**| Sort events in reverse timestamp order. | [optional]
272+
**suspect** | **bool**| Filter events previously tagged as suspicious via the [Update API](https://dev.fingerprint.com/reference/updateevent). | [optional]
273+
274+
### Return type
275+
276+
[**SearchEventsResponse**](SearchEventsResponse.md)
277+
278+
### Authorization
279+
280+
[ApiKeyHeader](../README.md#ApiKeyHeader), [ApiKeyQuery](../README.md#ApiKeyQuery)
281+
282+
### HTTP request headers
283+
284+
- **Content-Type**: Not defined
285+
- **Accept**: application/json
286+
287+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
288+
222289
# **update_event**
223290
> update_event(body, request_id)
224291

docs/SearchEventsResponse.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# SearchEventsResponse
2+
Contains a list of all identification events matching the specified search criteria.
3+
4+
5+
## Properties
6+
Name | Type | Description | Notes
7+
------------ | ------------- | ------------- | -------------
8+
**events** | [**list[SearchEventsResponseEvents]**](SearchEventsResponseEvents.md) | | [optional]
9+
**pagination_key** | **str** | | [optional]
10+
11+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
12+

docs/SearchEventsResponseEvents.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# SearchEventsResponseEvents
2+
Device intelligence results for the identification event.
3+
4+
5+
## Properties
6+
Name | Type | Description | Notes
7+
------------ | ------------- | ------------- | -------------
8+
**products** | [**Products**](Products.md) | |
9+
10+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
11+

fingerprint_pro_server_api_sdk/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@
9090
from fingerprint_pro_server_api_sdk.models.related_visitors_response import RelatedVisitorsResponse
9191
from fingerprint_pro_server_api_sdk.models.remote_control import RemoteControl
9292
from fingerprint_pro_server_api_sdk.models.root_apps import RootApps
93+
from fingerprint_pro_server_api_sdk.models.search_events_response import SearchEventsResponse
94+
from fingerprint_pro_server_api_sdk.models.search_events_response_events import SearchEventsResponseEvents
9395
from fingerprint_pro_server_api_sdk.models.suspect_score import SuspectScore
9496
from fingerprint_pro_server_api_sdk.models.tag import Tag
9597
from fingerprint_pro_server_api_sdk.models.tampering import Tampering

fingerprint_pro_server_api_sdk/api/fingerprint_api.py

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
from fingerprint_pro_server_api_sdk.models.events_get_response import EventsGetResponse # noqa: F401
2525
from fingerprint_pro_server_api_sdk.models.events_update_request import EventsUpdateRequest # noqa: F401
2626
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
2728
from fingerprint_pro_server_api_sdk.models.visitors_get_response import VisitorsGetResponse # noqa: F401
2829

2930

@@ -495,6 +496,150 @@ def get_visits_with_http_info(self, visitor_id: str, **kwargs): # noqa: E501
495496
raise extend_exception(e, error)
496497
raise e
497498

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+
498643
def update_event(self, body: EventsUpdateRequest, request_id: str, **kwargs) -> Union[None, AsyncResult[None]]: # noqa: E501
499644
"""Update an event with a given request ID # noqa: E501
500645

0 commit comments

Comments
 (0)