Skip to content

Commit

Permalink
Merge pull request #56 from fingerprintjs/update-schema-INTER-773
Browse files Browse the repository at this point in the history
Update schema
  • Loading branch information
ilfa authored Jul 23, 2024
2 parents f3eab65 + 2a23750 commit 901f2f3
Show file tree
Hide file tree
Showing 150 changed files with 4,368 additions and 210 deletions.
4 changes: 3 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
PRIVATE_KEY=<SECRET_API_KEY>
REQUEST_ID=<REQUEST_ID>
VISITOR_ID=<VISITOR_ID>
VISITOR_ID_TO_DELETE=<VISITOR_ID_TO_DELETE> # for delete visitor example
REQUEST_ID_TO_UPDATE=<REQUEST_ID_TO_UPDATE> # for update event example
# put 'eu' or 'ap' if necessary, 'us' is default
REGION=<REGION>
REGION=<REGION>
4 changes: 2 additions & 2 deletions .swagger-codegen-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
git_push.sh
tox.ini
test/*.py
fingerprint_pro_server_api_sdk/models/many_requests_response.py
fingerprint_pro_server_api_sdk/models/too_many_requests_response.py
requirements.txt
test-requirements.txt
test-requirements.txt
90 changes: 76 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ from fingerprint_pro_server_api_sdk.rest import ApiException, KnownApiException
configuration = fingerprint_pro_server_api_sdk.Configuration(api_key="SECRET_API_KEY")
api_instance = fingerprint_pro_server_api_sdk.FingerprintApi(configuration)

visitor_id = 'visitor_id_example' # str |
#request_id = 'request_id_example' # str | Filter events by requestId (optional)
#linked_id = 'linked_id_example' # str | Filter events by custom identifier (optional)
limit = 10 # int | Limit scanned results (optional)
#before = 56 # int | Used to paginate results (optional)
visitor_id = 'visitor_id_example' # str | Unique [visitor identifier](https://dev.fingerprint.com/docs/js-agent#visitorid) issued by Fingerprint Pro.
#request_id = 'request_id_example' # str | The unique event [identifier](https://dev.fingerprint.com/docs/js-agent#requestid).
#linked_id = 'linked_id_example' # str | Filter visits by your custom identifier. You can use [`linkedId`](https://dev.fingerprint.com/docs/js-agent#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)
limit = 10 # int | 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. (optional)
#pagination_key = 'pagination_key_example' # str | 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. (optional)

try:
api_response: Response = api_instance.get_visits(visitor_id, limit=2)
Expand All @@ -108,7 +108,26 @@ except KnownApiException as e:
structured_error = e.structured_error
print("Error: %s\n" % structured_error.error)
except ApiException as e:
print("Exception when calling DefaultApi->visitors_visitor_id_get: %s\n" % e)
print("Exception when calling FingerprintApi->visitors_visitor_id_get: %s\n" % e)
```

Delete visits using visitorId:
```python
import fingerprint_pro_server_api_sdk
from fingerprint_pro_server_api_sdk.rest import ApiException, KnownApiException

configuration = fingerprint_pro_server_api_sdk.Configuration(api_key="SECRET_API_KEY")
api_instance = fingerprint_pro_server_api_sdk.FingerprintApi(configuration)

visitor_id = 'visitor_id_example' # str | Unique [visitor identifier](https://dev.fingerprint.com/docs/js-agent#visitorid) issued by Fingerprint Pro.

try:
api_instance.delete_visitor_data(visitor_id)
except KnownApiException as e:
structured_error = e.structured_error
print("Error: %s\n" % structured_error.error)
except ApiException as e:
print("Exception when calling FingerprintApi->delete_visitor_data: %s\n" % e)
```

Fetching events for requestId:
Expand All @@ -120,7 +139,7 @@ from fingerprint_pro_server_api_sdk.rest import ApiException, KnownApiException
configuration = fingerprint_pro_server_api_sdk.Configuration(api_key="SECRET_API_KEY")
api_instance = fingerprint_pro_server_api_sdk.FingerprintApi(configuration)

request_id = 'request_id_example' # str
request_id = 'request_id_example' # str | The unique event [identifier](https://dev.fingerprint.com/docs/js-agent#requestid).

try:
events_response: EventResponse = api_instance.get_event(request_id)
Expand All @@ -129,7 +148,31 @@ except KnownApiException as e:
structured_error = e.structured_error
print("Error code: %s. Error message: %s\n" % (structured_error.error.code, structured_error.error.message))
except ApiException as e:
print("Exception when calling DefaultApi->get_event: %s\n" % e)
print("Exception when calling FingerprintApi->get_event: %s\n" % e)
```

Update event for requestId:
```python
import fingerprint_pro_server_api_sdk
from fingerprint_pro_server_api_sdk import EventUpdateRequest
from fingerprint_pro_server_api_sdk.rest import ApiException, KnownApiException

configuration = fingerprint_pro_server_api_sdk.Configuration(api_key="SECRET_API_KEY")
api_instance = fingerprint_pro_server_api_sdk.FingerprintApi(configuration)

request_id = 'request_id_example' # str | The unique event [identifier](https://dev.fingerprint.com/docs/js-agent#requestid).
body = EventUpdateRequest(linked_id='foo') # EventUpdateRequest |
# body = EventUpdateRequest(tag={'bar': 123})
# body = EventUpdateRequest(suspect=True)
# body = EventUpdateRequest(linked_id='foo', tag={'bar': 123}, suspect=False)

try:
api_instance.update_event(request_id, body)
except KnownApiException as e:
structured_error = e.structured_error
print("Error code: %s. Error message: %s\n" % (structured_error.error.code, structured_error.error.message))
except ApiException as e:
print("Exception when calling FingerprintApi->update_event: %s\n" % e)
```

## Sealed results
Expand Down Expand Up @@ -168,8 +211,10 @@ All URIs are relative to *https://api.fpjs.io*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*FingerprintApi* | [**get_event**](docs/FingerprintApi.md#get_event) | **GET** /events/{request_id} | Get event by requestId
*FingerprintApi* | [**get_visits**](docs/FingerprintApi.md#get_visits) | **GET** /visitors/{visitor_id} | Get visits by visitorId
*FingerprintApi* | [**delete_visitor_data**](docs/FingerprintApi.md#delete_visitor_data) | **DELETE** /visitors/{visitor_id} | Delete data by visitor ID
*FingerprintApi* | [**get_event**](docs/FingerprintApi.md#get_event) | **GET** /events/{request_id} | Get event by request ID
*FingerprintApi* | [**get_visits**](docs/FingerprintApi.md#get_visits) | **GET** /visitors/{visitor_id} | Get visits by visitor ID
*FingerprintApi* | [**update_event**](docs/FingerprintApi.md#update_event) | **PUT** /events/{request_id} | Update an event with a given request ID

## Documentation For Models

Expand All @@ -178,17 +223,28 @@ Class | Method | HTTP request | Description
- [BotdResult](docs/BotdResult.md)
- [BrowserDetails](docs/BrowserDetails.md)
- [ClonedAppResult](docs/ClonedAppResult.md)
- [Common403ErrorResponse](docs/Common403ErrorResponse.md)
- [Confidence](docs/Confidence.md)
- [DataCenter](docs/DataCenter.md)
- [DeprecatedIPLocation](docs/DeprecatedIPLocation.md)
- [DeprecatedIPLocationCity](docs/DeprecatedIPLocationCity.md)
- [EmulatorResult](docs/EmulatorResult.md)
- [ErrorEvent403Response](docs/ErrorEvent403Response.md)
- [ErrorEvent403ResponseError](docs/ErrorEvent403ResponseError.md)
- [ErrorCommon403Response](docs/ErrorCommon403Response.md)
- [ErrorCommon429Response](docs/ErrorCommon429Response.md)
- [ErrorCommon429ResponseError](docs/ErrorCommon429ResponseError.md)
- [ErrorEvent404Response](docs/ErrorEvent404Response.md)
- [ErrorEvent404ResponseError](docs/ErrorEvent404ResponseError.md)
- [ErrorUpdateEvent400Response](docs/ErrorUpdateEvent400Response.md)
- [ErrorUpdateEvent400ResponseError](docs/ErrorUpdateEvent400ResponseError.md)
- [ErrorUpdateEvent409Response](docs/ErrorUpdateEvent409Response.md)
- [ErrorUpdateEvent409ResponseError](docs/ErrorUpdateEvent409ResponseError.md)
- [ErrorVisitor400Response](docs/ErrorVisitor400Response.md)
- [ErrorVisitor400ResponseError](docs/ErrorVisitor400ResponseError.md)
- [ErrorVisitor404Response](docs/ErrorVisitor404Response.md)
- [ErrorVisitor404ResponseError](docs/ErrorVisitor404ResponseError.md)
- [ErrorVisits403](docs/ErrorVisits403.md)
- [EventResponse](docs/EventResponse.md)
- [EventUpdateRequest](docs/EventUpdateRequest.md)
- [FactoryResetResult](docs/FactoryResetResult.md)
- [FridaResult](docs/FridaResult.md)
- [HighActivityResult](docs/HighActivityResult.md)
Expand All @@ -204,7 +260,6 @@ Class | Method | HTTP request | Description
- [JailbrokenResult](docs/JailbrokenResult.md)
- [Location](docs/Location.md)
- [LocationSpoofingResult](docs/LocationSpoofingResult.md)
- [ManyRequestsResponse](docs/ManyRequestsResponse.md)
- [PrivacySettingsResult](docs/PrivacySettingsResult.md)
- [ProductError](docs/ProductError.md)
- [ProductsResponse](docs/ProductsResponse.md)
Expand All @@ -213,6 +268,7 @@ Class | Method | HTTP request | Description
- [ProductsResponseIdentificationData](docs/ProductsResponseIdentificationData.md)
- [ProxyResult](docs/ProxyResult.md)
- [RawDeviceAttributesResult](docs/RawDeviceAttributesResult.md)
- [RemoteControlResult](docs/RemoteControlResult.md)
- [Response](docs/Response.md)
- [ResponseVisits](docs/ResponseVisits.md)
- [RootAppsResult](docs/RootAppsResult.md)
Expand All @@ -230,16 +286,22 @@ Class | Method | HTTP request | Description
- [SignalResponsePrivacySettings](docs/SignalResponsePrivacySettings.md)
- [SignalResponseProxy](docs/SignalResponseProxy.md)
- [SignalResponseRawDeviceAttributes](docs/SignalResponseRawDeviceAttributes.md)
- [SignalResponseRemoteControl](docs/SignalResponseRemoteControl.md)
- [SignalResponseRootApps](docs/SignalResponseRootApps.md)
- [SignalResponseSuspectScore](docs/SignalResponseSuspectScore.md)
- [SignalResponseTampering](docs/SignalResponseTampering.md)
- [SignalResponseTor](docs/SignalResponseTor.md)
- [SignalResponseVelocity](docs/SignalResponseVelocity.md)
- [SignalResponseVirtualMachine](docs/SignalResponseVirtualMachine.md)
- [SignalResponseVpn](docs/SignalResponseVpn.md)
- [Subdivision](docs/Subdivision.md)
- [SuspectScoreResult](docs/SuspectScoreResult.md)
- [TamperingResult](docs/TamperingResult.md)
- [TooManyRequestsResponse](docs/TooManyRequestsResponse.md)
- [TorResult](docs/TorResult.md)
- [VelocityIntervalResult](docs/VelocityIntervalResult.md)
- [VelocityIntervals](docs/VelocityIntervals.md)
- [VelocityResult](docs/VelocityResult.md)
- [VirtualMachineResult](docs/VirtualMachineResult.md)
- [Visit](docs/Visit.md)
- [VpnResult](docs/VpnResult.md)
Expand Down Expand Up @@ -274,4 +336,4 @@ If you need private support, you can email us at [[email protected]](m

## License

This project is licensed under the [MIT License](https://github.com/fingerprintjs/fingerprint-pro-server-api-python-sdk/blob/main/LICENSE).
This project is licensed under the [MIT License](https://github.com/fingerprintjs/fingerprint-pro-server-api-python-sdk/blob/main/LICENSE).
2 changes: 1 addition & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] };
module.exports = { extends: ['@fingerprintjs/commit-lint-dx-team'] };
26 changes: 26 additions & 0 deletions delete_visitor_example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import os

import fingerprint_pro_server_api_sdk
from fingerprint_pro_server_api_sdk.rest import ApiException

from dotenv import load_dotenv

load_dotenv()

# configure
configuration = fingerprint_pro_server_api_sdk.Configuration(
api_key=os.environ["PRIVATE_KEY"], region=os.environ.get("REGION", "us"))

# create an instance of the API class
api_instance = fingerprint_pro_server_api_sdk.FingerprintApi(configuration)
visitor_id = os.environ["VISITOR_ID_TO_DELETE"]

try:
api_instance.delete_visitor_data(visitor_id)
except ApiException as e:
print("Exception when calling DefaultApi->delete_visitor_data: %s\n" % e)
exit(1)

print("Visitor data deleted!")

exit(0)
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# ErrorEvent403ResponseError
# Common403ErrorResponse

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**code** | **str** | Error code: * `TokenRequired` - `Auth-API-Key` header is missing or empty * `TokenNotFound` - subscription not found for specified secret key * `SubscriptionNotActive` - subscription is not active * `WrongRegion` - server and subscription region differ |
**code** | **str** | Error code: * `TokenRequired` - `Auth-API-Key` header is missing or empty * `TokenNotFound` - No Fingerprint application found for specified secret key * `SubscriptionNotActive` - Fingerprint application is not active * `WrongRegion` - server and application region differ * `FeatureNotEnabled` - this feature (for example, Delete API) is not enabled for your application |
**message** | **str** | |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
Expand Down
1 change: 1 addition & 0 deletions docs/Confidence.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**score** | **float** | The confidence score is a floating-point number between 0 and 1 that represents the probability of accurate identification. |
**revision** | **str** | The revision name of the method used to calculate the Confidence score. This field is only present for customers who opted in to an alternative calculation method. | [optional]

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

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# ErrorEvent403Response
# ErrorCommon403Response

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**error** | [**ErrorEvent403ResponseError**](ErrorEvent403ResponseError.md) | | [optional]
**error** | [**Common403ErrorResponse**](Common403ErrorResponse.md) | | [optional]

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

9 changes: 9 additions & 0 deletions docs/ErrorCommon429Response.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# ErrorCommon429Response

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**error** | [**ErrorCommon429ResponseError**](ErrorCommon429ResponseError.md) | | [optional]

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

10 changes: 10 additions & 0 deletions docs/ErrorCommon429ResponseError.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# ErrorCommon429ResponseError

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**code** | **str** | Error code: * `TooManyRequests` - The request is throttled. |
**message** | **str** | |

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

2 changes: 1 addition & 1 deletion docs/ErrorEvent404ResponseError.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**code** | **str** | Error code: * `RequestNotFound` - request not found for specified id |
**code** | **str** | Error code: * `RequestNotFound` - The specified request ID was not found. It never existed, expired, or it has been deleted. |
**message** | **str** | |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
Expand Down
9 changes: 9 additions & 0 deletions docs/ErrorUpdateEvent400Response.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# ErrorUpdateEvent400Response

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**error** | [**ErrorUpdateEvent400ResponseError**](ErrorUpdateEvent400ResponseError.md) | | [optional]

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

10 changes: 10 additions & 0 deletions docs/ErrorUpdateEvent400ResponseError.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# ErrorUpdateEvent400ResponseError

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**code** | **str** | Error code: * `RequestCannotBeParsed` - the JSON content of the request contains some errors that prevented us from parsing it (wrong type/surpassed limits) * `Failed` - the event is more than 10 days old and cannot be updated |
**message** | **str** | Details about the underlying issue with the input payload |

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

9 changes: 9 additions & 0 deletions docs/ErrorUpdateEvent409Response.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# ErrorUpdateEvent409Response

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**error** | [**ErrorUpdateEvent409ResponseError**](ErrorUpdateEvent409ResponseError.md) | | [optional]

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

10 changes: 10 additions & 0 deletions docs/ErrorUpdateEvent409ResponseError.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# ErrorUpdateEvent409ResponseError

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**code** | **str** | Error code: * `StateNotReady` - The event specified with request id is not ready for updates yet. Try again. This error happens in rare cases when update API is called immediately after receiving the request id on the client. In case you need to send information right away, we recommend using the JS agent API instead. |
**message** | **str** | |

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

9 changes: 9 additions & 0 deletions docs/ErrorVisitor400Response.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# ErrorVisitor400Response

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**error** | [**ErrorVisitor400ResponseError**](ErrorVisitor400ResponseError.md) | | [optional]

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

10 changes: 10 additions & 0 deletions docs/ErrorVisitor400ResponseError.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# ErrorVisitor400ResponseError

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**code** | **str** | Error code: * `RequestCannotBeParsed` - The visitor ID parameter is missing or in the wrong format. |
**message** | **str** | |

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

9 changes: 9 additions & 0 deletions docs/ErrorVisitor404Response.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# ErrorVisitor404Response

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**error** | [**ErrorVisitor404ResponseError**](ErrorVisitor404ResponseError.md) | | [optional]

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

Loading

0 comments on commit 901f2f3

Please sign in to comment.